OSDN Git Service

[Refactor] #37353 files.cの整形修正 / Fixed reshaped files.c
[hengband/hengband.git] / src / objectkind.h
1 #pragma once
2 #include "util.h"
3
4 /*!
5  * @struct object_kind
6  * @brief ベースアイテム情報の構造体 / Information about object "kinds", including player knowledge.
7  * @details
8  * ゲーム進行用のセーブファイル上では aware と tried のみ保存対象とすること。と英文ではあるが実際はもっとある様子である。 /
9  * Only "aware" and "tried" are saved in the savefile
10  */
11
12
13  /*
14   * Return the "char" for a given item.
15   * Use "flavor" if available.
16   * Default to user definitions.
17   */
18 #define object_char(T) \
19         ((k_info[(T)->k_idx].flavor) ? \
20          (k_info[k_info[(T)->k_idx].flavor].x_char) : \
21          (k_info[(T)->k_idx].x_char))
22
23
24 typedef struct object_kind object_kind;
25
26 struct object_kind
27 {
28         STR_OFFSET name;                        /*!< ベースアイテム名参照のためのネームバッファオフセット値 / Name (offset) */
29         STR_OFFSET text;                        /*!< 解説テキスト参照のためのネームバッファオフセット値 / Text (offset) */
30         STR_OFFSET flavor_name; /*!< 未確定名参照のためのネームバッファオフセット値 / Flavor name (offset) */
31
32         OBJECT_TYPE_VALUE tval;                 /*!< ベースアイテム種別の大項目値 Object type */
33         OBJECT_SUBTYPE_VALUE sval;                      /*!< ベースアイテム種別の小項目値 Object sub type */
34
35         PARAMETER_VALUE pval;   /*!< ベースアイテムのpval(能力修正共通値) Object extra info */
36
37         HIT_PROB to_h;                  /*!< ベースアイテムの命中修正値 / Bonus to hit */
38         HIT_POINT to_d;                 /*!< ベースアイテムのダメージ修正値 / Bonus to damage */
39         ARMOUR_CLASS to_a;                      /*!< ベースアイテムのAC修正値 / Bonus to armor */
40
41         ARMOUR_CLASS ac;                        /*!< ベースアイテムのAC基本値 /  Base armor */
42
43         DICE_NUMBER dd;
44         DICE_SID ds;            /*!< ダメージダイスの数と大きさ / Damage dice/sides */
45
46         WEIGHT weight;          /*!< ベースアイテムの重量 / Weight */
47
48         PRICE cost;                     /*!< ベースアイテムの基本価値 / Object "base cost" */
49
50         BIT_FLAGS flags[TR_FLAG_SIZE];  /*!< ベースアイテムの基本特性ビット配列 / Flags */
51
52         BIT_FLAGS gen_flags;            /*!< ベースアイテムの生成特性ビット配列 / flags for generate */
53
54         DEPTH locale[4];                /*!< ベースアイテムの生成階テーブル / Allocation level(s) */
55         PROB chance[4];         /*!< ベースアイテムの生成確率テーブル / Allocation chance(s) */
56
57         DEPTH level;                    /*!< ベースアイテムの基本生成階 / Level */
58         BIT_FLAGS8 extra;                       /*!< その他色々のビットフラグ配列 / Something */
59
60         TERM_COLOR d_attr;              /*!< デフォルトのアイテムシンボルカラー / Default object attribute */
61         SYMBOL_CODE d_char;             /*!< デフォルトのアイテムシンボルアルファベット / Default object character */
62
63         TERM_COLOR x_attr;              /*!< 設定変更後のアイテムシンボルカラー /  Desired object attribute */
64         SYMBOL_CODE x_char;             /*!< 設定変更後のアイテムシンボルアルファベット /  Desired object character */
65
66         IDX flavor;             /*!< 調査中(TODO) / Special object flavor (or zero) */
67
68         bool easy_know;         /*!< ベースアイテムが初期からベース名を判断可能かどうか / This object is always known (if aware) */
69
70         bool aware;                     /*!< ベースアイテムが鑑定済かどうか /  The player is "aware" of the item's effects */
71
72         bool tried;                     /*!< ベースアイテムを未鑑定のまま試したことがあるか /  The player has "tried" one of the items */
73
74         ACTIVATION_IDX act_idx;         /*!< 発動能力のID /  Activative ability index */
75 };
76
77 extern object_kind *k_info;
78 extern char *k_name;
79 extern char *k_text;
80 extern KIND_OBJECT_IDX max_k_idx;
81
82 extern s16b alloc_kind_size;
83 extern alloc_entry *alloc_kind_table;