3 #include "system/angband.h"
5 #include "object-enchant/tr-flags.h"
10 enum class SmithEffectType : int16_t;
11 enum class SmithCategoryType;
12 enum class SmithEssenceType : int16_t;
13 enum class RandomArtActType : short;
19 * @brief 鍛冶効果の情報の基底クラス
23 virtual ~ISmithInfo() = default;
28 * @param o_ptr 鍛冶効果の付与を行うアイテム構造体へのポインタ
29 * @param number 付与を行うエッセンスの個数
30 * @return 鍛冶効果の付与に成功した場合は true、失敗した場合は false
32 virtual bool add_essence(PlayerType *player_ptr, ObjectType *o_ptr, int number) const = 0;
37 * @param o_ptr 鍛冶効果の消去を行うアイテム構造体へのポインタ
39 virtual void erase_essence(ObjectType *o_ptr) const = 0;
42 * @brief 鍛冶効果により与えられる特性フラグ(tr_type)のFlagGroupオブジェクトを取得する
43 * 基底クラスは空のFlagGroupオブジェクトを返す。派生クラスで必要に応じて鍛冶効果で与えられる特性フラグを返すようオーバーライドする。
45 * @return TrFlags 鍛冶効果により与えられる特性フラグ(tr_type)のFlagGroupオブジェクト
47 virtual TrFlags tr_flags() const;
50 * @brief 鍛冶を行えるアイテムかどうかを調べる
52 * @param o_ptr 鍛冶を行うアイテム構造体へのポインタ
53 * @return 鍛冶を行えるなら true、そうでなければ false
55 virtual bool can_give_smith_effect(const ObjectType *o_ptr) const = 0;
57 SmithEffectType effect; //!< 鍛冶で与える効果の種類
58 concptr name; //!< 鍛冶で与える能力の名称
59 SmithCategoryType category; //!< 鍛冶で与える能力が所属するグループ
60 std::vector<SmithEssenceType> need_essences; //!< 能力を与えるのに必要なエッセンスのリスト
61 int consumption; //!< 能力を与えるのに必要な消費量(need_essencesに含まれるエッセンスそれぞれについてこの量を消費)
64 ISmithInfo(SmithEffectType effect, concptr name, SmithCategoryType category, std::vector<SmithEssenceType> need_essences, int consumption);
68 * @brief 基本的な鍛冶効果の情報クラス
69 * 多くの鍛冶効果が該当する、指定した特性フラグを与える鍛冶の情報を扱う
71 class BasicSmithInfo : public ISmithInfo {
73 BasicSmithInfo(SmithEffectType effect, concptr name, SmithCategoryType category, std::vector<SmithEssenceType> need_essences, int consumption, TrFlags add_flags);
74 virtual bool add_essence(PlayerType *player_ptr, ObjectType *o_ptr, int number) const override;
75 virtual void erase_essence(ObjectType *o_ptr) const override;
76 virtual TrFlags tr_flags() const override;
77 virtual bool can_give_smith_effect(const ObjectType *o_ptr) const final override;
80 virtual bool can_give_smith_effect_impl(const ObjectType *o_ptr) const;
81 TrFlags add_flags; //!< 鍛冶で能力を与えることにより付与されるアイテム特性フラグ
85 * @brief 発動効果を付与する鍛冶効果の情報クラス
88 class ActivationSmithInfo : public ISmithInfo {
90 ActivationSmithInfo(SmithEffectType effect, concptr name, SmithCategoryType category, std::vector<SmithEssenceType> need_essences, int consumption, RandomArtActType act_idx);
91 virtual bool add_essence(PlayerType *player_ptr, ObjectType *o_ptr, int number) const override;
92 virtual void erase_essence(ObjectType *) const override;
93 virtual bool can_give_smith_effect(const ObjectType *o_ptr) const override;
96 RandomArtActType act_idx; //!< 発動能力ID
100 * @brief 武器強化を行う鍛冶情報のクラス
101 * 武器の命中/ダメージ修正を強化する。鍛冶効果とは別枠で行うので鍛冶師の銘付きにはならない。
103 class EnchantWeaponSmithInfo : public ISmithInfo {
105 EnchantWeaponSmithInfo(SmithEffectType effect, concptr name, SmithCategoryType category, std::vector<SmithEssenceType> need_essences, int consumption);
106 virtual bool add_essence(PlayerType *player_ptr, ObjectType *o_ptr, int number) const override;
107 virtual void erase_essence(ObjectType *) const override {}
108 virtual bool can_give_smith_effect(const ObjectType *o_ptr) const override;
112 * @brief 防具強化を行う鍛冶情報のクラス
113 * 防具のAC修正を強化する。鍛冶効果とは別枠で行うので鍛冶師の銘付きにはならない。
115 class EnchantArmourSmithInfo : public ISmithInfo {
117 EnchantArmourSmithInfo(SmithEffectType effect, concptr name, SmithCategoryType category, std::vector<SmithEssenceType> need_essences, int consumption);
118 virtual bool add_essence(PlayerType *player_ptr, ObjectType *o_ptr, int number) const override;
119 virtual void erase_essence(ObjectType *) const override {}
120 virtual bool can_give_smith_effect(const ObjectType *o_ptr) const override;
124 * @brief 装備保持を行う鍛冶情報のクラス
125 * 四元素属性で破壊されないフラグを付与する。鍛冶効果とは別枠で行うので鍛冶師の銘付きにはならない。
127 class SustainSmithInfo : public ISmithInfo {
129 SustainSmithInfo(SmithEffectType effect, concptr name, SmithCategoryType category, std::vector<SmithEssenceType> need_essences, int consumption);
130 virtual bool add_essence(PlayerType *player_ptr, ObjectType *o_ptr, int number) const override;
131 virtual void erase_essence(ObjectType *) const override {}
132 virtual bool can_give_smith_effect(const ObjectType *o_ptr) const override;
136 * @brief 殺戮の小手を作成する鍛冶情報のクラス
137 * 小手に殺戮修正を付ける。(もともと殺戮修正のある小手は修正をさらに強化する)
139 class SlayingGlovesSmithInfo : public BasicSmithInfo {
141 SlayingGlovesSmithInfo(SmithEffectType effect, concptr name, SmithCategoryType category, std::vector<SmithEssenceType> need_essences, int consumption);
142 virtual bool add_essence(PlayerType *player_ptr, ObjectType *o_ptr, int number) const override;
143 virtual void erase_essence(ObjectType *) const override;
146 virtual bool can_give_smith_effect_impl(const ObjectType *o_ptr) const override;