5 * @brief アイテム定義の構造体とエンティティ処理定義
10 #include "object-enchant/object-ego.h"
11 #include "object-enchant/tr-flags.h"
12 #include "object-enchant/trc-types.h"
13 #include "system/angband.h"
14 #include "system/system-variables.h"
15 #include "util/flag-group.h"
18 enum class FixedArtifactId : short;
19 enum class ItemKindType : short;
20 enum class SmithEffectType : int16_t;
21 enum class RandomArtActType : short;
26 short bi_id{}; /*!< ベースアイテムID (0は、不具合調査用の無効アイテム または 何も装備していない箇所のアイテム であることを示す) */
27 POSITION iy{}; /*!< Y-position on map, or zero */
28 POSITION ix{}; /*!< X-position on map, or zero */
29 IDX stack_idx{}; /*!< このアイテムを含むアイテムリスト内の位置(降順) */
30 ItemKindType tval{}; /*!< Item type (from kind) */
32 OBJECT_SUBTYPE_VALUE sval{}; /*!< Item sub-type (from kind) */
33 PARAMETER_VALUE pval{}; /*!< Item extra-parameter */
34 byte discount{}; /*!< ゲーム中の値引き率 (0~100) / Discount (if any) */
35 ITEM_NUMBER number{}; /*!< Number of items */
36 WEIGHT weight{}; /*!< Item weight */
37 FixedArtifactId fixed_artifact_idx; /*!< 固定アーティファクト番号 (固定アーティファクトでないなら0) */
38 EgoType ego_idx{}; /*!< エゴ番号 (エゴでないなら0) */
40 RandomArtActType activation_id{}; /*!< エゴ/アーティファクトの発動ID / Extra info activation index */
41 byte chest_level = 0; /*!< 箱の中身レベル */
42 uint8_t captured_monster_speed = 0; /*!< 捕らえたモンスターの速度 */
43 short captured_monster_current_hp = 0; /*!< 捕らえたモンスターの現HP */
44 short captured_monster_max_hp = 0; /*!< 捕らえたモンスターの最大HP */
45 short fuel = 0; /*!< 光源の残り寿命 / Remaining fuel */
47 byte smith_hit = 0; /*!< 鍛冶をした結果上昇した命中値 */
48 byte smith_damage = 0; /*!< 鍛冶をした結果上昇したダメージ */
49 std::optional<SmithEffectType> smith_effect; //!< 鍛冶で付与された効果
50 std::optional<RandomArtActType> smith_act_idx; //!< 鍛冶で付与された発動効果のID
52 HIT_PROB to_h{}; /*!< Plusses to hit */
53 int to_d{}; /*!< Plusses to damage */
54 ARMOUR_CLASS to_a{}; /*!< Plusses to AC */
55 ARMOUR_CLASS ac{}; /*!< Normal AC */
57 DICE_NUMBER dd{}; /*!< Damage dice/nums */
58 DICE_SID ds{}; /*!< Damage dice/sides */
59 TIME_EFFECT timeout{}; /*!< Timeout Counter */
60 byte ident{}; /*!< Special flags */
61 byte marked{}; /*!< Object is marked */
62 uint16_t inscription{}; /*!< Inscription index */
63 uint16_t art_name{}; /*!< Artifact name (random artifacts) */
64 byte feeling{}; /*!< Game generated inscription number (eg, pseudo-id) */
66 TrFlags art_flags{}; /*!< Extra Flags for ego and artifacts */
67 EnumClassFlagGroup<CurseTraitType> curse_flags{}; /*!< Flags for curse */
68 MONSTER_IDX held_m_idx{}; /*!< アイテムを所持しているモンスターID (いないなら 0) / Monster holding us (if any) */
69 int artifact_bias{}; /*!< ランダムアーティファクト生成時のバイアスID */
72 void copy_from(const ItemEntity *j_ptr);
73 void prep(short new_bi_id);
74 bool is_weapon() const;
75 bool is_weapon_ammo() const;
76 bool is_weapon_armour_ammo() const;
77 bool is_melee_weapon() const;
78 bool is_melee_ammo() const;
79 bool is_wearable() const;
80 bool is_equipment() const;
81 bool is_orthodox_melee_weapons() const;
82 bool is_broken_weapon() const;
83 bool is_throwable() const;
84 bool is_wieldable_in_etheir_hand() const;
85 bool refuse_enchant_weapon() const;
86 bool allow_enchant_weapon() const;
87 bool allow_enchant_melee_weapon() const;
88 bool allow_two_hands_wielding() const;
90 bool is_convertible() const;
91 bool is_lance() const;
92 bool is_armour() const;
95 bool is_smith() const;
96 bool is_artifact() const;
97 bool is_fixed_artifact() const;
98 bool is_random_artifact() const;
99 bool is_nameless() const;
100 bool is_valid() const;
101 bool is_broken() const;
102 bool is_cursed() const;
103 bool is_held_by_monster() const;
104 bool is_known() const;
105 bool is_fully_known() const;
106 bool is_aware() const;
107 bool is_tried() const;
108 bool is_potion() const;
109 bool is_readable() const;
110 bool can_refill_lantern() const;
111 bool can_refill_torch() const;
112 bool is_rechargeable() const;
113 bool is_offerable() const;
114 bool is_activatable() const;
115 bool is_fuel() const;
116 bool is_book() const;
117 bool is_glove_same_temper(const ItemEntity *j_ptr) const;
118 bool can_pile(const ItemEntity *j_ptr) const;
119 TERM_COLOR get_color() const;
120 char get_symbol() const;
121 int get_price() const;
122 bool is_specific_artifact(FixedArtifactId id) const;
125 int get_baseitem_price() const;
126 int calc_figurine_value() const;
127 int calc_capture_value() const;