4 * @file object-type-definition.h
5 * @brief アイテム定義の構造体とエンティティ処理定義
10 #include "object-enchant/trc-types.h"
11 #include "object/tval-types.h"
12 #include "system/angband.h"
13 #include "system/system-variables.h"
14 #include "util/flag-group.h"
17 typedef struct object_type {
18 KIND_OBJECT_IDX k_idx{}; /*!< Kind index (zero if "dead") */
19 POSITION iy{}; /*!< Y-position on map, or zero */
20 POSITION ix{}; /*!< X-position on map, or zero */
21 IDX stack_idx{}; /*!< このアイテムを含むアイテムリスト内の位置(降順) */
22 tval_type tval{}; /*!< Item type (from kind) */
24 OBJECT_SUBTYPE_VALUE sval{}; /*!< Item sub-type (from kind) */
25 PARAMETER_VALUE pval{}; /*!< Item extra-parameter */
26 DISCOUNT_RATE discount{}; /*!< Discount (if any) */
27 ITEM_NUMBER number{}; /*!< Number of items */
28 WEIGHT weight{}; /*!< Item weight */
29 ARTIFACT_IDX name1{}; /*!< Artifact type, if any */
30 EGO_IDX name2{}; /*!< Ego-Item type, if any */
32 XTRA8 xtra1{}; /*!< Extra info type (now unused) */
33 XTRA16 xtra2{}; /*!< エゴ/アーティファクトの発動ID / Extra info activation index */
34 XTRA8 xtra3{}; /*!< 複数の使用用途 捕らえたモンスターの速度,付加した特殊なエッセンスID / Extra info for weaponsmith */
35 XTRA16 xtra4{}; /*!< 複数の使用用途 光源の残り寿命、あるいは捕らえたモンスターの現HP / Extra info fuel or captured monster's current HP */
36 XTRA16 xtra5{}; /*!< 複数の使用用途 捕らえたモンスターの最大HP / Extra info captured monster's max HP */
38 HIT_PROB to_h{}; /*!< Plusses to hit */
39 HIT_POINT to_d{}; /*!< Plusses to damage */
40 ARMOUR_CLASS to_a{}; /*!< Plusses to AC */
41 ARMOUR_CLASS ac{}; /*!< Normal AC */
43 DICE_NUMBER dd{}; /*!< Damage dice/nums */
44 DICE_SID ds{}; /*!< Damage dice/sides */
45 TIME_EFFECT timeout{}; /*!< Timeout Counter */
46 byte ident{}; /*!< Special flags */
47 byte marked{}; /*!< Object is marked */
48 uint16_t inscription{}; /*!< Inscription index */
49 uint16_t art_name{}; /*!< Artifact name (random artifacts) */
50 byte feeling{}; /*!< Game generated inscription number (eg, pseudo-id) */
52 TrFlags art_flags{}; /*!< Extra Flags for ego and artifacts */
53 EnumClassFlagGroup<TRC> curse_flags{}; /*!< Flags for curse */
54 MONSTER_IDX held_m_idx{}; /*!< アイテムを所持しているモンスターID (いないなら 0) / Monster holding us (if any) */
55 int artifact_bias{}; /*!< ランダムアーティファクト生成時のバイアスID */
58 void copy_from(object_type *j_ptr);
59 void prep(KIND_OBJECT_IDX ko_idx);
60 bool is_weapon() const;
61 bool is_weapon_ammo() const;
62 bool is_weapon_armour_ammo() const;
63 bool is_melee_weapon() const;
64 bool is_melee_ammo() const;
65 bool is_wearable() const;
66 bool is_equipment() const;
67 bool is_orthodox_melee_weapons() const;
68 bool is_broken_weapon() const;
69 bool is_throwable() const;
70 bool is_mochikae() const;
71 bool refuse_enchant_weapon() const;
72 bool allow_enchant_weapon() const;
73 bool allow_enchant_melee_weapon() const;
74 bool allow_two_hands_wielding() const;
76 bool is_convertible() const;
77 bool is_lance() const;
78 bool is_armour() const;
81 bool is_smith() const;
82 bool is_artifact() const;
83 bool is_fixed_artifact() const;
84 bool is_random_artifact() const;
85 bool is_nameless() const;
86 bool is_valid() const;
87 bool is_broken() const;
88 bool is_cursed() const;
89 bool is_held_by_monster() const;
90 bool is_known() const;
91 bool is_fully_known() const;
92 bool is_aware() const;
93 bool is_tried() const;