OSDN Git Service

[Refactor] 鍛冶関連の enum class を別ファイルに分離
authorHabu <habu1010+github@gmail.com>
Thu, 9 Sep 2021 12:58:23 +0000 (21:58 +0900)
committerHabu <habu1010+github@gmail.com>
Thu, 9 Sep 2021 13:05:53 +0000 (22:05 +0900)
Smithクラスの enum class 3種を定義専用の別ファイルに分離する。
ファイルを分けることで Smith クラス所属の enum class にする事は
できないので Smith::FooBar → SmithFooBar とする。

Hengband/Hengband/Hengband.vcxproj
Hengband/Hengband/Hengband.vcxproj.filters
src/Makefile.am
src/artifact/artifact-info.cpp
src/cmd-item/cmd-smith.cpp
src/flavor/flavor-describer.cpp
src/io-dump/special-class-dump.cpp
src/object-enchant/object-smith.cpp
src/object-enchant/object-smith.h
src/object-enchant/smith-types.h [new file with mode: 0644]
src/object/object-flags.cpp

index 20c701a..2b3920f 100644 (file)
     <ClInclude Include="..\..\src\action\run-execution.h" />\r
     <ClInclude Include="..\..\src\load\savedata-old-flag-types.h" />\r
     <ClInclude Include="..\..\src\object-enchant\object-smith.h" />\r
+    <ClInclude Include="..\..\src\object-enchant\smith-types.h" />\r
     <ClInclude Include="..\..\src\object-enchant\tr-flags.h" />\r
     <ClInclude Include="..\..\src\object-use\throw-execution.h" />\r
     <ClInclude Include="..\..\src\action\travel-execution.h" />\r
index a4aadb4..1f1b868 100644 (file)
     <ClInclude Include="..\..\src\object-enchant\object-smith.h">\r
       <Filter>object-enchant</Filter>\r
     </ClInclude>\r
+    <ClInclude Include="..\..\src\object-enchant\smith-types.h">\r
+      <Filter>object-enchant</Filter>\r
+    </ClInclude>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <None Include="..\..\src\wall.bmp" />\r
index 8d79337..4d517c8 100644 (file)
@@ -593,6 +593,7 @@ hengband_SOURCES = \
        object-enchant/object-smith.cpp object-enchant/object-smith.h \
        object-enchant/item-apply-magic.h object-enchant/item-feeling.h \
        object-enchant/old-ego-extra-values.h object-enchant/special-object-flags.h \
+       object-enchant/smith-types.h \
        object-enchant/tr-flags.h \
        object-enchant/tr-types.h object-enchant/trc-types.h \
        object-enchant/trg-types.h \
index fa967c2..09f910e 100644 (file)
@@ -10,6 +10,7 @@
 #include "object-enchant/activation-info-table.h"
 #include "object-enchant/object-ego.h"
 #include "object-enchant/object-smith.h"
+#include "object-enchant/smith-types.h"
 #include "object-enchant/tr-types.h"
 #include "object/object-kind.h"
 #include "system/artifact-type-definition.h"
 int activation_index(const object_type *o_ptr)
 {
     if (o_ptr->is_smith()) {
-        switch (static_cast<Smith::Effect>(o_ptr->xtra3)) {
-        case Smith::Effect::TMP_RES_ACID:
+        switch (static_cast<SmithEffect>(o_ptr->xtra3)) {
+        case SmithEffect::TMP_RES_ACID:
             return ACT_RESIST_ACID;
-        case Smith::Effect::TMP_RES_ELEC:
+        case SmithEffect::TMP_RES_ELEC:
             return ACT_RESIST_ELEC;
-        case Smith::Effect::TMP_RES_FIRE:
+        case SmithEffect::TMP_RES_FIRE:
             return ACT_RESIST_FIRE;
-        case Smith::Effect::TMP_RES_COLD:
+        case SmithEffect::TMP_RES_COLD:
             return ACT_RESIST_COLD;
-        case Smith::Effect::EARTHQUAKE:
+        case SmithEffect::EARTHQUAKE:
             return ACT_QUAKE;
         default:
             break;
index f22f96c..6dcaf4c 100644 (file)
@@ -20,6 +20,7 @@
 #include "main/sound-of-music.h"
 #include "mind/mind-weaponsmith.h"
 #include "object-enchant/object-smith.h"
+#include "object-enchant/smith-types.h"
 #include "object-enchant/tr-types.h"
 #include "object/item-tester-hooker.h"
 #include "object/item-use-flags.h"
@@ -212,7 +213,7 @@ static COMMAND_CODE choose_essence(void)
  * @brief エッセンスを実際に付加する
  * @param mode エッセンスの大別ID
  */
-static void add_essence(player_type *creature_ptr, Smith::Category mode)
+static void add_essence(player_type *creature_ptr, SmithCategory mode)
 {
     OBJECT_IDX item;
     COMMAND_CODE i;
@@ -418,7 +419,7 @@ static void add_essence(player_type *creature_ptr, Smith::Category mode)
     if (!o_ptr)
         return;
 
-    if ((mode != Smith::Category::ENCHANT) && (o_ptr->is_artifact() || o_ptr->is_smith())) {
+    if ((mode != SmithCategory::ENCHANT) && (o_ptr->is_artifact() || o_ptr->is_smith())) {
         msg_print(_("そのアイテムはこれ以上改良できない。", "This item can not be improved any further."));
         return;
     }
@@ -460,7 +461,7 @@ static void add_essence(player_type *creature_ptr, Smith::Category mode)
         }
 
         add_essence_count = o_ptr->pval;
-    } else if (effect == Smith::Effect::SLAY_GLOVE) {
+    } else if (effect == SmithEffect::SLAY_GLOVE) {
         char tmp_val[8] = "1";
         const auto max_val = creature_ptr->lev / 7 + 3;
         if (!get_string(format(_("いくつ付加しますか? (1-%d):", "Enchant how many? (1-%d):"), max_val), tmp_val, 2)) {
@@ -671,10 +672,10 @@ void do_cmd_kaji(player_type *creature_ptr, bool only_browse)
         mode = choose_essence();
         if (mode == 0)
             break;
-        add_essence(creature_ptr, static_cast<Smith::Category>(mode));
+        add_essence(creature_ptr, static_cast<SmithCategory>(mode));
         break;
     case 5:
-        add_essence(creature_ptr, Smith::Category::ENCHANT);
+        add_essence(creature_ptr, SmithCategory::ENCHANT);
         break;
     }
 }
index 69bb0c3..e7e8611 100644 (file)
@@ -18,6 +18,7 @@
 #include "mind/mind-weaponsmith.h"
 #include "object-enchant/object-ego.h"
 #include "object-enchant/object-smith.h"
+#include "object-enchant/smith-types.h"
 #include "object-enchant/special-object-flags.h"
 #include "object-enchant/tr-types.h"
 #include "object-enchant/trg-types.h"
@@ -106,7 +107,7 @@ static void decide_tval_show(flavor_type *flavor_ptr)
     if (flavor_ptr->tr_flags.has(TR_SHOW_MODS))
         flavor_ptr->show_weapon = true;
 
-    if (flavor_ptr->o_ptr->is_smith() && static_cast<Smith::Effect>(flavor_ptr->o_ptr->xtra3) == Smith::Effect::SLAY_GLOVE)
+    if (flavor_ptr->o_ptr->is_smith() && static_cast<SmithEffect>(flavor_ptr->o_ptr->xtra3) == SmithEffect::SLAY_GLOVE)
         flavor_ptr->show_weapon = true;
 
     if (flavor_ptr->o_ptr->to_h && flavor_ptr->o_ptr->to_d)
index 0f76aaa..c2af579 100644 (file)
@@ -99,7 +99,7 @@ static void dump_smith(player_type *creature_ptr, FILE *fff)
     auto n = essences.size();
     std::vector<int> amounts;
     std::transform(essences.begin(), essences.end(), std::back_inserter(amounts),
-        [smith = Smith(creature_ptr)](Smith::Essence e) { return smith.get_essence_num_of_posessions(e); });
+        [smith = Smith(creature_ptr)](SmithEssence e) { return smith.get_essence_num_of_posessions(e); });
 
     auto row = n / 3 + 1;
     for (auto i = 0U; i < row; i++) {
index 4f5aa33..942fc6c 100644 (file)
@@ -1,4 +1,5 @@
 #include "object-enchant/object-smith.h"
+#include "object-enchant/smith-types.h"
 #include "object-enchant/special-object-flags.h"
 #include "object-enchant/tr-flags.h"
 #include "object-enchant/tr-types.h"
@@ -19,138 +20,138 @@ namespace {
 /*!
  * @brief エッセンスの順序リスト。エッセンスの表示順等で使用する。
  */
-const std::vector<Smith::Essence> essence_list_order = {
-    Smith::Essence::STR,
-    Smith::Essence::INT,
-    Smith::Essence::WIS,
-    Smith::Essence::DEX,
-    Smith::Essence::CON,
-    Smith::Essence::CHR,
-    Smith::Essence::MAGIC_MASTERY,
-    Smith::Essence::STEALTH,
-    Smith::Essence::SEARCH,
-    Smith::Essence::INFRA,
-    Smith::Essence::TUNNEL,
-    Smith::Essence::SPEED,
-    Smith::Essence::BLOWS,
-    Smith::Essence::CHAOTIC,
-    Smith::Essence::VAMPIRIC,
-    Smith::Essence::EATHQUAKE,
-    Smith::Essence::BRAND_POIS,
-    Smith::Essence::BRAND_ACID,
-    Smith::Essence::BRAND_ELEC,
-    Smith::Essence::BRAND_FIRE,
-    Smith::Essence::BRAND_COLD,
-    Smith::Essence::SUST_STATUS,
-    Smith::Essence::IMMUNITY,
-    Smith::Essence::REFLECT,
-    Smith::Essence::FREE_ACT,
-    Smith::Essence::HOLD_EXP,
-    Smith::Essence::RES_ACID,
-    Smith::Essence::RES_ELEC,
-    Smith::Essence::RES_FIRE,
-    Smith::Essence::RES_COLD,
-    Smith::Essence::RES_POIS,
-    Smith::Essence::RES_FEAR,
-    Smith::Essence::RES_LITE,
-    Smith::Essence::RES_DARK,
-    Smith::Essence::RES_BLIND,
-    Smith::Essence::RES_CONF,
-    Smith::Essence::RES_SOUND,
-    Smith::Essence::RES_SHARDS,
-    Smith::Essence::RES_NETHER,
-    Smith::Essence::RES_NEXUS,
-    Smith::Essence::RES_CHAOS,
-    Smith::Essence::RES_DISEN,
-    Smith::Essence::NO_MAGIC,
-    Smith::Essence::WARNING,
-    Smith::Essence::LEVITATION,
-    Smith::Essence::LITE,
-    Smith::Essence::SEE_INVIS,
-    Smith::Essence::TELEPATHY,
-    Smith::Essence::SLOW_DIGEST,
-    Smith::Essence::REGEN,
-    Smith::Essence::TELEPORT,
-    Smith::Essence::SLAY_EVIL,
-    Smith::Essence::SLAY_ANIMAL,
-    Smith::Essence::SLAY_UNDEAD,
-    Smith::Essence::SLAY_DEMON,
-    Smith::Essence::SLAY_ORC,
-    Smith::Essence::SLAY_TROLL,
-    Smith::Essence::SLAY_GIANT,
-    Smith::Essence::SLAY_DRAGON,
-    Smith::Essence::SLAY_HUMAN,
-    Smith::Essence::ATTACK,
-    Smith::Essence::AC,
+const std::vector<SmithEssence> essence_list_order = {
+    SmithEssence::STR,
+    SmithEssence::INT,
+    SmithEssence::WIS,
+    SmithEssence::DEX,
+    SmithEssence::CON,
+    SmithEssence::CHR,
+    SmithEssence::MAGIC_MASTERY,
+    SmithEssence::STEALTH,
+    SmithEssence::SEARCH,
+    SmithEssence::INFRA,
+    SmithEssence::TUNNEL,
+    SmithEssence::SPEED,
+    SmithEssence::BLOWS,
+    SmithEssence::CHAOTIC,
+    SmithEssence::VAMPIRIC,
+    SmithEssence::EATHQUAKE,
+    SmithEssence::BRAND_POIS,
+    SmithEssence::BRAND_ACID,
+    SmithEssence::BRAND_ELEC,
+    SmithEssence::BRAND_FIRE,
+    SmithEssence::BRAND_COLD,
+    SmithEssence::SUST_STATUS,
+    SmithEssence::IMMUNITY,
+    SmithEssence::REFLECT,
+    SmithEssence::FREE_ACT,
+    SmithEssence::HOLD_EXP,
+    SmithEssence::RES_ACID,
+    SmithEssence::RES_ELEC,
+    SmithEssence::RES_FIRE,
+    SmithEssence::RES_COLD,
+    SmithEssence::RES_POIS,
+    SmithEssence::RES_FEAR,
+    SmithEssence::RES_LITE,
+    SmithEssence::RES_DARK,
+    SmithEssence::RES_BLIND,
+    SmithEssence::RES_CONF,
+    SmithEssence::RES_SOUND,
+    SmithEssence::RES_SHARDS,
+    SmithEssence::RES_NETHER,
+    SmithEssence::RES_NEXUS,
+    SmithEssence::RES_CHAOS,
+    SmithEssence::RES_DISEN,
+    SmithEssence::NO_MAGIC,
+    SmithEssence::WARNING,
+    SmithEssence::LEVITATION,
+    SmithEssence::LITE,
+    SmithEssence::SEE_INVIS,
+    SmithEssence::TELEPATHY,
+    SmithEssence::SLOW_DIGEST,
+    SmithEssence::REGEN,
+    SmithEssence::TELEPORT,
+    SmithEssence::SLAY_EVIL,
+    SmithEssence::SLAY_ANIMAL,
+    SmithEssence::SLAY_UNDEAD,
+    SmithEssence::SLAY_DEMON,
+    SmithEssence::SLAY_ORC,
+    SmithEssence::SLAY_TROLL,
+    SmithEssence::SLAY_GIANT,
+    SmithEssence::SLAY_DRAGON,
+    SmithEssence::SLAY_HUMAN,
+    SmithEssence::ATTACK,
+    SmithEssence::AC,
 };
 
 /*!
- * @brief Smith::Essence からエッセンスの表記名を引く連想配列
+ * @brief SmithEssence からエッセンスの表記名を引く連想配列
  */
-const std::unordered_map<Smith::Essence, concptr> essence_to_name = {
+const std::unordered_map<SmithEssence, concptr> essence_to_name = {
     // clang-format off
-    { Smith::Essence::STR, _("腕力", "strength") },
-    { Smith::Essence::INT, _("知能", "intelligen.") },
-    { Smith::Essence::WIS, _("賢さ", "wisdom") },
-    { Smith::Essence::DEX, _("器用さ", "dexterity") },
-    { Smith::Essence::CON, _("耐久力", "constitut.") },
-    { Smith::Essence::CHR, _("魅力", "charisma") },
-    { Smith::Essence::MAGIC_MASTERY, _("魔力支配", "magic mast.") },
-    { Smith::Essence::STEALTH, _("隠密", "stealth") },
-    { Smith::Essence::SEARCH, _("探索", "searching") },
-    { Smith::Essence::INFRA, _("赤外線視力", "infravision") },
-    { Smith::Essence::TUNNEL, _("採掘", "digging") },
-    { Smith::Essence::SPEED, _("スピード", "speed") },
-    { Smith::Essence::BLOWS, _("追加攻撃", "extra atk") },
-    { Smith::Essence::CHAOTIC, _("カオス攻撃", "chaos brand") },
-    { Smith::Essence::VAMPIRIC, _("吸血攻撃", "vampiric") },
-    { Smith::Essence::EATHQUAKE, _("地震", "quake") },
-    { Smith::Essence::BRAND_POIS, _("毒殺", "pois. brand") },
-    { Smith::Essence::BRAND_ACID, _("溶解", "acid brand") },
-    { Smith::Essence::BRAND_ELEC, _("電撃", "elec. brand") },
-    { Smith::Essence::BRAND_FIRE, _("焼棄", "fire brand") },
-    { Smith::Essence::BRAND_COLD, _("凍結", "cold brand") },
-    { Smith::Essence::SUST_STATUS, _("能力維持", "sustain") },
-    { Smith::Essence::IMMUNITY, _("免疫", "immunity") },
-    { Smith::Essence::REFLECT, _("反射", "reflection") },
-    { Smith::Essence::FREE_ACT, _("麻痺知らず", "free action") },
-    { Smith::Essence::HOLD_EXP, _("経験値維持", "hold exp") },
-    { Smith::Essence::RES_ACID, _("耐酸", "res. acid") },
-    { Smith::Essence::RES_ELEC, _("耐電撃", "res. elec.") },
-    { Smith::Essence::RES_FIRE, _("耐火炎", "res. fire") },
-    { Smith::Essence::RES_COLD, _("耐冷気", "res. cold") },
-    { Smith::Essence::RES_POIS, _("耐毒", "res. poison") },
-    { Smith::Essence::RES_FEAR, _("耐恐怖", "res. fear") },
-    { Smith::Essence::RES_LITE, _("耐閃光", "res. light") },
-    { Smith::Essence::RES_DARK, _("耐暗黒", "res. dark") },
-    { Smith::Essence::RES_BLIND, _("耐盲目", "res. blind") },
-    { Smith::Essence::RES_CONF, _("耐混乱", "res.confuse") },
-    { Smith::Essence::RES_SOUND, _("耐轟音", "res. sound") },
-    { Smith::Essence::RES_SHARDS, _("耐破片", "res. shard") },
-    { Smith::Essence::RES_NETHER, _("耐地獄", "res. nether") },
-    { Smith::Essence::RES_NEXUS, _("耐因果混乱", "res. nexus") },
-    { Smith::Essence::RES_CHAOS, _("耐カオス", "res. chaos") },
-    { Smith::Essence::RES_DISEN, _("耐劣化", "res. disen.") },
-    { Smith::Essence::NO_MAGIC, _("反魔法", "anti magic") },
-    { Smith::Essence::WARNING, _("警告", "warning") },
-    { Smith::Essence::LEVITATION, _("浮遊", "levitation") },
-    { Smith::Essence::LITE, _("永久光源", "perm. light") },
-    { Smith::Essence::SEE_INVIS, _("可視透明", "see invis.") },
-    { Smith::Essence::TELEPATHY, _("テレパシー", "telepathy") },
-    { Smith::Essence::SLOW_DIGEST, _("遅消化", "slow dige.") },
-    { Smith::Essence::REGEN, _("急速回復", "regen.") },
-    { Smith::Essence::TELEPORT, _("テレポート", "teleport") },
-    { Smith::Essence::SLAY_EVIL, _("邪悪倍打", "slay animal") },
-    { Smith::Essence::SLAY_ANIMAL, _("動物倍打", "slay evil") },
-    { Smith::Essence::SLAY_UNDEAD, _("不死倍打", "slay undead") },
-    { Smith::Essence::SLAY_DEMON, _("悪魔倍打", "slay demon") },
-    { Smith::Essence::SLAY_ORC, _("オーク倍打", "slay orc") },
-    { Smith::Essence::SLAY_TROLL, _("トロル倍打", "slay troll") },
-    { Smith::Essence::SLAY_GIANT, _("巨人倍打", "slay giant") },
-    { Smith::Essence::SLAY_DRAGON, _("竜倍打", "slay dragon") },
-    { Smith::Essence::SLAY_HUMAN, _("人間倍打", "slay human") },
-    { Smith::Essence::ATTACK, _("攻撃", "weapon enc.") },
-    { Smith::Essence::AC, _("防御", "armor enc.") },
+    { SmithEssence::STR, _("腕力", "strength") },
+    { SmithEssence::INT, _("知能", "intelligen.") },
+    { SmithEssence::WIS, _("賢さ", "wisdom") },
+    { SmithEssence::DEX, _("器用さ", "dexterity") },
+    { SmithEssence::CON, _("耐久力", "constitut.") },
+    { SmithEssence::CHR, _("魅力", "charisma") },
+    { SmithEssence::MAGIC_MASTERY, _("魔力支配", "magic mast.") },
+    { SmithEssence::STEALTH, _("隠密", "stealth") },
+    { SmithEssence::SEARCH, _("探索", "searching") },
+    { SmithEssence::INFRA, _("赤外線視力", "infravision") },
+    { SmithEssence::TUNNEL, _("採掘", "digging") },
+    { SmithEssence::SPEED, _("スピード", "speed") },
+    { SmithEssence::BLOWS, _("追加攻撃", "extra atk") },
+    { SmithEssence::CHAOTIC, _("カオス攻撃", "chaos brand") },
+    { SmithEssence::VAMPIRIC, _("吸血攻撃", "vampiric") },
+    { SmithEssence::EATHQUAKE, _("地震", "quake") },
+    { SmithEssence::BRAND_POIS, _("毒殺", "pois. brand") },
+    { SmithEssence::BRAND_ACID, _("溶解", "acid brand") },
+    { SmithEssence::BRAND_ELEC, _("電撃", "elec. brand") },
+    { SmithEssence::BRAND_FIRE, _("焼棄", "fire brand") },
+    { SmithEssence::BRAND_COLD, _("凍結", "cold brand") },
+    { SmithEssence::SUST_STATUS, _("能力維持", "sustain") },
+    { SmithEssence::IMMUNITY, _("免疫", "immunity") },
+    { SmithEssence::REFLECT, _("反射", "reflection") },
+    { SmithEssence::FREE_ACT, _("麻痺知らず", "free action") },
+    { SmithEssence::HOLD_EXP, _("経験値維持", "hold exp") },
+    { SmithEssence::RES_ACID, _("耐酸", "res. acid") },
+    { SmithEssence::RES_ELEC, _("耐電撃", "res. elec.") },
+    { SmithEssence::RES_FIRE, _("耐火炎", "res. fire") },
+    { SmithEssence::RES_COLD, _("耐冷気", "res. cold") },
+    { SmithEssence::RES_POIS, _("耐毒", "res. poison") },
+    { SmithEssence::RES_FEAR, _("耐恐怖", "res. fear") },
+    { SmithEssence::RES_LITE, _("耐閃光", "res. light") },
+    { SmithEssence::RES_DARK, _("耐暗黒", "res. dark") },
+    { SmithEssence::RES_BLIND, _("耐盲目", "res. blind") },
+    { SmithEssence::RES_CONF, _("耐混乱", "res.confuse") },
+    { SmithEssence::RES_SOUND, _("耐轟音", "res. sound") },
+    { SmithEssence::RES_SHARDS, _("耐破片", "res. shard") },
+    { SmithEssence::RES_NETHER, _("耐地獄", "res. nether") },
+    { SmithEssence::RES_NEXUS, _("耐因果混乱", "res. nexus") },
+    { SmithEssence::RES_CHAOS, _("耐カオス", "res. chaos") },
+    { SmithEssence::RES_DISEN, _("耐劣化", "res. disen.") },
+    { SmithEssence::NO_MAGIC, _("反魔法", "anti magic") },
+    { SmithEssence::WARNING, _("警告", "warning") },
+    { SmithEssence::LEVITATION, _("浮遊", "levitation") },
+    { SmithEssence::LITE, _("永久光源", "perm. light") },
+    { SmithEssence::SEE_INVIS, _("可視透明", "see invis.") },
+    { SmithEssence::TELEPATHY, _("テレパシー", "telepathy") },
+    { SmithEssence::SLOW_DIGEST, _("遅消化", "slow dige.") },
+    { SmithEssence::REGEN, _("急速回復", "regen.") },
+    { SmithEssence::TELEPORT, _("テレポート", "teleport") },
+    { SmithEssence::SLAY_EVIL, _("邪悪倍打", "slay animal") },
+    { SmithEssence::SLAY_ANIMAL, _("動物倍打", "slay evil") },
+    { SmithEssence::SLAY_UNDEAD, _("不死倍打", "slay undead") },
+    { SmithEssence::SLAY_DEMON, _("悪魔倍打", "slay demon") },
+    { SmithEssence::SLAY_ORC, _("オーク倍打", "slay orc") },
+    { SmithEssence::SLAY_TROLL, _("トロル倍打", "slay troll") },
+    { SmithEssence::SLAY_GIANT, _("巨人倍打", "slay giant") },
+    { SmithEssence::SLAY_DRAGON, _("竜倍打", "slay dragon") },
+    { SmithEssence::SLAY_HUMAN, _("人間倍打", "slay human") },
+    { SmithEssence::ATTACK, _("攻撃", "weapon enc.") },
+    { SmithEssence::AC, _("防御", "armor enc.") },
     // clang-format on
 };
 
@@ -159,7 +160,7 @@ const std::unordered_map<Smith::Essence, concptr> essence_to_name = {
  */
 struct essence_drain_type {
     tr_type tr_flag; //!< 抽出する対象アイテムの持つ特性フラグ
-    const std::vector<Smith::Essence> essences; //!< 抽出されるエッセンスのリスト
+    const std::vector<SmithEssence> essences; //!< 抽出されるエッセンスのリスト
     int amount; //! エッセンス抽出量。ただしマイナスのものは抽出時のペナルティ源として扱う
 };
 
@@ -168,120 +169,120 @@ struct essence_drain_type {
  */
 const std::vector<essence_drain_type> essence_drain_info_table = {
     // clang-format off
-    { TR_STR, { Smith::Essence::STR }, 10 },
-    { TR_INT, { Smith::Essence::INT }, 10 },
-    { TR_WIS, { Smith::Essence::WIS }, 10 },
-    { TR_DEX, { Smith::Essence::DEX }, 10 },
-    { TR_CON, { Smith::Essence::CON }, 10 },
-    { TR_CHR, { Smith::Essence::CHR }, 10 },
-    { TR_MAGIC_MASTERY, { Smith::Essence::MAGIC_MASTERY }, 10 },
-    { TR_FORCE_WEAPON, { Smith::Essence::INT, Smith::Essence::WIS }, 5 },
-    { TR_STEALTH, { Smith::Essence::STEALTH }, 10 },
-    { TR_SEARCH, { Smith::Essence::SEARCH }, 10 },
-    { TR_INFRA, { Smith::Essence::INFRA }, 10 },
-    { TR_TUNNEL, { Smith::Essence::TUNNEL }, 10 },
-    { TR_SPEED, { Smith::Essence::SPEED }, 10 },
-    { TR_BLOWS, { Smith::Essence::BLOWS }, 10 },
-    { TR_CHAOTIC, { Smith::Essence::CHAOTIC }, 10 },
-    { TR_VAMPIRIC, { Smith::Essence::VAMPIRIC }, 10 },
-    { TR_SLAY_ANIMAL, { Smith::Essence::SLAY_ANIMAL }, 10 },
-    { TR_SLAY_EVIL, { Smith::Essence::SLAY_EVIL }, 10 },
-    { TR_SLAY_UNDEAD, { Smith::Essence::SLAY_UNDEAD }, 10 },
-    { TR_SLAY_DEMON, { Smith::Essence::SLAY_DEMON }, 10 },
-    { TR_SLAY_ORC, { Smith::Essence::SLAY_ORC }, 10 },
-    { TR_SLAY_TROLL, { Smith::Essence::SLAY_TROLL }, 10 },
-    { TR_SLAY_GIANT, { Smith::Essence::SLAY_GIANT }, 10 },
-    { TR_SLAY_DRAGON, { Smith::Essence::SLAY_DRAGON }, 10 },
-    { TR_KILL_DRAGON, { Smith::Essence::SLAY_DRAGON }, 10 },
-    { TR_VORPAL, { Smith::Essence::BRAND_POIS, Smith::Essence::BRAND_ACID, Smith::Essence::BRAND_ELEC, Smith::Essence::BRAND_FIRE, Smith::Essence::BRAND_COLD }, 5},
-    { TR_EARTHQUAKE, { Smith::Essence::EATHQUAKE }, 10 },
-    { TR_BRAND_POIS, { Smith::Essence::BRAND_POIS }, 10 },
-    { TR_BRAND_ACID, { Smith::Essence::BRAND_ACID }, 10 },
-    { TR_BRAND_ELEC, { Smith::Essence::BRAND_ELEC }, 10 },
-    { TR_BRAND_FIRE, { Smith::Essence::BRAND_FIRE }, 10 },
-    { TR_BRAND_COLD, { Smith::Essence::BRAND_COLD }, 10 },
-    { TR_SUST_STR, { Smith::Essence::SUST_STATUS }, 10 },
-    { TR_SUST_INT, { Smith::Essence::SUST_STATUS }, 10 },
-    { TR_SUST_WIS, { Smith::Essence::SUST_STATUS }, 10 },
-    { TR_SUST_DEX, { Smith::Essence::SUST_STATUS }, 10 },
-    { TR_SUST_CON, { Smith::Essence::SUST_STATUS }, 10 },
-    { TR_SUST_CHR, { Smith::Essence::SUST_STATUS }, 10 },
+    { TR_STR, { SmithEssence::STR }, 10 },
+    { TR_INT, { SmithEssence::INT }, 10 },
+    { TR_WIS, { SmithEssence::WIS }, 10 },
+    { TR_DEX, { SmithEssence::DEX }, 10 },
+    { TR_CON, { SmithEssence::CON }, 10 },
+    { TR_CHR, { SmithEssence::CHR }, 10 },
+    { TR_MAGIC_MASTERY, { SmithEssence::MAGIC_MASTERY }, 10 },
+    { TR_FORCE_WEAPON, { SmithEssence::INT, SmithEssence::WIS }, 5 },
+    { TR_STEALTH, { SmithEssence::STEALTH }, 10 },
+    { TR_SEARCH, { SmithEssence::SEARCH }, 10 },
+    { TR_INFRA, { SmithEssence::INFRA }, 10 },
+    { TR_TUNNEL, { SmithEssence::TUNNEL }, 10 },
+    { TR_SPEED, { SmithEssence::SPEED }, 10 },
+    { TR_BLOWS, { SmithEssence::BLOWS }, 10 },
+    { TR_CHAOTIC, { SmithEssence::CHAOTIC }, 10 },
+    { TR_VAMPIRIC, { SmithEssence::VAMPIRIC }, 10 },
+    { TR_SLAY_ANIMAL, { SmithEssence::SLAY_ANIMAL }, 10 },
+    { TR_SLAY_EVIL, { SmithEssence::SLAY_EVIL }, 10 },
+    { TR_SLAY_UNDEAD, { SmithEssence::SLAY_UNDEAD }, 10 },
+    { TR_SLAY_DEMON, { SmithEssence::SLAY_DEMON }, 10 },
+    { TR_SLAY_ORC, { SmithEssence::SLAY_ORC }, 10 },
+    { TR_SLAY_TROLL, { SmithEssence::SLAY_TROLL }, 10 },
+    { TR_SLAY_GIANT, { SmithEssence::SLAY_GIANT }, 10 },
+    { TR_SLAY_DRAGON, { SmithEssence::SLAY_DRAGON }, 10 },
+    { TR_KILL_DRAGON, { SmithEssence::SLAY_DRAGON }, 10 },
+    { TR_VORPAL, { SmithEssence::BRAND_POIS, SmithEssence::BRAND_ACID, SmithEssence::BRAND_ELEC, SmithEssence::BRAND_FIRE, SmithEssence::BRAND_COLD }, 5},
+    { TR_EARTHQUAKE, { SmithEssence::EATHQUAKE }, 10 },
+    { TR_BRAND_POIS, { SmithEssence::BRAND_POIS }, 10 },
+    { TR_BRAND_ACID, { SmithEssence::BRAND_ACID }, 10 },
+    { TR_BRAND_ELEC, { SmithEssence::BRAND_ELEC }, 10 },
+    { TR_BRAND_FIRE, { SmithEssence::BRAND_FIRE }, 10 },
+    { TR_BRAND_COLD, { SmithEssence::BRAND_COLD }, 10 },
+    { TR_SUST_STR, { SmithEssence::SUST_STATUS }, 10 },
+    { TR_SUST_INT, { SmithEssence::SUST_STATUS }, 10 },
+    { TR_SUST_WIS, { SmithEssence::SUST_STATUS }, 10 },
+    { TR_SUST_DEX, { SmithEssence::SUST_STATUS }, 10 },
+    { TR_SUST_CON, { SmithEssence::SUST_STATUS }, 10 },
+    { TR_SUST_CHR, { SmithEssence::SUST_STATUS }, 10 },
     { TR_RIDING, {}, 0 },
     { TR_EASY_SPELL, {}, 0 },
-    { TR_IM_ACID, { Smith::Essence::IMMUNITY }, 10 },
-    { TR_IM_ELEC, { Smith::Essence::IMMUNITY }, 10 },
-    { TR_IM_FIRE, { Smith::Essence::IMMUNITY }, 10 },
-    { TR_IM_COLD, { Smith::Essence::IMMUNITY }, 10 },
+    { TR_IM_ACID, { SmithEssence::IMMUNITY }, 10 },
+    { TR_IM_ELEC, { SmithEssence::IMMUNITY }, 10 },
+    { TR_IM_FIRE, { SmithEssence::IMMUNITY }, 10 },
+    { TR_IM_COLD, { SmithEssence::IMMUNITY }, 10 },
     { TR_THROW, {}, 0 },
-    { TR_REFLECT, { Smith::Essence::REFLECT }, 10 },
-    { TR_FREE_ACT, { Smith::Essence::FREE_ACT }, 10 },
-    { TR_HOLD_EXP, { Smith::Essence::HOLD_EXP }, 10 },
-    { TR_RES_ACID, { Smith::Essence::RES_ACID }, 10 },
-    { TR_RES_ELEC, { Smith::Essence::RES_ELEC }, 10 },
-    { TR_RES_FIRE, { Smith::Essence::RES_FIRE }, 10 },
-    { TR_RES_COLD, { Smith::Essence::RES_COLD }, 10 },
-    { TR_RES_POIS, { Smith::Essence::RES_POIS }, 10 },
-    { TR_RES_FEAR, { Smith::Essence::RES_FEAR }, 10 },
-    { TR_RES_LITE, { Smith::Essence::RES_LITE }, 10 },
-    { TR_RES_DARK, { Smith::Essence::RES_DARK }, 10 },
-    { TR_RES_BLIND, { Smith::Essence::RES_BLIND }, 10 },
-    { TR_RES_CONF, { Smith::Essence::RES_CONF }, 10 },
-    { TR_RES_SOUND, { Smith::Essence::RES_SOUND }, 10 },
-    { TR_RES_SHARDS, { Smith::Essence::RES_SHARDS }, 10 },
-    { TR_RES_NETHER, { Smith::Essence::RES_NETHER }, 10 },
-    { TR_RES_NEXUS, { Smith::Essence::RES_NEXUS }, 10 },
-    { TR_RES_CHAOS, { Smith::Essence::RES_CHAOS }, 10 },
-    { TR_RES_DISEN, { Smith::Essence::RES_DISEN }, 10 },
-    { TR_SH_FIRE, { Smith::Essence::BRAND_FIRE, Smith::Essence::RES_FIRE }, 10 },
-    { TR_SH_ELEC, { Smith::Essence::BRAND_ELEC, Smith::Essence::RES_ELEC }, 10 },
-    { TR_SLAY_HUMAN, { Smith::Essence::SLAY_HUMAN }, 10 },
-    { TR_SH_COLD, { Smith::Essence::BRAND_COLD, Smith::Essence::RES_COLD }, 10 },
+    { TR_REFLECT, { SmithEssence::REFLECT }, 10 },
+    { TR_FREE_ACT, { SmithEssence::FREE_ACT }, 10 },
+    { TR_HOLD_EXP, { SmithEssence::HOLD_EXP }, 10 },
+    { TR_RES_ACID, { SmithEssence::RES_ACID }, 10 },
+    { TR_RES_ELEC, { SmithEssence::RES_ELEC }, 10 },
+    { TR_RES_FIRE, { SmithEssence::RES_FIRE }, 10 },
+    { TR_RES_COLD, { SmithEssence::RES_COLD }, 10 },
+    { TR_RES_POIS, { SmithEssence::RES_POIS }, 10 },
+    { TR_RES_FEAR, { SmithEssence::RES_FEAR }, 10 },
+    { TR_RES_LITE, { SmithEssence::RES_LITE }, 10 },
+    { TR_RES_DARK, { SmithEssence::RES_DARK }, 10 },
+    { TR_RES_BLIND, { SmithEssence::RES_BLIND }, 10 },
+    { TR_RES_CONF, { SmithEssence::RES_CONF }, 10 },
+    { TR_RES_SOUND, { SmithEssence::RES_SOUND }, 10 },
+    { TR_RES_SHARDS, { SmithEssence::RES_SHARDS }, 10 },
+    { TR_RES_NETHER, { SmithEssence::RES_NETHER }, 10 },
+    { TR_RES_NEXUS, { SmithEssence::RES_NEXUS }, 10 },
+    { TR_RES_CHAOS, { SmithEssence::RES_CHAOS }, 10 },
+    { TR_RES_DISEN, { SmithEssence::RES_DISEN }, 10 },
+    { TR_SH_FIRE, { SmithEssence::BRAND_FIRE, SmithEssence::RES_FIRE }, 10 },
+    { TR_SH_ELEC, { SmithEssence::BRAND_ELEC, SmithEssence::RES_ELEC }, 10 },
+    { TR_SLAY_HUMAN, { SmithEssence::SLAY_HUMAN }, 10 },
+    { TR_SH_COLD, { SmithEssence::BRAND_COLD, SmithEssence::RES_COLD }, 10 },
     { TR_NO_TELE, {}, -1 },
-    { TR_NO_MAGIC, { Smith::Essence::NO_MAGIC }, 10 },
-    { TR_DEC_MANA, { Smith::Essence::INT }, 10 },
+    { TR_NO_MAGIC, { SmithEssence::NO_MAGIC }, 10 },
+    { TR_DEC_MANA, { SmithEssence::INT }, 10 },
     { TR_TY_CURSE, {}, -1 },
-    { TR_WARNING, { Smith::Essence::WARNING }, 10 },
+    { TR_WARNING, { SmithEssence::WARNING }, 10 },
     { TR_HIDE_TYPE, {}, 0 },
     { TR_SHOW_MODS, {}, 0 },
     { TR_SLAY_GOOD, {}, 0 }, // todo
-    { TR_LEVITATION, { Smith::Essence::LEVITATION }, 10 },
-    { TR_LITE_1, { Smith::Essence::LITE }, 10 },
-    { TR_SEE_INVIS, { Smith::Essence::SEE_INVIS }, 10 },
-    { TR_TELEPATHY, { Smith::Essence::TELEPATHY }, 10 },
-    { TR_SLOW_DIGEST, { Smith::Essence::SLOW_DIGEST }, 10 },
-    { TR_REGEN, { Smith::Essence::REGEN }, 10 },
-    { TR_XTRA_MIGHT, { Smith::Essence::STR }, 10 },
-    { TR_XTRA_SHOTS, { Smith::Essence::DEX }, 10 },
+    { TR_LEVITATION, { SmithEssence::LEVITATION }, 10 },
+    { TR_LITE_1, { SmithEssence::LITE }, 10 },
+    { TR_SEE_INVIS, { SmithEssence::SEE_INVIS }, 10 },
+    { TR_TELEPATHY, { SmithEssence::TELEPATHY }, 10 },
+    { TR_SLOW_DIGEST, { SmithEssence::SLOW_DIGEST }, 10 },
+    { TR_REGEN, { SmithEssence::REGEN }, 10 },
+    { TR_XTRA_MIGHT, { SmithEssence::STR }, 10 },
+    { TR_XTRA_SHOTS, { SmithEssence::DEX }, 10 },
     { TR_IGNORE_ACID, {}, 0 },
     { TR_IGNORE_ELEC, {}, 0 },
     { TR_IGNORE_FIRE, {}, 0 },
     { TR_IGNORE_COLD, {}, 0 },
     { TR_ACTIVATE, {}, 0 },
     { TR_DRAIN_EXP, {}, -1 },
-    { TR_TELEPORT, { Smith::Essence::TELEPORT }, 10 },
+    { TR_TELEPORT, { SmithEssence::TELEPORT }, 10 },
     { TR_AGGRAVATE, {}, -1 },
     { TR_BLESSED, {}, 0 },
     { TR_ES_ATTACK, {}, 0 },
     { TR_ES_AC, {}, 0 },
     { TR_KILL_GOOD, {}, 0 }, // todo
 
-    { TR_KILL_ANIMAL, { Smith::Essence::SLAY_ANIMAL }, 10 },
-    { TR_KILL_EVIL, { Smith::Essence::SLAY_EVIL }, 10 },
-    { TR_KILL_UNDEAD, { Smith::Essence::SLAY_UNDEAD }, 10 },
-    { TR_KILL_DEMON, { Smith::Essence::SLAY_DEMON }, 10 },
-    { TR_KILL_ORC, { Smith::Essence::SLAY_ORC }, 10 },
-    { TR_KILL_TROLL, { Smith::Essence::SLAY_TROLL }, 10 },
-    { TR_KILL_GIANT, { Smith::Essence::SLAY_GIANT }, 10 },
-    { TR_KILL_HUMAN, { Smith::Essence::SLAY_HUMAN }, 10 },
-    { TR_ESP_ANIMAL, { Smith::Essence::SLAY_ANIMAL }, 10 },
-    { TR_ESP_UNDEAD, { Smith::Essence::SLAY_UNDEAD }, 10 },
-    { TR_ESP_DEMON, { Smith::Essence::SLAY_DEMON }, 10 },
-    { TR_ESP_ORC, { Smith::Essence::SLAY_ORC}, 10 },
-    { TR_ESP_TROLL, { Smith::Essence::SLAY_TROLL }, 10 },
-    { TR_ESP_GIANT, { Smith::Essence::SLAY_GIANT }, 10 },
-    { TR_ESP_DRAGON, { Smith::Essence::SLAY_DRAGON }, 10 },
-    { TR_ESP_HUMAN, { Smith::Essence::SLAY_HUMAN }, 10 },
-    { TR_ESP_EVIL, { Smith::Essence::SLAY_EVIL }, 10 },
+    { TR_KILL_ANIMAL, { SmithEssence::SLAY_ANIMAL }, 10 },
+    { TR_KILL_EVIL, { SmithEssence::SLAY_EVIL }, 10 },
+    { TR_KILL_UNDEAD, { SmithEssence::SLAY_UNDEAD }, 10 },
+    { TR_KILL_DEMON, { SmithEssence::SLAY_DEMON }, 10 },
+    { TR_KILL_ORC, { SmithEssence::SLAY_ORC }, 10 },
+    { TR_KILL_TROLL, { SmithEssence::SLAY_TROLL }, 10 },
+    { TR_KILL_GIANT, { SmithEssence::SLAY_GIANT }, 10 },
+    { TR_KILL_HUMAN, { SmithEssence::SLAY_HUMAN }, 10 },
+    { TR_ESP_ANIMAL, { SmithEssence::SLAY_ANIMAL }, 10 },
+    { TR_ESP_UNDEAD, { SmithEssence::SLAY_UNDEAD }, 10 },
+    { TR_ESP_DEMON, { SmithEssence::SLAY_DEMON }, 10 },
+    { TR_ESP_ORC, { SmithEssence::SLAY_ORC}, 10 },
+    { TR_ESP_TROLL, { SmithEssence::SLAY_TROLL }, 10 },
+    { TR_ESP_GIANT, { SmithEssence::SLAY_GIANT }, 10 },
+    { TR_ESP_DRAGON, { SmithEssence::SLAY_DRAGON }, 10 },
+    { TR_ESP_HUMAN, { SmithEssence::SLAY_HUMAN }, 10 },
+    { TR_ESP_EVIL, { SmithEssence::SLAY_EVIL }, 10 },
     { TR_ESP_GOOD, {}, 0 }, // TODO
     { TR_ESP_NONLIVING, {}, 0 }, // TODO
     { TR_ESP_UNIQUE, {}, 0 }, // TODO
@@ -291,8 +292,8 @@ const std::vector<essence_drain_type> essence_drain_info_table = {
     { TR_ADD_H_CURSE, {}, -1 },
     { TR_DRAIN_HP, {}, -1 },
     { TR_DRAIN_MANA, {}, -1 },
-    { TR_LITE_2, { Smith::Essence::LITE }, 20 },
-    { TR_LITE_3, { Smith::Essence::LITE }, 30 },
+    { TR_LITE_2, { SmithEssence::LITE }, 20 },
+    { TR_LITE_3, { SmithEssence::LITE }, 30 },
     { TR_LITE_M1, {}, 0 },
     { TR_LITE_M2, {}, 0 },
     { TR_LITE_M3, {}, 0 },
@@ -308,7 +309,7 @@ const std::vector<essence_drain_type> essence_drain_info_table = {
     { TR_FAST_DIGEST, {}, -1 },
     { TR_SLOW_REGEN, {}, -1 },
     { TR_MIGHTY_THROW, {}, 0 },
-    { TR_EASY2_WEAPON, { Smith::Essence::DEX }, 20 },
+    { TR_EASY2_WEAPON, { SmithEssence::DEX }, 20 },
     { TR_DOWN_SAVING, {}, 0 },
     { TR_NO_AC, {}, 0 },
     { TR_HEAVY_SPELL, {}, 0 },
@@ -334,10 +335,10 @@ const std::vector<essence_drain_type> essence_drain_info_table = {
  * @brief 鍛冶情報の構造体
  */
 struct smith_info_type {
-    Smith::Effect effect; //!< 鍛冶で与える効果の種類
+    SmithEffect effect; //!< 鍛冶で与える効果の種類
     concptr name; //!< 鍛冶で与える能力の名称
-    Smith::Category category; //!< 鍛冶で与える能力が所属するグループ
-    const std::vector<Smith::Essence> need_essences; //!< 能力を与えるのに必要なエッセンスのリスト
+    SmithCategory category; //!< 鍛冶で与える能力が所属するグループ
+    const std::vector<SmithEssence> need_essences; //!< 能力を与えるのに必要なエッセンスのリスト
     int consumption; //!< 能力を与えるのに必要な消費量(need_essencesに含まれるエッセンスそれぞれについてこの量を消費)
     TrFlags add_flags; //!< 鍛冶で能力を与えることにより付与されるアイテム特性フラグ
 };
@@ -346,115 +347,114 @@ struct smith_info_type {
  * @brief 鍛冶情報テーブル
  */
 const std::vector<smith_info_type> smith_info_table = {
-    { Smith::Effect::NONE, _("なし", "None"), Smith::Category::NONE, { Smith::Essence::NONE }, 0, {} },
-    { Smith::Effect::STR, _("腕力", "strength"), Smith::Category::PVAL, { Smith::Essence::STR }, 20, { TR_STR } },
-    { Smith::Effect::INT, _("知能", "intelligence"), Smith::Category::PVAL, { Smith::Essence::INT }, 20, { TR_INT } },
-    { Smith::Effect::WIS, _("賢さ", "wisdom"), Smith::Category::PVAL, { Smith::Essence::WIS }, 20, { TR_WIS } },
-    { Smith::Effect::DEX, _("器用さ", "dexterity"), Smith::Category::PVAL, { Smith::Essence::DEX }, 20, { TR_DEX } },
-    { Smith::Effect::CON, _("耐久力", "constitution"), Smith::Category::PVAL, { Smith::Essence::CON }, 20, { TR_CON } },
-    { Smith::Effect::CHR, _("魅力", "charisma"), Smith::Category::PVAL, { Smith::Essence::CHR }, 20, { TR_CHR } },
-    { Smith::Effect::MAGIC_MASTERY, _("魔力支配", "magic mastery"), Smith::Category::PVAL, { Smith::Essence::MAGIC_MASTERY }, 20, { TR_MAGIC_MASTERY } },
-    { Smith::Effect::STEALTH, _("隠密", "stealth"), Smith::Category::PVAL, { Smith::Essence::STEALTH }, 40, { TR_STEALTH } },
-    { Smith::Effect::SEARCH, _("探索", "searching"), Smith::Category::PVAL, { Smith::Essence::SEARCH }, 15, { TR_SEARCH } },
-    { Smith::Effect::INFRA, _("赤外線視力", "infravision"), Smith::Category::PVAL, { Smith::Essence::INFRA }, 15, { TR_INFRA } },
-    { Smith::Effect::TUNNEL, _("採掘", "digging"), Smith::Category::PVAL, { Smith::Essence::TUNNEL }, 15, { TR_TUNNEL } },
-    { Smith::Effect::SPEED, _("スピード", "speed"), Smith::Category::PVAL, { Smith::Essence::SPEED }, 12, { TR_SPEED } },
-    { Smith::Effect::BLOWS, _("追加攻撃", "extra attack"), Smith::Category::WEAPON_ATTR, { Smith::Essence::BLOWS }, 20, { TR_BLOWS } },
-    { Smith::Effect::CHAOTIC, _("カオス攻撃", "chaos brand"), Smith::Category::WEAPON_ATTR, { Smith::Essence::CHAOTIC }, 15, { TR_CHAOTIC } },
-    { Smith::Effect::VAMPIRIC, _("吸血攻撃", "vampiric brand"), Smith::Category::WEAPON_ATTR, { Smith::Essence::VAMPIRIC }, 60, { TR_VAMPIRIC } },
-    { Smith::Effect::EARTHQUAKE, _("地震発動", "quake activation"), Smith::Category::ETC, { Smith::Essence::EATHQUAKE }, 15, { TR_EARTHQUAKE, TR_ACTIVATE } },
-    { Smith::Effect::BRAND_POIS, _("毒殺", "poison brand"), Smith::Category::WEAPON_ATTR, { Smith::Essence::BRAND_POIS }, 20, { TR_BRAND_POIS } },
-    { Smith::Effect::BRAND_ACID, _("溶解", "acid brand"), Smith::Category::WEAPON_ATTR, { Smith::Essence::BRAND_ACID }, 20, { TR_BRAND_ACID } },
-    { Smith::Effect::BRAND_ELEC, _("電撃", "electric brand"), Smith::Category::WEAPON_ATTR, { Smith::Essence::BRAND_ELEC }, 20, { TR_BRAND_ELEC } },
-    { Smith::Effect::BRAND_FIRE, _("焼棄", "fire brand"), Smith::Category::WEAPON_ATTR, { Smith::Essence::BRAND_FIRE }, 20, { TR_BRAND_FIRE } },
-    { Smith::Effect::BRAND_COLD, _("凍結", "cold brand"), Smith::Category::WEAPON_ATTR, { Smith::Essence::BRAND_COLD }, 20, { TR_BRAND_COLD } },
-    { Smith::Effect::SUST_STR, _("腕力維持", "sustain strength"), Smith::Category::ABILITY, { Smith::Essence::SUST_STATUS }, 15, { TR_SUST_STR } },
-    { Smith::Effect::SUST_INT, _("知能維持", "sustain intelligence"), Smith::Category::ABILITY, { Smith::Essence::SUST_STATUS }, 15, { TR_SUST_INT } },
-    { Smith::Effect::SUST_WIS, _("賢さ維持", "sustain wisdom"), Smith::Category::ABILITY, { Smith::Essence::SUST_STATUS }, 15, { TR_SUST_WIS } },
-    { Smith::Effect::SUST_DEX, _("器用さ維持", "sustain dexterity"), Smith::Category::ABILITY, { Smith::Essence::SUST_STATUS }, 15, { TR_SUST_DEX } },
-    { Smith::Effect::SUST_CON, _("耐久力維持", "sustain constitution"), Smith::Category::ABILITY, { Smith::Essence::SUST_STATUS }, 15, { TR_SUST_CON } },
-    { Smith::Effect::SUST_CHR, _("魅力維持", "sustain charisma"), Smith::Category::ABILITY, { Smith::Essence::SUST_STATUS }, 15, { TR_SUST_CHR } },
-    { Smith::Effect::IM_ACID, _("酸免疫", "acid immunity"), Smith::Category::RESISTANCE, { Smith::Essence::IMMUNITY }, 20, { TR_IM_ACID } },
-    { Smith::Effect::IM_ELEC, _("電撃免疫", "electric immunity"), Smith::Category::RESISTANCE, { Smith::Essence::IMMUNITY }, 20, { TR_IM_ELEC } },
-    { Smith::Effect::IM_FIRE, _("火炎免疫", "fire immunity"), Smith::Category::RESISTANCE, { Smith::Essence::IMMUNITY }, 20, { TR_IM_FIRE } },
-    { Smith::Effect::IM_COLD, _("冷気免疫", "cold immunity"), Smith::Category::RESISTANCE, { Smith::Essence::IMMUNITY }, 20, { TR_IM_COLD } },
-    { Smith::Effect::REFLECT, _("反射", "reflection"), Smith::Category::RESISTANCE, { Smith::Essence::REFLECT }, 20, { TR_REFLECT } },
-    { Smith::Effect::FREE_ACT, _("麻痺知らず", "free action"), Smith::Category::ABILITY, { Smith::Essence::FREE_ACT }, 20, { TR_FREE_ACT } },
-    { Smith::Effect::HOLD_EXP, _("経験値維持", "hold experience"), Smith::Category::ABILITY, { Smith::Essence::HOLD_EXP }, 20, { TR_HOLD_EXP } },
-    { Smith::Effect::RES_ACID, _("耐酸", "resistance to acid"), Smith::Category::RESISTANCE, { Smith::Essence::RES_ACID }, 15, { TR_RES_ACID } },
-    { Smith::Effect::RES_ELEC, _("耐電撃", "resistance to electric"), Smith::Category::RESISTANCE, { Smith::Essence::RES_ELEC }, 15, { TR_RES_ELEC } },
-    { Smith::Effect::RES_FIRE, _("耐火炎", "resistance to fire"), Smith::Category::RESISTANCE, { Smith::Essence::RES_FIRE }, 15, { TR_RES_FIRE } },
-    { Smith::Effect::RES_COLD, _("耐冷気", "resistance to cold"), Smith::Category::RESISTANCE, { Smith::Essence::RES_COLD }, 15, { TR_RES_COLD } },
-    { Smith::Effect::RES_POIS, _("耐毒", "resistance to poison"), Smith::Category::RESISTANCE, { Smith::Essence::RES_POIS }, 25, { TR_RES_POIS } },
-    { Smith::Effect::RES_FEAR, _("耐恐怖", "resistance to fear"), Smith::Category::RESISTANCE, { Smith::Essence::RES_FEAR }, 20, { TR_RES_FEAR } },
-    { Smith::Effect::RES_LITE, _("耐閃光", "resistance to light"), Smith::Category::RESISTANCE, { Smith::Essence::RES_LITE }, 20, { TR_RES_LITE } },
-    { Smith::Effect::RES_DARK, _("耐暗黒", "resistance to dark"), Smith::Category::RESISTANCE, { Smith::Essence::RES_DARK }, 20, { TR_RES_DARK } },
-    { Smith::Effect::RES_BLIND, _("耐盲目", "resistance to blind"), Smith::Category::RESISTANCE, { Smith::Essence::RES_BLIND }, 20, { TR_RES_BLIND } },
-    { Smith::Effect::RES_CONF, _("耐混乱", "resistance to confusion"), Smith::Category::RESISTANCE, { Smith::Essence::RES_CONF }, 20, { TR_RES_CONF } },
-    { Smith::Effect::RES_SOUND, _("耐轟音", "resistance to sound"), Smith::Category::RESISTANCE, { Smith::Essence::RES_SOUND }, 20, { TR_RES_SOUND } },
-    { Smith::Effect::RES_SHARDS, _("耐破片", "resistance to shard"), Smith::Category::RESISTANCE, { Smith::Essence::RES_SHARDS }, 20, { TR_RES_SHARDS } },
-    { Smith::Effect::RES_NETHER, _("耐地獄", "resistance to nether"), Smith::Category::RESISTANCE, { Smith::Essence::RES_NETHER }, 20, { TR_RES_NETHER } },
-    { Smith::Effect::RES_NEXUS, _("耐因果混乱", "resistance to nexus"), Smith::Category::RESISTANCE, { Smith::Essence::RES_NEXUS }, 20, { TR_RES_NEXUS } },
-    { Smith::Effect::RES_CHAOS, _("耐カオス", "resistance to chaos"), Smith::Category::RESISTANCE, { Smith::Essence::RES_CHAOS }, 20, { TR_RES_CHAOS } },
-    { Smith::Effect::RES_DISEN, _("耐劣化", "resistance to disenchantment"), Smith::Category::RESISTANCE, { Smith::Essence::RES_DISEN }, 20, { TR_RES_DISEN } },
-    { Smith::Effect::NO_MAGIC, _("反魔法", "anti magic"), Smith::Category::ABILITY, { Smith::Essence::NO_MAGIC }, 15, { TR_NO_MAGIC } },
-    { Smith::Effect::WARNING, _("警告", "warning"), Smith::Category::ABILITY, { Smith::Essence::WARNING }, 20, { TR_WARNING } },
-    { Smith::Effect::LEVITATION, _("浮遊", "levitation"), Smith::Category::ABILITY, { Smith::Essence::LEVITATION }, 20, { TR_LEVITATION } },
-    { Smith::Effect::LITE, _("永久光源", "permanent light"), Smith::Category::ABILITY, { Smith::Essence::LITE }, 15, { TR_LITE_1 } },
-    { Smith::Effect::SEE_INVIS, _("可視透明", "see invisible"), Smith::Category::ABILITY, { Smith::Essence::SEE_INVIS }, 20, { TR_SEE_INVIS } },
-    { Smith::Effect::TELEPATHY, _("テレパシー", "telepathy"), Smith::Category::ESP, { Smith::Essence::TELEPATHY }, 15, { TR_TELEPATHY } },
-    { Smith::Effect::SLOW_DIGEST, _("遅消化", "slow digestion"), Smith::Category::ABILITY, { Smith::Essence::SLOW_DIGEST }, 15, { TR_SLOW_DIGEST } },
-    { Smith::Effect::REGEN, _("急速回復", "regeneration"), Smith::Category::ABILITY, { Smith::Essence::REGEN }, 20, { TR_REGEN } },
-    { Smith::Effect::TELEPORT, _("テレポート", "teleport"), Smith::Category::ABILITY, { Smith::Essence::TELEPORT }, 25, { TR_TELEPORT } },
-    { Smith::Effect::SLAY_EVIL, _("邪悪倍打", "slay evil"), Smith::Category::SLAYING, { Smith::Essence::SLAY_EVIL }, 100, { TR_SLAY_EVIL } },
-    { Smith::Effect::KILL_EVIL, _("邪悪倍倍打", "kill evil"), Smith::Category::NONE, { Smith::Essence::SLAY_EVIL }, 0,
-        { TR_KILL_EVIL } }, // 強力すぎるため無効(Smith::Category::NONE)
-    { Smith::Effect::SLAY_ANIMAL, _("動物倍打", "slay animal"), Smith::Category::SLAYING, { Smith::Essence::SLAY_ANIMAL }, 20, { TR_SLAY_ANIMAL } },
-    { Smith::Effect::KILL_ANIMAL, _("動物倍倍打", "kill animal"), Smith::Category::SLAYING, { Smith::Essence::SLAY_ANIMAL }, 60, { TR_KILL_ANIMAL } },
-    { Smith::Effect::SLAY_UNDEAD, _("不死倍打", "slay undead"), Smith::Category::SLAYING, { Smith::Essence::SLAY_UNDEAD }, 20, { TR_SLAY_UNDEAD } },
-    { Smith::Effect::KILL_UNDEAD, _("不死倍倍打", "kill undead"), Smith::Category::SLAYING, { Smith::Essence::SLAY_UNDEAD }, 60, { TR_KILL_UNDEAD } },
-    { Smith::Effect::SLAY_DEMON, _("悪魔倍打", "slay demon"), Smith::Category::SLAYING, { Smith::Essence::SLAY_DEMON }, 20, { TR_SLAY_DEMON } },
-    { Smith::Effect::KILL_DEMON, _("悪魔倍倍打", "kill demon"), Smith::Category::SLAYING, { Smith::Essence::SLAY_DEMON }, 60, { TR_KILL_DEMON } },
-    { Smith::Effect::SLAY_ORC, _("オーク倍打", "slay orc"), Smith::Category::SLAYING, { Smith::Essence::SLAY_ORC }, 20, { TR_SLAY_ORC } },
-    { Smith::Effect::KILL_ORC, _("オーク倍倍打", "kill orc"), Smith::Category::SLAYING, { Smith::Essence::SLAY_ORC }, 60, { TR_KILL_ORC } },
-    { Smith::Effect::SLAY_TROLL, _("トロル倍打", "slay troll"), Smith::Category::SLAYING, { Smith::Essence::SLAY_TROLL }, 20, { TR_SLAY_TROLL } },
-    { Smith::Effect::KILL_TROLL, _("トロル倍倍打", "kill troll"), Smith::Category::SLAYING, { Smith::Essence::SLAY_TROLL }, 60, { TR_KILL_TROLL } },
-    { Smith::Effect::SLAY_GIANT, _("巨人倍打", "slay giant"), Smith::Category::SLAYING, { Smith::Essence::SLAY_GIANT }, 20, { TR_SLAY_GIANT } },
-    { Smith::Effect::KILL_GIANT, _("巨人倍倍打", "kill giant"), Smith::Category::SLAYING, { Smith::Essence::SLAY_GIANT }, 60, { TR_KILL_GIANT } },
-    { Smith::Effect::SLAY_DRAGON, _("竜倍打", "slay dragon"), Smith::Category::SLAYING, { Smith::Essence::SLAY_DRAGON }, 20, { TR_SLAY_DRAGON } },
-    { Smith::Effect::KILL_DRAGON, _("竜倍倍打", "kill dragon"), Smith::Category::SLAYING, { Smith::Essence::SLAY_DRAGON }, 60, { TR_KILL_DRAGON } },
-    { Smith::Effect::SLAY_HUMAN, _("人間倍打", "slay human"), Smith::Category::SLAYING, { Smith::Essence::SLAY_HUMAN }, 20, { TR_SLAY_HUMAN } },
-    { Smith::Effect::KILL_HUMAN, _("人間倍倍打", "kill human"), Smith::Category::SLAYING, { Smith::Essence::SLAY_HUMAN }, 60, { TR_KILL_HUMAN } },
-    { Smith::Effect::ESP_ANIMAL, _("動物ESP", "sense animal"), Smith::Category::ESP, { Smith::Essence::SLAY_ANIMAL }, 40, { TR_ESP_ANIMAL } },
-    { Smith::Effect::ESP_UNDEAD, _("不死ESP", "sense undead"), Smith::Category::ESP, { Smith::Essence::SLAY_UNDEAD }, 40, { TR_ESP_UNDEAD } },
-    { Smith::Effect::ESP_DEMON, _("悪魔ESP", "sense demon"), Smith::Category::ESP, { Smith::Essence::SLAY_DEMON }, 40, { TR_ESP_DEMON } },
-    { Smith::Effect::ESP_ORC, _("オークESP", "sense orc"), Smith::Category::ESP, { Smith::Essence::SLAY_ORC }, 40, { TR_ESP_ORC } },
-    { Smith::Effect::ESP_TROLL, _("トロルESP", "sense troll"), Smith::Category::ESP, { Smith::Essence::SLAY_TROLL }, 40, { TR_ESP_TROLL } },
-    { Smith::Effect::ESP_GIANT, _("巨人ESP", "sense giant"), Smith::Category::ESP, { Smith::Essence::SLAY_GIANT }, 40, { TR_ESP_GIANT } },
-    { Smith::Effect::ESP_DRAGON, _("竜ESP", "sense dragon"), Smith::Category::ESP, { Smith::Essence::SLAY_DRAGON }, 40, { TR_ESP_DRAGON } },
-    { Smith::Effect::ESP_HUMAN, _("人間ESP", "sense human"), Smith::Category::ESP, { Smith::Essence::SLAY_HUMAN }, 40, { TR_ESP_HUMAN } },
-    { Smith::Effect::ATTACK, _("攻撃", "weapon enchant"), Smith::Category::ENCHANT, { Smith::Essence::ATTACK }, 30, {} },
-    { Smith::Effect::AC, _("防御", "armor enchant"), Smith::Category::ENCHANT, { Smith::Essence::AC }, 15, {} },
-    { Smith::Effect::TMP_RES_ACID, _("酸耐性発動", "resist acid activation"), Smith::Category::ETC, { Smith::Essence::RES_ACID }, 50,
-        { TR_RES_ACID, TR_ACTIVATE } },
-    { Smith::Effect::TMP_RES_ELEC, _("電撃耐性発動", "resist electricity activation"), Smith::Category::ETC, { Smith::Essence::RES_ELEC }, 50,
+    { SmithEffect::NONE, _("なし", "None"), SmithCategory::NONE, { SmithEssence::NONE }, 0, {} },
+    { SmithEffect::STR, _("腕力", "strength"), SmithCategory::PVAL, { SmithEssence::STR }, 20, { TR_STR } },
+    { SmithEffect::INT, _("知能", "intelligence"), SmithCategory::PVAL, { SmithEssence::INT }, 20, { TR_INT } },
+    { SmithEffect::WIS, _("賢さ", "wisdom"), SmithCategory::PVAL, { SmithEssence::WIS }, 20, { TR_WIS } },
+    { SmithEffect::DEX, _("器用さ", "dexterity"), SmithCategory::PVAL, { SmithEssence::DEX }, 20, { TR_DEX } },
+    { SmithEffect::CON, _("耐久力", "constitution"), SmithCategory::PVAL, { SmithEssence::CON }, 20, { TR_CON } },
+    { SmithEffect::CHR, _("魅力", "charisma"), SmithCategory::PVAL, { SmithEssence::CHR }, 20, { TR_CHR } },
+    { SmithEffect::MAGIC_MASTERY, _("魔力支配", "magic mastery"), SmithCategory::PVAL, { SmithEssence::MAGIC_MASTERY }, 20, { TR_MAGIC_MASTERY } },
+    { SmithEffect::STEALTH, _("隠密", "stealth"), SmithCategory::PVAL, { SmithEssence::STEALTH }, 40, { TR_STEALTH } },
+    { SmithEffect::SEARCH, _("探索", "searching"), SmithCategory::PVAL, { SmithEssence::SEARCH }, 15, { TR_SEARCH } },
+    { SmithEffect::INFRA, _("赤外線視力", "infravision"), SmithCategory::PVAL, { SmithEssence::INFRA }, 15, { TR_INFRA } },
+    { SmithEffect::TUNNEL, _("採掘", "digging"), SmithCategory::PVAL, { SmithEssence::TUNNEL }, 15, { TR_TUNNEL } },
+    { SmithEffect::SPEED, _("スピード", "speed"), SmithCategory::PVAL, { SmithEssence::SPEED }, 12, { TR_SPEED } },
+    { SmithEffect::BLOWS, _("追加攻撃", "extra attack"), SmithCategory::WEAPON_ATTR, { SmithEssence::BLOWS }, 20, { TR_BLOWS } },
+    { SmithEffect::CHAOTIC, _("カオス攻撃", "chaos brand"), SmithCategory::WEAPON_ATTR, { SmithEssence::CHAOTIC }, 15, { TR_CHAOTIC } },
+    { SmithEffect::VAMPIRIC, _("吸血攻撃", "vampiric brand"), SmithCategory::WEAPON_ATTR, { SmithEssence::VAMPIRIC }, 60, { TR_VAMPIRIC } },
+    { SmithEffect::EARTHQUAKE, _("地震発動", "quake activation"), SmithCategory::ETC, { SmithEssence::EATHQUAKE }, 15, { TR_EARTHQUAKE, TR_ACTIVATE } },
+    { SmithEffect::BRAND_POIS, _("毒殺", "poison brand"), SmithCategory::WEAPON_ATTR, { SmithEssence::BRAND_POIS }, 20, { TR_BRAND_POIS } },
+    { SmithEffect::BRAND_ACID, _("溶解", "acid brand"), SmithCategory::WEAPON_ATTR, { SmithEssence::BRAND_ACID }, 20, { TR_BRAND_ACID } },
+    { SmithEffect::BRAND_ELEC, _("電撃", "electric brand"), SmithCategory::WEAPON_ATTR, { SmithEssence::BRAND_ELEC }, 20, { TR_BRAND_ELEC } },
+    { SmithEffect::BRAND_FIRE, _("焼棄", "fire brand"), SmithCategory::WEAPON_ATTR, { SmithEssence::BRAND_FIRE }, 20, { TR_BRAND_FIRE } },
+    { SmithEffect::BRAND_COLD, _("凍結", "cold brand"), SmithCategory::WEAPON_ATTR, { SmithEssence::BRAND_COLD }, 20, { TR_BRAND_COLD } },
+    { SmithEffect::SUST_STR, _("腕力維持", "sustain strength"), SmithCategory::ABILITY, { SmithEssence::SUST_STATUS }, 15, { TR_SUST_STR } },
+    { SmithEffect::SUST_INT, _("知能維持", "sustain intelligence"), SmithCategory::ABILITY, { SmithEssence::SUST_STATUS }, 15, { TR_SUST_INT } },
+    { SmithEffect::SUST_WIS, _("賢さ維持", "sustain wisdom"), SmithCategory::ABILITY, { SmithEssence::SUST_STATUS }, 15, { TR_SUST_WIS } },
+    { SmithEffect::SUST_DEX, _("器用さ維持", "sustain dexterity"), SmithCategory::ABILITY, { SmithEssence::SUST_STATUS }, 15, { TR_SUST_DEX } },
+    { SmithEffect::SUST_CON, _("耐久力維持", "sustain constitution"), SmithCategory::ABILITY, { SmithEssence::SUST_STATUS }, 15, { TR_SUST_CON } },
+    { SmithEffect::SUST_CHR, _("魅力維持", "sustain charisma"), SmithCategory::ABILITY, { SmithEssence::SUST_STATUS }, 15, { TR_SUST_CHR } },
+    { SmithEffect::IM_ACID, _("酸免疫", "acid immunity"), SmithCategory::RESISTANCE, { SmithEssence::IMMUNITY }, 20, { TR_IM_ACID } },
+    { SmithEffect::IM_ELEC, _("電撃免疫", "electric immunity"), SmithCategory::RESISTANCE, { SmithEssence::IMMUNITY }, 20, { TR_IM_ELEC } },
+    { SmithEffect::IM_FIRE, _("火炎免疫", "fire immunity"), SmithCategory::RESISTANCE, { SmithEssence::IMMUNITY }, 20, { TR_IM_FIRE } },
+    { SmithEffect::IM_COLD, _("冷気免疫", "cold immunity"), SmithCategory::RESISTANCE, { SmithEssence::IMMUNITY }, 20, { TR_IM_COLD } },
+    { SmithEffect::REFLECT, _("反射", "reflection"), SmithCategory::RESISTANCE, { SmithEssence::REFLECT }, 20, { TR_REFLECT } },
+    { SmithEffect::FREE_ACT, _("麻痺知らず", "free action"), SmithCategory::ABILITY, { SmithEssence::FREE_ACT }, 20, { TR_FREE_ACT } },
+    { SmithEffect::HOLD_EXP, _("経験値維持", "hold experience"), SmithCategory::ABILITY, { SmithEssence::HOLD_EXP }, 20, { TR_HOLD_EXP } },
+    { SmithEffect::RES_ACID, _("耐酸", "resistance to acid"), SmithCategory::RESISTANCE, { SmithEssence::RES_ACID }, 15, { TR_RES_ACID } },
+    { SmithEffect::RES_ELEC, _("耐電撃", "resistance to electric"), SmithCategory::RESISTANCE, { SmithEssence::RES_ELEC }, 15, { TR_RES_ELEC } },
+    { SmithEffect::RES_FIRE, _("耐火炎", "resistance to fire"), SmithCategory::RESISTANCE, { SmithEssence::RES_FIRE }, 15, { TR_RES_FIRE } },
+    { SmithEffect::RES_COLD, _("耐冷気", "resistance to cold"), SmithCategory::RESISTANCE, { SmithEssence::RES_COLD }, 15, { TR_RES_COLD } },
+    { SmithEffect::RES_POIS, _("耐毒", "resistance to poison"), SmithCategory::RESISTANCE, { SmithEssence::RES_POIS }, 25, { TR_RES_POIS } },
+    { SmithEffect::RES_FEAR, _("耐恐怖", "resistance to fear"), SmithCategory::RESISTANCE, { SmithEssence::RES_FEAR }, 20, { TR_RES_FEAR } },
+    { SmithEffect::RES_LITE, _("耐閃光", "resistance to light"), SmithCategory::RESISTANCE, { SmithEssence::RES_LITE }, 20, { TR_RES_LITE } },
+    { SmithEffect::RES_DARK, _("耐暗黒", "resistance to dark"), SmithCategory::RESISTANCE, { SmithEssence::RES_DARK }, 20, { TR_RES_DARK } },
+    { SmithEffect::RES_BLIND, _("耐盲目", "resistance to blind"), SmithCategory::RESISTANCE, { SmithEssence::RES_BLIND }, 20, { TR_RES_BLIND } },
+    { SmithEffect::RES_CONF, _("耐混乱", "resistance to confusion"), SmithCategory::RESISTANCE, { SmithEssence::RES_CONF }, 20, { TR_RES_CONF } },
+    { SmithEffect::RES_SOUND, _("耐轟音", "resistance to sound"), SmithCategory::RESISTANCE, { SmithEssence::RES_SOUND }, 20, { TR_RES_SOUND } },
+    { SmithEffect::RES_SHARDS, _("耐破片", "resistance to shard"), SmithCategory::RESISTANCE, { SmithEssence::RES_SHARDS }, 20, { TR_RES_SHARDS } },
+    { SmithEffect::RES_NETHER, _("耐地獄", "resistance to nether"), SmithCategory::RESISTANCE, { SmithEssence::RES_NETHER }, 20, { TR_RES_NETHER } },
+    { SmithEffect::RES_NEXUS, _("耐因果混乱", "resistance to nexus"), SmithCategory::RESISTANCE, { SmithEssence::RES_NEXUS }, 20, { TR_RES_NEXUS } },
+    { SmithEffect::RES_CHAOS, _("耐カオス", "resistance to chaos"), SmithCategory::RESISTANCE, { SmithEssence::RES_CHAOS }, 20, { TR_RES_CHAOS } },
+    { SmithEffect::RES_DISEN, _("耐劣化", "resistance to disenchantment"), SmithCategory::RESISTANCE, { SmithEssence::RES_DISEN }, 20, { TR_RES_DISEN } },
+    { SmithEffect::NO_MAGIC, _("反魔法", "anti magic"), SmithCategory::ABILITY, { SmithEssence::NO_MAGIC }, 15, { TR_NO_MAGIC } },
+    { SmithEffect::WARNING, _("警告", "warning"), SmithCategory::ABILITY, { SmithEssence::WARNING }, 20, { TR_WARNING } },
+    { SmithEffect::LEVITATION, _("浮遊", "levitation"), SmithCategory::ABILITY, { SmithEssence::LEVITATION }, 20, { TR_LEVITATION } },
+    { SmithEffect::LITE, _("永久光源", "permanent light"), SmithCategory::ABILITY, { SmithEssence::LITE }, 15, { TR_LITE_1 } },
+    { SmithEffect::SEE_INVIS, _("可視透明", "see invisible"), SmithCategory::ABILITY, { SmithEssence::SEE_INVIS }, 20, { TR_SEE_INVIS } },
+    { SmithEffect::TELEPATHY, _("テレパシー", "telepathy"), SmithCategory::ESP, { SmithEssence::TELEPATHY }, 15, { TR_TELEPATHY } },
+    { SmithEffect::SLOW_DIGEST, _("遅消化", "slow digestion"), SmithCategory::ABILITY, { SmithEssence::SLOW_DIGEST }, 15, { TR_SLOW_DIGEST } },
+    { SmithEffect::REGEN, _("急速回復", "regeneration"), SmithCategory::ABILITY, { SmithEssence::REGEN }, 20, { TR_REGEN } },
+    { SmithEffect::TELEPORT, _("テレポート", "teleport"), SmithCategory::ABILITY, { SmithEssence::TELEPORT }, 25, { TR_TELEPORT } },
+    { SmithEffect::SLAY_EVIL, _("邪悪倍打", "slay evil"), SmithCategory::SLAYING, { SmithEssence::SLAY_EVIL }, 100, { TR_SLAY_EVIL } },
+    { SmithEffect::KILL_EVIL, _("邪悪倍倍打", "kill evil"), SmithCategory::NONE, { SmithEssence::SLAY_EVIL }, 0,
+        { TR_KILL_EVIL } }, // 強力すぎるため無効(SmithCategory::NONE)
+    { SmithEffect::SLAY_ANIMAL, _("動物倍打", "slay animal"), SmithCategory::SLAYING, { SmithEssence::SLAY_ANIMAL }, 20, { TR_SLAY_ANIMAL } },
+    { SmithEffect::KILL_ANIMAL, _("動物倍倍打", "kill animal"), SmithCategory::SLAYING, { SmithEssence::SLAY_ANIMAL }, 60, { TR_KILL_ANIMAL } },
+    { SmithEffect::SLAY_UNDEAD, _("不死倍打", "slay undead"), SmithCategory::SLAYING, { SmithEssence::SLAY_UNDEAD }, 20, { TR_SLAY_UNDEAD } },
+    { SmithEffect::KILL_UNDEAD, _("不死倍倍打", "kill undead"), SmithCategory::SLAYING, { SmithEssence::SLAY_UNDEAD }, 60, { TR_KILL_UNDEAD } },
+    { SmithEffect::SLAY_DEMON, _("悪魔倍打", "slay demon"), SmithCategory::SLAYING, { SmithEssence::SLAY_DEMON }, 20, { TR_SLAY_DEMON } },
+    { SmithEffect::KILL_DEMON, _("悪魔倍倍打", "kill demon"), SmithCategory::SLAYING, { SmithEssence::SLAY_DEMON }, 60, { TR_KILL_DEMON } },
+    { SmithEffect::SLAY_ORC, _("オーク倍打", "slay orc"), SmithCategory::SLAYING, { SmithEssence::SLAY_ORC }, 20, { TR_SLAY_ORC } },
+    { SmithEffect::KILL_ORC, _("オーク倍倍打", "kill orc"), SmithCategory::SLAYING, { SmithEssence::SLAY_ORC }, 60, { TR_KILL_ORC } },
+    { SmithEffect::SLAY_TROLL, _("トロル倍打", "slay troll"), SmithCategory::SLAYING, { SmithEssence::SLAY_TROLL }, 20, { TR_SLAY_TROLL } },
+    { SmithEffect::KILL_TROLL, _("トロル倍倍打", "kill troll"), SmithCategory::SLAYING, { SmithEssence::SLAY_TROLL }, 60, { TR_KILL_TROLL } },
+    { SmithEffect::SLAY_GIANT, _("巨人倍打", "slay giant"), SmithCategory::SLAYING, { SmithEssence::SLAY_GIANT }, 20, { TR_SLAY_GIANT } },
+    { SmithEffect::KILL_GIANT, _("巨人倍倍打", "kill giant"), SmithCategory::SLAYING, { SmithEssence::SLAY_GIANT }, 60, { TR_KILL_GIANT } },
+    { SmithEffect::SLAY_DRAGON, _("竜倍打", "slay dragon"), SmithCategory::SLAYING, { SmithEssence::SLAY_DRAGON }, 20, { TR_SLAY_DRAGON } },
+    { SmithEffect::KILL_DRAGON, _("竜倍倍打", "kill dragon"), SmithCategory::SLAYING, { SmithEssence::SLAY_DRAGON }, 60, { TR_KILL_DRAGON } },
+    { SmithEffect::SLAY_HUMAN, _("人間倍打", "slay human"), SmithCategory::SLAYING, { SmithEssence::SLAY_HUMAN }, 20, { TR_SLAY_HUMAN } },
+    { SmithEffect::KILL_HUMAN, _("人間倍倍打", "kill human"), SmithCategory::SLAYING, { SmithEssence::SLAY_HUMAN }, 60, { TR_KILL_HUMAN } },
+    { SmithEffect::ESP_ANIMAL, _("動物ESP", "sense animal"), SmithCategory::ESP, { SmithEssence::SLAY_ANIMAL }, 40, { TR_ESP_ANIMAL } },
+    { SmithEffect::ESP_UNDEAD, _("不死ESP", "sense undead"), SmithCategory::ESP, { SmithEssence::SLAY_UNDEAD }, 40, { TR_ESP_UNDEAD } },
+    { SmithEffect::ESP_DEMON, _("悪魔ESP", "sense demon"), SmithCategory::ESP, { SmithEssence::SLAY_DEMON }, 40, { TR_ESP_DEMON } },
+    { SmithEffect::ESP_ORC, _("オークESP", "sense orc"), SmithCategory::ESP, { SmithEssence::SLAY_ORC }, 40, { TR_ESP_ORC } },
+    { SmithEffect::ESP_TROLL, _("トロルESP", "sense troll"), SmithCategory::ESP, { SmithEssence::SLAY_TROLL }, 40, { TR_ESP_TROLL } },
+    { SmithEffect::ESP_GIANT, _("巨人ESP", "sense giant"), SmithCategory::ESP, { SmithEssence::SLAY_GIANT }, 40, { TR_ESP_GIANT } },
+    { SmithEffect::ESP_DRAGON, _("竜ESP", "sense dragon"), SmithCategory::ESP, { SmithEssence::SLAY_DRAGON }, 40, { TR_ESP_DRAGON } },
+    { SmithEffect::ESP_HUMAN, _("人間ESP", "sense human"), SmithCategory::ESP, { SmithEssence::SLAY_HUMAN }, 40, { TR_ESP_HUMAN } },
+    { SmithEffect::ATTACK, _("攻撃", "weapon enchant"), SmithCategory::ENCHANT, { SmithEssence::ATTACK }, 30, {} },
+    { SmithEffect::AC, _("防御", "armor enchant"), SmithCategory::ENCHANT, { SmithEssence::AC }, 15, {} },
+    { SmithEffect::TMP_RES_ACID, _("酸耐性発動", "resist acid activation"), SmithCategory::ETC, { SmithEssence::RES_ACID }, 50, { TR_RES_ACID, TR_ACTIVATE } },
+    { SmithEffect::TMP_RES_ELEC, _("電撃耐性発動", "resist electricity activation"), SmithCategory::ETC, { SmithEssence::RES_ELEC }, 50,
         { TR_RES_ELEC, TR_ACTIVATE } },
-    { Smith::Effect::TMP_RES_FIRE, _("火炎耐性発動", "resist fire activation"), Smith::Category::ETC, { Smith::Essence::RES_FIRE }, 50,
+    { SmithEffect::TMP_RES_FIRE, _("火炎耐性発動", "resist fire activation"), SmithCategory::ETC, { SmithEssence::RES_FIRE }, 50,
         { TR_RES_FIRE, TR_ACTIVATE } },
-    { Smith::Effect::TMP_RES_COLD, _("冷気耐性発動", "resist cold activation"), Smith::Category::ETC, { Smith::Essence::RES_COLD }, 50,
+    { SmithEffect::TMP_RES_COLD, _("冷気耐性発動", "resist cold activation"), SmithCategory::ETC, { SmithEssence::RES_COLD }, 50,
         { TR_RES_COLD, TR_ACTIVATE } },
-    { Smith::Effect::SH_FIRE, _("火炎オーラ", "fiery sheath"), Smith::Category::ETC, { Smith::Essence::RES_FIRE, Smith::Essence::BRAND_FIRE }, 50,
+    { SmithEffect::SH_FIRE, _("火炎オーラ", "fiery sheath"), SmithCategory::ETC, { SmithEssence::RES_FIRE, SmithEssence::BRAND_FIRE }, 50,
         { TR_RES_FIRE, TR_SH_FIRE } },
-    { Smith::Effect::SH_ELEC, _("電撃オーラ", "electric sheath"), Smith::Category::ETC, { Smith::Essence::RES_ELEC, Smith::Essence::BRAND_ELEC }, 50,
+    { SmithEffect::SH_ELEC, _("電撃オーラ", "electric sheath"), SmithCategory::ETC, { SmithEssence::RES_ELEC, SmithEssence::BRAND_ELEC }, 50,
         { TR_RES_ELEC, TR_SH_ELEC } },
-    { Smith::Effect::SH_COLD, _("冷気オーラ", "sheath of coldness"), Smith::Category::ETC, { Smith::Essence::RES_COLD, Smith::Essence::BRAND_COLD }, 50,
+    { SmithEffect::SH_COLD, _("冷気オーラ", "sheath of coldness"), SmithCategory::ETC, { SmithEssence::RES_COLD, SmithEssence::BRAND_COLD }, 50,
         { TR_RES_COLD, TR_SH_COLD } },
-    { Smith::Effect::RESISTANCE, _("全耐性", "resistance"), Smith::Category::RESISTANCE,
-        { Smith::Essence::RES_ACID, Smith::Essence::RES_ELEC, Smith::Essence::RES_FIRE, Smith::Essence::RES_COLD }, 150,
+    { SmithEffect::RESISTANCE, _("全耐性", "resistance"), SmithCategory::RESISTANCE,
+        { SmithEssence::RES_ACID, SmithEssence::RES_ELEC, SmithEssence::RES_FIRE, SmithEssence::RES_COLD }, 150,
         { TR_RES_ACID, TR_RES_ELEC, TR_RES_FIRE, TR_RES_COLD } },
-    { Smith::Effect::SUSTAIN, _("装備保持", "elements proof"), Smith::Category::ENCHANT,
-        { Smith::Essence::RES_ACID, Smith::Essence::RES_ELEC, Smith::Essence::RES_FIRE, Smith::Essence::RES_COLD }, 10, {} },
-    { Smith::Effect::SLAY_GLOVE, _("殺戮の小手", "gauntlets of slaying"), Smith::Category::WEAPON_ATTR, { Smith::Essence::ATTACK }, 200, {} },
+    { SmithEffect::SUSTAIN, _("装備保持", "elements proof"), SmithCategory::ENCHANT,
+        { SmithEssence::RES_ACID, SmithEssence::RES_ELEC, SmithEssence::RES_FIRE, SmithEssence::RES_COLD }, 10, {} },
+    { SmithEffect::SLAY_GLOVE, _("殺戮の小手", "gauntlets of slaying"), SmithCategory::WEAPON_ATTR, { SmithEssence::ATTACK }, 200, {} },
 };
 
 /**
@@ -464,7 +464,7 @@ const std::vector<smith_info_type> smith_info_table = {
  * @param consumption 1種あたりに使用する消費量
  * @return 所持しているエッセンスで付与可能な回数を返す
  */
-int addable_count(const player_type *player_ptr, std::vector<Smith::Essence> essence_list, int consumption)
+int addable_count(const player_type *player_ptr, std::vector<SmithEssence> essence_list, int consumption)
 {
     if (consumption <= 0) {
         return 0;
@@ -484,10 +484,10 @@ int addable_count(const player_type *player_ptr, std::vector<Smith::Essence> ess
  * @param effect 情報を得る鍛冶効果
  * @return 鍛冶情報構造体へのポインタを保持する std::optional オブジェクトを返す
  */
-std::optional<const smith_info_type *> find_smith_info(Smith::Effect effect)
+std::optional<const smith_info_type *> find_smith_info(SmithEffect effect)
 {
     // 何度も呼ぶので線形探索を避けるため鍛冶効果から鍛冶情報のテーブルを引けるmapを作成しておく。
-    static std::unordered_map<Smith::Effect, const smith_info_type *> search_map;
+    static std::unordered_map<SmithEffect, const smith_info_type *> search_map;
     if (search_map.empty()) {
         for (const auto &info : smith_info_table) {
             search_map.emplace(info.effect, &info);
@@ -518,7 +518,7 @@ Smith::Smith(player_type *player_ptr)
  * @param essence 表記名を取得するエッセンス
  * @return 表記名を表す文字列へのポインタ
  */
-concptr Smith::get_essence_name(Essence essence)
+concptr Smith::get_essence_name(SmithEssence essence)
 {
     auto it = essence_to_name.find(essence);
     auto essence_name = it != essence_to_name.end() ? it->second : _("不明", "Unknown");
@@ -531,7 +531,7 @@ concptr Smith::get_essence_name(Essence essence)
  * @param effect 表記名を取得する鍛冶効果
  * @return 表記名を表す文字列へのポインタ
  */
-concptr Smith::get_effect_name(Effect effect)
+concptr Smith::get_effect_name(SmithEffect effect)
 {
     auto info = find_smith_info(effect);
     if (!info.has_value()) {
@@ -547,7 +547,7 @@ concptr Smith::get_effect_name(Effect effect)
  * @param effect 鍛冶効果
  * @return 鍛冶効果の付与に必要なエッセンスを表記する std::string オブジェクト
  */
-std::string Smith::get_need_essences_desc(Effect effect)
+std::string Smith::get_need_essences_desc(SmithEffect effect)
 {
     auto info = find_smith_info(effect);
     if (!info.has_value() || info.value()->need_essences.empty()) {
@@ -572,7 +572,7 @@ std::string Smith::get_need_essences_desc(Effect effect)
  * @param effect 鍛冶効果
  * @return 鍛冶効果を付与するのに必要なエッセンスのリスト
  */
-std::vector<Smith::Essence> Smith::get_need_essences(Effect effect)
+std::vector<SmithEssence> Smith::get_need_essences(SmithEffect effect)
 {
     auto info = find_smith_info(effect);
     if (!info.has_value()) {
@@ -591,7 +591,7 @@ std::vector<Smith::Essence> Smith::get_need_essences(Effect effect)
  * @param o_ptr 鍛冶効果を付与するアイテムへのポインタ。nullptrの場合はデフォルトの消費量が返される。
  * @return 鍛冶効果を付与する時のエッセンス消費量
  */
-int Smith::get_essence_consumption(Effect effect, const object_type *o_ptr)
+int Smith::get_essence_consumption(SmithEffect effect, const object_type *o_ptr)
 {
     auto info = find_smith_info(effect);
     if (!info.has_value()) {
@@ -618,23 +618,23 @@ int Smith::get_essence_consumption(Effect effect, const object_type *o_ptr)
  * @param effect 鍛冶効果
  * @return ItemTesterクラスのオブジェクトをstd::unique_ptrに格納したものを返す
  */
-std::unique_ptr<ItemTester> Smith::get_item_tester(Effect effect)
+std::unique_ptr<ItemTester> Smith::get_item_tester(SmithEffect effect)
 {
-    auto category = Category::NONE;
+    auto category = SmithCategory::NONE;
     if (auto info = find_smith_info(effect); info.has_value()) {
         category = info.value()->category;
     }
 
-    if (effect == Smith::Effect::SLAY_GLOVE) {
+    if (effect == SmithEffect::SLAY_GLOVE) {
         return std::make_unique<TvalItemTester>(TV_GLOVES);
     }
-    if (category == Smith::Category::WEAPON_ATTR || category == Smith::Category::SLAYING) {
+    if (category == SmithCategory::WEAPON_ATTR || category == SmithCategory::SLAYING) {
         return std::make_unique<FuncItemTester>(&object_type::is_melee_ammo);
     }
-    if (effect == Smith::Effect::ATTACK) {
+    if (effect == SmithEffect::ATTACK) {
         return std::make_unique<FuncItemTester>(&object_type::allow_enchant_weapon);
     }
-    if (effect == Smith::Effect::AC) {
+    if (effect == SmithEffect::AC) {
         return std::make_unique<FuncItemTester>(&object_type::is_armour);
     }
 
@@ -647,7 +647,7 @@ std::unique_ptr<ItemTester> Smith::get_item_tester(Effect effect)
  * @param effect 鍛冶効果
  * @return 鍛冶効果により得られる特性フラグがONになったTrFlagsオブジェクト
  */
-TrFlags Smith::get_effect_tr_flags(Effect effect)
+TrFlags Smith::get_effect_tr_flags(SmithEffect effect)
 {
     auto info = find_smith_info(effect);
     if (!info.has_value()) {
@@ -663,9 +663,9 @@ TrFlags Smith::get_effect_tr_flags(Effect effect)
  * @param category 鍛冶カテゴリ
  * @return 指定した鍛冶カテゴリの鍛冶効果のリスト
  */
-std::vector<Smith::Effect> Smith::get_effect_list(Category category)
+std::vector<SmithEffect> Smith::get_effect_list(SmithCategory category)
 {
-    std::vector<Smith::Effect> result;
+    std::vector<SmithEffect> result;
 
     for (const auto &info : smith_info_table) {
         if (info.category == category) {
@@ -683,7 +683,7 @@ std::vector<Smith::Effect> Smith::get_effect_list(Category category)
  * @param item_number 同時に付与するスタックしたアイテム数。スタックしている場合アイテム数倍の数だけエッセンスが必要となる。
  * @return エッセンスを付与できる回数を返す
  */
-int Smith::get_addable_count(Effect effect, int item_number) const
+int Smith::get_addable_count(SmithEffect effect, int item_number) const
 {
     auto info = find_smith_info(effect);
     if (!info.has_value()) {
@@ -698,7 +698,7 @@ int Smith::get_addable_count(Effect effect, int item_number) const
  *
  * @return 鍛冶エッセンスの全リスト
  */
-const std::vector<Smith::Essence> &Smith::get_essence_list()
+const std::vector<SmithEssence> &Smith::get_essence_list()
 {
     return essence_list_order;
 }
@@ -709,7 +709,7 @@ const std::vector<Smith::Essence> &Smith::get_essence_list()
  * @param essence 所持量を取得するエッセンス
  * @return エッセンスの所持量
  */
-int Smith::get_essence_num_of_posessions(Essence essence) const
+int Smith::get_essence_num_of_posessions(SmithEssence essence) const
 {
     return this->player_ptr->magic_num1[enum2i(essence)];
 }
@@ -773,7 +773,7 @@ Smith::DrainEssenceResult Smith::drain_essence(object_type *o_ptr)
 
     auto new_flgs = object_flags(o_ptr);
 
-    std::unordered_map<Essence, int> drain_values;
+    std::unordered_map<SmithEssence, int> drain_values;
 
     // 特性フラグからのエッセンス抽出
     for (auto &&info : essence_drain_info_table) {
@@ -793,14 +793,14 @@ Smith::DrainEssenceResult Smith::drain_essence(object_type *o_ptr)
     auto diff = [](int o, int n) { return std::max(o - n, 0); };
 
     if (o_ptr->is_weapon_ammo()) {
-        drain_values[Smith::Essence::ATTACK] += diff(old_o.ds, o_ptr->ds) * 10;
-        drain_values[Smith::Essence::ATTACK] += diff(old_o.dd, o_ptr->dd) * 10;
+        drain_values[SmithEssence::ATTACK] += diff(old_o.ds, o_ptr->ds) * 10;
+        drain_values[SmithEssence::ATTACK] += diff(old_o.dd, o_ptr->dd) * 10;
     }
 
-    drain_values[Smith::Essence::ATTACK] += diff(old_o.to_h, o_ptr->to_h) * 10;
-    drain_values[Smith::Essence::ATTACK] += diff(old_o.to_d, o_ptr->to_d) * 10;
-    drain_values[Smith::Essence::AC] += diff(old_o.ac, o_ptr->ac) * 10;
-    drain_values[Smith::Essence::AC] += diff(old_o.to_a, o_ptr->to_a) * 10;
+    drain_values[SmithEssence::ATTACK] += diff(old_o.to_h, o_ptr->to_h) * 10;
+    drain_values[SmithEssence::ATTACK] += diff(old_o.to_d, o_ptr->to_d) * 10;
+    drain_values[SmithEssence::AC] += diff(old_o.ac, o_ptr->ac) * 10;
+    drain_values[SmithEssence::AC] += diff(old_o.to_a, o_ptr->to_a) * 10;
 
     // 個数/矢弾/マイナス効果のペナルティによる抽出量の調整
     for (auto &&[unuse, val] : drain_values) {
@@ -813,7 +813,7 @@ Smith::DrainEssenceResult Smith::drain_essence(object_type *o_ptr)
     }
 
     // 所持エッセンスに追加
-    std::vector<std::tuple<Smith::Essence, int>> result;
+    std::vector<std::tuple<SmithEssence, int>> result;
 
     for (auto essence : essence_list_order) {
         auto drain_value = drain_values[essence];
@@ -837,7 +837,7 @@ Smith::DrainEssenceResult Smith::drain_essence(object_type *o_ptr)
  * @param number エッセンス付与数
  * @return 鍛冶効果の付与に成功したら ture、失敗したら false を返す
  */
-bool Smith::add_essence(Effect effect, object_type *o_ptr, int number)
+bool Smith::add_essence(SmithEffect effect, object_type *o_ptr, int number)
 {
     auto info = find_smith_info(effect);
     if (!info.has_value()) {
@@ -849,7 +849,7 @@ bool Smith::add_essence(Effect effect, object_type *o_ptr, int number)
         this->player_ptr->magic_num1[enum2i(essence)] -= total_consumption;
     }
 
-    if (effect == Smith::Effect::SLAY_GLOVE) {
+    if (effect == SmithEffect::SLAY_GLOVE) {
         auto get_to_h = ((number + 1) / 2 + randint0(number / 2 + 1));
         auto get_to_d = ((number + 1) / 2 + randint0(number / 2 + 1));
         o_ptr->xtra4 = (get_to_h << 8) + get_to_d;
@@ -857,7 +857,7 @@ bool Smith::add_essence(Effect effect, object_type *o_ptr, int number)
         o_ptr->to_d += get_to_d;
     }
 
-    if (effect == Smith::Effect::ATTACK) {
+    if (effect == SmithEffect::ATTACK) {
         const auto max_val = this->player_ptr->lev / 5 + 5;
         if ((o_ptr->to_h >= max_val) && (o_ptr->to_d >= max_val)) {
             return false;
@@ -865,14 +865,14 @@ bool Smith::add_essence(Effect effect, object_type *o_ptr, int number)
             o_ptr->to_h = std::min(o_ptr->to_h + 1, max_val);
             o_ptr->to_d = std::min(o_ptr->to_d + 1, max_val);
         }
-    } else if (effect == Smith::Effect::AC) {
+    } else if (effect == SmithEffect::AC) {
         const auto max_val = this->player_ptr->lev / 5 + 5;
         if (o_ptr->to_a >= max_val) {
             return false;
         } else {
             o_ptr->to_a = std::min(o_ptr->to_a + 1, max_val);
         }
-    } else if (effect == Smith::Effect::SUSTAIN) {
+    } else if (effect == SmithEffect::SUSTAIN) {
         o_ptr->art_flags.set(TR_IGNORE_ACID);
         o_ptr->art_flags.set(TR_IGNORE_ELEC);
         o_ptr->art_flags.set(TR_IGNORE_FIRE);
@@ -891,8 +891,8 @@ bool Smith::add_essence(Effect effect, object_type *o_ptr, int number)
  */
 void Smith::erase_essence(object_type *o_ptr) const
 {
-    auto effect = static_cast<Smith::Effect>(o_ptr->xtra3);
-    if (effect == Smith::Effect::SLAY_GLOVE) {
+    auto effect = static_cast<SmithEffect>(o_ptr->xtra3);
+    if (effect == SmithEffect::SLAY_GLOVE) {
         o_ptr->to_h -= (o_ptr->xtra4 >> 8);
         o_ptr->to_d -= (o_ptr->xtra4 & 0x000f);
         o_ptr->xtra4 = 0;
index bc33f46..fea7a58 100644 (file)
@@ -10,238 +10,35 @@ struct object_type;
 struct player_type;
 class ItemTester;
 
+enum class SmithEffect;
+enum class SmithCategory;
+enum class SmithEssence;
+
 /*!
  * @brief 鍛冶クラス
  */
 class Smith {
 public:
-    /**
-     * @brief アイテムに付与できる鍛冶効果の列挙体
-     */
-    enum class Effect {
-        NONE = 0,
-        STR = 1, //!< 腕力
-        INT = 2, //!< 知能
-        WIS = 3, //!< 賢さ
-        DEX = 4, //!< 器用さ
-        CON = 5, //!< 耐久力
-        CHR = 6, //!< 魅力
-
-        SUST_STR = 10, //!< 腕力維持
-        SUST_INT = 11, //!< 知能維持
-        SUST_WIS = 12, //!< 賢さ維持
-        SUST_DEX = 13, //!< 器用維持
-        SUST_CON = 14, //!< 耐久力維持
-        SUST_CHR = 15, //!< 魅力維持
-
-        MAGIC_MASTERY = 20, //!< 魔法道具支配
-        STEALTH = 21, //!< 隠密
-        SEARCH = 22, //!< 探索
-        INFRA = 23, //!< 赤外線視力
-        TUNNEL = 24, //!< 採掘
-        SPEED = 25, //!< スピード
-        BLOWS = 26, //!< 追加攻撃
-
-        CHAOTIC = 40, //!< カオス攻撃
-        VAMPIRIC = 41, //!< 吸血攻撃
-        EARTHQUAKE = 42, //!< 地震発動
-        BRAND_POIS = 43, //!< 毒殺
-        BRAND_ACID = 44, //!< 溶解
-        BRAND_ELEC = 45, //!< 電撃
-        BRAND_FIRE = 46, //!< 焼棄
-        BRAND_COLD = 47, //!< 凍結
-
-        IM_ACID = 60, //!< 酸免疫
-        IM_ELEC = 61, //!< 電撃免疫
-        IM_FIRE = 62, //!< 火炎免疫
-        IM_COLD = 63, //!< 冷気免疫
-        REFLECT = 64, //!< 反射
-
-        RES_ACID = 70, //!< 耐酸
-        RES_ELEC = 71, //!< 耐電撃
-        RES_FIRE = 72, //!< 耐火炎
-        RES_COLD = 73, //!< 耐冷気
-        RES_POIS = 74, //!< 耐毒
-        RES_FEAR = 75, //!< 耐恐怖
-        RES_LITE = 76, //!< 耐閃光
-        RES_DARK = 77, //!< 耐暗黒
-        RES_BLIND = 78, //!< 耐盲目
-        RES_CONF = 79, //!< 耐混乱
-        RES_SOUND = 70, //!< 耐轟音
-        RES_SHARDS = 71, //!< 耐破片
-        RES_NETHER = 72, //!< 耐地獄
-        RES_NEXUS = 73, //!< 耐因果混乱
-        RES_CHAOS = 74, //!< 耐カオス
-        RES_DISEN = 75, //!< 耐劣化
-
-        HOLD_EXP = 90, //!< 経験値維持
-        FREE_ACT = 91, //!< 麻痺知らず
-        WARNING = 92, //!< 警告
-        LEVITATION = 93, //!< 浮遊
-        SEE_INVIS = 94, //!< 可視透明
-        SLOW_DIGEST = 95, //!< 遅消化
-        REGEN = 96, //!< 急速回復
-        TELEPORT = 97, //!< テレポート
-        NO_MAGIC = 98, //!< 反魔法
-        LITE = 99, //!< 永久光源
-
-        SLAY_EVIL = 110, //!< 邪悪倍打
-        SLAY_ANIMAL = 111, //!< 動物倍打
-        SLAY_UNDEAD = 112, //!< 不死倍打
-        SLAY_DEMON = 113, //!< 悪魔倍打
-        SLAY_ORC = 114, //!< オーク倍打
-        SLAY_TROLL = 115, //!< トロル倍打
-        SLAY_GIANT = 116, //!< 巨人倍打
-        SLAY_DRAGON = 117, //!< 竜倍打
-        SLAY_HUMAN = 118, //!< 人間倍打
-        /* @todo GOOD */
-
-        KILL_EVIL = 130, //!< 邪悪倍倍打
-        KILL_ANIMAL = 131, //!< 動物倍倍打
-        KILL_UNDEAD = 132, //!< 不死倍倍打
-        KILL_DEMON = 133, //!< 悪魔倍倍打
-        KILL_ORC = 134, //!< オーク倍倍打
-        KILL_TROLL = 135, //!< トロル倍倍打
-        KILL_GIANT = 136, //!< 巨人倍倍打
-        KILL_DRAGON = 137, //!< 竜倍倍打
-        KILL_HUMAN = 138, //!< 人間倍倍打
-
-        TELEPATHY = 150, //!< テレパシー
-        ESP_ANIMAL = 151, //!< 動物ESP
-        ESP_UNDEAD = 152, //!< 不死ESP
-        ESP_DEMON = 153, //!< 悪魔ESP
-        ESP_ORC = 154, //!< オークESP
-        ESP_TROLL = 155, //!< トロルESP
-        ESP_GIANT = 156, //!< 巨人ESP
-        ESP_DRAGON = 157, //!< 竜ESP
-        ESP_HUMAN = 158, //!< 人間ESP
-
-        TMP_RES_ACID = 200, //!< 酸耐性発動
-        TMP_RES_ELEC = 201, //!< 電撃耐性発動
-        TMP_RES_FIRE = 202, //!< 火炎耐性発動
-        TMP_RES_COLD = 203, //!< 冷気耐性発動
-        SH_FIRE = 204, //!< 火炎オーラ
-        SH_ELEC = 205, //!< 電撃オーラ
-        SH_COLD = 206, //!< 冷気オーラ
-
-        RESISTANCE = 220, //!< 全耐性
-        SLAY_GLOVE = 221, //!< 殺戮の小手
-
-        ATTACK = 250,
-        AC = 251,
-        SUSTAIN = 252, //!< 装備保持
-
-        MAX = 256, //!< 鍛冶アイテムの保存領域が1バイトなので、この値未満を割り当てる必要あり
-    };
-
-    /**
-     * @brief アイテムに付与できる鍛冶効果のカテゴリ
-     */
-    enum class Category {
-        NONE = 0,
-        WEAPON_ATTR = 1, //!< 武器属性
-        RESISTANCE = 2, //!< 耐性
-        ABILITY = 3, //!< 能力
-        PVAL = 4, //!< 数値
-        SLAYING = 5, //!< スレイ
-        ESP = 6, //!< ESP
-        ETC = 7, //!< その他
-        ENCHANT = 10, //!< 武器防具強化
-    };
-
-    /**
-     * @brief 鍛冶エッセンスの列挙体
-     */
-    enum class Essence {
-        NONE = 0,
-        STR = 1, //!< 腕力
-        INT = 2, //!< 知能
-        WIS = 3, //!< 賢さ
-        DEX = 4, //!< 器用さ
-        CON = 5, //!< 耐久力
-        CHR = 6, //!< 魅力
-        MAGIC_MASTERY = 7, //!< 魔法道具支配
-        STEALTH = 8, //!< 隠密
-        SEARCH = 9, //!< 探索
-        INFRA = 10, //!< 赤外線視力
-        TUNNEL = 11, //!< 採掘
-        SPEED = 12, //!< スピード
-        BLOWS = 13, //!< 攻撃回数
-        CHAOTIC = 14, //!< カオス攻撃
-        VAMPIRIC = 15, //!< 吸血攻撃
-        EATHQUAKE = 16, //!< 地震
-        BRAND_POIS = 17, //!< 毒殺
-        BRAND_ACID = 18, //!< 溶解
-        BRAND_ELEC = 19, //!< 電撃
-        BRAND_FIRE = 20, //!< 焼棄
-        BRAND_COLD = 21, //!< 凍結
-        SUST_STATUS = 22, //!< 能力値維持(6能力値共通)
-        IMMUNITY = 23, //!< 免疫(4元素共通)
-        REFLECT = 24, //!< 反射
-        FREE_ACT = 25, //!< 麻痺知らず
-        HOLD_EXP = 26, //!< 経験値維持
-        RES_ACID = 27, //!< 耐酸
-        RES_ELEC = 28, //!< 耐電撃
-        RES_FIRE = 29, //!< 耐火炎
-        RES_COLD = 30, //!< 耐冷気
-        RES_POIS = 31, //!< 耐毒
-        RES_FEAR = 32, //!< 耐恐怖
-        RES_LITE = 33, //!< 耐閃光
-        RES_DARK = 34, //!< 耐暗黒
-        RES_BLIND = 35, //!< 耐盲目
-        RES_CONF = 36, //!< 耐混乱
-        RES_SOUND = 37, //!< 耐轟音
-        RES_SHARDS = 38, //!< 耐破片
-        RES_NETHER = 39, //!< 耐地獄
-        RES_NEXUS = 40, //!< 耐因果混乱
-        RES_CHAOS = 41, //!< 耐カオス
-        RES_DISEN = 42, //!< 耐劣化
-        NO_MAGIC = 43, //!< 反魔法
-        WARNING = 44, //!< 警告
-        LEVITATION = 45, //!< 浮遊
-        LITE = 46, //!< 永久光源
-        SEE_INVIS = 47, //!< 可視透明
-        TELEPATHY = 48, //!< テレパシー
-        SLOW_DIGEST = 49, //!< 遅消化
-        REGEN = 50, //!< 急速回復
-        TELEPORT = 51, //!< テレポート
-
-        SLAY_EVIL = 52, //!< 邪悪倍打
-        SLAY_ANIMAL = 53, //!< 動物倍打
-        SLAY_UNDEAD = 54, //!< 不死倍打
-        SLAY_DEMON = 55, //!< 悪魔倍打
-        SLAY_ORC = 56, //!< オーク倍打
-        SLAY_TROLL = 57, //!< トロル倍打
-        SLAY_GIANT = 58, //!< 巨人倍打
-        SLAY_DRAGON = 59, //!< 竜倍打
-        SLAY_HUMAN = 60, //!< 人間倍打
-
-        ATTACK = 100, //!< 攻撃
-        AC = 101, //!< 防御
-
-        MAX = MAX_SPELLS, //!< エッセンス所持量はplayer_type::magic_num1[MAX_SPELLS]に格納するので、この値未満を割り当てる必要あり
-    };
-
     //! エッセンスとその抽出量を表すタプルのリスト
-    using DrainEssenceResult = std::vector<std::tuple<Essence, int>>;
+    using DrainEssenceResult = std::vector<std::tuple<SmithEssence, int>>;
 
     Smith(player_type *player_ptr);
 
-    static const std::vector<Essence> &get_essence_list();
-    static concptr get_essence_name(Essence essence);
-    static std::vector<Effect> get_effect_list(Category category);
-    static concptr get_effect_name(Effect effect);
-    static std::string get_need_essences_desc(Effect effect);
-    static std::vector<Essence> get_need_essences(Effect effect);
-    static int get_essence_consumption(Effect effect, const object_type *o_ptr = nullptr);
-    static std::unique_ptr<ItemTester> get_item_tester(Effect effect);
-    static TrFlags get_effect_tr_flags(Effect effect);
-
-    int get_essence_num_of_posessions(Essence essence) const;
+    static const std::vector<SmithEssence> &get_essence_list();
+    static concptr get_essence_name(SmithEssence essence);
+    static std::vector<SmithEffect> get_effect_list(SmithCategory category);
+    static concptr get_effect_name(SmithEffect effect);
+    static std::string get_need_essences_desc(SmithEffect effect);
+    static std::vector<SmithEssence> get_need_essences(SmithEffect effect);
+    static int get_essence_consumption(SmithEffect effect, const object_type *o_ptr = nullptr);
+    static std::unique_ptr<ItemTester> get_item_tester(SmithEffect effect);
+    static TrFlags get_effect_tr_flags(SmithEffect effect);
+
+    int get_essence_num_of_posessions(SmithEssence essence) const;
     DrainEssenceResult drain_essence(object_type *o_ptr);
-    bool add_essence(Effect effect, object_type *o_ptr, int consumption);
+    bool add_essence(SmithEffect effect, object_type *o_ptr, int consumption);
     void erase_essence(object_type *o_ptr) const;
-    int get_addable_count(Effect smith_effect, int item_number) const;
+    int get_addable_count(SmithEffect smith_effect, int item_number) const;
 
 private:
     player_type *player_ptr;
diff --git a/src/object-enchant/smith-types.h b/src/object-enchant/smith-types.h
new file mode 100644 (file)
index 0000000..d1f20b4
--- /dev/null
@@ -0,0 +1,210 @@
+#pragma once
+
+#include "system/system-variables.h"
+
+/**
+ * @brief アイテムに付与できる鍛冶効果の列挙体
+ */
+enum class SmithEffect {
+    NONE = 0,
+    STR = 1, //!< 腕力
+    INT = 2, //!< 知能
+    WIS = 3, //!< 賢さ
+    DEX = 4, //!< 器用さ
+    CON = 5, //!< 耐久力
+    CHR = 6, //!< 魅力
+
+    SUST_STR = 10, //!< 腕力維持
+    SUST_INT = 11, //!< 知能維持
+    SUST_WIS = 12, //!< 賢さ維持
+    SUST_DEX = 13, //!< 器用維持
+    SUST_CON = 14, //!< 耐久力維持
+    SUST_CHR = 15, //!< 魅力維持
+
+    MAGIC_MASTERY = 20, //!< 魔法道具支配
+    STEALTH = 21, //!< 隠密
+    SEARCH = 22, //!< 探索
+    INFRA = 23, //!< 赤外線視力
+    TUNNEL = 24, //!< 採掘
+    SPEED = 25, //!< スピード
+    BLOWS = 26, //!< 追加攻撃
+
+    CHAOTIC = 40, //!< カオス攻撃
+    VAMPIRIC = 41, //!< 吸血攻撃
+    EARTHQUAKE = 42, //!< 地震発動
+    BRAND_POIS = 43, //!< 毒殺
+    BRAND_ACID = 44, //!< 溶解
+    BRAND_ELEC = 45, //!< 電撃
+    BRAND_FIRE = 46, //!< 焼棄
+    BRAND_COLD = 47, //!< 凍結
+
+    IM_ACID = 60, //!< 酸免疫
+    IM_ELEC = 61, //!< 電撃免疫
+    IM_FIRE = 62, //!< 火炎免疫
+    IM_COLD = 63, //!< 冷気免疫
+    REFLECT = 64, //!< 反射
+
+    RES_ACID = 70, //!< 耐酸
+    RES_ELEC = 71, //!< 耐電撃
+    RES_FIRE = 72, //!< 耐火炎
+    RES_COLD = 73, //!< 耐冷気
+    RES_POIS = 74, //!< 耐毒
+    RES_FEAR = 75, //!< 耐恐怖
+    RES_LITE = 76, //!< 耐閃光
+    RES_DARK = 77, //!< 耐暗黒
+    RES_BLIND = 78, //!< 耐盲目
+    RES_CONF = 79, //!< 耐混乱
+    RES_SOUND = 70, //!< 耐轟音
+    RES_SHARDS = 71, //!< 耐破片
+    RES_NETHER = 72, //!< 耐地獄
+    RES_NEXUS = 73, //!< 耐因果混乱
+    RES_CHAOS = 74, //!< 耐カオス
+    RES_DISEN = 75, //!< 耐劣化
+
+    HOLD_EXP = 90, //!< 経験値維持
+    FREE_ACT = 91, //!< 麻痺知らず
+    WARNING = 92, //!< 警告
+    LEVITATION = 93, //!< 浮遊
+    SEE_INVIS = 94, //!< 可視透明
+    SLOW_DIGEST = 95, //!< 遅消化
+    REGEN = 96, //!< 急速回復
+    TELEPORT = 97, //!< テレポート
+    NO_MAGIC = 98, //!< 反魔法
+    LITE = 99, //!< 永久光源
+
+    SLAY_EVIL = 110, //!< 邪悪倍打
+    SLAY_ANIMAL = 111, //!< 動物倍打
+    SLAY_UNDEAD = 112, //!< 不死倍打
+    SLAY_DEMON = 113, //!< 悪魔倍打
+    SLAY_ORC = 114, //!< オーク倍打
+    SLAY_TROLL = 115, //!< トロル倍打
+    SLAY_GIANT = 116, //!< 巨人倍打
+    SLAY_DRAGON = 117, //!< 竜倍打
+    SLAY_HUMAN = 118, //!< 人間倍打
+    /* @todo GOOD */
+
+    KILL_EVIL = 130, //!< 邪悪倍倍打
+    KILL_ANIMAL = 131, //!< 動物倍倍打
+    KILL_UNDEAD = 132, //!< 不死倍倍打
+    KILL_DEMON = 133, //!< 悪魔倍倍打
+    KILL_ORC = 134, //!< オーク倍倍打
+    KILL_TROLL = 135, //!< トロル倍倍打
+    KILL_GIANT = 136, //!< 巨人倍倍打
+    KILL_DRAGON = 137, //!< 竜倍倍打
+    KILL_HUMAN = 138, //!< 人間倍倍打
+
+    TELEPATHY = 150, //!< テレパシー
+    ESP_ANIMAL = 151, //!< 動物ESP
+    ESP_UNDEAD = 152, //!< 不死ESP
+    ESP_DEMON = 153, //!< 悪魔ESP
+    ESP_ORC = 154, //!< オークESP
+    ESP_TROLL = 155, //!< トロルESP
+    ESP_GIANT = 156, //!< 巨人ESP
+    ESP_DRAGON = 157, //!< 竜ESP
+    ESP_HUMAN = 158, //!< 人間ESP
+
+    TMP_RES_ACID = 200, //!< 酸耐性発動
+    TMP_RES_ELEC = 201, //!< 電撃耐性発動
+    TMP_RES_FIRE = 202, //!< 火炎耐性発動
+    TMP_RES_COLD = 203, //!< 冷気耐性発動
+    SH_FIRE = 204, //!< 火炎オーラ
+    SH_ELEC = 205, //!< 電撃オーラ
+    SH_COLD = 206, //!< 冷気オーラ
+
+    RESISTANCE = 220, //!< 全耐性
+    SLAY_GLOVE = 221, //!< 殺戮の小手
+
+    ATTACK = 250, //!< 命中/ダメージ強化
+    AC = 251, //!< AC強化
+    SUSTAIN = 252, //!< 装備保持
+
+    MAX = 256, //!< 鍛冶アイテムの保存領域が1バイトなので、この値未満を割り当てる必要あり
+};
+
+/**
+ * @brief アイテムに付与できる鍛冶効果のカテゴリ
+ */
+enum class SmithCategory {
+    NONE = 0,
+    WEAPON_ATTR = 1, //!< 武器属性
+    RESISTANCE = 2, //!< 耐性
+    ABILITY = 3, //!< 能力
+    PVAL = 4, //!< 数値
+    SLAYING = 5, //!< スレイ
+    ESP = 6, //!< ESP
+    ETC = 7, //!< その他
+    ENCHANT = 10, //!< 武器防具強化
+};
+
+/**
+ * @brief 鍛冶エッセンスの列挙体
+ */
+enum class SmithEssence {
+    NONE = 0,
+    STR = 1, //!< 腕力
+    INT = 2, //!< 知能
+    WIS = 3, //!< 賢さ
+    DEX = 4, //!< 器用さ
+    CON = 5, //!< 耐久力
+    CHR = 6, //!< 魅力
+    MAGIC_MASTERY = 7, //!< 魔法道具支配
+    STEALTH = 8, //!< 隠密
+    SEARCH = 9, //!< 探索
+    INFRA = 10, //!< 赤外線視力
+    TUNNEL = 11, //!< 採掘
+    SPEED = 12, //!< スピード
+    BLOWS = 13, //!< 攻撃回数
+    CHAOTIC = 14, //!< カオス攻撃
+    VAMPIRIC = 15, //!< 吸血攻撃
+    EATHQUAKE = 16, //!< 地震
+    BRAND_POIS = 17, //!< 毒殺
+    BRAND_ACID = 18, //!< 溶解
+    BRAND_ELEC = 19, //!< 電撃
+    BRAND_FIRE = 20, //!< 焼棄
+    BRAND_COLD = 21, //!< 凍結
+    SUST_STATUS = 22, //!< 能力値維持(6能力値共通)
+    IMMUNITY = 23, //!< 免疫(4元素共通)
+    REFLECT = 24, //!< 反射
+    FREE_ACT = 25, //!< 麻痺知らず
+    HOLD_EXP = 26, //!< 経験値維持
+    RES_ACID = 27, //!< 耐酸
+    RES_ELEC = 28, //!< 耐電撃
+    RES_FIRE = 29, //!< 耐火炎
+    RES_COLD = 30, //!< 耐冷気
+    RES_POIS = 31, //!< 耐毒
+    RES_FEAR = 32, //!< 耐恐怖
+    RES_LITE = 33, //!< 耐閃光
+    RES_DARK = 34, //!< 耐暗黒
+    RES_BLIND = 35, //!< 耐盲目
+    RES_CONF = 36, //!< 耐混乱
+    RES_SOUND = 37, //!< 耐轟音
+    RES_SHARDS = 38, //!< 耐破片
+    RES_NETHER = 39, //!< 耐地獄
+    RES_NEXUS = 40, //!< 耐因果混乱
+    RES_CHAOS = 41, //!< 耐カオス
+    RES_DISEN = 42, //!< 耐劣化
+    NO_MAGIC = 43, //!< 反魔法
+    WARNING = 44, //!< 警告
+    LEVITATION = 45, //!< 浮遊
+    LITE = 46, //!< 永久光源
+    SEE_INVIS = 47, //!< 可視透明
+    TELEPATHY = 48, //!< テレパシー
+    SLOW_DIGEST = 49, //!< 遅消化
+    REGEN = 50, //!< 急速回復
+    TELEPORT = 51, //!< テレポート
+
+    SLAY_EVIL = 52, //!< 邪悪倍打
+    SLAY_ANIMAL = 53, //!< 動物倍打
+    SLAY_UNDEAD = 54, //!< 不死倍打
+    SLAY_DEMON = 55, //!< 悪魔倍打
+    SLAY_ORC = 56, //!< オーク倍打
+    SLAY_TROLL = 57, //!< トロル倍打
+    SLAY_GIANT = 58, //!< 巨人倍打
+    SLAY_DRAGON = 59, //!< 竜倍打
+    SLAY_HUMAN = 60, //!< 人間倍打
+
+    ATTACK = 100, //!< 攻撃
+    AC = 101, //!< 防御
+
+    MAX = MAX_SPELLS, //!< エッセンス所持量はplayer_type::magic_num1[MAX_SPELLS]に格納するので、この値未満を割り当てる必要あり
+};
index 3dfe3b6..75a081f 100644 (file)
@@ -47,7 +47,7 @@ TrFlags object_flags(const object_type *o_ptr)
     flgs.set(o_ptr->art_flags);
 
     if (o_ptr->is_smith()) {
-        auto tr_flags = Smith::get_effect_tr_flags(static_cast<Smith::Effect>(o_ptr->xtra3));
+        auto tr_flags = Smith::get_effect_tr_flags(static_cast<SmithEffect>(o_ptr->xtra3));
         flgs.set(tr_flags);
     }
 
@@ -101,7 +101,7 @@ TrFlags object_flags_known(const object_type *o_ptr)
     if (!o_ptr->is_smith())
         return flgs;
 
-    auto tr_flags = Smith::get_effect_tr_flags(static_cast<Smith::Effect>(o_ptr->xtra3));
+    auto tr_flags = Smith::get_effect_tr_flags(static_cast<SmithEffect>(o_ptr->xtra3));
     flgs.set(tr_flags).reset(TR_ACTIVATE);
 
     return flgs;