OSDN Git Service

[Refactor] #3772 refuse_enchant_weapon() では状態変更の意なのでshould_refuse_enchant() に改名した
authorHourier <66951241+Hourier@users.noreply.github.com>
Sat, 2 Dec 2023 12:12:35 +0000 (21:12 +0900)
committerHourier <66951241+Hourier@users.noreply.github.com>
Mon, 4 Dec 2023 10:46:59 +0000 (19:46 +0900)
src/system/baseitem-info.cpp
src/system/baseitem-info.h
src/system/item-entity.cpp
src/system/item-entity.h

index 3b9bf2b..6fef30a 100644 (file)
@@ -513,7 +513,7 @@ bool BaseitemKey::is_cross_bow() const
     }
 }
 
-bool BaseitemKey::refuse_enchant_weapon() const
+bool BaseitemKey::should_refuse_enchant() const
 {
     return *this == BaseitemKey(ItemKindType::SWORD, SV_POISON_NEEDLE);
 }
index 73a275d..5f7688f 100644 (file)
@@ -71,7 +71,7 @@ public:
     bool is_junk() const;
     bool is_armour() const;
     bool is_cross_bow() const;
-    bool refuse_enchant_weapon() const;
+    bool should_refuse_enchant() const;
     std::string explain_activation() const;
     bool is_convertible() const;
     bool is_fuel() const;
index fd46ca3..7ad0e3d 100644 (file)
@@ -213,21 +213,12 @@ bool ItemEntity::is_wieldable_in_etheir_hand() const
 }
 
 /*!
- * @brief 強化不能武器であるかを判定する
- * @return 強化不能か否か
- */
-bool ItemEntity::refuse_enchant_weapon() const
-{
-    return this->bi_key.refuse_enchant_weapon();
-}
-
-/*!
  * @brief 強化可能武器であるかを判定する
  * @return 強化可能か否か
  */
 bool ItemEntity::allow_enchant_weapon() const
 {
-    return this->is_weapon_ammo() && !this->refuse_enchant_weapon();
+    return this->is_weapon_ammo() && !this->should_refuse_enchant();
 }
 
 /*!
@@ -236,7 +227,7 @@ bool ItemEntity::allow_enchant_weapon() const
  */
 bool ItemEntity::allow_enchant_melee_weapon() const
 {
-    return this->is_melee_weapon() && !this->refuse_enchant_weapon();
+    return this->is_melee_weapon() && !this->should_refuse_enchant();
 }
 
 /*!
@@ -700,6 +691,15 @@ int ItemEntity::calc_capture_value() const
     return MonraceList::get_instance().calc_capture_value(r_idx);
 }
 
+/*!
+ * @brief 強化不能武器であるかを判定する
+ * @return 強化不能か否か
+ */
+bool ItemEntity::should_refuse_enchant() const
+{
+    return this->bi_key.should_refuse_enchant();
+}
+
 bool ItemEntity::is_specific_artifact(FixedArtifactId id) const
 {
     return this->fixed_artifact_idx == id;
index 2cfd7d1..def5268 100644 (file)
@@ -89,7 +89,6 @@ public:
     bool is_broken_weapon() const;
     bool is_throwable() const;
     bool is_wieldable_in_etheir_hand() const;
-    bool refuse_enchant_weapon() const;
     bool allow_enchant_weapon() const;
     bool allow_enchant_melee_weapon() const;
     bool allow_two_hands_wielding() const;
@@ -158,6 +157,7 @@ private:
     int get_baseitem_price() const;
     int calc_figurine_value() const;
     int calc_capture_value() const;
+    bool should_refuse_enchant() const;
     void modify_ego_lite_flags(TrFlags &flags) const;
     RandomArtActType get_activation_index() const;
     std::string build_activation_description() const;