OSDN Git Service

[Feature] 鍛冶効果:切れ味
authorHabu <habu1010+github@gmail.com>
Sun, 12 Sep 2021 12:37:23 +0000 (21:37 +0900)
committerHabu <habu1010+github@gmail.com>
Mon, 13 Sep 2021 12:21:50 +0000 (21:21 +0900)
武器属性の切れ味を付与する鍛冶を実装する。
使用エッセンスは溶解・電撃・焼棄・凍結を10ずつ。
付与できる武器は刀剣類のみに限定。

src/object-enchant/smith-info.cpp
src/object-enchant/smith-tables.cpp
src/object-enchant/smith-types.h

index 2f09d1d..c1b2255 100644 (file)
@@ -2,6 +2,7 @@
 #include "object-enchant/smith-types.h"
 #include "object-enchant/tr-types.h"
 #include "object/object-flags.h"
+#include "sv-definition/sv-weapon-types.h"
 #include "system/object-type-definition.h"
 #include "system/player-type-definition.h"
 
@@ -66,6 +67,9 @@ bool BasicSmithInfo::can_give_smith_effect(const object_type *o_ptr) const
 
 bool BasicSmithInfo::can_give_smith_effect_impl(const object_type *o_ptr) const
 {
+    if (this->effect == SmithEffect::VORPAL) {
+        return (o_ptr->tval == TV_SWORD) && (o_ptr->sval != SV_POISON_NEEDLE);
+    }
     if (this->category == SmithCategory::WEAPON_ATTR || this->category == SmithCategory::SLAYING) {
         return o_ptr->is_melee_ammo();
     }
index 28284dd..15c8a94 100644 (file)
@@ -388,6 +388,7 @@ const std::vector<std::shared_ptr<ISmithInfo>> Smith::smith_info_table = {
     make_basic_smith_info(SmithEffect::BRAND_ELEC, _("電撃", "electric brand"), SmithCategory::WEAPON_ATTR, { SmithEssence::BRAND_ELEC }, 20, { TR_BRAND_ELEC }),
     make_basic_smith_info(SmithEffect::BRAND_FIRE, _("焼棄", "fire brand"), SmithCategory::WEAPON_ATTR, { SmithEssence::BRAND_FIRE }, 20, { TR_BRAND_FIRE }),
     make_basic_smith_info(SmithEffect::BRAND_COLD, _("凍結", "cold brand"), SmithCategory::WEAPON_ATTR, { SmithEssence::BRAND_COLD }, 20, { TR_BRAND_COLD }),
+    make_basic_smith_info(SmithEffect::VORPAL, _("切れ味", "sharpness"), SmithCategory::WEAPON_ATTR, { SmithEssence::BRAND_ACID, SmithEssence::BRAND_ELEC, SmithEssence::BRAND_FIRE, SmithEssence::BRAND_COLD }, 10, { TR_VORPAL }),
 
     make_basic_smith_info(SmithEffect::IM_ACID, _("酸免疫", "acid immunity"), SmithCategory::RESISTANCE, { SmithEssence::IMMUNITY }, 20, { TR_IM_ACID }),
     make_basic_smith_info(SmithEffect::IM_ELEC, _("電撃免疫", "electric immunity"), SmithCategory::RESISTANCE, { SmithEssence::IMMUNITY }, 20, { TR_IM_ELEC }),
index 2f8ab00..9899331 100644 (file)
@@ -37,6 +37,7 @@ enum class SmithEffect {
     BRAND_ELEC = 45, //!< 電撃
     BRAND_FIRE = 46, //!< 焼棄
     BRAND_COLD = 47, //!< 凍結
+    VORPAL = 48, //!< 切れ味
 
     IM_ACID = 60, //!< 酸免疫
     IM_ELEC = 61, //!< 電撃免疫