OSDN Git Service

[Refactor] #38993 cur_wid/hgt を floor_type に取り込み width/heightに改名。 / Move cur_wid...
[hengband/hengband.git] / src / types.h
index dc85a09..c92f065 100644 (file)
@@ -37,7 +37,7 @@
  *
  * Certain data is saved in multiple places for efficient access, currently,
  * this includes the tval/sval/weight fields in "object_type", various fields
- * in "header_type", and the "m_idx" and "o_idx" fields in "cave_type".  All
+ * in "header_type", and the "m_idx" and "o_idx" fields in "grid_type".  All
  * of these could be removed, but this would, in general, slow down the game
  * and increase the complexity of the code.
  * </pre>
@@ -427,13 +427,13 @@ struct skill_table
 /*
  * A single "grid" in a Cave
  *
- * Note that several aspects of the code restrict the actual cave
+ * Note that several aspects of the code restrict the actual current_floor_ptr->grid_array
  * to a max size of 256 by 256.  In partcular, locations are often
  * saved as bytes, limiting each coordinate to the 0-255 range.
  *
  * The "o_idx" and "m_idx" fields are very interesting.  There are
  * many places in the code where we need quick access to the actual
- * monster or object(s) in a given cave grid.  The easiest way to
+ * monster or object(s) in a given grid.  The easiest way to
  * do this is to simply keep the index of the monster and object
  * (if any) with the grid, but this takes 198*66*4 bytes of memory.
  * Several other methods come to mind, which require only half this
@@ -450,17 +450,17 @@ struct skill_table
  * Note the special fields for the "MONSTER_FLOW" code.
  */
 
-typedef struct cave_type cave_type;
+typedef struct grid_type grid_type;
 
-struct cave_type
+struct grid_type
 {
-       BIT_FLAGS info;         /* Hack -- cave flags */
+       BIT_FLAGS info;         /* Hack -- current_floor_ptr->grid_array flags */
 
        FEAT_IDX feat;          /* Hack -- feature type */
        OBJECT_IDX o_idx;               /* Object in this grid */
        MONSTER_IDX m_idx;              /* Monster in this grid */
 
-       /*! 地形の特別な情報を保存する / Special cave info
+       /*! 地形の特別な情報を保存する / Special current_floor_ptr->grid_array info
         * 具体的な使用一覧はクエスト行き階段の移行先クエストID、
         * 各ダンジョン入口の移行先ダンジョンID、
         * 
@@ -503,7 +503,7 @@ struct coord
  * Note that "object flags" must now be derived from the object kind,
  * the artifact and ego-item indexes, and the two "xtra" fields.
  *
- * Each cave grid points to one (or zero) objects via the "o_idx"
+ * Each grid points to one (or zero) objects via the "o_idx"
  * field (above).  Each object then points to one (or zero) objects
  * via the "next_o_idx" field, forming a singly linked list, which
  * in game terms, represents a "stack" of objects in the same grid.
@@ -1020,12 +1020,13 @@ struct player_type
 
        PLAYER_LEVEL lev;                       /* Level */
 
-       s16b town_num;                  /* Current town number */
+       TOWN_IDX town_num;                      /* Current town number */
        s16b arena_number;              /* monster number in arena -KMW- */
        bool inside_arena;              /* Is character inside arena? */
        QUEST_IDX inside_quest;         /* Inside quest level */
        bool inside_battle;             /* Is character inside tougijou? */
 
+       DUNGEON_IDX dungeon_idx; /* current dungeon index */
        POSITION wilderness_x;  /* Coordinates in the wilderness */
        POSITION wilderness_y;
        bool wild_mode;
@@ -1104,6 +1105,9 @@ struct player_type
        TIME_EFFECT multishadow;       /* Timed -- Multi-shadow */
        TIME_EFFECT dustrobe;          /* Timed -- Robe of dust */
 
+       bool timewalk;
+
+
        PATRON_IDX chaos_patron;
 
        BIT_FLAGS muta1; /*!< レイシャル型の変異 / "Activatable" mutations must be in MUT1_* */        
@@ -1547,31 +1551,31 @@ typedef struct martial_arts martial_arts;
 
 struct martial_arts
 {
-       concptr    desc;       /* A verbose attack description */
-       int     min_level;  /* Minimum level to use */
-       int     chance;     /* Chance of 'success' */
-       int     dd;         /* Damage dice */
-       int     ds;         /* Damage sides */
-       int     effect;     /* Special effects */
+       concptr desc;       /* A verbose attack description */
+       PLAYER_LEVEL min_level;  /* Minimum level to use */
+       int chance;     /* Chance of 'success' */
+       int dd;         /* Damage dice */
+       int ds;         /* Damage sides */
+       int effect;     /* Special effects */
 };
 
 typedef struct kamae kamae;
 
 struct kamae
 {
-       concptr    desc;       /* A verbose kamae description */
-       int     min_level;  /* Minimum level to use */
-       concptr    info;
+       concptr desc;       /* A verbose kamae description */
+       PLAYER_LEVEL min_level;  /* Minimum level to use */
+       concptr info;
 };
 
 /* Mindcrafters */
 typedef struct mind_type mind_type;
 struct mind_type
 {
-       int     min_lev;
-       int     mana_cost;
-       int     fail;
-       concptr    name;
+       PLAYER_LEVEL min_lev;
+       MANA_POINT mana_cost;
+       PERCENTAGE fail;
+       concptr name;
 };
 
 typedef struct mind_power mind_power;
@@ -1605,7 +1609,7 @@ struct building_type
 {
        GAME_TEXT name[20];                  /* proprietor name */
        GAME_TEXT owner_name[20];            /* proprietor name */
-       char owner_race[20];            /* proprietor race */
+       GAME_TEXT owner_race[20];            /* proprietor race */
 
        GAME_TEXT act_names[8][30];          /* action names */
        PRICE member_costs[8];           /* Costs for class members of building */
@@ -1643,7 +1647,7 @@ typedef struct wilderness_type wilderness_type;
 struct wilderness_type
 {
        int terrain;
-       int town;
+       TOWN_IDX town;
        int road;
        u32b seed;
        DEPTH level;
@@ -1664,15 +1668,6 @@ struct town_type
        byte numstores;
 };
 
-/* Dungeons */
-typedef struct dun_type dun_type;
-struct dun_type
-{
-       DEPTH min_level; /* Minimum level in the dungeon */
-       DEPTH max_level; /* Maximum dungeon level allowed */
-       concptr name;      /* The name of the dungeon */
-};
-
 /*
  * Sort-array element
  */
@@ -1738,8 +1733,8 @@ feat_prob;
 
 
 /* A structure for the != dungeon types */
-typedef struct dungeon_info_type dungeon_info_type;
-struct dungeon_info_type {
+typedef struct dungeon_type dungeon_type;
+struct dungeon_type {
 
        STR_OFFSET name; /* Name */
        STR_OFFSET text; /* Description */
@@ -1878,3 +1873,11 @@ typedef struct {
        int type;
        concptr name;
 } dragonbreath_type;
+
+typedef struct {
+       grid_type *grid_array[MAX_HGT];
+       DEPTH dun_level;                /*!< 現在の実ダンジョン階層base_levelの参照元となる / Current dungeon level */
+       DEPTH base_level;
+       POSITION width;                 /* Current dungeon width */
+       POSITION height;                /* Current dungeon height */
+} floor_type;
\ No newline at end of file