3 #include "object-enchant/tr-flags.h"
4 #include "object-enchant/trg-types.h"
5 #include "system/angband.h"
6 #include "util/flag-group.h"
12 enum class ItemKindType : short;
15 constexpr BaseitemKey(const ItemKindType type_value, const std::optional<int> &subtype_value = std::nullopt)
16 : type_value(type_value)
17 , subtype_value(subtype_value)
21 bool operator==(const BaseitemKey &other) const;
22 bool operator!=(const BaseitemKey &other) const
24 return !(*this == other);
27 bool operator<(const BaseitemKey &other) const;
28 bool operator>(const BaseitemKey &other) const
33 bool operator<=(const BaseitemKey &other) const
35 return !(*this > other);
38 bool operator>=(const BaseitemKey &other) const
40 return !(*this < other);
43 ItemKindType tval() const;
44 std::optional<int> sval() const;
45 bool is(ItemKindType tval) const;
47 ItemKindType get_arrow_kind() const;
48 bool is_spell_book() const;
49 bool is_high_level_book() const;
50 bool is_melee_weapon() const;
52 bool has_unidentified_name() const;
53 bool can_recharge() const;
54 bool is_wand_rod() const;
55 bool is_wand_staff() const;
56 bool is_protector() const;
57 bool can_be_aura_protector() const;
58 bool is_wearable() const;
59 bool is_weapon() const;
60 bool is_equipement() const;
61 bool is_melee_ammo() const;
62 bool is_orthodox_melee_weapon() const;
63 bool is_broken_weapon() const;
64 bool is_throwable() const;
65 bool is_wieldable_in_etheir_hand() const;
67 short get_bow_energy() const;
68 int get_arrow_magnification() const;
69 bool is_aiming_rod() const;
70 bool is_lite_requiring_fuel() const;
72 bool is_armour() const;
73 bool is_cross_bow() const;
74 bool refuse_enchant_weapon() const;
75 std::string explain_activation() const;
76 bool is_convertible() const;
78 bool is_lance() const;
79 bool is_readable() const;
80 bool is_corpse() const;
83 ItemKindType type_value;
84 std::optional<int> subtype_value;
86 bool is_mushrooms() const;
89 enum class ItemKindType : short;
90 enum class RandomArtActType : short;
96 std::string name; /*!< ベースアイテム名 */
97 std::string text; /*!< 解説テキスト */
98 std::string flavor_name; /*!< 未確定名 */
102 PARAMETER_VALUE pval{}; /*!< ベースアイテムのpval(能力修正共通値) Object extra info */
104 HIT_PROB to_h{}; /*!< ベースアイテムの命中修正値 / Bonus to hit */
105 int to_d{}; /*!< ベースアイテムのダメージ修正値 / Bonus to damage */
106 ARMOUR_CLASS to_a{}; /*!< ベースアイテムのAC修正値 / Bonus to armor */
107 ARMOUR_CLASS ac{}; /*!< ベースアイテムのAC基本値 / Base armor */
109 DICE_NUMBER dd{}; /*!< ダメージダイスの数 / Damage dice */
110 DICE_SID ds{}; /*!< ダメージダイスの大きさ / Damage sides */
112 WEIGHT weight{}; /*!< ベースアイテムの重量 / Weight */
113 PRICE cost{}; /*!< ベースアイテムの基本価値 / Object "base cost" */
114 TrFlags flags{}; /*!< ベースアイテムの基本特性ビット配列 / Flags */
115 EnumClassFlagGroup<ItemGenerationTraitType> gen_flags; /*!< ベースアイテムの生成特性ビット配列 / flags for generate */
117 DEPTH level{}; /*!< ベースアイテムの基本生成階 / Level */
120 int level; /*!< ベースアイテムの生成階 */
121 short chance; /*!< ベースアイテムの生成確率 */
124 std::array<alloc_table, 4> alloc_tables{}; /*!< ベースアイテムの生成テーブル */
126 TERM_COLOR d_attr{}; /*!< デフォルトのアイテムシンボルカラー / Default object attribute */
127 char d_char{}; /*!< デフォルトのアイテムシンボルアルファベット / Default object character */
128 bool easy_know{}; /*!< ベースアイテムが初期からベース名を判断可能かどうか / This object is always known (if aware) */
129 RandomArtActType act_idx{}; /*!< 発動能力のID / Activative ability index */
131 void decide_easy_know();
133 /* @todo ここから下はk_info.txt に依存しないミュータブルなフィールド群なので、将来的に分離予定 */
135 TERM_COLOR x_attr{}; /*!< 設定変更後のアイテムシンボルカラー / Desired object attribute */
136 char x_char{}; /*!< 設定変更後のアイテムシンボルアルファベット / Desired object character */
138 IDX flavor{}; /*!< 未鑑定名の何番目を当てるか(0は未鑑定名なし) / Special object flavor (or zero) */
139 bool aware{}; /*!< ベースアイテムが鑑定済かどうか / The player is "aware" of the item's effects */
140 bool tried{}; /*!< ベースアイテムを未鑑定のまま試したことがあるか / The player has "tried" one of the items */
142 void mark_as_tried();
145 extern std::vector<BaseitemInfo> baseitems_info;