-#pragma once
+#pragma once
#include "object-enchant/tr-flags.h"
#include "object-enchant/trg-types.h"
enum class ItemKindType : short;
class BaseitemKey {
public:
- BaseitemKey(const ItemKindType type_value, const std::optional<int> &subtype_value = std::nullopt);
+ constexpr BaseitemKey(const ItemKindType type_value, const std::optional<int> &subtype_value = std::nullopt)
+ : type_value(type_value)
+ , subtype_value(subtype_value)
+ {
+ }
+
bool operator==(const BaseitemKey &other) const;
bool operator!=(const BaseitemKey &other) const
{
ItemKindType tval() const;
std::optional<int> sval() const;
+ bool is(ItemKindType tval) const;
ItemKindType get_arrow_kind() const;
bool is_spell_book() const;
bool is_junk() const;
bool is_armour() const;
bool is_cross_bow() const;
+ bool refuse_enchant_weapon() const;
private:
ItemKindType type_value;
bool easy_know{}; /*!< ベースアイテムが初期からベース名を判断可能かどうか / This object is always known (if aware) */
RandomArtActType act_idx{}; /*!< 発動能力のID / Activative ability index */
+ void decide_easy_know();
+
/* @todo ここから下はk_info.txt に依存しないミュータブルなフィールド群なので、将来的に分離予定 */
TERM_COLOR x_attr{}; /*!< 設定変更後のアイテムシンボルカラー / Desired object attribute */
IDX flavor{}; /*!< 未鑑定名の何番目を当てるか(0は未鑑定名なし) / Special object flavor (or zero) */
bool aware{}; /*!< ベースアイテムが鑑定済かどうか / The player is "aware" of the item's effects */
bool tried{}; /*!< ベースアイテムを未鑑定のまま試したことがあるか / The player has "tried" one of the items */
+
+ void mark_as_tried();
};
extern std::vector<BaseitemInfo> baseitems_info;