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 "object/object-mark-types.h"
14 #include "system/angband.h"
15 #include "system/baseitem-info.h"
16 #include "system/system-variables.h"
17 #include "util/flag-group.h"
20 enum class FixedArtifactId : short;
21 enum class ItemKindType : short;
22 enum class SmithEffectType : int16_t;
23 enum class RandomArtActType : short;
25 class EgoItemDefinition;
30 short bi_id{}; /*!< ベースアイテムID (0は、不具合調査用の無効アイテム または 何も装備していない箇所のアイテム であることを示す) */
31 POSITION iy{}; /*!< Y-position on map, or zero */
32 POSITION ix{}; /*!< X-position on map, or zero */
33 IDX stack_idx{}; /*!< このアイテムを含むアイテムリスト内の位置(降順) */
35 PARAMETER_VALUE pval{}; /*!< Item extra-parameter */
36 byte discount{}; /*!< ゲーム中の値引き率 (0~100) / Discount (if any) */
37 ITEM_NUMBER number{}; /*!< Number of items */
38 WEIGHT weight{}; /*!< Item weight */
39 FixedArtifactId fixed_artifact_idx; /*!< 固定アーティファクト番号 (固定アーティファクトでないなら0) */
40 EgoType ego_idx{}; /*!< エゴ番号 (エゴでないなら0) */
42 RandomArtActType activation_id{}; /*!< エゴ/アーティファクトの発動ID / Extra info activation index */
43 byte chest_level = 0; /*!< 箱の中身レベル */
44 uint8_t captured_monster_speed = 0; /*!< 捕らえたモンスターの速度 */
45 short captured_monster_current_hp = 0; /*!< 捕らえたモンスターの現HP */
46 short captured_monster_max_hp = 0; /*!< 捕らえたモンスターの最大HP */
47 short fuel = 0; /*!< 光源の残り寿命 / Remaining fuel */
49 byte smith_hit = 0; /*!< 鍛冶をした結果上昇した命中値 */
50 byte smith_damage = 0; /*!< 鍛冶をした結果上昇したダメージ */
51 std::optional<SmithEffectType> smith_effect; //!< 鍛冶で付与された効果
52 std::optional<RandomArtActType> smith_act_idx; //!< 鍛冶で付与された発動効果のID
54 HIT_PROB to_h{}; /*!< Plusses to hit */
55 int to_d{}; /*!< Plusses to damage */
56 ARMOUR_CLASS to_a{}; /*!< Plusses to AC */
57 ARMOUR_CLASS ac{}; /*!< Normal AC */
59 DICE_NUMBER dd{}; /*!< Damage dice/nums */
60 DICE_SID ds{}; /*!< Damage dice/sides */
61 TIME_EFFECT timeout{}; /*!< Timeout Counter */
62 byte ident{}; /*!< Special flags */
63 EnumClassFlagGroup<OmType> marked{}; /*!< Object is marked */
64 std::optional<std::string> inscription{}; /*!< Inscription */
65 std::optional<std::string> randart_name{}; /*!< Artifact name (random artifacts) */
66 byte feeling{}; /*!< Game generated inscription number (eg, pseudo-id) */
68 TrFlags art_flags{}; /*!< Extra Flags for ego and artifacts */
69 EnumClassFlagGroup<CurseTraitType> curse_flags{}; /*!< Flags for curse */
70 MONSTER_IDX held_m_idx{}; /*!< アイテムを所持しているモンスターID (いないなら 0) / Monster holding us (if any) */
71 int artifact_bias{}; /*!< ランダムアーティファクト生成時のバイアスID */
74 void copy_from(const ItemEntity *j_ptr);
75 void prep(short new_bi_id);
76 bool is_weapon() const;
77 bool is_weapon_ammo() const;
78 bool is_weapon_armour_ammo() const;
79 bool is_melee_weapon() const;
80 bool is_melee_ammo() const;
81 bool is_wearable() const;
82 bool is_equipment() const;
83 bool is_orthodox_melee_weapons() const;
84 bool is_broken_weapon() const;
85 bool is_throwable() const;
86 bool is_wieldable_in_etheir_hand() const;
87 bool refuse_enchant_weapon() const;
88 bool allow_enchant_weapon() const;
89 bool allow_enchant_melee_weapon() const;
90 bool allow_two_hands_wielding() const;
92 bool is_convertible() const;
93 bool is_lance() const;
94 bool is_protector() const;
95 bool can_be_aura_protector() const;
98 bool is_smith() const;
99 bool is_fixed_or_random_artifact() const;
100 bool is_fixed_artifact() const;
101 bool is_random_artifact() const;
102 bool is_nameless() const;
103 bool is_valid() const;
104 bool is_broken() const;
105 bool is_cursed() const;
106 bool is_held_by_monster() const;
107 bool is_known() const;
108 bool is_fully_known() const;
109 bool is_aware() const;
110 bool is_tried() const;
111 bool is_potion() const;
112 bool is_readable() const;
113 bool can_refill_lantern() const;
114 bool can_refill_torch() const;
115 bool can_recharge() const;
116 bool is_offerable() const;
117 bool is_activatable() const;
118 bool is_fuel() const;
119 bool is_spell_book() const;
120 bool is_glove_same_temper(const ItemEntity *j_ptr) const;
121 bool can_pile(const ItemEntity *j_ptr) const;
122 TERM_COLOR get_color() const;
123 char get_symbol() const;
124 int get_price() const;
125 bool is_specific_artifact(FixedArtifactId id) const;
126 bool has_unidentified_name() const;
127 ItemKindType get_arrow_kind() const;
128 bool is_wand_rod() const;
129 bool is_wand_staff() const;
130 short get_bow_energy() const;
131 int get_arrow_magnification() const;
132 bool is_aiming_rod() const;
133 bool is_lite_requiring_fuel() const;
134 bool is_junk() const;
135 bool is_armour() const;
136 bool is_cross_bow() const;
137 bool is_inscribed() const;
139 BaseitemInfo &get_baseitem() const;
140 EgoItemDefinition &get_ego() const;
143 int get_baseitem_price() const;
144 int calc_figurine_value() const;
145 int calc_capture_value() const;