OSDN Git Service

[Refactor] #37353 snipe_type をグローバル変数から、引数へ置換 / Replace snipe_type from global to...
[hengband/hengband.git] / src / variable.c
index fe31bb7..56a3ed2 100644 (file)
@@ -11,6 +11,7 @@
  */
 
 #include "angband.h"
+#include "geometry.h"
 
 /*!
  * コピーライト情報 /
@@ -25,7 +26,6 @@ const concptr copyright[5] =
        "are included in all such copies."
 };
 
-
 int max_macrotrigger = 0; /*!< 現在登録中のマクロ(トリガー)の数 */
 concptr macro_template = NULL; /*!< Angband設定ファイルのT: タグ情報から読み込んだ長いTコードを処理するために利用する文字列ポインタ */
 concptr macro_modifier_chr; /*!< &x# で指定されるマクロトリガーに関する情報を記録する文字列ポインタ */
@@ -46,7 +46,7 @@ autopick_type *autopick_list = NULL; /*!< 自動拾い/破壊設定構造体の
 /*
  * Savefile version
  */
-byte h_ver_major;       /* Savefile version for Hengband 1.1.1 and later */
+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;
@@ -110,22 +110,9 @@ s16b command_new;          /* Command chaining from inven/equip view */
 bool msg_flag;                 /* Used in msg_print() for "buffering" */
 
 s16b running;                  /* Current counter for running, if any */
-GAME_TURN resting;                     /* Current counter for resting, if any */
-
-POSITION cur_hgt;              /* Current dungeon height */
-POSITION cur_wid;              /* Current dungeon width */
-DEPTH dun_level;               /*!< 現在の実ダンジョン階層、base_levelの参照元となる / Current dungeon level */
-MONSTER_NUMBER num_repro; /*!< Current reproducer count */
-DEPTH base_level;              /*!< 基本生成レベル、後述のobject_level, monster_levelの参照元となる / Base dungeon level */
-DEPTH object_level;            /*!< アイテムの生成レベル、base_levelを起点に一時変更する時に参照 / Current object creation level */
-DEPTH monster_level;   /*!< モンスターの生成レベル、base_levelを起点に一時変更する時に参照 / Current monster creation level */
+
 bool invoking_midnight_curse; /*!< 悪夢モード時の真夜中太古の呪い発生処理フラグ */
 
-GAME_TURN turn;                                /*!< 画面表示上のゲーム時間基準となるターン / Current game turn */
-GAME_TURN turn_limit;          /*!< turnの最大値 / Limit of game turn */
-GAME_TURN dungeon_turn;                        /*!< NASTY生成の計算に関わる内部ターン値 / Game turn in dungeon */
-GAME_TURN dungeon_turn_limit;  /*!< dungeon_turnの最大値 / Limit of game turn in dungeon */
-GAME_TURN old_turn;                    /* Turn when level began */
 GAME_TURN old_battle;
 
 bool use_sound;                        /* The "sound" mode is enabled */
@@ -165,6 +152,7 @@ MONSTER_IDX m_cnt = 0; /* Number of live monsters */
 
 MONSTER_IDX hack_m_idx = 0;    /* Hack -- see "process_monsters()" */
 MONSTER_IDX hack_m_idx_ii = 0;
+
 bool multi_rew = FALSE;
 char summon_kin_type;   /* Hack, by Julian Lighton: summon 'relatives' */
 
@@ -195,7 +183,7 @@ POSITION panel_col_prt, panel_row_prt;
 /*
  * Targetting variables
  */
-IDX target_who;
+MONSTER_IDX target_who;
 POSITION target_col;
 POSITION target_row;
 
@@ -220,25 +208,8 @@ char player_base[32];
 char savefile[1024];
 char savefile_base[40];
 
-POSITION_IDX lite_n; //!< Array of grids lit by player lite (see "cave.c")
-POSITION lite_y[LITE_MAX];
-POSITION lite_x[LITE_MAX];
-
-POSITION_IDX mon_lite_n; //!< Array of grids lit by player lite (see "cave.c")
-POSITION mon_lite_y[MON_LITE_MAX];
-POSITION mon_lite_x[MON_LITE_MAX];
-
-POSITION_IDX view_n; //!< Array of grids viewable to the player (see "cave.c")
-POSITION view_y[VIEW_MAX];
-POSITION view_x[VIEW_MAX];
 
-POSITION_IDX temp_n; //!< Array of grids for use by various functions (see "cave.c")
-POSITION temp_y[TEMP_MAX];
-POSITION temp_x[TEMP_MAX];
-
-POSITION_IDX redraw_n = 0; //!< Array of grids for delayed visual updating (see "cave.c")
-POSITION redraw_y[REDRAW_MAX];
-POSITION redraw_x[REDRAW_MAX];
+pos_list tmp_pos;
 
 
 /*
@@ -462,12 +433,12 @@ const concptr angband_music_basic_name[MUSIC_BASIC_MAX] =
 
 
 /*
- * The array of "cave grids" [MAX_WID][MAX_HGT].
+ * The array of "current_floor_ptr->grid_array grids" [MAX_WID][MAX_HGT].
  * Not completely allocated, that would be inefficient
  * Not completely hardcoded, that would overflow memory
  */
-cave_type *cave[MAX_HGT];
-
+floor_type floor;
+floor_type *current_floor_ptr = &floor;
 
 /*
  * The array of saved floors
@@ -478,7 +449,11 @@ saved_floor_type saved_floors[MAX_SAVED_FLOORS];
 /*
  * Number of floor_id used from birth
  */
-s16b max_floor_id;
+FLOOR_IDX max_floor_id;
+
+
+world_type world;
+world_type *current_world_ptr = &world;
 
 
 /*
@@ -489,31 +464,14 @@ u32b saved_floor_file_sign;
 
 
 /*
- * The array of dungeon items [max_o_idx]
- */
-object_type *o_list;
-
-/*
- * The array of dungeon monsters [max_m_idx]
- */
-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
  */
-u16b max_towns;
+TOWN_IDX max_towns;
 
 /*
  * The towns [max_towns]
  */
-town_type *town;
+town_type *town_info;
 
 
 /*
@@ -549,7 +507,7 @@ alloc_entry *alloc_race_table;
  * Be sure to use "index & 0x7F" to avoid illegal access
  */
 TERM_COLOR misc_to_attr[256];
-char misc_to_char[256];
+SYMBOL_CODE misc_to_char[256];
 
 
 /*
@@ -557,7 +515,7 @@ char misc_to_char[256];
  * Be sure to use "index & 0x7F" to avoid illegal access
  */
 TERM_COLOR tval_to_attr[128];
-char tval_to_char[128];
+SYMBOL_CODE tval_to_char[128];
 
 
 /*
@@ -654,7 +612,7 @@ char *r_text;
 /*
  * The dungeon arrays
  */
-dungeon_info_type *d_info;
+dungeon_type *d_info;
 char *d_name;
 char *d_text;
 
@@ -724,18 +682,6 @@ monsterrace_hook_type get_mon_num2_hook;
  */
 bool (*get_obj_num_hook)(KIND_OBJECT_IDX k_idx);
 
-
-/* Hack, monk armour */
-bool monk_armour_aux;
-bool monk_notify_aux;
-
-
-/*
- * Wilderness
- */
-wilderness_type **wilderness;
-
-
 /*
  * Buildings
  */
@@ -782,21 +728,7 @@ EGO_IDX max_e_idx;
  */
 DUNGEON_IDX max_d_idx;
 
-/*
- * Maximum number of objects in the level
- */
-OBJECT_IDX max_o_idx;
-
-/*
- * Maximum number of monsters in the level
- */
-MONSTER_IDX max_m_idx;
 
-/*
- * Maximum size of the wilderness
- */
-POSITION max_wild_x;
-POSITION max_wild_y;
 
 /*
  * Quest info
@@ -816,7 +748,7 @@ int quest_text_line;
 /*
  * Default spell color table (quark index)
  */
-s16b gf_color[MAX_GF];
+TERM_COLOR gf_color[MAX_GF];
 
 /*
  * Flags for initialization
@@ -829,12 +761,8 @@ int init_flags;
  */
 int highscore_fd = -1;
 
-int mutant_regenerate_mod = 100;
-
 bool can_save = FALSE;        /* Game can be saved */
 
-s16b world_monster;
-bool world_player;
 
 int cap_mon;
 int cap_mspeed;
@@ -851,12 +779,10 @@ u32b mon_odds[4];
 MONSTER_IDX pet_t_m_idx;
 MONSTER_IDX riding_t_m_idx;
 
-MONSTER_IDX kubi_r_idx[MAX_KUBI];
 MONSTER_IDX today_mon;
 
 bool write_level;
 
-u32b playtime;
 u32b start_time;
 
 bool sukekaku;
@@ -952,15 +878,13 @@ FEAT_IDX feat_undetected;
 /*
  * Which dungeon ?
  */
-DUNGEON_IDX dungeon_type;
 DEPTH *max_dlv;
 
 FEAT_IDX feat_wall_outer;
 FEAT_IDX feat_wall_inner;
 FEAT_IDX feat_wall_solid;
-FEAT_IDX floor_type[100], fill_type[100];
+FEAT_IDX feat_ground_type[100], feat_wall_type[100];
 
-bool now_damaged;
 COMMAND_CODE now_message;
 bool use_menu;
 
@@ -980,7 +904,6 @@ travel_type travel;
 #endif
 
 /* for snipers */
-int snipe_type = SP_NONE;
 bool reset_concent = FALSE;   /* Concentration reset flag */
 bool is_fired = FALSE;