OSDN Git Service

[Refactor] #37353 型の置換。 / Type replacement.
[hengband/hengband.git] / src / types.h
index 434b07c..7eec923 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,22 +71,25 @@ 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;  /*!< 副特性値 */
+       FEAT_SUBTYPE subtype;  /*!< 副特性値 */
        FEAT_POWER power;    /*!< 地形強度 */
 
-       SYMBOL_COLOR d_attr[F_LIT_MAX];   /*!< デフォルトの地形シンボルカラー / Default feature attribute */
+       TERM_COLOR d_attr[F_LIT_MAX];   /*!< デフォルトの地形シンボルカラー / Default feature attribute */
        SYMBOL_CODE d_char[F_LIT_MAX];   /*!< デフォルトの地形シンボルアルファベット / Default feature character */
 
-       SYMBOL_COLOR x_attr[F_LIT_MAX];   /*!< 設定変更後の地形シンボルカラー / Desired feature attribute */
+       TERM_COLOR x_attr[F_LIT_MAX];   /*!< 設定変更後の地形シンボルカラー / Desired feature attribute */
        SYMBOL_CODE x_char[F_LIT_MAX];   /*!< 設定変更後の地形シンボルアルファベット / Desired feature character */
 };
 
@@ -134,13 +138,13 @@ struct object_kind
        DEPTH level;                    /*!< ベースアイテムの基本生成階 / Level */
        BIT_FLAGS8 extra;                       /*!< その他色々のビットフラグ配列 / Something */
 
-       SYMBOL_COLOR d_attr;            /*!< デフォルトのアイテムシンボルカラー / Default object attribute */
+       TERM_COLOR d_attr;              /*!< デフォルトのアイテムシンボルカラー / Default object attribute */
        SYMBOL_CODE d_char;             /*!< デフォルトのアイテムシンボルアルファベット / Default object character */
 
-       SYMBOL_COLOR x_attr;            /*!< 設定変更後のアイテムシンボルカラー /  Desired object attribute */
+       TERM_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 */
 };
 
 
@@ -196,7 +200,7 @@ struct artifact_type
        byte cur_num;           /*! 現在の生成数 / Number created (0 or 1) */
        byte max_num;           /*! (未使用)最大生成数 / Unused (should be "1") */
 
-       s16b floor_id;      /*! アイテムを落としたフロアのID / Leaved on this location last time */
+       FLOOR_IDX floor_id;      /*! アイテムを落としたフロアのID / Leaved on this location last time */
 
        byte act_idx;           /*! 発動能力ID / Activative ability index */
 };
@@ -342,28 +346,25 @@ struct monster_race
        DEPTH level;                    /* Level of creature */
        RARITY rarity;                  /* Rarity of creature */
 
-
-       SYMBOL_COLOR d_attr;            /* Default monster attribute */
+       TERM_COLOR d_attr;              /* Default monster attribute */
        SYMBOL_CODE d_char;                     /* Default monster character */
 
-
-       SYMBOL_COLOR x_attr;            /* Desired monster attribute */
+       TERM_COLOR x_attr;              /* Desired monster attribute */
        SYMBOL_CODE x_char;                     /* Desired monster character */
 
 
-       byte max_num;                   /* Maximum population allowed per level */
+       MONSTER_NUMBER max_num; /* Maximum population allowed per level */
+       MONSTER_NUMBER cur_num; /* Monster population on current level */
 
-       byte cur_num;                   /* Monster population on current level */
+       FLOOR_IDX floor_id;             /* Location of unique monster */
 
-       s16b floor_id;          /* Location of unique monster */
 
+       MONSTER_NUMBER r_sights;        /* Count sightings of this monster */
+       MONSTER_NUMBER r_deaths;        /* Count deaths from this monster */
 
-       s16b r_sights;                  /* Count sightings of this monster */
-       s16b 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 +372,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 */
 
@@ -453,7 +454,7 @@ typedef struct cave_type cave_type;
 
 struct cave_type
 {
-       u16b info;              /* Hack -- cave flags */
+       BIT_FLAGS info;         /* Hack -- cave flags */
 
        FEAT_IDX feat;          /* Hack -- feature type */
        OBJECT_IDX o_idx;               /* Object in this grid */
@@ -590,7 +591,7 @@ typedef struct monster_type monster_type;
 struct monster_type
 {
        MONRACE_IDX r_idx;              /* Monster race index */
-       IDX ap_r_idx;           /* Monster race appearance index */
+       MONRACE_IDX ap_r_idx;   /* Monster race appearance index */
        byte sub_align;         /* Sub-alignment for a neutral monster */
 
        POSITION fy;            /* Y location on map */
@@ -599,7 +600,7 @@ struct monster_type
        HIT_POINT hp;           /* Current Hit points */
        HIT_POINT maxhp;                /* Max Hit points */
        HIT_POINT max_maxhp;            /* Max Max Hit points */
-       u32b dealt_damage;              /* Sum of damages dealt by player */
+       HIT_POINT dealt_damage;         /* Sum of damages dealt by player */
 
        TIME_EFFECT mtimed[MAX_MTIMED]; /* Timed status counter */
 
@@ -1097,7 +1098,7 @@ struct player_type
 
        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 */
@@ -1112,7 +1113,7 @@ 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 */
 
        SPELL_IDX mane_spell[MAX_MANE];
        HIT_POINT mane_dam[MAX_MANE];
@@ -1150,7 +1151,7 @@ struct player_type
        s16b today_mon;           /* Wanted monster */
 
        bool dtrap;               /* Whether you are on trap-safe grids */
-       s16b floor_id;            /* Current floor location */ 
+       FLOOR_IDX floor_id;            /* Current floor location */ 
 
        bool autopick_autoregister; /* auto register is in-use or not */
 
@@ -1217,6 +1218,7 @@ struct player_type
        ALIGNMENT align;                                /* Good/evil/neutral */
        POSITION run_py;
        POSITION run_px;
+       DIRECTION fishing_dir;
 
 
        /*** Extracted fields ***/
@@ -1332,7 +1334,16 @@ struct player_type
        ACTION_SKILL_POWER skill_dev;   /*!< 行動技能値:魔道具使用 / Skill: Magic Devices */
        ACTION_SKILL_POWER skill_sav;   /*!< 行動技能値:魔法防御 / Skill: Saving throw */
        ACTION_SKILL_POWER skill_stl;   /*!< 行動技能値:隠密 / Skill: Stealth factor */
-       ACTION_SKILL_POWER skill_srh;   /*!< 行動技能値:知覚 / Skill: Searching ability */
+
+       /*! 
+        * 行動技能値:知覚 / Skill: Searching ability
+        * この値はsearch()による地形の隠し要素発見処理などで混乱、盲目、幻覚、無光源などの
+        * 状態異常がない限り、難易度修正などがないままそのままパーセンテージ値として使われる。
+        * 100以上ならば必ず全てのトラップなどを見つけることが出来る。
+        */
+       ACTION_SKILL_POWER skill_srh;
+
+
        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) */
@@ -1434,9 +1445,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;
@@ -1457,11 +1468,11 @@ 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 */
 
        CLASS_IDX member_class[MAX_CLASS];   /* which classes are part of guild */
        RACE_IDX member_race[MAX_RACES];    /* which classes are part of guild */
@@ -1615,7 +1626,7 @@ struct dungeon_info_type {
        PLAYER_LEVEL min_plev;         /* Minimal plev needed to enter -- it's an anti-cheating mesure */
        BIT_FLAGS16 pit;
        BIT_FLAGS16 nest;
-       byte mode;              /* Mode of combinaison of the monster flags */
+       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 */
@@ -1641,7 +1652,7 @@ struct dungeon_info_type {
        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;
@@ -1655,7 +1666,7 @@ struct dungeon_info_type {
 typedef struct {
        cptr name;          /*!< 自動拾い/破壊定義の名称一致基準 / Items which have 'name' as part of its name match */
        cptr insc;          /*!< 対象となったアイテムに自動で刻む内容 / Items will be auto-inscribed as 'insc' */
-       u32b flag[2];       /*!< キーワードに関する汎用的な条件フラグ / Misc. keyword to be matched */
+       BIT_FLAGS flag[2];       /*!< キーワードに関する汎用的な条件フラグ / Misc. keyword to be matched */
        byte action;        /*!< 対象のアイテムを拾う/破壊/放置するかの指定フラグ / Auto-pickup or Destroy or Leave items */
        byte dice;          /*!< 武器のダイス値基準値 / Weapons which have more than 'dice' dice match */
        byte bonus;         /*!< アイテムのボーナス基準値 / Items which have more than 'bonus' magical bonus match */
@@ -1667,8 +1678,8 @@ 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) */
+       FLOOR_IDX floor_id;        /* No recycle until 65536 IDs are all used */
+       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. */
@@ -1682,9 +1693,9 @@ typedef struct
  */
 typedef struct
 {
-       u16b info;
-       s16b feat;
-       s16b mimic;
+       BIT_FLAGS info;
+       FEAT_IDX feat;
+       FEAT_IDX mimic;
        s16b special;
        u16b occurrence;
 } cave_template_type;
@@ -1696,9 +1707,9 @@ typedef struct
  */
 typedef struct
 {
-       s16b r_idx; /*!< 闘技場のモンスター種族ID(0ならば表彰式) / Monster (0 means victory prizing) */
-       byte tval;  /*!< モンスター打倒後に得られるアイテムの大カテゴリID / tval of prize (0 means no prize) */
-       byte sval;  /*!< モンスター打倒後に得られるアイテムの小カテゴリID / sval of prize */
+       MONRACE_IDX r_idx; /*!< 闘技場のモンスター種族ID(0ならば表彰式) / Monster (0 means victory prizing) */
+       OBJECT_TYPE_VALUE tval;  /*!< モンスター打倒後に得られるアイテムの大カテゴリID / tval of prize (0 means no prize) */
+       OBJECT_SUBTYPE_VALUE sval;  /*!< モンスター打倒後に得られるアイテムの小カテゴリID / sval of prize */
 } arena_type;
 
 
@@ -1724,9 +1735,9 @@ typedef struct
 typedef struct {
        int run; /* Remaining grid number */
        int cost[MAX_HGT][MAX_WID];
-       int x; /* Target X */
-       int y; /* Target Y */
-       int dir; /* Running direction */
+       POSITION x; /* Target X */
+       POSITION y; /* Target Y */
+       DIRECTION dir; /* Running direction */
 } travel_type;
 #endif
 
@@ -1737,7 +1748,7 @@ typedef struct {
        s32b value;
        struct {
                int constant;
-               int dice;
+               DICE_NUMBER dice;
        } timeout;
        cptr desc;
 } activation_type;