OSDN Git Service

[Refactor] #37287 #37353 型の置換。 / Type replacement.
[hengband/hengband.git] / src / types.h
index 27955c3..84fa936 100644 (file)
@@ -52,8 +52,9 @@ typedef struct feature_state feature_state;
 
 struct feature_state
 {
-       byte action; /*!< 変化条件をFF_*のIDで指定 / Action (FF_*) */
-       s16b result; /*!< 変化先ID / Result (f_info ID) */
+       FF_FLAGS_IDX action; /*!< 変化条件をFF_*のIDで指定 / Action (FF_*) */
+       STR_OFFSET result_tag; /*!< 変化先ID / Result (f_info ID) */
+       FEAT_IDX result; /*!< 変化先ID / Result (f_info ID) */
 };
 
 
@@ -70,17 +71,20 @@ struct feature_type
        STR_OFFSET text;                /*!< 地形説明参照のためのネームバッファオフセット値 /  Text (offset) */
        STR_OFFSET tag;                 /*!< 地形特性タグ参照のためのネームバッファオフセット値 /  Tag (offset) */
 
-       IDX mimic;               /*!< 未確定時の外形地形ID / Feature to mimic */
+       STR_OFFSET mimic_tag;
+       STR_OFFSET destroyed_tag;
+
+       FEAT_IDX mimic;               /*!< 未確定時の外形地形ID / Feature to mimic */
+       FEAT_IDX destroyed;           /*!< *破壊*に巻き込まれた時の地形移行先(未実装?) / Default destroyed state */
 
        BIT_FLAGS flags[FF_FLAG_SIZE]; /*!< 地形の基本特性ビット配列 / Flags */
 
-       u16b priority;            /*!< 縮小表示で省略する際の表示優先度 / Map priority */
-       IDX destroyed;           /*!< *破壊*に巻き込まれた時の地形移行先(未実装?) / Default destroyed state */
+       FEAT_PRIORITY priority;            /*!< 縮小表示で省略する際の表示優先度 / Map priority */
 
        feature_state state[MAX_FEAT_STATES]; /*!< feature_state テーブル */
 
-       byte subtype;  /*!< 副特性値 */
-       byte power;    /*!< 地形強度 */
+       FEAT_SUBTYPE subtype;  /*!< 副特性値 */
+       FEAT_POWER power;    /*!< 地形強度 */
 
        SYMBOL_COLOR d_attr[F_LIT_MAX];   /*!< デフォルトの地形シンボルカラー / Default feature attribute */
        SYMBOL_CODE d_char[F_LIT_MAX];   /*!< デフォルトの地形シンボルアルファベット / Default feature character */
@@ -129,10 +133,10 @@ struct object_kind
        BIT_FLAGS gen_flags;            /*!< ベースアイテムの生成特性ビット配列 / flags for generate */
 
        DEPTH locale[4];                /*!< ベースアイテムの生成階テーブル / Allocation level(s) */
-       byte chance[4];         /*!< ベースアイテムの生成確率テーブル / Allocation chance(s) */
+       PROB chance[4];         /*!< ベースアイテムの生成確率テーブル / Allocation chance(s) */
 
        DEPTH level;                    /*!< ベースアイテムの基本生成階 / Level */
-       byte extra;                     /*!< その他色々のビットフラグ配列 / Something */
+       BIT_FLAGS8 extra;                       /*!< その他色々のビットフラグ配列 / Something */
 
        SYMBOL_COLOR d_attr;            /*!< デフォルトのアイテムシンボルカラー / Default object attribute */
        SYMBOL_CODE d_char;             /*!< デフォルトのアイテムシンボルアルファベット / Default object character */
@@ -140,7 +144,7 @@ struct object_kind
        SYMBOL_COLOR x_attr;            /*!< 設定変更後のアイテムシンボルカラー /  Desired object attribute */
        SYMBOL_CODE x_char;             /*!< 設定変更後のアイテムシンボルアルファベット /  Desired object character */
 
-       s16b flavor;            /*!< 調査中(TODO) / Special object flavor (or zero) */
+       IDX flavor;             /*!< 調査中(TODO) / Special object flavor (or zero) */
 
        bool easy_know;         /*!< ベースアイテムが初期からベース名を判断可能かどうか / This object is always known (if aware) */
 
@@ -148,7 +152,7 @@ struct object_kind
 
        bool tried;                     /*!< ベースアイテムを未鑑定のまま試したことがあるか /  The player has "tried" one of the items */
 
-       IDX act_idx;            /*!< 発動能力のID /  Activative ability index */
+       ACTIVATION_IDX act_idx;         /*!< 発動能力のID /  Activative ability index */
 };
 
 
@@ -168,29 +172,30 @@ struct artifact_type
        STR_OFFSET name;                        /*!< アーティファクト名(headerオフセット参照) / Name (offset) */
        STR_OFFSET text;                        /*!< アーティファクト解説(headerオフセット参照) / Text (offset) */
 
-       byte tval;                      /*!< ベースアイテム大項目ID / Artifact type */
-       byte sval;                      /*!< ベースアイテム小項目ID / Artifact sub type */
+       OBJECT_TYPE_VALUE tval;         /*!< ベースアイテム大項目ID / Artifact type */
+       OBJECT_SUBTYPE_VALUE sval;      /*!< ベースアイテム小項目ID / Artifact sub type */
 
-       s16b pval;                      /*!< pval修正値 / Artifact extra info */
+       PARAMETER_VALUE pval;   /*!< pval修正値 / Artifact extra info */
 
-       s16b to_h;                      /*!< 命中ボーナス値 /  Bonus to hit */
-       s16b to_d;                      /*!< ダメージボーナス値 / Bonus to damage */
-       s16b to_a;                      /*!< ACボーナス値 / Bonus to armor */
+       HIT_PROB to_h;                  /*!< 命中ボーナス値 /  Bonus to hit */
+       HIT_POINT to_d;         /*!< ダメージボーナス値 / Bonus to damage */
+       ARMOUR_CLASS to_a;                      /*!< ACボーナス値 / Bonus to armor */
 
-       s16b ac;                        /*!< 上書きベースAC値 / Base armor */
+       ARMOUR_CLASS ac;                        /*!< 上書きベースAC値 / Base armor */
 
-       byte dd, ds;            /*!< ダイス値 / Damage when hits */
+       DICE_NUMBER dd;
+       DICE_SID ds;    /*!< ダイス値 / Damage when hits */
 
-       s16b weight;            /*!< 重量 / Weight */
+       WEIGHT weight;          /*!< 重量 / Weight */
 
-       s32b cost;                      /*!< 基本価格 / Artifact "cost" */
+       PRICE cost;                     /*!< 基本価格 / Artifact "cost" */
 
-       u32b flags[TR_FLAG_SIZE];       /*! アイテムフラグ / Artifact Flags */
+       BIT_FLAGS flags[TR_FLAG_SIZE];       /*! アイテムフラグ / Artifact Flags */
 
-       u32b gen_flags;         /*! アイテム生成フラグ / flags for generate */
+       BIT_FLAGS gen_flags;            /*! アイテム生成フラグ / flags for generate */
 
-       byte level;                     /*! 基本生成階 / Artifact level */
-       byte rarity;            /*! レアリティ / Artifact rarity */
+       DEPTH level;            /*! 基本生成階 / Artifact level */
+       RARITY rarity;          /*! レアリティ / Artifact rarity */
 
        byte cur_num;           /*! 現在の生成数 / Number created (0 or 1) */
        byte max_num;           /*! (未使用)最大生成数 / Unused (should be "1") */
@@ -212,23 +217,22 @@ struct ego_item_type
        STR_OFFSET name;                        /* Name (offset) */
        STR_OFFSET text;                        /* Text (offset) */
 
-       byte slot;                      /* Standard slot value */
-       byte rating;            /* Rating boost */
+       INVENTORY_IDX slot;             /*!< 装備部位 / Standard slot value */
+       PRICE rating;           /*!< ベースアイテムからの価値加速 / Rating boost */
 
        DEPTH level;                    /* Minimum level */
        RARITY rarity;          /* Object rarity */
 
-       byte max_to_h;          /* Maximum to-hit bonus */
-       byte max_to_d;          /* Maximum to-dam bonus */
-       byte max_to_a;          /* Maximum to-ac bonus */
+       HIT_PROB max_to_h;              /* Maximum to-hit bonus */
+       HIT_POINT max_to_d;             /* Maximum to-dam bonus */
+       ARMOUR_CLASS max_to_a;          /* Maximum to-ac bonus */
 
        PARAMETER_VALUE max_pval;               /* Maximum pval */
 
-       s32b cost;                      /* Ego-item "cost" */
+       PRICE cost;                     /* Ego-item "cost" */
 
-       u32b flags[TR_FLAG_SIZE];       /* Ego-Item Flags */
-
-       u32b gen_flags;         /* flags for generate */
+       BIT_FLAGS flags[TR_FLAG_SIZE];  /* Ego-Item Flags */
+       BIT_FLAGS gen_flags;            /* flags for generate */
 
        IDX act_idx;            /* Activative ability index */
 };
@@ -249,10 +253,10 @@ typedef struct monster_blow monster_blow;
 
 struct monster_blow
 {
-       byte method;
-       byte effect;
-       byte d_dice;
-       byte d_side;
+       BLOW_METHOD method;
+       BLOW_EFFECT effect;
+       DICE_NUMBER d_dice;
+       DICE_SID d_side;
 };
 
 
@@ -301,29 +305,29 @@ struct monster_race
 
        ARMOUR_CLASS ac;                /*!< アーマークラス / Armour Class */
 
-       s16b sleep;                             /*!< 睡眠値 / Inactive counter (base) */
-       byte aaf;                               /*!< 感知範囲(1-100スクエア) / Area affect radius (1-100) */
+       SLEEP_DEGREE sleep;                             /*!< 睡眠値 / Inactive counter (base) */
+       POSITION aaf;                           /*!< 感知範囲(1-100スクエア) / Area affect radius (1-100) */
        SPEED speed;                            /*!< 加速(110で+0) / Speed (normally 110) */
 
-       s32b mexp;                              /*!< 殺害時基本経験値 / Exp value for kill */
+       EXP mexp;                               /*!< 殺害時基本経験値 / Exp value for kill */
 
-       s16b extra;                             /*!< 未使用 /  Unused (for now) */
+       BIT_FLAGS16 extra;                              /*!< 未使用 /  Unused (for now) */
 
-       byte freq_spell;                /*!< 魔法&特殊能力仕様頻度(1/n) /  Spell frequency */
+       RARITY freq_spell;              /*!< 魔法&特殊能力仕様頻度(1/n) /  Spell frequency */
 
-       u32b flags1;                    /* Flags 1 (general) */
-       u32b flags2;                    /* Flags 2 (abilities) */
-       u32b flags3;                    /* Flags 3 (race/resist) */
-       u32b flags4;                    /* Flags 4 (inate/breath) */
-       u32b flags7;                    /* Flags 7 (movement related abilities) */
-       u32b flags8;                    /* Flags 8 (wilderness info) */
-       u32b flags9;                    /* Flags 9 (drops info) */
-       u32b flagsr;                    /* Flags R (resistances info) */
+       BIT_FLAGS flags1;                       /* Flags 1 (general) */
+       BIT_FLAGS flags2;                       /* Flags 2 (abilities) */
+       BIT_FLAGS flags3;                       /* Flags 3 (race/resist) */
+       BIT_FLAGS flags4;                       /* Flags 4 (inate/breath) */
+       BIT_FLAGS flags7;                       /* Flags 7 (movement related abilities) */
+       BIT_FLAGS flags8;                       /* Flags 8 (wilderness info) */
+       BIT_FLAGS flags9;                       /* Flags 9 (drops info) */
+       BIT_FLAGS flagsr;                       /* Flags R (resistances info) */
 
-       u32b a_ability_flags1;  /* Activate Ability Flags 5 (normal spells) */
-       u32b a_ability_flags2;  /* Activate Ability Flags 6 (special spells) */
-       u32b a_ability_flags3;  /* Activate Ability Flags 7 (implementing) */
-       u32b a_ability_flags4;  /* Activate Ability Flags 8 (implementing) */
+       BIT_FLAGS a_ability_flags1;     /* Activate Ability Flags 5 (normal spells) */
+       BIT_FLAGS a_ability_flags2;     /* Activate Ability Flags 6 (special spells) */
+       BIT_FLAGS a_ability_flags3;     /* Activate Ability Flags 7 (implementing) */
+       BIT_FLAGS a_ability_flags4;     /* Activate Ability Flags 8 (implementing) */
 
        monster_blow blow[4];   /* Up to four blows per round */
        MONRACE_IDX reinforce_id[6];
@@ -336,8 +340,8 @@ struct monster_race
 
        PERCENTAGE arena_ratio;         /* アリーナの評価修正値(%基準 / 0=100%) / Arena */
 
-       IDX next_r_idx;
-       u32b next_exp;
+       MONRACE_IDX next_r_idx;
+       EXP next_exp;
 
        DEPTH level;                    /* Level of creature */
        RARITY rarity;                  /* Rarity of creature */
@@ -351,19 +355,18 @@ struct monster_race
        SYMBOL_CODE x_char;                     /* Desired monster character */
 
 
-       byte max_num;                   /* Maximum population allowed per level */
-
-       byte cur_num;                   /* Monster population on current level */
+       MONSTER_NUMBER max_num; /* Maximum population allowed per level */
+       MONSTER_NUMBER cur_num; /* Monster population on current level */
 
-       s16b floor_id;          /* Location of unique monster */
+       FLOOR_IDX floor_id;             /* Location of unique monster */
 
 
-       s16b r_sights;                  /* Count sightings of this monster */
-       s16b r_deaths;                  /* Count deaths from this monster */
+       MONSTER_NUMBER r_sights;        /* Count sightings of this monster */
+       MONSTER_NUMBER r_deaths;        /* Count deaths from this monster */
 
-       s16b r_pkills;                  /* Count visible monsters killed in this life */
-       s16b r_akills;                  /* Count all monsters killed in this life */
-       s16b r_tkills;                  /* Count monsters killed in all lives */
+       MONSTER_NUMBER r_pkills;        /* Count visible monsters killed in this life */
+       MONSTER_NUMBER r_akills;        /* Count all monsters killed in this life */
+       MONSTER_NUMBER r_tkills;        /* Count monsters killed in all lives */
 
        byte r_wake;                    /* Number of times woken up (?) */
        byte r_ignore;                  /* Number of times ignored (?) */
@@ -371,8 +374,8 @@ struct monster_race
        byte r_xtra1;                   /* Something (unused) */
        byte r_xtra2;                   /* Something (unused) */
 
-       byte r_drop_gold;               /* Max number of gold dropped at once */
-       byte r_drop_item;               /* Max number of item dropped at once */
+       ITEM_NUMBER r_drop_gold;        /*!< これまでに撃破時に落とした財宝の数 / Max number of gold dropped at once */
+       ITEM_NUMBER r_drop_item;        /*!< これまでに撃破時に落としたアイテムの数 / Max number of item dropped at once */
 
        byte r_cast_spell;              /* Max number of other spells seen */
 
@@ -401,8 +404,8 @@ struct vault_type
        STR_OFFSET name;        /* Name (offset) */
        STR_OFFSET text;        /* Text (offset) */
 
-       byte typ;                       /* Vault type */
-       byte rat;                       /* Vault rating */
+       ROOM_IDX typ;           /* Vault type */
+       PROB rat;                       /* Vault rating (unused) */
        POSITION hgt;           /* Vault height */
        POSITION wid;           /* Vault width */
 };
@@ -453,15 +456,20 @@ typedef struct cave_type cave_type;
 
 struct cave_type
 {
-       u16b info;              /* Hack -- cave flags */
+       BIT_FLAGS info;         /* Hack -- cave flags */
 
-       IDX feat;               /* Hack -- feature type */
-       IDX o_idx;              /* Object in this grid */
+       FEAT_IDX feat;          /* Hack -- feature type */
+       OBJECT_IDX o_idx;               /* Object in this grid */
        MONSTER_IDX m_idx;              /* Monster in this grid */
 
-       s16b special;   /* Special cave info */
+       /*! 地形の特別な情報を保存する / Special cave info
+        * 具体的な使用一覧はクエスト行き階段の移行先クエストID、
+        * 各ダンジョン入口の移行先ダンジョンID、
+        * 
+        */
+       s16b special;
 
-       s16b mimic;             /* Feature to mimic */
+       FEAT_IDX mimic;         /* Feature to mimic */
 
        byte cost;              /* Hack -- cost of flowing */
        byte dist;              /* Hack -- distance from player */
@@ -515,7 +523,7 @@ typedef struct object_type object_type;
 
 struct object_type
 {
-       IDX k_idx;                      /* Kind index (zero if "dead") */
+       KIND_OBJECT_IDX k_idx;                  /* Kind index (zero if "dead") */
 
        POSITION iy;                    /* Y-position on map, or zero */
        POSITION ix;                    /* X-position on map, or zero */
@@ -534,11 +542,11 @@ struct object_type
        IDX name1;                      /* Artifact type, if any */
        IDX name2;                      /* Ego-Item type, if any */
 
-       byte xtra1;                     /* Extra info type (now unused) */
-       byte xtra2;                     /* Extra info activation index */
-       byte xtra3;                     /* Extra info for weaponsmith */
-       s16b xtra4;                     /* Extra info fuel or captured monster's current HP */
-       s16b xtra5;                     /* Extra info captured monster's max HP */
+       XTRA8 xtra1;                    /* Extra info type (now unused) */
+       XTRA8 xtra2;                    /* Extra info activation index */
+       XTRA8 xtra3;                    /* Extra info for weaponsmith */
+       XTRA16 xtra4;                   /*!< 光源の残り寿命、あるいは捕らえたモンスターの現HP / Extra info fuel or captured monster's current HP */
+       XTRA16 xtra5;                   /*!< 捕らえたモンスターの最大HP / Extra info captured monster's max HP */
 
        HIT_PROB to_h;                  /* Plusses to hit */
        HIT_POINT to_d;                 /* Plusses to damage */
@@ -565,6 +573,8 @@ struct object_type
 
        IDX next_o_idx; /* Next object in stack (if any) */
        IDX held_m_idx; /* Monster holding us (if any) */
+
+       ARTIFACT_BIAS_IDX artifact_bias; /*!< ランダムアーティファクト生成時のバイアスID */
 };
 
 
@@ -606,18 +616,18 @@ struct monster_type
 
        bool ml;                /* Monster is "visible" */
 
-       IDX hold_o_idx; /* Object being held (if any) */
+       OBJECT_IDX hold_o_idx;  /* Object being held (if any) */
 
        POSITION target_y;              /* Can attack !los player */
        POSITION target_x;              /* Can attack !los player */
 
-       u16b nickname;          /* Monster's Nickname */
+       STR_OFFSET nickname;            /* Monster's Nickname */
 
-       u32b exp;
+       EXP exp;
 
-       u32b smart;                     /* Field for "smart_learn" */
+       BIT_FLAGS smart;                        /* Field for "smart_learn" */
 
-       s16b parent_m_idx;
+       MONSTER_IDX parent_m_idx;
 };
 
 
@@ -635,12 +645,12 @@ typedef struct alloc_entry alloc_entry;
 
 struct alloc_entry
 {
-       s16b index;             /* The actual index */
+       KIND_OBJECT_IDX index;          /* The actual index */
 
-       byte level;             /* Base dungeon level */
-       byte prob1;             /* Probability, pass 1 */
-       byte prob2;             /* Probability, pass 2 */
-       byte prob3;             /* Probability, pass 3 */
+       DEPTH level;            /* Base dungeon level */
+       PROB prob1;             /* Probability, pass 1 */
+       PROB prob2;             /* Probability, pass 2 */
+       PROB prob3;             /* Probability, pass 3 */
 
        u16b total;             /* Unused for now */
 };
@@ -690,25 +700,24 @@ typedef struct quest_type quest_type;
 
 struct quest_type
 {
-       s16b status;            /*!< クエストの進行ステータス / Is the quest taken, completed, finished? */
-
-       s16b type;              /*!< クエストの種別 / The quest type */
+       QUEST_STATUS status;          /*!< クエストの進行ステータス / Is the quest taken, completed, finished? */
+       QUEST_TYPE type;              /*!< クエストの種別 / The quest type */
 
        char name[60];          /*!< クエスト名 / Quest name */
-       DEPTH level;             /*!< 処理階層 / Dungeon level */
-       MONRACE_IDX r_idx;             /*!< クエスト対象のモンスターID / Monster race */
-          
-       s16b cur_num;           /*!< 撃破したモンスターの数 / Number killed */
-       s16b max_num;           /*!< 求められるモンスターの撃破数 / Number required */
+       DEPTH level;            /*!< 処理階層 / Dungeon level */
+       MONRACE_IDX r_idx;      /*!< クエスト対象のモンスターID / Monster race */
+
+       MONSTER_NUMBER cur_num; /*!< 撃破したモンスターの数 / Number killed */
+       MONSTER_NUMBER max_num; /*!< 求められるモンスターの撃破数 / Number required */
 
-       IDX k_idx;             /*!< クエスト対象のアイテムID / object index */
-       s16b num_mon;           /*!< QUEST_TYPE_KILL_NUMBER時の目標撃破数 number of monsters on level */
+       KIND_OBJECT_IDX k_idx;              /*!< クエスト対象のアイテムID / object index */
+       MONSTER_NUMBER num_mon; /*!< QUEST_TYPE_KILL_NUMBER時の目標撃破数 number of monsters on level */
 
-       byte flags;             /*!< クエストに関するフラグビット / quest flags */
-       byte dungeon;           /*!< クエスト対象のダンジョンID / quest dungeon */
+       BIT_FLAGS flags;             /*!< クエストに関するフラグビット / quest flags */
+       DUNGEON_IDX dungeon;           /*!< クエスト対象のダンジョンID / quest dungeon */
 
-       byte complev;           /*!< クリア時プレイヤーレベル / player level (complete) */
-       u32b comptime;          /*!< クリア時ゲーム時間 /  quest clear time*/
+       PLAYER_LEVEL complev;           /*!< クリア時プレイヤーレベル / player level (complete) */
+       REAL_TIME comptime;          /*!< クリア時ゲーム時間 /  quest clear time*/
 };
 
 
@@ -721,7 +730,7 @@ struct owner_type
 {
        cptr owner_name;        /* Name */
 
-       s32b max_cost;          /* Purse limit */
+       PRICE max_cost;         /* Purse limit */
 
        byte max_inflate;       /* Inflation (max) */
        byte min_inflate;       /* Inflation (min) */
@@ -776,10 +785,10 @@ typedef struct magic_type magic_type;
 
 struct magic_type
 {
-       byte slevel;            /* Required level (to learn) */
-       byte smana;                     /* Required mana (to cast) */
-       byte sfail;                     /* Minimum chance of failure */
-       byte sexp;                      /* Encoded experience bonus */
+       PLAYER_LEVEL slevel;    /* Required level (to learn) */
+       MANA_POINT smana;               /* Required mana (to cast) */
+       PERCENTAGE sfail;               /* Minimum chance of failure */
+       EXP sexp;                               /* Encoded experience bonus */
 };
 
 
@@ -1061,7 +1070,7 @@ struct player_type
        TIME_EFFECT magicdef;
        TIME_EFFECT tim_res_nether;     /* Timed -- Nether resistance */
        TIME_EFFECT tim_res_time;       /* Timed -- Time resistance */
-       IDX mimic_form;
+       MIMIC_RACE_IDX mimic_form;
        TIME_EFFECT tim_mimic;
        TIME_EFFECT tim_sh_fire;
        TIME_EFFECT tim_sh_holy;
@@ -1072,7 +1081,7 @@ struct player_type
        TIME_EFFECT multishadow;       /* Timed -- Multi-shadow */
        TIME_EFFECT dustrobe;          /* Timed -- Robe of dust */
 
-       s16b chaos_patron;
+       PATRON_IDX chaos_patron;
        BIT_FLAGS muta1;
        BIT_FLAGS muta2;
        BIT_FLAGS muta3;
@@ -1080,18 +1089,18 @@ struct player_type
        s16b virtues[8];
        s16b vir_types[8];
 
-       s16b word_recall;         /* Word of recall counter */
-       s16b alter_reality;       /* Alter reality counter */
-       IDX recall_dungeon;      /* Dungeon set to be recalled */
+       TIME_EFFECT word_recall;          /* Word of recall counter */
+       TIME_EFFECT alter_reality;        /* Alter reality counter */
+       DUNGEON_IDX recall_dungeon;      /* Dungeon set to be recalled */
 
        ENERGY energy_need;       /* Energy needed for next move */
        ENERGY enchant_energy_need;       /* Energy needed for next upkeep effect        */
 
-       s16b food;                /* Current nutrition */
+       FEED food;                /* Current nutrition */
 
        BIT_FLAGS special_attack;         /* Special attack capacity -LM- */
        BIT_FLAGS special_defense;        /* Special block capacity -LM- */
-       byte action;              /* Currently action */
+       ACTION_IDX action;                /* Currently action */
 
        BIT_FLAGS spell_learned1;         /* bit mask of spells learned */
        BIT_FLAGS spell_learned2;         /* bit mask of spells learned */
@@ -1106,15 +1115,15 @@ struct player_type
        SUB_EXP skill_exp[GINOU_MAX]; /* Proficiency of misc. skill */
 
        MAGIC_NUM1 magic_num1[108];     /*!< Array for non-spellbook type magic */
-       MAGIC_NUM2 magic_num2[108];     /*!< Flags for non-spellbook type magics */
+       MAGIC_NUM2 magic_num2[108];     /*!< 魔道具術師の取り込み済魔道具使用回数 / Flags for non-spellbook type magics */
 
-       s16b mane_spell[MAX_MANE];
-       s16b mane_dam[MAX_MANE];
+       SPELL_IDX mane_spell[MAX_MANE];
+       HIT_POINT mane_dam[MAX_MANE];
        s16b mane_num;
 
        s16b concent;      /* Sniper's concentration level */
 
-       s16b player_hp[PY_MAX_LEVEL];
+       HIT_POINT player_hp[PY_MAX_LEVEL];
        char died_from[80];       /* What killed the player */
        cptr last_message;        /* Last message on death or retirement */
        char history[4][60];      /* Textual "history" for the Player */
@@ -1208,14 +1217,14 @@ struct player_type
        bool sutemi;
        bool counter;
 
-       s32b align;                             /* Good/evil/neutral */
+       ALIGNMENT align;                                /* Good/evil/neutral */
        POSITION run_py;
        POSITION run_px;
 
 
        /*** Extracted fields ***/
 
-       u32b total_weight;      /* Total weight being carried */
+       WEIGHT total_weight;    /*!< 所持品と装備品の計算総重量 / Total weight being carried */
 
        s16b stat_add[6];       /* Modifiers to stat values */
        s16b stat_ind[6];       /* Indexes into stat tables */
@@ -1259,7 +1268,7 @@ struct player_type
        bool sustain_con;       /* Keep constitution */
        bool sustain_chr;       /* Keep charisma */
 
-       u32b cursed;            /* Player is cursed */
+       BIT_FLAGS cursed;       /* Player is cursed */
 
        bool can_swim;          /* No damage falling */
        bool levitation;                /* No damage falling */
@@ -1296,21 +1305,20 @@ struct player_type
        bool mighty_throw;
        bool see_nocto;         /* Noctovision */
 
-       s16b to_dd[2]; /* Extra dice/sides */
-       s16b to_ds[2];
+       DICE_NUMBER to_dd[2]; /* Extra dice/sides */
+       DICE_SID to_ds[2];
 
-       s16b dis_to_h[2];       /* Known bonus to hit (wield) */
-       s16b dis_to_h_b;        /* Known bonus to hit (bow) */
-       s16b dis_to_d[2];       /* Known bonus to dam (wield) */
-       s16b dis_to_a;          /* Known bonus to ac */
+       HIT_PROB dis_to_h[2];   /*!< 判明している現在の表記上の近接武器命中修正値 /  Known bonus to hit (wield) */
+       HIT_PROB dis_to_h_b;    /*!< 判明している現在の表記上の射撃武器命中修正値 / Known bonus to hit (bow) */
+       HIT_POINT dis_to_d[2];  /*!< 判明している現在の表記上の近接武器ダメージ修正値 / Known bonus to dam (wield) */
+       ARMOUR_CLASS dis_to_a;  /*!< 判明している現在の表記上の装備AC修正値 / Known bonus to ac */
+       ARMOUR_CLASS dis_ac;    /*!< 判明している現在の表記上の装備AC基礎値 / Known base ac */
 
-       s16b dis_ac;            /* Known base ac */
-
-       s16b to_h[2];                   /* Bonus to hit (wield) */
-       s16b to_h_b;                    /* Bonus to hit (bow) */
-       s16b to_h_m;                    /* Bonus to hit (misc) */
-       s16b to_d[2];                   /* Bonus to dam (wield) */
-       s16b to_d_m;                    /* Bonus to dam (misc) */
+       s16b to_h[2];           /* Bonus to hit (wield) */
+       s16b to_h_b;            /* Bonus to hit (bow) */
+       s16b to_h_m;            /* Bonus to hit (misc) */
+       s16b to_d[2];           /* Bonus to dam (wield) */
+       s16b to_d_m;            /* Bonus to dam (misc) */
        s16b to_a;                      /* Bonus to ac */
 
        s16b to_m_chance;               /* Minusses to cast chance */
@@ -1320,35 +1328,42 @@ struct player_type
        bool hidarite;
        bool no_flowed;
 
-       s16b ac;                        /* Base ac */
+       ARMOUR_CLASS ac;        /*!< 装備無しの基本AC / Base ac */
+
+       ACTION_SKILL_POWER see_infra;   /*!< 赤外線視能力の強さ /Infravision range */
+       ACTION_SKILL_POWER skill_dis;   /*!< 行動技能値:解除能力 / Skill: Disarming */
+       ACTION_SKILL_POWER skill_dev;   /*!< 行動技能値:魔道具使用 / Skill: Magic Devices */
+       ACTION_SKILL_POWER skill_sav;   /*!< 行動技能値:魔法防御 / Skill: Saving throw */
+       ACTION_SKILL_POWER skill_stl;   /*!< 行動技能値:隠密 / Skill: Stealth factor */
 
-       s16b see_infra;         /* Infravision range */
+       /*! 
+        * 行動技能値:知覚 / Skill: Searching ability
+        * この値はsearch()による地形の隠し要素発見処理などで混乱、盲目、幻覚、無光源などの
+        * 状態異常がない限り、難易度修正などがないままそのままパーセンテージ値として使われる。
+        * 100以上ならば必ず全てのトラップなどを見つけることが出来る。
+        */
+       ACTION_SKILL_POWER skill_srh;
 
-       s16b skill_dis;         /* Skill: Disarming */
-       s16b skill_dev;         /* Skill: Magic Devices */
-       s16b skill_sav;         /* Skill: Saving throw */
-       s16b skill_stl;         /* Skill: Stealth factor */
-       s16b skill_srh;         /* Skill: Searching ability */
-       s16b skill_fos;         /* Skill: Searching frequency */
-       s16b skill_thn;         /* Skill: To hit (normal) */
-       s16b skill_thb;         /* Skill: To hit (shooting) */
-       s16b skill_tht;         /* Skill: To hit (throwing) */
-       s16b skill_dig;         /* Skill: Digging */
+
+       ACTION_SKILL_POWER skill_fos;   /*!< 行動技能値:探索 / Skill: Searching frequency */
+       ACTION_SKILL_POWER skill_thn;   /*!< 行動技能値:打撃命中能力 / Skill: To hit (normal) */
+       ACTION_SKILL_POWER skill_thb;   /*!< 行動技能値:射撃命中能力 / Skill: To hit (shooting) */
+       ACTION_SKILL_POWER skill_tht;   /*!< 行動技能値:投射命中能力 / Skill: To hit (throwing) */
+       ACTION_SKILL_POWER skill_dig;   /*!< 行動技能値:掘削 / Skill: Digging */
 
        s16b num_blow[2];       /* Number of blows */
        s16b num_fire;          /* Number of shots */
 
        byte tval_xtra;         /* Correct xtra tval */
-
        byte tval_ammo;         /* Correct ammo tval */
 
        byte pspeed;            /* Current speed */
 
-       s16b energy_use;        /* Energy use this turn */
+       ENERGY energy_use;      /* Energy use this turn */
 
        POSITION y;     /* Player location in dungeon */
        POSITION x;     /* Player location in dungeon */
-       char name[32]; /* Current player's character name */
+       char name[32]; /*!< 現在のプレイヤー名 / Current player's character name */
 };
 
 
@@ -1371,13 +1386,13 @@ struct birther
        s16b wt;
        s16b sc;
 
-       s32b au;
+       PRICE au; /*!< 初期の所持金 */
 
-       s16b stat_max[6];       /* Current "maximal" stat values */
-       s16b stat_max_max[6];   /* Maximal "maximal" stat values */
-       s16b player_hp[PY_MAX_LEVEL];
+       BASE_STATUS stat_max[6];        /* Current "maximal" stat values */
+       BASE_STATUS stat_max_max[6];    /* Maximal "maximal" stat values */
+       HIT_POINT player_hp[PY_MAX_LEVEL];
 
-       s16b chaos_patron;
+       PATRON_IDX chaos_patron;
 
        s16b vir_types[8];
 
@@ -1431,9 +1446,9 @@ struct mind_power
 typedef struct monster_power monster_power;
 struct monster_power
 {
-       int     level;
-       int     smana;
-       int     fail;
+       PLAYER_LEVEL level;
+       MANA_POINT smana;
+       PERCENTAGE fail;
        int     manedam;
        int     manefail;
        int     use_stat;
@@ -1454,15 +1469,15 @@ struct building_type
        char owner_race[20];            /* proprietor race */
 
        char act_names[8][30];          /* action names */
-       s32b member_costs[8];           /* Costs for class members of building */
-       s32b other_costs[8];                /* Costs for nonguild members */
+       PRICE member_costs[8];           /* Costs for class members of building */
+       PRICE other_costs[8];               /* Costs for nonguild members */
        char letters[8];                /* action letters */
-       s16b actions[8];                /* action codes */
-       s16b action_restr[8];           /* action restrictions */
+       BACT_IDX actions[8];                /* action codes */
+       BACT_RESTRICT_IDX action_restr[8];           /* action restrictions */
 
-       s16b member_class[MAX_CLASS];   /* which classes are part of guild */
-       s16b member_race[MAX_RACES];    /* which classes are part of guild */
-       s16b member_realm[MAX_MAGIC+1]; /* which realms are part of guild */
+       CLASS_IDX member_class[MAX_CLASS];   /* which classes are part of guild */
+       RACE_IDX member_race[MAX_RACES];    /* which classes are part of guild */
+       REALM_IDX member_realm[MAX_MAGIC+1]; /* which realms are part of guild */
 };
 
 
@@ -1492,7 +1507,7 @@ struct wilderness_type
        int         town;
        int         road;
        u32b        seed;
-       s16b        level;
+       DEPTH        level;
        byte        entrance;
 };
 
@@ -1585,8 +1600,8 @@ struct high_score
 
 typedef struct
 {
-       s16b feat;    /* Feature tile */
-       byte percent; /* Chance of type */
+       FEAT_IDX feat;    /* Feature tile */
+       PERCENTAGE percent; /* Chance of type */
 }
 feat_prob;
 
@@ -1597,48 +1612,48 @@ struct dungeon_info_type {
        STR_OFFSET name;                /* Name */
        STR_OFFSET text;                /* Description */
 
-       byte dy;
-       byte dx;
+       POSITION dy;
+       POSITION dx;
 
        feat_prob floor[DUNGEON_FEAT_PROB_NUM]; /* Floor probability */
        feat_prob fill[DUNGEON_FEAT_PROB_NUM];  /* Cave wall probability */
-       s16b outer_wall;                        /* Outer wall tile */
-       s16b inner_wall;                        /* Inner wall tile */
-       s16b stream1;                           /* stream tile */
-       s16b stream2;                           /* stream tile */
-
-       s16b mindepth;         /* Minimal depth */
-       s16b maxdepth;         /* Maximal depth */
-       byte min_plev;         /* Minimal plev needed to enter -- it's an anti-cheating mesure */
-       s16b pit;
-       s16b nest;
-       byte mode;              /* Mode of combinaison of the monster flags */
+       FEAT_IDX outer_wall;                        /* Outer wall tile */
+       FEAT_IDX inner_wall;                        /* Inner wall tile */
+       FEAT_IDX stream1;                           /* stream tile */
+       FEAT_IDX stream2;                           /* stream tile */
+
+       DEPTH mindepth;         /* Minimal depth */
+       DEPTH maxdepth;         /* Maximal depth */
+       PLAYER_LEVEL min_plev;         /* Minimal plev needed to enter -- it's an anti-cheating mesure */
+       BIT_FLAGS16 pit;
+       BIT_FLAGS16 nest;
+       BIT_FLAGS8 mode; /* Mode of combinaison of the monster flags */
 
        int min_m_alloc_level;  /* Minimal number of monsters per level */
        int max_m_alloc_chance; /* There is a 1/max_m_alloc_chance chance per round of creating a new monster */
 
-       u32b flags1;            /* Flags 1 */
+       BIT_FLAGS flags1;               /* Flags 1 */
 
-       u32b mflags1;           /* The monster flags that are allowed */
-       u32b mflags2;
-       u32b mflags3;
-       u32b mflags4;
-       u32b mflags7;
-       u32b mflags8;
-       u32b mflags9;
-       u32b mflagsr;
+       BIT_FLAGS mflags1;              /* The monster flags that are allowed */
+       BIT_FLAGS mflags2;
+       BIT_FLAGS mflags3;
+       BIT_FLAGS mflags4;
+       BIT_FLAGS mflags7;
+       BIT_FLAGS mflags8;
+       BIT_FLAGS mflags9;
+       BIT_FLAGS mflagsr;
 
-       u32b m_a_ability_flags1;
-       u32b m_a_ability_flags2;
-       u32b m_a_ability_flags3;
-       u32b m_a_ability_flags4;
+       BIT_FLAGS m_a_ability_flags1;
+       BIT_FLAGS m_a_ability_flags2;
+       BIT_FLAGS m_a_ability_flags3;
+       BIT_FLAGS m_a_ability_flags4;
 
        char r_char[5];         /* Monster race allowed */
-       int final_object;       /* The object you'll find at the bottom */
-       int final_artifact;     /* The artifact you'll find at the bottom */
-       int final_guardian;     /* The artifact's guardian. If an artifact is specified, then it's NEEDED */
+       KIND_OBJECT_IDX final_object;   /* The object you'll find at the bottom */
+       ARTIFACT_IDX final_artifact;    /* The artifact you'll find at the bottom */
+       MONRACE_IDX final_guardian;     /* The artifact's guardian. If an artifact is specified, then it's NEEDED */
 
-       byte special_div;       /* % of monsters affected by the flags/races allowed, to add some variety */
+       PROB special_div;       /* % of monsters affected by the flags/races allowed, to add some variety */
        int tunnel_percent;
        int obj_great;
        int obj_good;
@@ -1665,7 +1680,7 @@ typedef struct {
 typedef struct 
 {
        s16b floor_id;        /* No recycle until 65536 IDs are all used */
-       byte savefile_id;     /* ID for savefile (from 0 to MAX_SAVED_FLOOR) */
+       s16b savefile_id;     /* ID for savefile (from 0 to MAX_SAVED_FLOOR) */
        DEPTH dun_level;
        s32b last_visit;      /* Time count of last visit. 0 for new floor. */
        u32b visit_mark;      /* Older has always smaller mark. */
@@ -1679,7 +1694,7 @@ typedef struct
  */
 typedef struct
 {
-       u16b info;
+       BIT_FLAGS info;
        s16b feat;
        s16b mimic;
        s16b special;
@@ -1704,13 +1719,13 @@ typedef struct
  */
 typedef struct
 {
-       s16b open;
-       s16b broken;
-       s16b closed;
-       s16b locked[MAX_LJ_DOORS];
-       s16b num_locked;
-       s16b jammed[MAX_LJ_DOORS];
-       s16b num_jammed;
+       FEAT_IDX open;
+       FEAT_IDX broken;
+       FEAT_IDX closed;
+       FEAT_IDX locked[MAX_LJ_DOORS];
+       FEAT_IDX num_locked;
+       FEAT_IDX jammed[MAX_LJ_DOORS];
+       FEAT_IDX num_jammed;
 } door_type;