OSDN Git Service

#37324 (2.2.0.28) obj-desc.spo の出力内容に、にアイテム生成chance値を追加。 / Add chance values to info...
[hengband/hengband.git] / src / variable.c
index c2d91b6..1574009 100644 (file)
@@ -1,22 +1,22 @@
-/* File: variable.c */
-
-/* Purpose: Angband variables */
-
-/*
- * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
- *
- * This software may be copied and distributed for educational, research, and
- * not for profit purposes provided that this copyright and statement are
- * included in all such copies.
+/*!
+ * @file variable.c
+ * @brief グローバル変数定義 / Angband variables
+ * @date 2014/10/05
+ * @author
+ * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke<br>
+ * <br>
+ * This software may be copied and distributed for educational, research,<br>
+ * and not for profit purposes provided that this copyright and statement<br>
+ * are included in all such copies.  Other copyrights may also apply.<br>
  */
 
 #include "angband.h"
 
-
-/*
+/*!
+ * コピーライト情報 /
  * Hack -- Link a copyright message into the executable
  */
-cptr copyright[5] =
+const cptr copyright[5] =
 {
        "Copyright (c) 1989 James E. Wilson, Robert A. Keoneke",
        "",
@@ -26,39 +26,32 @@ cptr copyright[5] =
 };
 
 
-int max_macrotrigger = 0;
-char *macro_template = NULL;
-char *macro_modifier_chr;
-char *macro_modifier_name[MAX_MACRO_MOD];
-char *macro_trigger_name[MAX_MACRO_TRIG];
-char *macro_trigger_keycode[2][MAX_MACRO_TRIG];
+int max_macrotrigger = 0; /*!< 現在登録中のマクロ(トリガー)の数 */
+cptr macro_template = NULL; /*!< Angband設定ファイルのT: タグ情報から読み込んだ長いTコードを処理するために利用する文字列ポインタ */
+cptr macro_modifier_chr; /*!< &x# で指定されるマクロトリガーに関する情報を記録する文字列ポインタ */
+cptr macro_modifier_name[MAX_MACRO_MOD]; /*!< マクロ上で取り扱う特殊キーを文字列上で表現するためのフォーマットを記録した文字列ポインタ配列 */
+cptr macro_trigger_name[MAX_MACRO_TRIG]; /*!< マクロのトリガーコード */
+cptr macro_trigger_keycode[2][MAX_MACRO_TRIG];  /*!< マクロの内容 */
 
-/* ¥ì¥Ù¥ë¥¢¥Ã¥×¤Î»þ¤Ë¾å¾ºÎ̤òɽ¼¨¤¹¤ë¤Î¤Ë»È¤¦ */
-int level_up = 0;
+int level_up = 0; /*!< レベルアップの際に遅延してcalc_mana()関数上で上昇量を表示するかどうかの判定フラグ */
 
-/* 
- *  List for auto-picker/destroyer entries
- */
-int max_autopick = 0;
-autopick_type autopick_list[MAX_AUTOPICK];
-autopick_type autopick_entry_last_destroyed;
 
-/*
- * Executable version
+/* 
+ * 自動拾い/破壊設定のリストに関する変数 / List for auto-picker/destroyer entries
  */
-byte version_major = VERSION_MAJOR;
-byte version_minor = VERSION_MINOR;
-byte version_patch = VERSION_PATCH;
-byte version_extra = VERSION_EXTRA;
+int max_autopick = 0; /*!< 現在登録している自動拾い/破壊設定の数 */
+int max_max_autopick = 0; /*!< 自動拾い/破壊設定の限界数 */
+autopick_type *autopick_list = NULL; /*!< 自動拾い/破壊設定構造体のポインタ配列 */
 
 /*
  * Savefile version
  */
-byte sf_major;                 /* Savefile's "version_major" */
-byte sf_minor;                 /* Savefile's "version_minor" */
-byte sf_patch;                 /* Savefile's "version_patch" */
-byte sf_extra;                 /* Savefile's "version_extra" */
-u32b sf_version;               /* Savefile's "version" */
+byte h_ver_major;       /* Savefile version for Hengband 1.1.1 and later */
+byte h_ver_minor;
+byte h_ver_patch;
+byte h_ver_extra;
+
+byte sf_extra;         /* Savefile's encoding key */
 
 byte z_major;           /* Savefile version for Hengband */
 byte z_minor;
@@ -67,7 +60,7 @@ byte z_patch;
 /*
  * Savefile information
  */
-u32b sf_xtra;                  /* Operating system info */
+u32b sf_system;                        /* Operating system info */
 u32b sf_when;                  /* Time when savefile created */
 u16b sf_lives;                 /* Number of past "lives" with this file */
 u16b sf_saves;                 /* Number of "saves" during this life */
@@ -78,6 +71,7 @@ u16b sf_saves;                        /* Number of "saves" during this life */
 bool arg_fiddle;                       /* Command arg -- Request fiddle mode */
 bool arg_wizard;                       /* Command arg -- Request wizard mode */
 bool arg_sound;                                /* Command arg -- Request special sounds */
+bool arg_music;                                /* Command arg -- Request special musics */
 byte arg_graphics;                     /* Command arg -- Request graphics mode */
 bool arg_monochrome;           /* Command arg -- Request monochrome mode */
 bool arg_force_original;       /* Command arg -- Request original keyset */
@@ -95,6 +89,8 @@ bool character_saved;         /* The character was just saved to a savefile */
 bool character_icky;           /* The game is in an icky full screen mode */
 bool character_xtra;           /* The game is in an icky startup mode */
 
+bool creating_savefile;                /* New savefile is currently created */
+
 u32b seed_flavor;              /* Hack -- consistent object colors */
 u32b seed_town;                        /* Hack -- consistent town layout */
 
@@ -104,24 +100,15 @@ s16b command_arg;         /* Gives argument of current command */
 s16b command_rep;              /* Gives repetition of current command */
 s16b command_dir;              /* Gives direction of current command */
 
-s16b command_see;              /* See "cmd1.c" */
-s16b command_wrk;              /* See "cmd1.c" */
+s16b command_see;              /* See "object1.c" */
+s16b command_wrk;              /* See "object1.c" */
 
-s16b command_gap = 50; /* See "cmd1.c" */
+s16b command_gap = 999;         /* See "object1.c" */
 
 s16b command_new;              /* Command chaining from inven/equip view */
 
-s16b energy_use;               /* Energy use this turn */
-
-byte create_up_stair;  /* Auto-create "up stairs" */
-byte create_down_stair;        /* Auto-create "down stairs" */
-
 bool msg_flag;                 /* Used in msg_print() for "buffering" */
 
-bool alive;                            /* True if game is running */
-
-bool death;                            /* True if player has died */
-
 s16b running;                  /* Current counter for running, if any */
 s16b resting;                  /* Current counter for resting, if any */
 
@@ -133,30 +120,25 @@ s16b object_level;                /* Current object creation level */
 s16b monster_level;            /* Current monster creation level */
 s16b base_level;        /* Base dungeon level */
 
-s32b turn;                             /* Current game turn */
-s32b dungeon_turn;                     /* Game turn in dungeon */
-s32b old_turn;                 /* Turn when level began (feelings) */
+s32b turn;                             /*!< 画面表示上のゲーム時間基準となるターン / Current game turn */
+s32b turn_limit;               /*!< turnの最大値 / Limit of game turn */
+s32b dungeon_turn;                     /*!< NASTY生成の計算に関わる内部ターン値 / Game turn in dungeon */
+s32b dungeon_turn_limit;       /*!< dungeon_turnの最大値 / Limit of game turn in dungeon */
+s32b old_turn;                 /* Turn when level began */
 s32b old_battle;
 
-bool wizard;                   /* Is the player currently in Wizard mode? */
-
 bool use_sound;                        /* The "sound" mode is enabled */
+bool use_music;                        /* The "music" mode is enabled */
 bool use_graphics;             /* The "graphics" mode is enabled */
 bool use_bigtile = FALSE;
 
-u16b total_winner;             /* Semi-Hack -- Game has been won */
-
-u16b panic_save;               /* Track some special "conditions" */
-u16b noscore;                  /* Track various "cheating" conditions */
-bool wait_report_score;         /* Waiting to report score */
-
 s16b signal_count;             /* Hack -- Count interupts */
 
 bool inkey_base;               /* See the "inkey()" function */
 bool inkey_xtra;               /* See the "inkey()" function */
 bool inkey_scan;               /* See the "inkey()" function */
 bool inkey_flag;               /* See the "inkey()" function */
-bool inkey_special;            /* See the "inkey()" function */
+bool get_com_no_macros = FALSE;        /* Expand macros in "get_com" or not */
 
 s16b coin_type;                        /* Hack -- force coin type */
 
@@ -187,149 +169,203 @@ bool multi_rew = FALSE;
 char summon_kin_type;   /* Hack, by Julian Lighton: summon 'relatives' */
 
 int total_friends = 0;
-s32b total_friend_levels = 0;
 s32b friend_align = 0;
 
 int leaving_quest = 0;
+bool reinit_wilderness = FALSE;
 
 
 /*
  * Software options (set via the '=' command).  See "tables.c"
  */
 
-
-/* Option Set 1 -- User Interface */
+/*** Input Options ***/
 
 bool rogue_like_commands;      /* Rogue-like commands */
-bool quick_messages;           /* Activate quick messages */
-bool auto_more;
-bool command_menu;
-bool other_query_flag;         /* Prompt for various information */
-bool carry_query_flag;         /* Prompt before picking things up */
-bool use_old_target;           /* Use old target by default */
-bool always_pickup;                    /* Pick things up by default */
-bool always_repeat;                    /* Repeat obvious commands */
-bool depth_in_feet;                    /* Show dungeon level in feet */
-
-bool stack_force_notes;                /* Merge inscriptions when stacking */
-bool stack_force_costs;                /* Merge discounts when stacking */
-
-bool show_labels;                      /* Show labels in object listings */
-bool show_weights;                     /* Show weights in object listings */
-bool show_choices;                     /* Show choices in certain sub-windows */
-
-bool ring_bell;                                /* Ring the bell (on errors, etc) */
-
-bool show_item_graph;
-
-
-/* Option Set 2 -- Disturbance */
-
-bool find_ignore_stairs;       /* Run past stairs */
-bool find_ignore_doors;                /* Run through open doors */
-bool find_cut;                         /* Run past known corners */
-bool find_examine;                     /* Run into potential corners */
-
-bool disturb_move;                     /* Disturb whenever any monster moves */
-bool disturb_near;                     /* Disturb whenever viewable monster moves */
-bool disturb_panel;                    /* Disturb whenever map panel changes */
-bool disturb_state;                    /* Disturn whenever player state changes */
-bool disturb_minor;                    /* Disturb whenever boring things happen */
-
-bool alert_hitpoint;           /* Alert user to critical hitpoints */
-bool disturb_trap_detect;       /* Disturb when leaving last trap detect area */
-bool last_words;               /* Get last words upon dying */
-bool over_exert;
-bool small_levels;             /* Allow unusually small dungeon levels */
-bool always_small_levels;              /* Use always unusually small dungeon levels */
-bool empty_levels;             /* Allow empty 'arena' levels */
-bool player_symbols;           /* Use varying symbols for the player char */
-bool equippy_chars;            /* Back by popular demand... */
-bool display_mutations;                /* Skip mutations screen even if we have it */
-bool plain_descriptions;       /* Plain object descriptions */
-bool stupid_monsters;          /* Monsters use old AI */
-bool confirm_destroy;          /* Known worthless items are destroyed without confirmation */
-bool confirm_stairs;           /* Prompt before staircases... */
-bool confirm_wear;             /* Confirm before putting on known cursed items */
-bool disturb_pets;             /* Pets moving nearby disturb us */
-
-
-
-/* Option Set 3 -- Game-Play */
-
-bool manual_haggle;                    /* Auto-haggle in stores */
-
-bool auto_scum;                                /* Auto-scum for good levels */
-
-bool stack_allow_items;                /* Allow weapons and armor to stack */
-
-bool expand_look;                      /* Expand the power of the look command */
-bool expand_list;                      /* Expand the power of the list commands */
-
-bool view_perma_grids;         /* Map remembers all perma-lit grids */
-bool view_torch_grids;         /* Map remembers all torch-lit grids */
+bool always_pickup;    /* Pick things up by default */
+bool carry_query_flag; /* Prompt before picking things up */
+bool quick_messages;   /* Activate quick messages */
+bool auto_more;        /* Automatically clear '-more-' prompts */
+bool command_menu;     /* Enable command selection menu */
+bool other_query_flag; /* Prompt for floor item selection */
+bool use_old_target;   /* Use old target by default */
+bool always_repeat;    /* Repeat obvious commands */
+bool confirm_destroy;  /* Prompt for destruction of known worthless items */
+bool confirm_wear;     /* Confirm to wear/wield known cursed items */
+bool confirm_quest;    /* Prompt before exiting a quest level */
+bool target_pet;       /* Allow targetting pets */
+
+#ifdef ALLOW_EASY_OPEN
+bool easy_open;        /* Automatically open doors */
+#endif
 
-bool dungeon_align;                    /* Generate dungeons with aligned rooms */
-bool dungeon_stair;                    /* Generate dungeons with connected stairs */
+#ifdef ALLOW_EASY_DISARM
+bool easy_disarm;      /* Automatically disarm traps */
+#endif
 
-bool track_follow;                     /* Monsters follow the player */
-bool track_target;                     /* Monsters target the player */
+#ifdef ALLOW_EASY_FLOOR
+bool easy_floor;       /* Display floor stacks in a list */
+#endif
 
-bool smart_learn;                      /* Monsters learn from their mistakes */
-bool smart_cheat;                      /* Monsters exploit player weaknesses */
+bool use_command;      /* Allow unified use command */
+bool over_exert;       /* Allow casting spells when short of mana */
+bool numpad_as_cursorkey;      /* Use numpad keys as cursor key in editor mode */
 
 
-/* Option Set 4 -- Efficiency */
+/*** Map Screen Options ***/
 
-bool view_reduce_lite;         /* Reduce lite-radius when running */
-bool view_reduce_view;         /* Reduce view-radius in town */
+bool center_player;    /* Center map while walking (*slow*) */
+bool center_running;   /* Centering even while running */
+bool view_yellow_lite; /* Use special colors for torch-lit grids */
+bool view_bright_lite; /* Use special colors for 'viewable' grids */
+bool view_granite_lite;        /* Use special colors for wall grids (slow) */
+bool view_special_lite;        /* Use special colors for floor grids (slow) */
+bool view_perma_grids; /* Map remembers all perma-lit grids */
+bool view_torch_grids; /* Map remembers all torch-lit grids */
+bool view_unsafe_grids;        /* Map marked by detect traps */
+bool view_reduce_view; /* Reduce view-radius in town */
+bool fresh_before;     /* Flush output while continuous command */
+bool fresh_after;      /* Flush output after monster's move */
+bool fresh_message;    /* Flush output after every message */
+bool hilite_player;    /* Hilite the player with the cursor */
+bool display_path;     /* Display actual path before shooting */
 
-bool check_abort;                      /* Avoid checking for user abort */
 
-bool flush_failure;                    /* Flush input on any failure */
-bool flush_disturb;                    /* Flush input on disturbance */
+/*** Text Display Options ***/
 
-bool fresh_before;                     /* Flush output before normal commands */
-bool fresh_after;                      /* Flush output after normal commands */
-bool fresh_message;                    /* Flush output after all messages */
+bool plain_descriptions;       /* Plain object descriptions */
+bool plain_pickup;     /* Plain pickup messages(japanese only) */
+bool always_show_list; /* Always show list when choosing items */
+bool depth_in_feet;    /* Show dungeon level in feet */
+bool show_labels;      /* Show labels in object listings */
+bool show_weights;     /* Show weights in object listings */
+bool show_item_graph;  /* Show items graphics */
+bool equippy_chars;    /* Display 'equippy' chars */
+bool display_mutations;        /* Display mutations in 'C'haracter Display */
+bool compress_savefile;        /* Compress messages in savefiles */
+bool abbrev_extra;     /* Describe obj's extra resistances by abbreviation */
+bool abbrev_all;       /* Describe obj's all resistances by abbreviation */
+bool exp_need; /* Show the experience needed for next level */
+bool ignore_unview;    /* Ignore whenever any monster does */
+
+
+/*** Game-Play Options ***/
+
+bool stack_force_notes;        /* Merge inscriptions when stacking */
+bool stack_force_costs;        /* Merge discounts when stacking */
+bool expand_list;      /* Expand the power of the list commands */
+bool small_levels;     /* Allow unusually small dungeon levels */
+bool always_small_levels;      /* Always create unusually small dungeon levels */
+bool empty_levels;     /* Allow empty 'arena' levels */
+bool bound_walls_perm; /* Boundary walls become 'permanent wall' */
+bool last_words;       /* Leave last words when your character dies */
+
+#ifdef WORLD_SCORE
+bool send_score;       /* Send score dump to the world score server */
+#endif
 
-bool compress_savefile;                /* Compress messages in savefiles */
+bool allow_debug_opts; /* Allow use of debug/cheat options */
 
-bool hilite_player;                    /* Hilite the player with the cursor */
 
-bool view_yellow_lite;         /* Use special colors for torch-lit grids */
-bool view_bright_lite;         /* Use special colors for 'viewable' grids */
+/*** Disturbance Options ***/
 
-bool view_granite_lite;                /* Use special colors for wall grids (slow) */
-bool view_special_lite;                /* Use special colors for floor grids (slow) */
-bool new_ascii_graphics;
-bool display_path;
-bool target_pet;
-bool plain_pickup;
+bool find_ignore_stairs;       /* Run past stairs */
+bool find_ignore_doors;        /* Run through open doors */
+bool find_cut; /* Run past known corners */
+bool check_abort;      /* Check for user abort while continuous command */
+bool flush_failure;    /* Flush input on various failures */
+bool flush_disturb;    /* Flush input whenever disturbed */
+bool disturb_move;     /* Disturb whenever any monster moves */
+bool disturb_high;     /* Disturb whenever high-level monster moves */
+bool disturb_near;     /* Disturb whenever viewable monster moves */
+bool disturb_pets;     /* Disturb when visible pets move */
+bool disturb_panel;    /* Disturb whenever map panel changes */
+bool disturb_state;    /* Disturb whenever player state changes */
+bool disturb_minor;    /* Disturb whenever boring things happen */
+bool ring_bell;        /* Audible bell (on errors, etc) */
+bool disturb_trap_detect;      /* Disturb when leaving trap detected area */
+bool alert_trap_detect;        /* Alert when leaving trap detected area */
+
+
+/*** Birth Options ***/
+
+bool manual_haggle;    /* Manually haggle in stores */
+bool easy_band;        /* Easy Mode (*) */
+bool smart_learn;      /* Monsters learn from their mistakes (*) */
+bool smart_cheat;      /* Monsters exploit players weaknesses (*) */
+bool vanilla_town;     /* Use 'vanilla' town without quests and wilderness */
+bool lite_town;        /* Use 'lite' town without a wilderness */
+bool ironman_shops;    /* Stores are permanently closed (*) */
+bool ironman_small_levels;     /* Always create unusually small dungeon levels (*) */
+bool ironman_downward; /* Disable recall and use of up stairs (*) */
+bool ironman_empty_levels;     /* Always create empty 'arena' levels (*) */
+bool ironman_rooms;    /* Always generate very unusual rooms (*) */
+bool ironman_nightmare;        /* Nightmare mode(it isn't even remotely fair!)(*) */
+bool left_hander;      /* Left-Hander */
+bool preserve_mode;    /* Preserve artifacts (*) */
+bool autoroller;       /* Allow use of autoroller for stats (*) */
+bool autochara;        /* Autoroll for weight, height and social status */
+bool powerup_home;     /* Increase capacity of your home (*) */
+bool show_ammo_detail; /* Show Description of ammo damage */
+bool show_ammo_no_crit;        /* Show No-crit damage of ammo */
+bool show_ammo_crit_ratio;     /* Show critical ratio of ammo */
+
+
+
+
+/*** Easy Object Auto-Destroyer ***/
+
+bool destroy_items;    /* Use easy auto-destroyer */
+bool destroy_feeling;  /* Apply auto-destroy as sense feeling */
+bool destroy_identify; /* Apply auto-destroy as identify an item */
+bool leave_worth;      /* Auto-destroyer leaves known worthy items */
+bool leave_equip;      /* Auto-destroyer leaves weapons and armour */
+bool leave_chest;      /* Auto-destroyer leaves closed chests */
+bool leave_wanted;     /* Auto-destroyer leaves wanted corpses */
+bool leave_corpse;     /* Auto-destroyer leaves corpses and skeletons */
+bool leave_junk;       /* Auto-destroyer leaves junk */
+bool leave_special;    /* Auto-destroyer leaves items your race/class needs */
+
+
+/*** Play-record Options ***/
+
+bool record_fix_art;   /* Record fixed artifacts */
+bool record_rand_art;  /* Record random artifacts */
+bool record_destroy_uniq;      /* Record when destroy unique monster */
+bool record_fix_quest; /* Record fixed quests */
+bool record_rand_quest;        /* Record random quests */
+bool record_maxdepth;  /* Record movements to deepest level */
+bool record_stair;     /* Record recall and stair movements */
+bool record_buy;       /* Record purchased items */
+bool record_sell;      /* Record sold items */
+bool record_danger;    /* Record hitpoint warning */
+bool record_arena;     /* Record arena victories */
+bool record_ident;     /* Record first identified items */
+bool record_named_pet; /* Record informations of named pets */
+char record_o_name[MAX_NLEN];
+s32b record_turn;
 
-bool always_show_list;
-bool powerup_home;
-bool change_numeral;
-bool send_score;
 
 /* Cheating options */
 
-bool cheat_peek;               /* Peek into object creation */
-bool cheat_hear;               /* Peek into monster creation */
-bool cheat_room;               /* Peek into dungeon creation */
-bool cheat_xtra;               /* Peek into something else */
-bool cheat_know;               /* Know complete monster info */
-bool cheat_live;               /* Allow player to avoid death */
+bool cheat_peek;       /* Peek into object creation */
+bool cheat_hear;       /* Peek into monster creation */
+bool cheat_room;       /* Peek into dungeon creation */
+bool cheat_xtra;       /* Peek into something else */
+bool cheat_know;       /* Know complete monster info */
+bool cheat_live;       /* Allow player to avoid death */
+bool cheat_save;       /* Ask for saving death */
 
 
 /* Special options */
 
-byte hitpoint_warn;            /* Hitpoint warning (0 to 9) */
+byte hitpoint_warn;    /* Hitpoint warning (0 to 9) */
+byte mana_warn;        /* Mana color (0 to 9) */
 
-byte delay_factor;             /* Delay factor (0 to 9) */
+byte delay_factor;     /* Delay factor (0 to 9) */
 
-bool autosave_l;        /* Autosave before entering new levels */
-bool autosave_t;        /* Timed autosave */
+bool autosave_l;       /* Autosave before entering new levels */
+bool autosave_t;       /* Timed autosave */
 s16b autosave_freq;     /* Autosave frequency */
 
 
@@ -337,11 +373,6 @@ s16b autosave_freq;     /* Autosave frequency */
  * Dungeon variables
  */
 
-byte feeling;                  /* Most recent feeling */
-s16b rating;                   /* Level's current rating */
-
-bool good_item_flag;           /* True if "Artifact" on this level */
-
 bool closing_flag;             /* Dungeon is closing */
 
 
@@ -353,11 +384,6 @@ s16b panel_row_min, panel_row_max;
 s16b panel_col_min, panel_col_max;
 s16b panel_col_prt, panel_row_prt;
 
-/*
- * Player location in dungeon
- */
-int py;
-int px;
 
 /*
  * Targetting variables
@@ -375,24 +401,10 @@ int player_euid;
 int player_egid;
 
 /*
- * Current player's character name
- */
-char player_name[32];
-
-/*
  * Stripped version of "player_name"
  */
 char player_base[32];
 
-/*
- * What killed the player
- */
-char died_from[80];
-
-/*
- * Hack -- Textual "history" for the Player
- */
-char history[4][60];
 
 /*
  * Buffer to hold the current savefile name
@@ -412,8 +424,8 @@ s16b lite_x[LITE_MAX];
  * Array of grids lit by player lite (see "cave.c")
  */
 s16b mon_lite_n;
-s16b mon_lite_y[LITE_MAX];
-s16b mon_lite_x[LITE_MAX];
+s16b mon_lite_y[MON_LITE_MAX];
+s16b mon_lite_x[MON_LITE_MAX];
 
 /*
  * Array of grids viewable to the player (see "cave.c")
@@ -429,6 +441,13 @@ s16b temp_n;
 byte temp_y[TEMP_MAX];
 byte temp_x[TEMP_MAX];
 
+/*
+ * Array of grids for delayed visual updating (see "cave.c")
+ */
+s16b redraw_n = 0;
+byte redraw_y[REDRAW_MAX];
+byte redraw_x[REDRAW_MAX];
+
 
 /*
  * Number of active macros.
@@ -521,7 +540,7 @@ term *angband_term[8];
 /*
  * Standard window names
  */
-char angband_term_name[8][16] =
+const char angband_term_name[8][16] =
 {
        "Hengband",
        "Term-1",
@@ -561,9 +580,9 @@ byte angband_color_table[256][4] =
 /*
  * Standard sound names
  */
-char angband_sound_name[SOUND_MAX][16] =
+const cptr angband_sound_name[SOUND_MAX] =
 {
-       "",
+       "dummy",
        "hit",
        "miss",
        "flee",
@@ -628,6 +647,35 @@ char angband_sound_name[SOUND_MAX][16] =
        "show",
        "unused",
        "explode",
+       "glass",
+};
+
+/*
+ * Standard music names
+ */
+const cptr angband_music_basic_name[MUSIC_BASIC_MAX] =
+{
+       "default",
+       "gameover",
+       "exit",
+       "town",
+       "field1",
+       "field2",
+       "field3",
+       "dun_low",
+       "dun_med",
+       "dun_high",
+       "feel1",
+       "feel2",
+       "winner",
+       "build",
+       "wild",
+       "quest",
+       "arena",
+       "battle",
+       "quest_clear",
+       "final_quest_clear",
+       "ambush",
 };
 
 
@@ -638,6 +686,26 @@ char angband_sound_name[SOUND_MAX][16] =
  */
 cave_type *cave[MAX_HGT];
 
+
+/*
+ * The array of saved floors
+ */
+saved_floor_type saved_floors[MAX_SAVED_FLOORS];
+
+
+/*
+ * Number of floor_id used from birth
+ */
+s16b max_floor_id;
+
+
+/*
+ * Sign for current process used in temporal files.
+ * Actually it is the start time of current process.
+ */
+u32b saved_floor_file_sign;
+
+
 /*
  * The array of dungeon items [max_o_idx]
  */
@@ -648,6 +716,12 @@ object_type *o_list;
  */
 monster_type *m_list;
 
+/*
+ * The array to process dungeon monsters [max_m_idx]
+ */
+s16b *mproc_list[MAX_MTIMED];
+s16b mproc_max[MAX_MTIMED]; /* Number of monsters to be processed */
+
 
 /*
  * Maximum number of towns
@@ -727,32 +801,11 @@ player_type *p_ptr = &p_body;
  * Pointer to the player tables
  * (sex, race, class, magic)
  */
-player_sex *sp_ptr;
-player_race *rp_ptr;
-player_class *cp_ptr;
-player_seikaku *ap_ptr;
-player_magic *mp_ptr;
-
-
-/*
- * More spell info
- */
-u32b spell_learned1;   /* bit mask of spells learned */
-u32b spell_learned2;   /* bit mask of spells learned */
-u32b spell_worked1;    /* bit mask of spells tried and worked */
-u32b spell_worked2;    /* bit mask of spells tried and worked */
-u32b spell_forgotten1; /* bit mask of spells learned but forgotten */
-u32b spell_forgotten2; /* bit mask of spells learned but forgotten */
-byte spell_order[64];  /* order spells learned/remembered/forgotten */
-
-
-/*
- * Calculated base hp values for player at each level,
- * store them so that drain life + restore life does not
- * affect hit points.  Also prevents shameless use of backup
- * savefiles for hitpoint acquirement.
- */
-s16b player_hp[PY_MAX_LEVEL];
+const player_sex *sp_ptr;
+const player_race *rp_ptr;
+const player_class *cp_ptr;
+const player_seikaku *ap_ptr;
+const player_magic *mp_ptr;
 
 
 /*
@@ -773,22 +826,18 @@ char *v_text;
  * The skill table
  */
 skill_table *s_info;
-char *s_name;
-char *s_text;
 
 /*
  * The magic info
  */
 player_magic *m_info;
-char *m_name;
-char *m_text;
 
 /*
  * The terrain feature arrays
  */
 feature_type *f_info;
 char *f_name;
-char *f_text;
+char *f_tag;
 
 /*
  * The object kind arrays
@@ -982,47 +1031,6 @@ bool (*get_obj_num_hook)(int k_idx);
 bool monk_armour_aux;
 bool monk_notify_aux;
 
-#ifdef ALLOW_EASY_OPEN /* TNB */
-bool easy_open;
-#endif /* ALLOW_EASY_OPEN -- TNB */
-
-#ifdef ALLOW_EASY_DISARM /* TNB */
-bool easy_disarm;
-#endif /* ALLOW_EASY_DISARM -- TNB */
-
-#ifdef ALLOW_EASY_FLOOR /* TNB */
-bool easy_floor;
-#endif /* ALLOW_EASY_FLOOR -- TNB */
-
-bool use_command;
-bool center_player;
-bool center_running;
-
-/* Auto-destruction options */
-bool destroy_items;
-bool leave_worth;
-bool leave_equip;
-bool leave_wanted;
-bool leave_corpse;
-bool leave_junk;
-bool leave_chest;
-
-/* Nikki */
-bool record_fix_art;
-bool record_rand_art;
-bool record_destroy_uniq;
-bool record_fix_quest;
-bool record_rand_quest;
-bool record_maxdeapth;
-bool record_stair;
-bool record_buy;
-bool record_sell;
-bool record_danger;
-bool record_arena;
-bool record_ident;
-bool record_named_pet;
-char record_o_name[MAX_NLEN];
-s32b record_turn;
 
 /*
  * Wilderness
@@ -1123,49 +1131,13 @@ int init_flags;
  */
 int highscore_fd = -1;
 
-/*
- * Should the monster allocation fail with inappropriate terrain?
- */
-bool monster_terrain_sensitive = TRUE;
-
 int mutant_regenerate_mod = 100;
 
-/*
- * Startup options
- */
-bool easy_band;
-bool vanilla_town;            /* Use "vanilla" town without set quests */
-bool ironman_shops;           /* Stores are permanently closed */
-bool ironman_small_levels;    /* Always create unusually small dungeon levels */
-bool ironman_downward;        /* Don't allow climbing upwards/recalling */
-bool ironman_autoscum;        /* Permanently enable the autoscummer */
-bool lite_town;               /* Use "lite" town without wilderness */
-bool ironman_empty_levels;    /* Always create empty 'arena' levels */
-bool terrain_streams;         /* Create terrain 'streamers' in the dungeon */
-bool munchkin_death;          /* Ask for saving death */
-bool ironman_rooms;           /* Always generate very unusual rooms */
-bool ironman_nightmare;                        /* Play the game in Nightmare mode */
-bool left_hander;
-bool preserve_mode;
-bool autoroller;
-bool autochara;
-
-
 bool can_save = FALSE;        /* Game can be saved */
 
-s16b spell_exp[64];           /* mahou keikenchi */
-
-s16b weapon_exp[5][64];       /* weapon keikenchi */
-
-s16b skill_exp[10];           /* ginou keikenchi */
-
-bool world_monster;
+s16b world_monster;
 bool world_player;
 
-s16b mane_spell[MAX_MANE];
-s16b mane_dam[MAX_MANE];
-s16b mane_num;
-
 int cap_mon;
 int cap_mspeed;
 int cap_hp;
@@ -1184,8 +1156,6 @@ int riding_t_m_idx;
 s16b kubi_r_idx[MAX_KUBI];
 s16b today_mon;
 
-monster_type party_mon[21];
-
 bool write_level;
 
 u32b playtime;
@@ -1203,16 +1173,91 @@ bool generate_encounter;
 
 cptr screen_dump = NULL;
 
+/*** Terrain feature variables ***/
+
+/* Nothing */
+s16b feat_none;
+
+/* Floor */
+s16b feat_floor;
+
+/* Objects */
+s16b feat_glyph;
+s16b feat_explosive_rune;
+s16b feat_mirror;
+
+/* Doors */
+door_type feat_door[MAX_DOOR_TYPES];
+
+/* Stairs */
+s16b feat_up_stair;
+s16b feat_down_stair;
+s16b feat_entrance;
+
+/* Special traps */
+s16b feat_trap_open;
+s16b feat_trap_armageddon;
+s16b feat_trap_piranha;
+
+/* Rubble */
+s16b feat_rubble;
+
+/* Seams */
+s16b feat_magma_vein;
+s16b feat_quartz_vein;
+
+/* Walls */
+s16b feat_granite;
+s16b feat_permanent;
+
+/* Glass floor */
+s16b feat_glass_floor;
+
+/* Glass walls */
+s16b feat_glass_wall;
+s16b feat_permanent_glass_wall;
+
+/* Pattern */
+s16b feat_pattern_start;
+s16b feat_pattern_1;
+s16b feat_pattern_2;
+s16b feat_pattern_3;
+s16b feat_pattern_4;
+s16b feat_pattern_end;
+s16b feat_pattern_old;
+s16b feat_pattern_exit;
+s16b feat_pattern_corrupted;
+
+/* Various */
+s16b feat_black_market;
+s16b feat_town;
+
+/* Terrains */
+s16b feat_deep_water;
+s16b feat_shallow_water;
+s16b feat_deep_lava;
+s16b feat_shallow_lava;
+s16b feat_dirt;
+s16b feat_grass;
+s16b feat_flower;
+s16b feat_brake;
+s16b feat_tree;
+s16b feat_mountain;
+s16b feat_swamp;
+
+/* Unknown grid (not detected) */
+s16b feat_undetected;
+
 /*
  * Which dungeon ?
  */
 byte dungeon_type;
 s16b *max_dlv;
 
-byte feat_wall_outer;
-byte feat_wall_inner;
-byte feat_wall_solid;
-byte floor_type[100], fill_type[100];
+s16b feat_wall_outer;
+s16b feat_wall_inner;
+s16b feat_wall_solid;
+s16b floor_type[100], fill_type[100];
 
 bool now_damaged;
 s16b now_message;
@@ -1224,3 +1269,17 @@ bool chuukei_client;
 char *server_name;
 int server_port;
 #endif
+
+/* for movie */
+bool browsing_movie;
+
+#ifdef TRAVEL
+/* for travel */
+travel_type travel;
+#endif
+
+/* for snipers */
+int snipe_type = SP_NONE;
+bool reset_concent = FALSE;   /* Concentration reset flag */
+bool is_fired = FALSE;
+