3 #include "system/system-variables.h"
5 #include "object-enchant/tr-flags.h"
9 #include <unordered_map>
14 struct essence_drain_type;
16 struct smith_data_type;
18 enum class SmithEffectType : int16_t;
19 enum class SmithCategoryType;
20 enum class SmithEssenceType : int16_t;
21 enum class RandomArtActType : short;
28 //! エッセンスとその抽出量を表すタプルのリスト
29 using DrainEssenceResult = std::vector<std::tuple<SmithEssenceType, int>>;
31 Smith(PlayerType *player_ptr);
33 static const std::vector<SmithEssenceType> &get_essence_list();
34 static concptr get_essence_name(SmithEssenceType essence);
35 static std::vector<SmithEffectType> get_effect_list(SmithCategoryType category);
36 static concptr get_effect_name(SmithEffectType effect);
37 static std::string get_need_essences_desc(SmithEffectType effect);
38 static std::vector<SmithEssenceType> get_need_essences(SmithEffectType effect);
39 static int get_essence_consumption(SmithEffectType effect, const ItemEntity *o_ptr = nullptr);
40 static std::unique_ptr<ItemTester> get_item_tester(SmithEffectType effect);
41 static TrFlags get_effect_tr_flags(SmithEffectType effect);
42 static std::optional<RandomArtActType> object_activation(const ItemEntity *o_ptr);
43 static std::optional<SmithEffectType> object_effect(const ItemEntity *o_ptr);
45 int get_essence_num_of_posessions(SmithEssenceType essence) const;
46 DrainEssenceResult drain_essence(ItemEntity *o_ptr);
47 bool add_essence(SmithEffectType effect, ItemEntity *o_ptr, int consumption);
48 void erase_essence(ItemEntity *o_ptr) const;
49 int get_addable_count(SmithEffectType smith_effect, const ItemEntity *o_ptr = nullptr) const;
51 static constexpr int ESSENCE_AMOUNT_MAX = 20000;
54 static std::optional<const ISmithInfo *> find_smith_info(SmithEffectType effect);
56 static const std::vector<SmithEssenceType> essence_list_order;
57 static const std::unordered_map<SmithEssenceType, concptr> essence_to_name;
58 static const std::vector<essence_drain_type> essence_drain_info_table;
59 static const std::vector<std::shared_ptr<ISmithInfo>> smith_info_table;
61 PlayerType *player_ptr;
62 std::shared_ptr<smith_data_type> smith_data;