• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revisionfe5949d469767c59b9f070504c98553f7e137a45 (tree)
Time2019-03-11 22:09:26
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #37353 鍛冶の処理を cmd-smith.c に分離 / Separate cmd-smith.c from object2.c.

Change Summary

Incremental Difference

--- a/Hengband_vcs2017/Hengband/Hengband.vcxproj
+++ b/Hengband_vcs2017/Hengband/Hengband.vcxproj
@@ -147,6 +147,7 @@
147147 <ClCompile Include="..\..\src\cmd-pet.c" />
148148 <ClCompile Include="..\..\src\cmd-quaff.c" />
149149 <ClCompile Include="..\..\src\cmd-read.c" />
150+ <ClCompile Include="..\..\src\cmd-smith.c" />
150151 <ClCompile Include="..\..\src\feature.c" />
151152 <ClCompile Include="..\..\src\floor-events.c" />
152153 <ClCompile Include="..\..\src\floor-generate.c" />
@@ -182,6 +183,7 @@
182183 <ClInclude Include="..\..\src\cmd-item.h" />
183184 <ClInclude Include="..\..\src\cmd-magiceat.h" />
184185 <ClInclude Include="..\..\src\cmd-pet.h" />
186+ <ClInclude Include="..\..\src\cmd-smith.h" />
185187 <ClInclude Include="..\..\src\cmd-spell.h" />
186188 <ClInclude Include="..\..\src\cmd-zaprod.h" />
187189 <ClInclude Include="..\..\src\cmd-zapwand.h">
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -16,7 +16,9 @@ hengband_SOURCES = \
1616 cmd-item.c cmd-item.h cmd-magiceat.c cmd-magiceat.h cmd-pet.c cmd-pet.h \
1717 cmd-quaff.c cmd-quaff.h cmd-read.c cmd-read.h cmd-spell.c cmd-spell.h \
1818 cmd-usestaff.c cmd-usestaff.h cmd-zaprod.c cmd-zaprod.h cmd-zapwand.c \
19- cmd-zapwand.h defines.h dungeon.c effects.c externs.h files.c flavor.c \
19+ cmd-zapwand.h cmd-smith.c cmd-smith.h \
20+ \
21+ defines.h dungeon.c effects.c externs.h files.c flavor.c \
2022 \
2123 floor.h floor-events.c floor-events.h floor-generate.c floor-save.c \
2224 floor-streams.c floor-streams.h \
--- /dev/null
+++ b/src/cmd-smith.c
@@ -0,0 +1,1524 @@
1+#include "angband.h"
2+#include "object-hook.h"
3+#include "player-status.h"
4+
5+
6+
7+/*!
8+ * エッセンス情報の構造体 / A structure for smithing
9+ */
10+typedef struct {
11+ int add; /* TR flag number or special essence id */
12+ concptr add_name; /* Name of this ability */
13+ ESSENCE_IDX type; /* Menu number */
14+ int essence; /* Index for carrying essences */
15+ int value; /* Needed value to add this ability */
16+} essence_type;
17+
18+
19+/*!
20+ * エッセンス情報テーブル Smithing type data for Weapon smith
21+ */
22+#ifdef JP
23+static essence_type essence_info[] =
24+{
25+ {TR_STR, "腕力", 4, TR_STR, 20},
26+ {TR_INT, "知能", 4, TR_INT, 20},
27+ {TR_WIS, "賢さ", 4, TR_WIS, 20},
28+ {TR_DEX, "器用さ", 4, TR_DEX, 20},
29+ {TR_CON, "耐久力", 4, TR_CON, 20},
30+ {TR_CHR, "魅力", 4, TR_CHR, 20},
31+ {TR_MAGIC_MASTERY, "魔力支配", 4, TR_MAGIC_MASTERY, 20},
32+ {TR_STEALTH, "隠密", 4, TR_STEALTH, 40},
33+ {TR_SEARCH, "探索", 4, TR_SEARCH, 15},
34+ {TR_INFRA, "赤外線視力", 4, TR_INFRA, 15},
35+ {TR_TUNNEL, "採掘", 4, TR_TUNNEL, 15},
36+ {TR_SPEED, "スピード", 4, TR_SPEED, 12},
37+ {TR_BLOWS, "追加攻撃", 1, TR_BLOWS, 20},
38+ {TR_CHAOTIC, "カオス攻撃", 1, TR_CHAOTIC, 15},
39+ {TR_VAMPIRIC, "吸血攻撃", 1, TR_VAMPIRIC, 60},
40+ {TR_IMPACT, "地震発動", 7, TR_IMPACT, 15},
41+ {TR_BRAND_POIS, "毒殺", 1, TR_BRAND_POIS, 20},
42+ {TR_BRAND_ACID, "溶解", 1, TR_BRAND_ACID, 20},
43+ {TR_BRAND_ELEC, "電撃", 1, TR_BRAND_ELEC, 20},
44+ {TR_BRAND_FIRE, "焼棄", 1, TR_BRAND_FIRE, 20},
45+ {TR_BRAND_COLD, "凍結", 1, TR_BRAND_COLD, 20},
46+ {TR_SUST_STR, "腕力維持", 3, TR_SUST_STR, 15},
47+ {TR_SUST_INT, "知能維持", 3, TR_SUST_STR, 15},
48+ {TR_SUST_WIS, "賢さ維持", 3, TR_SUST_STR, 15},
49+ {TR_SUST_DEX, "器用さ維持", 3, TR_SUST_STR, 15},
50+ {TR_SUST_CON, "耐久力維持", 3, TR_SUST_STR, 15},
51+ {TR_SUST_CHR, "魅力維持", 3, TR_SUST_STR, 15},
52+ {TR_IM_ACID, "酸免疫", 2, TR_IM_ACID, 20},
53+ {TR_IM_ELEC, "電撃免疫", 2, TR_IM_ACID, 20},
54+ {TR_IM_FIRE, "火炎免疫", 2, TR_IM_ACID, 20},
55+ {TR_IM_COLD, "冷気免疫", 2, TR_IM_ACID, 20},
56+ {TR_REFLECT, "反射", 2, TR_REFLECT, 20},
57+ {TR_FREE_ACT, "麻痺知らず", 3, TR_FREE_ACT, 20},
58+ {TR_HOLD_EXP, "経験値維持", 3, TR_HOLD_EXP, 20},
59+ {TR_RES_ACID, "耐酸", 2, TR_RES_ACID, 15},
60+ {TR_RES_ELEC, "耐電撃", 2, TR_RES_ELEC, 15},
61+ {TR_RES_FIRE, "耐火炎", 2, TR_RES_FIRE, 15},
62+ {TR_RES_COLD, "耐冷気", 2, TR_RES_COLD, 15},
63+ {TR_RES_POIS, "耐毒", 2, TR_RES_POIS, 25},
64+ {TR_RES_FEAR, "耐恐怖", 2, TR_RES_FEAR, 20},
65+ {TR_RES_LITE, "耐閃光", 2, TR_RES_LITE, 20},
66+ {TR_RES_DARK, "耐暗黒", 2, TR_RES_DARK, 20},
67+ {TR_RES_BLIND, "耐盲目", 2, TR_RES_BLIND, 20},
68+ {TR_RES_CONF, "耐混乱", 2, TR_RES_CONF, 20},
69+ {TR_RES_SOUND, "耐轟音", 2, TR_RES_SOUND, 20},
70+ {TR_RES_SHARDS, "耐破片", 2, TR_RES_SHARDS, 20},
71+ {TR_RES_NETHER, "耐地獄", 2, TR_RES_NETHER, 20},
72+ {TR_RES_NEXUS, "耐因果混乱", 2, TR_RES_NEXUS, 20},
73+ {TR_RES_CHAOS, "耐カオス", 2, TR_RES_CHAOS, 20},
74+ {TR_RES_DISEN, "耐劣化", 2, TR_RES_DISEN, 20},
75+ {TR_SH_FIRE, "", 0, -2, 0},
76+ {TR_SH_ELEC, "", 0, -2, 0},
77+ {TR_SH_COLD, "", 0, -2, 0},
78+ {TR_NO_MAGIC, "反魔法", 3, TR_NO_MAGIC, 15},
79+ {TR_WARNING, "警告", 3, TR_WARNING, 20},
80+ {TR_LEVITATION, "浮遊", 3, TR_LEVITATION, 20},
81+ {TR_LITE_1, "永久光源", 3, TR_LITE_1, 15},
82+ {TR_LITE_2, "", 0, -2, 0},
83+ {TR_LITE_3, "", 0, -2, 0},
84+ {TR_SEE_INVIS, "可視透明", 3, TR_SEE_INVIS, 20},
85+ {TR_TELEPATHY, "テレパシー", 6, TR_TELEPATHY, 15},
86+ {TR_SLOW_DIGEST, "遅消化", 3, TR_SLOW_DIGEST, 15},
87+ {TR_REGEN, "急速回復", 3, TR_REGEN, 20},
88+ {TR_TELEPORT, "テレポート", 3, TR_TELEPORT, 25},
89+
90+ {TR_SLAY_EVIL, "邪悪倍打", 5, TR_SLAY_EVIL, 100},
91+ {TR_KILL_EVIL, "邪悪倍倍打", 0, TR_SLAY_EVIL, 60},
92+ {TR_SLAY_ANIMAL, "動物倍打", 5, TR_SLAY_ANIMAL, 20},
93+ {TR_KILL_ANIMAL, "動物倍倍打", 5, TR_SLAY_ANIMAL, 60},
94+ {TR_SLAY_UNDEAD, "不死倍打", 5, TR_SLAY_UNDEAD, 20},
95+ {TR_KILL_UNDEAD, "不死倍倍打", 5, TR_SLAY_UNDEAD, 60},
96+ {TR_SLAY_DEMON, "悪魔倍打", 5, TR_SLAY_DEMON, 20},
97+ {TR_KILL_DEMON, "悪魔倍倍打", 5, TR_SLAY_DEMON, 60},
98+ {TR_SLAY_ORC, "オーク倍打", 5, TR_SLAY_ORC, 15},
99+ {TR_KILL_ORC, "オーク倍倍打", 5, TR_SLAY_ORC, 60},
100+ {TR_SLAY_TROLL, "トロル倍打", 5, TR_SLAY_TROLL, 15},
101+ {TR_KILL_TROLL, "トロル倍倍打", 5, TR_SLAY_TROLL, 60},
102+ {TR_SLAY_GIANT, "巨人倍打", 5, TR_SLAY_GIANT, 20},
103+ {TR_KILL_GIANT, "巨人倍倍打", 5, TR_SLAY_GIANT, 60},
104+ {TR_SLAY_DRAGON, "竜倍打", 5, TR_SLAY_DRAGON, 20},
105+ {TR_KILL_DRAGON, "竜倍倍打", 5, TR_SLAY_DRAGON, 60},
106+ {TR_SLAY_HUMAN, "人間倍打", 5, TR_SLAY_HUMAN, 20},
107+ {TR_KILL_HUMAN, "人間倍倍打", 5, TR_SLAY_HUMAN, 60},
108+
109+ {TR_ESP_ANIMAL, "動物ESP", 6, TR_SLAY_ANIMAL, 40},
110+ {TR_ESP_UNDEAD, "不死ESP", 6, TR_SLAY_UNDEAD, 40},
111+ {TR_ESP_DEMON, "悪魔ESP", 6, TR_SLAY_DEMON, 40},
112+ {TR_ESP_ORC, "オークESP", 6, TR_SLAY_ORC, 40},
113+ {TR_ESP_TROLL, "トロルESP", 6, TR_SLAY_TROLL, 40},
114+ {TR_ESP_GIANT, "巨人ESP", 6, TR_SLAY_GIANT, 40},
115+ {TR_ESP_DRAGON, "竜ESP", 6, TR_SLAY_DRAGON, 40},
116+ {TR_ESP_HUMAN, "人間ESP", 6, TR_SLAY_HUMAN, 40},
117+
118+ {ESSENCE_ATTACK, "攻撃", 10, TR_ES_ATTACK, 30},
119+ {ESSENCE_AC, "防御", 10, TR_ES_AC, 15},
120+ {ESSENCE_TMP_RES_ACID, "酸耐性発動", 7, TR_RES_ACID, 50},
121+ {ESSENCE_TMP_RES_ELEC, "電撃耐性発動", 7, TR_RES_ELEC, 50},
122+ {ESSENCE_TMP_RES_FIRE, "火炎耐性発動", 7, TR_RES_FIRE, 50},
123+ {ESSENCE_TMP_RES_COLD, "冷気耐性発動", 7, TR_RES_COLD, 50},
124+ {ESSENCE_SH_FIRE, "火炎オーラ", 7, -1, 50},
125+ {ESSENCE_SH_ELEC, "電撃オーラ", 7, -1, 50},
126+ {ESSENCE_SH_COLD, "冷気オーラ", 7, -1, 50},
127+ {ESSENCE_RESISTANCE, "全耐性", 2, -1, 150},
128+ {ESSENCE_SUSTAIN, "装備保持", 10, -1, 10},
129+ {ESSENCE_SLAY_GLOVE, "殺戮の小手", 1, TR_ES_ATTACK, 200},
130+
131+ {-1, NULL, 0, -1, 0}
132+};
133+#else
134+static essence_type essence_info[] =
135+{
136+ {TR_STR, "strength", 4, TR_STR, 20},
137+ {TR_INT, "intelligence", 4, TR_INT, 20},
138+ {TR_WIS, "wisdom", 4, TR_WIS, 20},
139+ {TR_DEX, "dexterity", 4, TR_DEX, 20},
140+ {TR_CON, "constitution", 4, TR_CON, 20},
141+ {TR_CHR, "charisma", 4, TR_CHR, 20},
142+ {TR_MAGIC_MASTERY, "magic mastery", 4, TR_MAGIC_MASTERY, 20},
143+ {TR_STEALTH, "stealth", 4, TR_STEALTH, 40},
144+ {TR_SEARCH, "serching", 4, TR_SEARCH, 15},
145+ {TR_INFRA, "infravision", 4, TR_INFRA, 15},
146+ {TR_TUNNEL, "digging", 4, TR_TUNNEL, 15},
147+ {TR_SPEED, "speed", 4, TR_SPEED, 12},
148+ {TR_BLOWS, "extra attack", 1, TR_BLOWS, 20},
149+ {TR_CHAOTIC, "chaos brand", 1, TR_CHAOTIC, 15},
150+ {TR_VAMPIRIC, "vampiric brand", 1, TR_VAMPIRIC, 60},
151+ {TR_IMPACT, "quake activation", 7, TR_IMPACT, 15},
152+ {TR_BRAND_POIS, "poison brand", 1, TR_BRAND_POIS, 20},
153+ {TR_BRAND_ACID, "acid brand", 1, TR_BRAND_ACID, 20},
154+ {TR_BRAND_ELEC, "electric brand", 1, TR_BRAND_ELEC, 20},
155+ {TR_BRAND_FIRE, "fire brand", 1, TR_BRAND_FIRE, 20},
156+ {TR_BRAND_COLD, "cold brand", 1, TR_BRAND_COLD, 20},
157+ {TR_SUST_STR, "sustain strength", 3, TR_SUST_STR, 15},
158+ {TR_SUST_INT, "sustain intelligence", 3, TR_SUST_STR, 15},
159+ {TR_SUST_WIS, "sustain wisdom", 3, TR_SUST_STR, 15},
160+ {TR_SUST_DEX, "sustain dexterity", 3, TR_SUST_STR, 15},
161+ {TR_SUST_CON, "sustain constitution", 3, TR_SUST_STR, 15},
162+ {TR_SUST_CHR, "sustain charisma", 3, TR_SUST_STR, 15},
163+ {TR_IM_ACID, "acid immunity", 2, TR_IM_ACID, 20},
164+ {TR_IM_ELEC, "electric immunity", 2, TR_IM_ACID, 20},
165+ {TR_IM_FIRE, "fire immunity", 2, TR_IM_ACID, 20},
166+ {TR_IM_COLD, "cold immunity", 2, TR_IM_ACID, 20},
167+ {TR_REFLECT, "reflection", 2, TR_REFLECT, 20},
168+ {TR_FREE_ACT, "free action", 3, TR_FREE_ACT, 20},
169+ {TR_HOLD_EXP, "hold experience", 3, TR_HOLD_EXP, 20},
170+ {TR_RES_ACID, "resistance to acid", 2, TR_RES_ACID, 15},
171+ {TR_RES_ELEC, "resistance to electric", 2, TR_RES_ELEC, 15},
172+ {TR_RES_FIRE, "resistance to fire", 2, TR_RES_FIRE, 15},
173+ {TR_RES_COLD, "resistance to cold", 2, TR_RES_COLD, 15},
174+ {TR_RES_POIS, "resistance to poison", 2, TR_RES_POIS, 25},
175+ {TR_RES_FEAR, "resistance to fear", 2, TR_RES_FEAR, 20},
176+ {TR_RES_LITE, "resistance to light", 2, TR_RES_LITE, 20},
177+ {TR_RES_DARK, "resistance to dark", 2, TR_RES_DARK, 20},
178+ {TR_RES_BLIND, "resistance to blind", 2, TR_RES_BLIND, 20},
179+ {TR_RES_CONF, "resistance to confusion", 2, TR_RES_CONF, 20},
180+ {TR_RES_SOUND, "resistance to sound", 2, TR_RES_SOUND, 20},
181+ {TR_RES_SHARDS, "resistance to shard", 2, TR_RES_SHARDS, 20},
182+ {TR_RES_NETHER, "resistance to nether", 2, TR_RES_NETHER, 20},
183+ {TR_RES_NEXUS, "resistance to nexus", 2, TR_RES_NEXUS, 20},
184+ {TR_RES_CHAOS, "resistance to chaos", 2, TR_RES_CHAOS, 20},
185+ {TR_RES_DISEN, "resistance to disenchantment", 2, TR_RES_DISEN, 20},
186+ {TR_SH_FIRE, "", 0, -2, 0},
187+ {TR_SH_ELEC, "", 0, -2, 0},
188+ {TR_SH_COLD, "", 0, -2, 0},
189+ {TR_NO_MAGIC, "anti magic", 3, TR_NO_MAGIC, 15},
190+ {TR_WARNING, "warning", 3, TR_WARNING, 20},
191+ {TR_LEVITATION, "levitation", 3, TR_LEVITATION, 20},
192+ {TR_LITE_1, "permanent light", 3, TR_LITE_1, 15},
193+ {TR_LITE_2, "", 0, -2, 0},
194+ {TR_LITE_3, "", 0, -2, 0},
195+ {TR_SEE_INVIS, "see invisible", 3, TR_SEE_INVIS, 20},
196+ {TR_TELEPATHY, "telepathy", 6, TR_TELEPATHY, 15},
197+ {TR_SLOW_DIGEST, "slow digestion", 3, TR_SLOW_DIGEST, 15},
198+ {TR_REGEN, "regeneration", 3, TR_REGEN, 20},
199+ {TR_TELEPORT, "teleport", 3, TR_TELEPORT, 25},
200+
201+ {TR_SLAY_EVIL, "slay evil", 5, TR_SLAY_EVIL, 100},
202+ {TR_SLAY_ANIMAL, "slay animal", 5, TR_SLAY_ANIMAL, 20},
203+ {TR_KILL_ANIMAL, "kill animal", 5, TR_SLAY_ANIMAL, 60},
204+ {TR_KILL_EVIL, "kill evil", 0, TR_SLAY_EVIL, 60},
205+ {TR_SLAY_UNDEAD, "slay undead", 5, TR_SLAY_UNDEAD, 20},
206+ {TR_KILL_UNDEAD, "kill undead", 5, TR_SLAY_UNDEAD, 60},
207+ {TR_SLAY_DEMON, "slay demon", 5, TR_SLAY_DEMON, 20},
208+ {TR_KILL_DEMON, "kill demon", 5, TR_SLAY_DEMON, 60},
209+ {TR_SLAY_ORC, "slay orc", 5, TR_SLAY_ORC, 15},
210+ {TR_KILL_ORC, "kill orc", 5, TR_SLAY_ORC, 60},
211+ {TR_SLAY_TROLL, "slay troll", 5, TR_SLAY_TROLL, 15},
212+ {TR_KILL_TROLL, "kill troll", 5, TR_SLAY_TROLL, 60},
213+ {TR_SLAY_GIANT, "slay giant", 5, TR_SLAY_GIANT, 20},
214+ {TR_KILL_GIANT, "kill giant", 5, TR_SLAY_GIANT, 60},
215+ {TR_SLAY_DRAGON, "slay dragon", 5, TR_SLAY_DRAGON, 20},
216+ {TR_KILL_DRAGON, "kill dragon", 5, TR_SLAY_DRAGON, 60},
217+ {TR_SLAY_HUMAN, "slay human", 5, TR_SLAY_HUMAN, 20},
218+ {TR_KILL_HUMAN, "kill human", 5, TR_SLAY_HUMAN, 60},
219+
220+ {TR_ESP_ANIMAL, "sense animal", 6, TR_SLAY_ANIMAL, 40},
221+ {TR_ESP_UNDEAD, "sense undead", 6, TR_SLAY_UNDEAD, 40},
222+ {TR_ESP_DEMON, "sense demon", 6, TR_SLAY_DEMON, 40},
223+ {TR_ESP_ORC, "sense orc", 6, TR_SLAY_ORC, 40},
224+ {TR_ESP_TROLL, "sense troll", 6, TR_SLAY_TROLL, 40},
225+ {TR_ESP_GIANT, "sense giant", 6, TR_SLAY_GIANT, 40},
226+ {TR_ESP_DRAGON, "sense dragon", 6, TR_SLAY_DRAGON, 40},
227+ {TR_ESP_HUMAN, "sense human", 6, TR_SLAY_HUMAN, 40},
228+
229+ {ESSENCE_ATTACK, "weapon enchant", 10, TR_ES_ATTACK, 30},
230+ {ESSENCE_AC, "armor enchant", 10, TR_ES_AC, 15},
231+ {ESSENCE_TMP_RES_ACID, "resist acid activation", 7, TR_RES_ACID, 50},
232+ {ESSENCE_TMP_RES_ELEC, "resist electricity activation", 7, TR_RES_ELEC, 50},
233+ {ESSENCE_TMP_RES_FIRE, "resist fire activation", 7, TR_RES_FIRE, 50},
234+ {ESSENCE_TMP_RES_COLD, "resist cold activation", 7, TR_RES_COLD, 50},
235+ {ESSENCE_SH_FIRE, "fiery sheath", 7, -1, 50},
236+ {ESSENCE_SH_ELEC, "electric sheath", 7, -1, 50},
237+ {ESSENCE_SH_COLD, "sheath of coldness", 7, -1, 50},
238+ {ESSENCE_RESISTANCE, "resistance", 2, -1, 150},
239+ {ESSENCE_SUSTAIN, "elements proof", 10, -1, 10},
240+ {ESSENCE_SLAY_GLOVE, "gauntlets of slaying", 1, TR_ES_ATTACK, 200},
241+
242+ {-1, NULL, 0, -1, 0}
243+};
244+#endif
245+
246+
247+/*!
248+ * エッセンス名テーブル / Essense names for Weapon smith
249+ */
250+#ifdef JP
251+concptr essence_name[] =
252+{
253+ "腕力",
254+ "知能",
255+ "賢さ",
256+ "器用さ",
257+ "耐久力",
258+ "魅力",
259+ "魔力支配",
260+ "",
261+ "隠密",
262+ "探索",
263+ "赤外線視力",
264+ "採掘",
265+ "スピード",
266+ "追加攻撃",
267+ "カオス攻撃",
268+ "吸血攻撃",
269+ "動物倍打",
270+ "邪悪倍打",
271+ "不死倍打",
272+ "悪魔倍打",
273+ "オーク倍打",
274+ "トロル倍打",
275+ "巨人倍打",
276+ "竜倍打",
277+ "",
278+ "",
279+ "地震",
280+ "毒殺",
281+ "溶解",
282+ "電撃",
283+ "焼棄",
284+ "凍結",
285+ "能力維持",
286+ "",
287+ "",
288+ "",
289+ "",
290+ "",
291+ "",
292+ "",
293+ "免疫",
294+ "",
295+ "",
296+ "",
297+ "",
298+ "反射",
299+ "麻痺知らず",
300+ "経験値維持",
301+ "耐酸",
302+ "耐電撃",
303+ "耐火炎",
304+ "耐冷気",
305+ "耐毒",
306+ "耐恐怖",
307+ "耐閃光",
308+ "耐暗黒",
309+ "耐盲目",
310+ "耐混乱",
311+ "耐轟音",
312+ "耐破片",
313+ "耐地獄",
314+ "耐因果混乱",
315+ "耐カオス",
316+ "耐劣化",
317+ "",
318+ "",
319+ "人間倍打",
320+ "",
321+ "",
322+ "反魔法",
323+ "",
324+ "",
325+ "警告",
326+ "",
327+ "",
328+ "",
329+ "浮遊",
330+ "永久光源",
331+ "可視透明",
332+ "テレパシー",
333+ "遅消化",
334+ "急速回復",
335+ "",
336+ "",
337+ "",
338+ "",
339+ "",
340+ "",
341+ "",
342+ "",
343+ "テレポート",
344+ "",
345+ "",
346+ "攻撃",
347+ "防御",
348+
349+ NULL
350+};
351+
352+#else
353+
354+concptr essence_name[] =
355+{
356+ "strength",
357+ "intelligen.",
358+ "wisdom",
359+ "dexterity",
360+ "constitut.",
361+ "charisma",
362+ "magic mast.",
363+ "",
364+ "stealth",
365+ "serching",
366+ "infravision",
367+ "digging",
368+ "speed",
369+ "extra atk",
370+ "chaos brand",
371+ "vampiric",
372+ "slay animal",
373+ "slay evil",
374+ "slay undead",
375+ "slay demon",
376+ "slay orc",
377+ "slay troll",
378+ "slay giant",
379+ "slay dragon",
380+ "",
381+ "",
382+ "quake",
383+ "pois. brand",
384+ "acid brand",
385+ "elec. brand",
386+ "fire brand",
387+ "cold brand",
388+ "sustain",
389+ "",
390+ "",
391+ "",
392+ "",
393+ "",
394+ "",
395+ "",
396+ "immunity",
397+ "",
398+ "",
399+ "",
400+ "",
401+ "reflection",
402+ "free action",
403+ "hold exp",
404+ "res. acid",
405+ "res. elec.",
406+ "res. fire",
407+ "res. cold",
408+ "res. poison",
409+ "res. fear",
410+ "res. light",
411+ "res. dark",
412+ "res. blind",
413+ "res.confuse",
414+ "res. sound",
415+ "res. shard",
416+ "res. nether",
417+ "res. nexus",
418+ "res. chaos",
419+ "res. disen.",
420+ "",
421+ "",
422+ "slay human",
423+ "",
424+ "",
425+ "anti magic",
426+ "",
427+ "",
428+ "warning",
429+ "",
430+ "",
431+ "",
432+ "levitation",
433+ "perm. light",
434+ "see invis.",
435+ "telepathy",
436+ "slow dige.",
437+ "regen.",
438+ "",
439+ "",
440+ "",
441+ "",
442+ "",
443+ "",
444+ "",
445+ "",
446+ "teleport",
447+ "",
448+ "",
449+ "weapon enc.",
450+ "armor enc.",
451+
452+ NULL
453+};
454+#endif
455+
456+static concptr const kaji_tips[5] =
457+{
458+#ifdef JP
459+ "現在持っているエッセンスの一覧を表示する。",
460+ "アイテムからエッセンスを取り出す。エッセンスを取られたアイテムは全く魔法がかかっていない初期状態に戻る。",
461+ "既にエッセンスが付加されたアイテムからエッセンスのみ消し去る。エッセンスは手に入らない。",
462+ "アイテムにエッセンスを付加する。既にエッセンスが付加されたアイテムやアーティファクトには付加できない。",
463+ "武器や防具を強化したり、攻撃で傷つかないようにしたりする。エッセンスが付加されたアイテムやアーティファクトに対しても使用できる。",
464+#else
465+ "Display essences you have.",
466+ "Extract essences from an item. The item become non magical.",
467+ "Remove added essences from an equipment which was improved before. The removed essence will be ruined.",
468+ "Add essences to an item. The improved items or artifacts cannot be reimprove.",
469+ "Enchant an equipment or make an equiment element-proofed. The improved items and artifacts can be enchanted too.",
470+#endif
471+};
472+
473+
474+/*!
475+ * @brief 所持しているエッセンス一覧を表示する
476+ * @return なし
477+ */
478+static void display_essence(void)
479+{
480+ int i, num = 0;
481+
482+ screen_save();
483+ for (i = 1; i < 22; i++)
484+ {
485+ prt("", i, 0);
486+ }
487+ prt(_("エッセンス 個数 エッセンス 個数 エッセンス 個数",
488+ "Essence Num Essence Num Essence Num "), 1, 8);
489+ for (i = 0; essence_name[i]; i++)
490+ {
491+ if (!essence_name[i][0]) continue;
492+ prt(format("%-11s %5d", essence_name[i], p_ptr->magic_num1[i]), 2 + num % 21, 8 + num / 21 * 22);
493+ num++;
494+ }
495+ prt(_("現在所持しているエッセンス", "List of all essences you have."), 0, 0);
496+ (void)inkey();
497+ screen_load();
498+ return;
499+}
500+
501+/*!
502+ * @brief エッセンスの抽出処理
503+ * @return なし
504+ */
505+static void drain_essence(void)
506+{
507+ int drain_value[sizeof(p_ptr->magic_num1) / sizeof(s32b)];
508+ int i;
509+ OBJECT_IDX item;
510+ int dec = 4;
511+ bool observe = FALSE;
512+ int old_ds, old_dd, old_to_h, old_to_d, old_ac, old_to_a, old_pval, old_name2;
513+ TIME_EFFECT old_timeout;
514+ BIT_FLAGS old_flgs[TR_FLAG_SIZE], new_flgs[TR_FLAG_SIZE];
515+ object_type *o_ptr;
516+ concptr q, s;
517+ POSITION iy, ix;
518+ byte_hack marked;
519+ ITEM_NUMBER number;
520+ OBJECT_IDX next_o_idx;
521+ WEIGHT weight;
522+
523+ for (i = 0; i < sizeof(drain_value) / sizeof(int); i++)
524+ drain_value[i] = 0;
525+
526+ item_tester_hook = object_is_weapon_armour_ammo;
527+
528+ q = _("どのアイテムから抽出しますか?", "Extract from which item? ");
529+ s = _("抽出できるアイテムがありません。", "You have nothing you can extract from.");
530+
531+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
532+ if (!o_ptr) return;
533+
534+ if (object_is_known(o_ptr) && !object_is_nameless(o_ptr))
535+ {
536+ GAME_TEXT o_name[MAX_NLEN];
537+ object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
538+ if (!get_check(format(_("本当に%sから抽出してよろしいですか?", "Really extract from %s? "), o_name))) return;
539+ }
540+
541+ take_turn(p_ptr, 100);
542+
543+ object_flags(o_ptr, old_flgs);
544+ if (have_flag(old_flgs, TR_KILL_DRAGON)) add_flag(old_flgs, TR_SLAY_DRAGON);
545+ if (have_flag(old_flgs, TR_KILL_ANIMAL)) add_flag(old_flgs, TR_SLAY_ANIMAL);
546+ if (have_flag(old_flgs, TR_KILL_EVIL)) add_flag(old_flgs, TR_SLAY_EVIL);
547+ if (have_flag(old_flgs, TR_KILL_UNDEAD)) add_flag(old_flgs, TR_SLAY_UNDEAD);
548+ if (have_flag(old_flgs, TR_KILL_DEMON)) add_flag(old_flgs, TR_SLAY_DEMON);
549+ if (have_flag(old_flgs, TR_KILL_ORC)) add_flag(old_flgs, TR_SLAY_ORC);
550+ if (have_flag(old_flgs, TR_KILL_TROLL)) add_flag(old_flgs, TR_SLAY_TROLL);
551+ if (have_flag(old_flgs, TR_KILL_GIANT)) add_flag(old_flgs, TR_SLAY_GIANT);
552+ if (have_flag(old_flgs, TR_KILL_HUMAN)) add_flag(old_flgs, TR_SLAY_HUMAN);
553+
554+ old_to_a = o_ptr->to_a;
555+ old_ac = o_ptr->ac;
556+ old_to_h = o_ptr->to_h;
557+ old_to_d = o_ptr->to_d;
558+ old_ds = o_ptr->ds;
559+ old_dd = o_ptr->dd;
560+ old_pval = o_ptr->pval;
561+ old_name2 = o_ptr->name2;
562+ old_timeout = o_ptr->timeout;
563+ if (o_ptr->curse_flags & (TRC_CURSED | TRC_HEAVY_CURSE | TRC_PERMA_CURSE)) dec--;
564+ if (have_flag(old_flgs, TR_ADD_L_CURSE)) dec--;
565+ if (have_flag(old_flgs, TR_ADD_H_CURSE)) dec--;
566+ if (have_flag(old_flgs, TR_AGGRAVATE)) dec--;
567+ if (have_flag(old_flgs, TR_NO_TELE)) dec--;
568+ if (have_flag(old_flgs, TR_DRAIN_EXP)) dec--;
569+ if (have_flag(old_flgs, TR_DRAIN_HP)) dec--;
570+ if (have_flag(old_flgs, TR_DRAIN_MANA)) dec--;
571+ if (have_flag(old_flgs, TR_CALL_ANIMAL)) dec--;
572+ if (have_flag(old_flgs, TR_CALL_DEMON)) dec--;
573+ if (have_flag(old_flgs, TR_CALL_DRAGON)) dec--;
574+ if (have_flag(old_flgs, TR_CALL_UNDEAD)) dec--;
575+ if (have_flag(old_flgs, TR_COWARDICE)) dec--;
576+ if (have_flag(old_flgs, TR_LOW_MELEE)) dec--;
577+ if (have_flag(old_flgs, TR_LOW_AC)) dec--;
578+ if (have_flag(old_flgs, TR_LOW_MAGIC)) dec--;
579+ if (have_flag(old_flgs, TR_FAST_DIGEST)) dec--;
580+ if (have_flag(old_flgs, TR_SLOW_REGEN)) dec--;
581+ if (have_flag(old_flgs, TR_TY_CURSE)) dec--;
582+
583+ iy = o_ptr->iy;
584+ ix = o_ptr->ix;
585+ next_o_idx = o_ptr->next_o_idx;
586+ marked = o_ptr->marked;
587+ weight = o_ptr->weight;
588+ number = o_ptr->number;
589+
590+ object_prep(o_ptr, o_ptr->k_idx);
591+
592+ o_ptr->iy = iy;
593+ o_ptr->ix = ix;
594+ o_ptr->next_o_idx = next_o_idx;
595+ o_ptr->marked = marked;
596+ o_ptr->number = number;
597+ if (o_ptr->tval == TV_DRAG_ARMOR) o_ptr->timeout = old_timeout;
598+ if (item >= 0) p_ptr->total_weight += (o_ptr->weight*o_ptr->number - weight * number);
599+ o_ptr->ident |= (IDENT_MENTAL);
600+ object_aware(o_ptr);
601+ object_known(o_ptr);
602+
603+ object_flags(o_ptr, new_flgs);
604+
605+ for (i = 0; essence_info[i].add_name; i++)
606+ {
607+ essence_type *es_ptr = &essence_info[i];
608+ PARAMETER_VALUE pval = 0;
609+
610+ if (es_ptr->add < TR_FLAG_MAX && is_pval_flag(es_ptr->add) && old_pval)
611+ pval = (have_flag(new_flgs, es_ptr->add)) ? old_pval - o_ptr->pval : old_pval;
612+
613+ if (es_ptr->add < TR_FLAG_MAX &&
614+ (!have_flag(new_flgs, es_ptr->add) || pval) &&
615+ have_flag(old_flgs, es_ptr->add))
616+ {
617+ if (pval)
618+ {
619+ drain_value[es_ptr->essence] += 10 * pval;
620+ }
621+ else if (es_ptr->essence != -2)
622+ {
623+ drain_value[es_ptr->essence] += 10;
624+ }
625+ else if (es_ptr->add == TR_SH_FIRE)
626+ {
627+ drain_value[TR_BRAND_FIRE] += 10;
628+ drain_value[TR_RES_FIRE] += 10;
629+ }
630+ else if (es_ptr->add == TR_SH_ELEC)
631+ {
632+ drain_value[TR_BRAND_ELEC] += 10;
633+ drain_value[TR_RES_ELEC] += 10;
634+ }
635+ else if (es_ptr->add == TR_SH_COLD)
636+ {
637+ drain_value[TR_BRAND_COLD] += 10;
638+ drain_value[TR_RES_COLD] += 10;
639+ }
640+ else if (es_ptr->add == TR_LITE_2)
641+ {
642+ drain_value[TR_LITE_1] += 20;
643+ }
644+ else if (es_ptr->add == TR_LITE_3)
645+ {
646+ drain_value[TR_LITE_1] += 30;
647+ }
648+ }
649+ }
650+
651+ if ((have_flag(old_flgs, TR_FORCE_WEAPON)) && !(have_flag(new_flgs, TR_FORCE_WEAPON)))
652+ {
653+ drain_value[TR_INT] += 5;
654+ drain_value[TR_WIS] += 5;
655+ }
656+ if ((have_flag(old_flgs, TR_VORPAL)) && !(have_flag(new_flgs, TR_VORPAL)))
657+ {
658+ drain_value[TR_BRAND_POIS] += 5;
659+ drain_value[TR_BRAND_ACID] += 5;
660+ drain_value[TR_BRAND_ELEC] += 5;
661+ drain_value[TR_BRAND_FIRE] += 5;
662+ drain_value[TR_BRAND_COLD] += 5;
663+ }
664+ if ((have_flag(old_flgs, TR_DEC_MANA)) && !(have_flag(new_flgs, TR_DEC_MANA)))
665+ {
666+ drain_value[TR_INT] += 10;
667+ }
668+ if ((have_flag(old_flgs, TR_XTRA_MIGHT)) && !(have_flag(new_flgs, TR_XTRA_MIGHT)))
669+ {
670+ drain_value[TR_STR] += 10;
671+ }
672+ if ((have_flag(old_flgs, TR_XTRA_SHOTS)) && !(have_flag(new_flgs, TR_XTRA_SHOTS)))
673+ {
674+ drain_value[TR_DEX] += 10;
675+ }
676+ if (old_name2 == EGO_2WEAPON)
677+ {
678+ drain_value[TR_DEX] += 20;
679+ }
680+ if (object_is_weapon_ammo(o_ptr))
681+ {
682+ if (old_ds > o_ptr->ds) drain_value[TR_ES_ATTACK] += (old_ds - o_ptr->ds) * 10;
683+
684+ if (old_dd > o_ptr->dd) drain_value[TR_ES_ATTACK] += (old_dd - o_ptr->dd) * 10;
685+ }
686+ if (old_to_h > o_ptr->to_h) drain_value[TR_ES_ATTACK] += (old_to_h - o_ptr->to_h) * 10;
687+ if (old_to_d > o_ptr->to_d) drain_value[TR_ES_ATTACK] += (old_to_d - o_ptr->to_d) * 10;
688+ if (old_ac > o_ptr->ac) drain_value[TR_ES_AC] += (old_ac - o_ptr->ac) * 10;
689+ if (old_to_a > o_ptr->to_a) drain_value[TR_ES_AC] += (old_to_a - o_ptr->to_a) * 10;
690+
691+ for (i = 0; i < sizeof(drain_value) / sizeof(int); i++)
692+ {
693+ drain_value[i] *= number;
694+ drain_value[i] = drain_value[i] * dec / 4;
695+ drain_value[i] = MAX(drain_value[i], 0);
696+ if ((o_ptr->tval >= TV_SHOT) && (o_ptr->tval <= TV_BOLT)) drain_value[i] /= 10;
697+ if (drain_value[i])
698+ {
699+ observe = TRUE;
700+ }
701+ }
702+ if (!observe)
703+ {
704+ msg_print(_("エッセンスは抽出できませんでした。", "You were not able to extract any essence."));
705+ }
706+ else
707+ {
708+ msg_print(_("抽出したエッセンス:", "Extracted essences:"));
709+
710+ for (i = 0; essence_name[i]; i++)
711+ {
712+ if (!essence_name[i][0]) continue;
713+ if (!drain_value[i]) continue;
714+
715+ p_ptr->magic_num1[i] += drain_value[i];
716+ p_ptr->magic_num1[i] = MIN(20000, p_ptr->magic_num1[i]);
717+ msg_print(NULL);
718+ msg_format("%s...%d%s", essence_name[i], drain_value[i], _("。", ". "));
719+ }
720+ }
721+
722+ /* Apply autodestroy/inscription to the drained item */
723+ autopick_alter_item(item, TRUE);
724+ p_ptr->update |= (PU_COMBINE | PU_REORDER);
725+ p_ptr->window |= (PW_INVEN);
726+}
727+
728+/*!
729+ * @brief 付加するエッセンスの大別を選択する
730+ * @return 選んだエッセンスの大別ID
731+ */
732+static COMMAND_CODE choose_essence(void)
733+{
734+ COMMAND_CODE mode = 0;
735+ char choice;
736+ COMMAND_CODE menu_line = (use_menu ? 1 : 0);
737+
738+#ifdef JP
739+ concptr menu_name[] = {
740+ "武器属性",
741+ "耐性",
742+ "能力",
743+ "数値",
744+ "スレイ",
745+ "ESP",
746+ "その他"
747+ };
748+#else
749+ concptr menu_name[] = {
750+ "Brand weapon",
751+ "Resistance",
752+ "Ability",
753+ "Magic number",
754+ "Slay",
755+ "ESP",
756+ "Others"
757+ };
758+#endif
759+ const COMMAND_CODE mode_max = 7;
760+
761+ if (repeat_pull(&mode) && 1 <= mode && mode <= mode_max)
762+ return mode;
763+ mode = 0;
764+ if (use_menu)
765+ {
766+ screen_save();
767+
768+ while (!mode)
769+ {
770+ int i;
771+ for (i = 0; i < mode_max; i++)
772+#ifdef JP
773+ prt(format(" %s %s", (menu_line == 1 + i) ? "》" : " ", menu_name[i]), 2 + i, 14);
774+ prt("どの種類のエッセンス付加を行いますか?", 0, 0);
775+#else
776+ prt(format(" %s %s", (menu_line == 1 + i) ? "> " : " ", menu_name[i]), 2 + i, 14);
777+ prt("Choose from menu.", 0, 0);
778+#endif
779+
780+ choice = inkey();
781+ switch (choice)
782+ {
783+ case ESCAPE:
784+ case 'z':
785+ case 'Z':
786+ screen_load();
787+ return 0;
788+ case '2':
789+ case 'j':
790+ case 'J':
791+ menu_line++;
792+ break;
793+ case '8':
794+ case 'k':
795+ case 'K':
796+ menu_line += mode_max - 1;
797+ break;
798+ case '\r':
799+ case '\n':
800+ case 'x':
801+ case 'X':
802+ mode = menu_line;
803+ break;
804+ }
805+ if (menu_line > mode_max) menu_line -= mode_max;
806+ }
807+ screen_load();
808+ }
809+ else
810+ {
811+ screen_save();
812+ while (!mode)
813+ {
814+ int i;
815+
816+ for (i = 0; i < mode_max; i++)
817+ prt(format(" %c) %s", 'a' + i, menu_name[i]), 2 + i, 14);
818+
819+ if (!get_com(_("何を付加しますか:", "Command :"), &choice, TRUE))
820+ {
821+ screen_load();
822+ return 0;
823+ }
824+
825+ if (isupper(choice)) choice = (char)tolower(choice);
826+
827+ if ('a' <= choice && choice <= 'a' + (char)mode_max - 1)
828+ mode = (int)choice - 'a' + 1;
829+ }
830+ screen_load();
831+ }
832+
833+ repeat_push(mode);
834+ return mode;
835+}
836+
837+/*!
838+ * @brief エッセンスを実際に付加する
839+ * @param mode エッセンスの大別ID
840+ * @return なし
841+ */
842+static void add_essence(ESSENCE_IDX mode)
843+{
844+ OBJECT_IDX item;
845+ int max_num = 0;
846+ COMMAND_CODE i;
847+ bool flag, redraw;
848+ char choice;
849+ concptr q, s;
850+ object_type *o_ptr;
851+ int ask = TRUE;
852+ char out_val[160];
853+ int num[22];
854+ GAME_TEXT o_name[MAX_NLEN];
855+ int use_essence;
856+ essence_type *es_ptr;
857+ bool able[22] = { 0 };
858+
859+ int menu_line = (use_menu ? 1 : 0);
860+
861+ for (i = 0; essence_info[i].add_name; i++)
862+ {
863+ es_ptr = &essence_info[i];
864+
865+ if (es_ptr->type != mode) continue;
866+ num[max_num++] = i;
867+ }
868+
869+ if (!repeat_pull(&i) || i < 0 || i >= max_num)
870+ {
871+
872+ /* Nothing chosen yet */
873+ flag = FALSE;
874+
875+ /* No redraw yet */
876+ redraw = FALSE;
877+
878+ /* Build a prompt */
879+ (void)strnfmt(out_val, 78, _("('*'で一覧, ESCで中断) どの能力を付加しますか?", "(*=List, ESC=exit) Add which ability? "));
880+ if (use_menu) screen_save();
881+
882+ /* Get a spell from the user */
883+
884+ choice = (always_show_list || use_menu) ? ESCAPE : 1;
885+ while (!flag)
886+ {
887+ if (choice == ESCAPE) choice = ' ';
888+ else if (!get_com(out_val, &choice, FALSE))break;
889+
890+ if (use_menu && choice != ' ')
891+ {
892+ switch (choice)
893+ {
894+ case '0':
895+ {
896+ screen_load();
897+ return;
898+ }
899+
900+ case '8':
901+ case 'k':
902+ case 'K':
903+ {
904+ menu_line += (max_num - 1);
905+ break;
906+ }
907+
908+ case '2':
909+ case 'j':
910+ case 'J':
911+ {
912+ menu_line++;
913+ break;
914+ }
915+
916+ case '4':
917+ case 'h':
918+ case 'H':
919+ {
920+ menu_line = 1;
921+ break;
922+ }
923+ case '6':
924+ case 'l':
925+ case 'L':
926+ {
927+ menu_line = max_num;
928+ break;
929+ }
930+
931+ case 'x':
932+ case 'X':
933+ case '\r':
934+ case '\n':
935+ {
936+ i = menu_line - 1;
937+ ask = FALSE;
938+ break;
939+ }
940+ }
941+ if (menu_line > max_num) menu_line -= max_num;
942+ }
943+ /* Request redraw */
944+ if ((choice == ' ') || (choice == '*') || (choice == '?') || (use_menu && ask))
945+ {
946+ /* Show the list */
947+ if (!redraw || use_menu)
948+ {
949+ byte y, x = 10;
950+ int ctr;
951+ char dummy[80], dummy2[80];
952+ byte col;
953+
954+ strcpy(dummy, "");
955+ redraw = TRUE;
956+ if (!use_menu) screen_save();
957+
958+ for (y = 1; y < 24; y++)
959+ prt("", y, x);
960+
961+ /* Print header(s) */
962+#ifdef JP
963+ prt(format(" %-43s %6s/%s", "能力(必要エッセンス)", "必要数", "所持数"), 1, x);
964+
965+#else
966+ prt(format(" %-43s %6s/%s", "Ability (needed essence)", "Needs", "Possess"), 1, x);
967+#endif
968+ /* Print list */
969+ for (ctr = 0; ctr < max_num; ctr++)
970+ {
971+ es_ptr = &essence_info[num[ctr]];
972+
973+ if (use_menu)
974+ {
975+ if (ctr == (menu_line - 1))
976+ strcpy(dummy, _("》 ", "> "));
977+ else strcpy(dummy, " ");
978+
979+ }
980+ /* letter/number for power selection */
981+ else
982+ {
983+ sprintf(dummy, "%c) ", I2A(ctr));
984+ }
985+
986+ strcat(dummy, es_ptr->add_name);
987+
988+ col = TERM_WHITE;
989+ able[ctr] = TRUE;
990+
991+ if (es_ptr->essence != -1)
992+ {
993+ strcat(dummy, format("(%s)", essence_name[es_ptr->essence]));
994+ if (p_ptr->magic_num1[es_ptr->essence] < es_ptr->value) able[ctr] = FALSE;
995+ }
996+ else
997+ {
998+ switch (es_ptr->add)
999+ {
1000+ case ESSENCE_SH_FIRE:
1001+ strcat(dummy, _("(焼棄+耐火炎)", "(brand fire + res.fire)"));
1002+ if (p_ptr->magic_num1[TR_BRAND_FIRE] < es_ptr->value) able[ctr] = FALSE;
1003+ if (p_ptr->magic_num1[TR_RES_FIRE] < es_ptr->value) able[ctr] = FALSE;
1004+ break;
1005+ case ESSENCE_SH_ELEC:
1006+ strcat(dummy, _("(電撃+耐電撃)", "(brand elec. + res. elec.)"));
1007+ if (p_ptr->magic_num1[TR_BRAND_ELEC] < es_ptr->value) able[ctr] = FALSE;
1008+ if (p_ptr->magic_num1[TR_RES_ELEC] < es_ptr->value) able[ctr] = FALSE;
1009+ break;
1010+ case ESSENCE_SH_COLD:
1011+ strcat(dummy, _("(凍結+耐冷気)", "(brand cold + res. cold)"));
1012+ if (p_ptr->magic_num1[TR_BRAND_COLD] < es_ptr->value) able[ctr] = FALSE;
1013+ if (p_ptr->magic_num1[TR_RES_COLD] < es_ptr->value) able[ctr] = FALSE;
1014+ break;
1015+ case ESSENCE_RESISTANCE:
1016+ strcat(dummy, _("(耐火炎+耐冷気+耐電撃+耐酸)", "(r.fire+r.cold+r.elec+r.acid)"));
1017+ if (p_ptr->magic_num1[TR_RES_FIRE] < es_ptr->value) able[ctr] = FALSE;
1018+ if (p_ptr->magic_num1[TR_RES_COLD] < es_ptr->value) able[ctr] = FALSE;
1019+ if (p_ptr->magic_num1[TR_RES_ELEC] < es_ptr->value) able[ctr] = FALSE;
1020+ if (p_ptr->magic_num1[TR_RES_ACID] < es_ptr->value) able[ctr] = FALSE;
1021+ break;
1022+ case ESSENCE_SUSTAIN:
1023+ strcat(dummy, _("(耐火炎+耐冷気+耐電撃+耐酸)", "(r.fire+r.cold+r.elec+r.acid)"));
1024+ if (p_ptr->magic_num1[TR_RES_FIRE] < es_ptr->value) able[ctr] = FALSE;
1025+ if (p_ptr->magic_num1[TR_RES_COLD] < es_ptr->value) able[ctr] = FALSE;
1026+ if (p_ptr->magic_num1[TR_RES_ELEC] < es_ptr->value) able[ctr] = FALSE;
1027+ if (p_ptr->magic_num1[TR_RES_ACID] < es_ptr->value) able[ctr] = FALSE;
1028+ break;
1029+ }
1030+ }
1031+
1032+ if (!able[ctr]) col = TERM_RED;
1033+
1034+ if (es_ptr->essence != -1)
1035+ {
1036+ sprintf(dummy2, "%-49s %3d/%d", dummy, es_ptr->value, (int)p_ptr->magic_num1[es_ptr->essence]);
1037+ }
1038+ else
1039+ {
1040+ sprintf(dummy2, "%-49s %3d/(\?\?)", dummy, es_ptr->value);
1041+ }
1042+
1043+ c_prt(col, dummy2, ctr + 2, x);
1044+ }
1045+ }
1046+
1047+ /* Hide the list */
1048+ else
1049+ {
1050+ /* Hide list */
1051+ redraw = FALSE;
1052+ screen_load();
1053+ }
1054+
1055+ /* Redo asking */
1056+ continue;
1057+ }
1058+
1059+ if (!use_menu)
1060+ {
1061+ /* Note verify */
1062+ ask = (isupper(choice));
1063+
1064+ /* Lowercase */
1065+ if (ask) choice = (char)tolower(choice);
1066+
1067+ /* Extract request */
1068+ i = (islower(choice) ? A2I(choice) : -1);
1069+ }
1070+
1071+ /* Totally Illegal */
1072+ if ((i < 0) || (i >= max_num) || !able[i])
1073+ {
1074+ bell();
1075+ continue;
1076+ }
1077+
1078+ /* Verify it */
1079+ if (ask)
1080+ {
1081+ char tmp_val[160];
1082+
1083+ /* Prompt */
1084+ (void)strnfmt(tmp_val, 78, _("%sを付加しますか? ", "Add the abilitiy of %s? "), essence_info[num[i]].add_name);
1085+
1086+ /* Belay that order */
1087+ if (!get_check(tmp_val)) continue;
1088+ }
1089+
1090+ /* Stop the loop */
1091+ flag = TRUE;
1092+ }
1093+ if (redraw) screen_load();
1094+
1095+ if (!flag) return;
1096+
1097+ repeat_push(i);
1098+ }
1099+ es_ptr = &essence_info[num[i]];
1100+
1101+ if (es_ptr->add == ESSENCE_SLAY_GLOVE)
1102+ item_tester_tval = TV_GLOVES;
1103+ else if (mode == 1 || mode == 5)
1104+ item_tester_hook = item_tester_hook_melee_ammo;
1105+ else if (es_ptr->add == ESSENCE_ATTACK)
1106+ item_tester_hook = object_allow_enchant_weapon;
1107+ else if (es_ptr->add == ESSENCE_AC)
1108+ item_tester_hook = object_is_armour;
1109+ else
1110+ item_tester_hook = object_is_weapon_armour_ammo;
1111+
1112+ q = _("どのアイテムを改良しますか?", "Improve which item? ");
1113+ s = _("改良できるアイテムがありません。", "You have nothing to improve.");
1114+
1115+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
1116+ if (!o_ptr) return;
1117+
1118+ if ((mode != 10) && (object_is_artifact(o_ptr) || object_is_smith(o_ptr)))
1119+ {
1120+ msg_print(_("そのアイテムはこれ以上改良できない。", "This item is no more able to be improved."));
1121+ return;
1122+ }
1123+
1124+ object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1125+
1126+ use_essence = es_ptr->value;
1127+ if ((o_ptr->tval >= TV_SHOT) && (o_ptr->tval <= TV_BOLT)) use_essence = (use_essence + 9) / 10;
1128+ if (o_ptr->number > 1)
1129+ {
1130+ use_essence *= o_ptr->number;
1131+ msg_format(_("%d個あるのでエッセンスは%d必要です。", "It will take %d essences."), o_ptr->number, use_essence);
1132+ }
1133+
1134+ if (es_ptr->essence != -1)
1135+ {
1136+ if (p_ptr->magic_num1[es_ptr->essence] < use_essence)
1137+ {
1138+ msg_print(_("エッセンスが足りない。", "You don't have enough essences."));
1139+ return;
1140+ }
1141+ if (is_pval_flag(es_ptr->add))
1142+ {
1143+ if (o_ptr->pval < 0)
1144+ {
1145+ msg_print(_("このアイテムの能力修正を強化することはできない。", "You cannot increase magic number of this item."));
1146+ return;
1147+ }
1148+ else if (es_ptr->add == TR_BLOWS)
1149+ {
1150+ if (o_ptr->pval > 1)
1151+ {
1152+ if (!get_check(_("修正値は1になります。よろしいですか?", "The magic number of this weapon will become 1. Are you sure? "))) return;
1153+ }
1154+
1155+ o_ptr->pval = 1;
1156+ msg_format(_("エッセンスを%d個使用します。", "It will take %d essences."), use_essence);
1157+ }
1158+ else if (o_ptr->pval > 0)
1159+ {
1160+ use_essence *= o_ptr->pval;
1161+ msg_format(_("エッセンスを%d個使用します。", "It will take %d essences."), use_essence);
1162+ }
1163+ else
1164+ {
1165+ char tmp[80];
1166+ char tmp_val[160];
1167+ PARAMETER_VALUE pval;
1168+ PARAMETER_VALUE limit = MIN(5, p_ptr->magic_num1[es_ptr->essence] / es_ptr->value);
1169+
1170+ sprintf(tmp, _("いくつ付加しますか? (1-%d): ", "Enchant how many? (1-%d): "), limit);
1171+ strcpy(tmp_val, "1");
1172+
1173+ if (!get_string(tmp, tmp_val, 1)) return;
1174+ pval = (PARAMETER_VALUE)atoi(tmp_val);
1175+ if (pval > limit) pval = limit;
1176+ else if (pval < 1) pval = 1;
1177+ o_ptr->pval += pval;
1178+ use_essence *= pval;
1179+ msg_format(_("エッセンスを%d個使用します。", "It will take %d essences."), use_essence);
1180+ }
1181+
1182+ if (p_ptr->magic_num1[es_ptr->essence] < use_essence)
1183+ {
1184+ msg_print(_("エッセンスが足りない。", "You don't have enough essences."));
1185+ return;
1186+ }
1187+ }
1188+ else if (es_ptr->add == ESSENCE_SLAY_GLOVE)
1189+ {
1190+ char tmp_val[160];
1191+ int val;
1192+ HIT_PROB get_to_h;
1193+ HIT_POINT get_to_d;
1194+
1195+ strcpy(tmp_val, "1");
1196+ if (!get_string(format(_("いくつ付加しますか? (1-%d):", "Enchant how many? (1-%d):"), p_ptr->lev / 7 + 3), tmp_val, 2)) return;
1197+ val = atoi(tmp_val);
1198+ if (val > p_ptr->lev / 7 + 3) val = p_ptr->lev / 7 + 3;
1199+ else if (val < 1) val = 1;
1200+ use_essence *= val;
1201+ msg_format(_("エッセンスを%d個使用します。", "It will take %d essences."), use_essence);
1202+ if (p_ptr->magic_num1[es_ptr->essence] < use_essence)
1203+ {
1204+ msg_print(_("エッセンスが足りない。", "You don't have enough essences."));
1205+ return;
1206+ }
1207+ get_to_h = ((val + 1) / 2 + randint0(val / 2 + 1));
1208+ get_to_d = ((val + 1) / 2 + randint0(val / 2 + 1));
1209+ o_ptr->xtra4 = (get_to_h << 8) + get_to_d;
1210+ o_ptr->to_h += get_to_h;
1211+ o_ptr->to_d += get_to_d;
1212+ }
1213+ p_ptr->magic_num1[es_ptr->essence] -= use_essence;
1214+ if (es_ptr->add == ESSENCE_ATTACK)
1215+ {
1216+ if ((o_ptr->to_h >= p_ptr->lev / 5 + 5) && (o_ptr->to_d >= p_ptr->lev / 5 + 5))
1217+ {
1218+ msg_print(_("改良に失敗した。", "You failed to enchant."));
1219+ take_turn(p_ptr, 100);
1220+ return;
1221+ }
1222+ else
1223+ {
1224+ if (o_ptr->to_h < p_ptr->lev / 5 + 5) o_ptr->to_h++;
1225+ if (o_ptr->to_d < p_ptr->lev / 5 + 5) o_ptr->to_d++;
1226+ }
1227+ }
1228+ else if (es_ptr->add == ESSENCE_AC)
1229+ {
1230+ if (o_ptr->to_a >= p_ptr->lev / 5 + 5)
1231+ {
1232+ msg_print(_("改良に失敗した。", "You failed to enchant."));
1233+ take_turn(p_ptr, 100);
1234+ return;
1235+ }
1236+ else
1237+ {
1238+ if (o_ptr->to_a < p_ptr->lev / 5 + 5) o_ptr->to_a++;
1239+ }
1240+ }
1241+ else
1242+ {
1243+ o_ptr->xtra3 = es_ptr->add + 1;
1244+ }
1245+ }
1246+ else
1247+ {
1248+ bool success = TRUE;
1249+
1250+ switch (es_ptr->add)
1251+ {
1252+ case ESSENCE_SH_FIRE:
1253+ if ((p_ptr->magic_num1[TR_BRAND_FIRE] < use_essence) || (p_ptr->magic_num1[TR_RES_FIRE] < use_essence))
1254+ {
1255+ success = FALSE;
1256+ break;
1257+ }
1258+ p_ptr->magic_num1[TR_BRAND_FIRE] -= use_essence;
1259+ p_ptr->magic_num1[TR_RES_FIRE] -= use_essence;
1260+ break;
1261+ case ESSENCE_SH_ELEC:
1262+ if ((p_ptr->magic_num1[TR_BRAND_ELEC] < use_essence) || (p_ptr->magic_num1[TR_RES_ELEC] < use_essence))
1263+ {
1264+ success = FALSE;
1265+ break;
1266+ }
1267+ p_ptr->magic_num1[TR_BRAND_ELEC] -= use_essence;
1268+ p_ptr->magic_num1[TR_RES_ELEC] -= use_essence;
1269+ break;
1270+ case ESSENCE_SH_COLD:
1271+ if ((p_ptr->magic_num1[TR_BRAND_COLD] < use_essence) || (p_ptr->magic_num1[TR_RES_COLD] < use_essence))
1272+ {
1273+ success = FALSE;
1274+ break;
1275+ }
1276+ p_ptr->magic_num1[TR_BRAND_COLD] -= use_essence;
1277+ p_ptr->magic_num1[TR_RES_COLD] -= use_essence;
1278+ break;
1279+ case ESSENCE_RESISTANCE:
1280+ case ESSENCE_SUSTAIN:
1281+ if ((p_ptr->magic_num1[TR_RES_ACID] < use_essence) || (p_ptr->magic_num1[TR_RES_ELEC] < use_essence) || (p_ptr->magic_num1[TR_RES_FIRE] < use_essence) || (p_ptr->magic_num1[TR_RES_COLD] < use_essence))
1282+ {
1283+ success = FALSE;
1284+ break;
1285+ }
1286+ p_ptr->magic_num1[TR_RES_ACID] -= use_essence;
1287+ p_ptr->magic_num1[TR_RES_ELEC] -= use_essence;
1288+ p_ptr->magic_num1[TR_RES_FIRE] -= use_essence;
1289+ p_ptr->magic_num1[TR_RES_COLD] -= use_essence;
1290+ break;
1291+ }
1292+ if (!success)
1293+ {
1294+ msg_print(_("エッセンスが足りない。", "You don't have enough essences."));
1295+ return;
1296+ }
1297+ if (es_ptr->add == ESSENCE_SUSTAIN)
1298+ {
1299+ add_flag(o_ptr->art_flags, TR_IGNORE_ACID);
1300+ add_flag(o_ptr->art_flags, TR_IGNORE_ELEC);
1301+ add_flag(o_ptr->art_flags, TR_IGNORE_FIRE);
1302+ add_flag(o_ptr->art_flags, TR_IGNORE_COLD);
1303+ }
1304+ else
1305+ {
1306+ o_ptr->xtra3 = es_ptr->add + 1;
1307+ }
1308+ }
1309+
1310+ take_turn(p_ptr, 100);
1311+
1312+#ifdef JP
1313+ msg_format(_("%sに%sの能力を付加しました。", "You have added ability of %s to %s."), o_name, es_ptr->add_name);
1314+#else
1315+ msg_format(, es_ptr->add_name, o_name);
1316+#endif
1317+ p_ptr->update |= (PU_COMBINE | PU_REORDER);
1318+ p_ptr->window |= (PW_INVEN);
1319+}
1320+
1321+/*!
1322+ * @brief エッセンスを消去する
1323+ * @return なし
1324+ */
1325+static void erase_essence(void)
1326+{
1327+ OBJECT_IDX item;
1328+ concptr q, s;
1329+ object_type *o_ptr;
1330+ GAME_TEXT o_name[MAX_NLEN];
1331+ BIT_FLAGS flgs[TR_FLAG_SIZE];
1332+
1333+ item_tester_hook = object_is_smith;
1334+
1335+ q = _("どのアイテムのエッセンスを消去しますか?", "Remove from which item? ");
1336+ s = _("エッセンスを付加したアイテムがありません。", "You have nothing to remove essence.");
1337+
1338+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
1339+ if (!o_ptr) return;
1340+
1341+ object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1342+ if (!get_check(format(_("よろしいですか? [%s]", "Are you sure? [%s]"), o_name))) return;
1343+
1344+ take_turn(p_ptr, 100);
1345+
1346+ if (o_ptr->xtra3 == 1 + ESSENCE_SLAY_GLOVE)
1347+ {
1348+ o_ptr->to_h -= (o_ptr->xtra4 >> 8);
1349+ o_ptr->to_d -= (o_ptr->xtra4 & 0x000f);
1350+ o_ptr->xtra4 = 0;
1351+ if (o_ptr->to_h < 0) o_ptr->to_h = 0;
1352+ if (o_ptr->to_d < 0) o_ptr->to_d = 0;
1353+ }
1354+ o_ptr->xtra3 = 0;
1355+ object_flags(o_ptr, flgs);
1356+ if (!(have_pval_flags(flgs))) o_ptr->pval = 0;
1357+ msg_print(_("エッセンスを取り去った。", "You removed all essence you have added."));
1358+ p_ptr->update |= (PU_COMBINE | PU_REORDER);
1359+ p_ptr->window |= (PW_INVEN);
1360+}
1361+
1362+/*!
1363+ * @brief 鍛冶コマンドのメインルーチン
1364+ * @param only_browse TRUEならばエッセンス一覧の表示のみを行う
1365+ * @return なし
1366+ */
1367+void do_cmd_kaji(bool only_browse)
1368+{
1369+ COMMAND_CODE mode = 0;
1370+ char choice;
1371+
1372+ COMMAND_CODE menu_line = (use_menu ? 1 : 0);
1373+
1374+ if (!only_browse)
1375+ {
1376+ if (cmd_limit_confused(p_ptr)) return;
1377+ if (p_ptr->blind)
1378+ {
1379+ msg_print(_("目が見えなくて作業できない!", "You are blind!"));
1380+ return;
1381+ }
1382+ if (p_ptr->image)
1383+ {
1384+ msg_print(_("うまく見えなくて作業できない!", "You are hallucinating!"));
1385+ return;
1386+ }
1387+ }
1388+
1389+ if (!(repeat_pull(&mode) && 1 <= mode && mode <= 5))
1390+ {
1391+ if (only_browse) screen_save();
1392+ do {
1393+ if (!only_browse) screen_save();
1394+ if (use_menu)
1395+ {
1396+ while (!mode)
1397+ {
1398+#ifdef JP
1399+ prt(format(" %s エッセンス一覧", (menu_line == 1) ? "》" : " "), 2, 14);
1400+ prt(format(" %s エッセンス抽出", (menu_line == 2) ? "》" : " "), 3, 14);
1401+ prt(format(" %s エッセンス消去", (menu_line == 3) ? "》" : " "), 4, 14);
1402+ prt(format(" %s エッセンス付加", (menu_line == 4) ? "》" : " "), 5, 14);
1403+ prt(format(" %s 武器/防具強化", (menu_line == 5) ? "》" : " "), 6, 14);
1404+ prt(format("どの種類の技術を%sますか?", only_browse ? "調べ" : "使い"), 0, 0);
1405+#else
1406+ prt(format(" %s List essences", (menu_line == 1) ? "> " : " "), 2, 14);
1407+ prt(format(" %s Extract essence", (menu_line == 2) ? "> " : " "), 3, 14);
1408+ prt(format(" %s Remove essence", (menu_line == 3) ? "> " : " "), 4, 14);
1409+ prt(format(" %s Add essence", (menu_line == 4) ? "> " : " "), 5, 14);
1410+ prt(format(" %s Enchant weapon/armor", (menu_line == 5) ? "> " : " "), 6, 14);
1411+ prt(format("Choose command from menu."), 0, 0);
1412+#endif
1413+ choice = inkey();
1414+ switch (choice)
1415+ {
1416+ case ESCAPE:
1417+ case 'z':
1418+ case 'Z':
1419+ screen_load();
1420+ return;
1421+ case '2':
1422+ case 'j':
1423+ case 'J':
1424+ menu_line++;
1425+ break;
1426+ case '8':
1427+ case 'k':
1428+ case 'K':
1429+ menu_line += 4;
1430+ break;
1431+ case '\r':
1432+ case '\n':
1433+ case 'x':
1434+ case 'X':
1435+ mode = menu_line;
1436+ break;
1437+ }
1438+ if (menu_line > 5) menu_line -= 5;
1439+ }
1440+ }
1441+
1442+ else
1443+ {
1444+ while (!mode)
1445+ {
1446+ prt(_(" a) エッセンス一覧", " a) List essences"), 2, 14);
1447+ prt(_(" b) エッセンス抽出", " b) Extract essence"), 3, 14);
1448+ prt(_(" c) エッセンス消去", " c) Remove essence"), 4, 14);
1449+ prt(_(" d) エッセンス付加", " d) Add essence"), 5, 14);
1450+ prt(_(" e) 武器/防具強化", " e) Enchant weapon/armor"), 6, 14);
1451+#ifdef JP
1452+ if (!get_com(format("どの能力を%sますか:", only_browse ? "調べ" : "使い"), &choice, TRUE))
1453+#else
1454+ if (!get_com("Command :", &choice, TRUE))
1455+#endif
1456+ {
1457+ screen_load();
1458+ return;
1459+ }
1460+ switch (choice)
1461+ {
1462+ case 'A':
1463+ case 'a':
1464+ mode = 1;
1465+ break;
1466+ case 'B':
1467+ case 'b':
1468+ mode = 2;
1469+ break;
1470+ case 'C':
1471+ case 'c':
1472+ mode = 3;
1473+ break;
1474+ case 'D':
1475+ case 'd':
1476+ mode = 4;
1477+ break;
1478+ case 'E':
1479+ case 'e':
1480+ mode = 5;
1481+ break;
1482+ }
1483+ }
1484+ }
1485+
1486+ if (only_browse)
1487+ {
1488+ char temp[62 * 5];
1489+ int line, j;
1490+
1491+ /* Clear lines, position cursor (really should use strlen here) */
1492+ Term_erase(14, 21, 255);
1493+ Term_erase(14, 20, 255);
1494+ Term_erase(14, 19, 255);
1495+ Term_erase(14, 18, 255);
1496+ Term_erase(14, 17, 255);
1497+ Term_erase(14, 16, 255);
1498+
1499+ roff_to_buf(kaji_tips[mode - 1], 62, temp, sizeof(temp));
1500+ for (j = 0, line = 17; temp[j]; j += (1 + strlen(&temp[j])))
1501+ {
1502+ prt(&temp[j], line, 15);
1503+ line++;
1504+ }
1505+ mode = 0;
1506+ }
1507+ if (!only_browse) screen_load();
1508+ } while (only_browse);
1509+ repeat_push(mode);
1510+ }
1511+ switch (mode)
1512+ {
1513+ case 1: display_essence(); break;
1514+ case 2: drain_essence(); break;
1515+ case 3: erase_essence(); break;
1516+ case 4:
1517+ mode = choose_essence();
1518+ if (mode == 0)
1519+ break;
1520+ add_essence(mode);
1521+ break;
1522+ case 5: add_essence(10); break;
1523+ }
1524+}
--- /dev/null
+++ b/src/cmd-smith.h
@@ -0,0 +1,3 @@
1+#pragma once
2+
3+extern void do_cmd_kaji(bool only_browse);
--- a/src/dungeon.c
+++ b/src/dungeon.c
@@ -17,6 +17,7 @@
1717 #include "cmd-magiceat.h"
1818 #include "cmd-quaff.h"
1919 #include "cmd-read.h"
20+#include "cmd-smith.h"
2021 #include "cmd-usestaff.h"
2122 #include "cmd-zaprod.h"
2223 #include "cmd-zapwand.h"
--- a/src/externs.h
+++ b/src/externs.h
@@ -785,7 +785,6 @@ extern void reorder_pack(void);
785785 extern void display_koff(KIND_OBJECT_IDX k_idx);
786786 extern object_type *choose_warning_item(void);
787787 extern bool process_warning(POSITION xx, POSITION yy);
788-extern void do_cmd_kaji(bool only_browse);
789788 extern void torch_flags(object_type *o_ptr, BIT_FLAGS *flgs);
790789 extern void torch_dice(object_type *o_ptr, DICE_NUMBER *dd, DICE_SID *ds);
791790 extern void torch_lost_fuel(object_type *o_ptr);
--- a/src/object2.c
+++ b/src/object2.c
@@ -21,24 +21,6 @@
2121
2222 static void one_sustain(object_type *o_ptr);
2323
24-
25-static concptr const kaji_tips[5] =
26-{
27-#ifdef JP
28- "現在持っているエッセンスの一覧を表示する。",
29- "アイテムからエッセンスを取り出す。エッセンスを取られたアイテムは全く魔法がかかっていない初期状態に戻る。",
30- "既にエッセンスが付加されたアイテムからエッセンスのみ消し去る。エッセンスは手に入らない。",
31- "アイテムにエッセンスを付加する。既にエッセンスが付加されたアイテムやアーティファクトには付加できない。",
32- "武器や防具を強化したり、攻撃で傷つかないようにしたりする。エッセンスが付加されたアイテムやアーティファクトに対しても使用できる。",
33-#else
34- "Display essences you have.",
35- "Extract essences from an item. The item become non magical.",
36- "Remove added essences from an equipment which was improved before. The removed essence will be ruined.",
37- "Add essences to an item. The improved items or artifacts cannot be reimprove.",
38- "Enchant an equipment or make an equiment element-proofed. The improved items and artifacts can be enchanted too.",
39-#endif
40-};
41-
4224 /*!
4325 * @brief 対象のオブジェクトにランダムな能力維持を一つ付加する。/ Choose one random sustain
4426 * @details 重複の抑止はない。
@@ -6671,1507 +6653,6 @@ bool process_warning(POSITION xx, POSITION yy)
66716653 return TRUE;
66726654 }
66736655
6674-/*!
6675- * エッセンス情報の構造体 / A structure for smithing
6676- */
6677-typedef struct {
6678- int add; /* TR flag number or special essence id */
6679- concptr add_name; /* Name of this ability */
6680- ESSENCE_IDX type; /* Menu number */
6681- int essence; /* Index for carrying essences */
6682- int value; /* Needed value to add this ability */
6683-} essence_type;
6684-
6685-
6686-/*!
6687- * エッセンス情報テーブル Smithing type data for Weapon smith
6688- */
6689-#ifdef JP
6690-static essence_type essence_info[] =
6691-{
6692- {TR_STR, "腕力", 4, TR_STR, 20},
6693- {TR_INT, "知能", 4, TR_INT, 20},
6694- {TR_WIS, "賢さ", 4, TR_WIS, 20},
6695- {TR_DEX, "器用さ", 4, TR_DEX, 20},
6696- {TR_CON, "耐久力", 4, TR_CON, 20},
6697- {TR_CHR, "魅力", 4, TR_CHR, 20},
6698- {TR_MAGIC_MASTERY, "魔力支配", 4, TR_MAGIC_MASTERY, 20},
6699- {TR_STEALTH, "隠密", 4, TR_STEALTH, 40},
6700- {TR_SEARCH, "探索", 4, TR_SEARCH, 15},
6701- {TR_INFRA, "赤外線視力", 4, TR_INFRA, 15},
6702- {TR_TUNNEL, "採掘", 4, TR_TUNNEL, 15},
6703- {TR_SPEED, "スピード", 4, TR_SPEED, 12},
6704- {TR_BLOWS, "追加攻撃", 1, TR_BLOWS, 20},
6705- {TR_CHAOTIC, "カオス攻撃", 1, TR_CHAOTIC, 15},
6706- {TR_VAMPIRIC, "吸血攻撃", 1, TR_VAMPIRIC, 60},
6707- {TR_IMPACT, "地震発動", 7, TR_IMPACT, 15},
6708- {TR_BRAND_POIS, "毒殺", 1, TR_BRAND_POIS, 20},
6709- {TR_BRAND_ACID, "溶解", 1, TR_BRAND_ACID, 20},
6710- {TR_BRAND_ELEC, "電撃", 1, TR_BRAND_ELEC, 20},
6711- {TR_BRAND_FIRE, "焼棄", 1, TR_BRAND_FIRE, 20},
6712- {TR_BRAND_COLD, "凍結", 1, TR_BRAND_COLD, 20},
6713- {TR_SUST_STR, "腕力維持", 3, TR_SUST_STR, 15},
6714- {TR_SUST_INT, "知能維持", 3, TR_SUST_STR, 15},
6715- {TR_SUST_WIS, "賢さ維持", 3, TR_SUST_STR, 15},
6716- {TR_SUST_DEX, "器用さ維持", 3, TR_SUST_STR, 15},
6717- {TR_SUST_CON, "耐久力維持", 3, TR_SUST_STR, 15},
6718- {TR_SUST_CHR, "魅力維持", 3, TR_SUST_STR, 15},
6719- {TR_IM_ACID, "酸免疫", 2, TR_IM_ACID, 20},
6720- {TR_IM_ELEC, "電撃免疫", 2, TR_IM_ACID, 20},
6721- {TR_IM_FIRE, "火炎免疫", 2, TR_IM_ACID, 20},
6722- {TR_IM_COLD, "冷気免疫", 2, TR_IM_ACID, 20},
6723- {TR_REFLECT, "反射", 2, TR_REFLECT, 20},
6724- {TR_FREE_ACT, "麻痺知らず", 3, TR_FREE_ACT, 20},
6725- {TR_HOLD_EXP, "経験値維持", 3, TR_HOLD_EXP, 20},
6726- {TR_RES_ACID, "耐酸", 2, TR_RES_ACID, 15},
6727- {TR_RES_ELEC, "耐電撃", 2, TR_RES_ELEC, 15},
6728- {TR_RES_FIRE, "耐火炎", 2, TR_RES_FIRE, 15},
6729- {TR_RES_COLD, "耐冷気", 2, TR_RES_COLD, 15},
6730- {TR_RES_POIS, "耐毒", 2, TR_RES_POIS, 25},
6731- {TR_RES_FEAR, "耐恐怖", 2, TR_RES_FEAR, 20},
6732- {TR_RES_LITE, "耐閃光", 2, TR_RES_LITE, 20},
6733- {TR_RES_DARK, "耐暗黒", 2, TR_RES_DARK, 20},
6734- {TR_RES_BLIND, "耐盲目", 2, TR_RES_BLIND, 20},
6735- {TR_RES_CONF, "耐混乱", 2, TR_RES_CONF, 20},
6736- {TR_RES_SOUND, "耐轟音", 2, TR_RES_SOUND, 20},
6737- {TR_RES_SHARDS, "耐破片", 2, TR_RES_SHARDS, 20},
6738- {TR_RES_NETHER, "耐地獄", 2, TR_RES_NETHER, 20},
6739- {TR_RES_NEXUS, "耐因果混乱", 2, TR_RES_NEXUS, 20},
6740- {TR_RES_CHAOS, "耐カオス", 2, TR_RES_CHAOS, 20},
6741- {TR_RES_DISEN, "耐劣化", 2, TR_RES_DISEN, 20},
6742- {TR_SH_FIRE, "", 0, -2, 0},
6743- {TR_SH_ELEC, "", 0, -2, 0},
6744- {TR_SH_COLD, "", 0, -2, 0},
6745- {TR_NO_MAGIC, "反魔法", 3, TR_NO_MAGIC, 15},
6746- {TR_WARNING, "警告", 3, TR_WARNING, 20},
6747- {TR_LEVITATION, "浮遊", 3, TR_LEVITATION, 20},
6748- {TR_LITE_1, "永久光源", 3, TR_LITE_1, 15},
6749- {TR_LITE_2, "", 0, -2, 0},
6750- {TR_LITE_3, "", 0, -2, 0},
6751- {TR_SEE_INVIS, "可視透明", 3, TR_SEE_INVIS, 20},
6752- {TR_TELEPATHY, "テレパシー", 6, TR_TELEPATHY, 15},
6753- {TR_SLOW_DIGEST, "遅消化", 3, TR_SLOW_DIGEST, 15},
6754- {TR_REGEN, "急速回復", 3, TR_REGEN, 20},
6755- {TR_TELEPORT, "テレポート", 3, TR_TELEPORT, 25},
6756-
6757- {TR_SLAY_EVIL, "邪悪倍打", 5, TR_SLAY_EVIL, 100},
6758- {TR_KILL_EVIL, "邪悪倍倍打", 0, TR_SLAY_EVIL, 60},
6759- {TR_SLAY_ANIMAL, "動物倍打", 5, TR_SLAY_ANIMAL, 20},
6760- {TR_KILL_ANIMAL, "動物倍倍打", 5, TR_SLAY_ANIMAL, 60},
6761- {TR_SLAY_UNDEAD, "不死倍打", 5, TR_SLAY_UNDEAD, 20},
6762- {TR_KILL_UNDEAD, "不死倍倍打", 5, TR_SLAY_UNDEAD, 60},
6763- {TR_SLAY_DEMON, "悪魔倍打", 5, TR_SLAY_DEMON, 20},
6764- {TR_KILL_DEMON, "悪魔倍倍打", 5, TR_SLAY_DEMON, 60},
6765- {TR_SLAY_ORC, "オーク倍打", 5, TR_SLAY_ORC, 15},
6766- {TR_KILL_ORC, "オーク倍倍打", 5, TR_SLAY_ORC, 60},
6767- {TR_SLAY_TROLL, "トロル倍打", 5, TR_SLAY_TROLL, 15},
6768- {TR_KILL_TROLL, "トロル倍倍打", 5, TR_SLAY_TROLL, 60},
6769- {TR_SLAY_GIANT, "巨人倍打", 5, TR_SLAY_GIANT, 20},
6770- {TR_KILL_GIANT, "巨人倍倍打", 5, TR_SLAY_GIANT, 60},
6771- {TR_SLAY_DRAGON, "竜倍打", 5, TR_SLAY_DRAGON, 20},
6772- {TR_KILL_DRAGON, "竜倍倍打", 5, TR_SLAY_DRAGON, 60},
6773- {TR_SLAY_HUMAN, "人間倍打", 5, TR_SLAY_HUMAN, 20},
6774- {TR_KILL_HUMAN, "人間倍倍打", 5, TR_SLAY_HUMAN, 60},
6775-
6776- {TR_ESP_ANIMAL, "動物ESP", 6, TR_SLAY_ANIMAL, 40},
6777- {TR_ESP_UNDEAD, "不死ESP", 6, TR_SLAY_UNDEAD, 40},
6778- {TR_ESP_DEMON, "悪魔ESP", 6, TR_SLAY_DEMON, 40},
6779- {TR_ESP_ORC, "オークESP", 6, TR_SLAY_ORC, 40},
6780- {TR_ESP_TROLL, "トロルESP", 6, TR_SLAY_TROLL, 40},
6781- {TR_ESP_GIANT, "巨人ESP", 6, TR_SLAY_GIANT, 40},
6782- {TR_ESP_DRAGON, "竜ESP", 6, TR_SLAY_DRAGON, 40},
6783- {TR_ESP_HUMAN, "人間ESP", 6, TR_SLAY_HUMAN, 40},
6784-
6785- {ESSENCE_ATTACK, "攻撃", 10, TR_ES_ATTACK, 30},
6786- {ESSENCE_AC, "防御", 10, TR_ES_AC, 15},
6787- {ESSENCE_TMP_RES_ACID, "酸耐性発動", 7, TR_RES_ACID, 50},
6788- {ESSENCE_TMP_RES_ELEC, "電撃耐性発動", 7, TR_RES_ELEC, 50},
6789- {ESSENCE_TMP_RES_FIRE, "火炎耐性発動", 7, TR_RES_FIRE, 50},
6790- {ESSENCE_TMP_RES_COLD, "冷気耐性発動", 7, TR_RES_COLD, 50},
6791- {ESSENCE_SH_FIRE, "火炎オーラ", 7, -1, 50},
6792- {ESSENCE_SH_ELEC, "電撃オーラ", 7, -1, 50},
6793- {ESSENCE_SH_COLD, "冷気オーラ", 7, -1, 50},
6794- {ESSENCE_RESISTANCE, "全耐性", 2, -1, 150},
6795- {ESSENCE_SUSTAIN, "装備保持", 10, -1, 10},
6796- {ESSENCE_SLAY_GLOVE, "殺戮の小手", 1, TR_ES_ATTACK, 200},
6797-
6798- {-1, NULL, 0, -1, 0}
6799-};
6800-#else
6801-static essence_type essence_info[] =
6802-{
6803- {TR_STR, "strength", 4, TR_STR, 20},
6804- {TR_INT, "intelligence", 4, TR_INT, 20},
6805- {TR_WIS, "wisdom", 4, TR_WIS, 20},
6806- {TR_DEX, "dexterity", 4, TR_DEX, 20},
6807- {TR_CON, "constitution", 4, TR_CON, 20},
6808- {TR_CHR, "charisma", 4, TR_CHR, 20},
6809- {TR_MAGIC_MASTERY, "magic mastery", 4, TR_MAGIC_MASTERY, 20},
6810- {TR_STEALTH, "stealth", 4, TR_STEALTH, 40},
6811- {TR_SEARCH, "serching", 4, TR_SEARCH, 15},
6812- {TR_INFRA, "infravision", 4, TR_INFRA, 15},
6813- {TR_TUNNEL, "digging", 4, TR_TUNNEL, 15},
6814- {TR_SPEED, "speed", 4, TR_SPEED, 12},
6815- {TR_BLOWS, "extra attack", 1, TR_BLOWS, 20},
6816- {TR_CHAOTIC, "chaos brand", 1, TR_CHAOTIC, 15},
6817- {TR_VAMPIRIC, "vampiric brand", 1, TR_VAMPIRIC, 60},
6818- {TR_IMPACT, "quake activation", 7, TR_IMPACT, 15},
6819- {TR_BRAND_POIS, "poison brand", 1, TR_BRAND_POIS, 20},
6820- {TR_BRAND_ACID, "acid brand", 1, TR_BRAND_ACID, 20},
6821- {TR_BRAND_ELEC, "electric brand", 1, TR_BRAND_ELEC, 20},
6822- {TR_BRAND_FIRE, "fire brand", 1, TR_BRAND_FIRE, 20},
6823- {TR_BRAND_COLD, "cold brand", 1, TR_BRAND_COLD, 20},
6824- {TR_SUST_STR, "sustain strength", 3, TR_SUST_STR, 15},
6825- {TR_SUST_INT, "sustain intelligence", 3, TR_SUST_STR, 15},
6826- {TR_SUST_WIS, "sustain wisdom", 3, TR_SUST_STR, 15},
6827- {TR_SUST_DEX, "sustain dexterity", 3, TR_SUST_STR, 15},
6828- {TR_SUST_CON, "sustain constitution", 3, TR_SUST_STR, 15},
6829- {TR_SUST_CHR, "sustain charisma", 3, TR_SUST_STR, 15},
6830- {TR_IM_ACID, "acid immunity", 2, TR_IM_ACID, 20},
6831- {TR_IM_ELEC, "electric immunity", 2, TR_IM_ACID, 20},
6832- {TR_IM_FIRE, "fire immunity", 2, TR_IM_ACID, 20},
6833- {TR_IM_COLD, "cold immunity", 2, TR_IM_ACID, 20},
6834- {TR_REFLECT, "reflection", 2, TR_REFLECT, 20},
6835- {TR_FREE_ACT, "free action", 3, TR_FREE_ACT, 20},
6836- {TR_HOLD_EXP, "hold experience", 3, TR_HOLD_EXP, 20},
6837- {TR_RES_ACID, "resistance to acid", 2, TR_RES_ACID, 15},
6838- {TR_RES_ELEC, "resistance to electric", 2, TR_RES_ELEC, 15},
6839- {TR_RES_FIRE, "resistance to fire", 2, TR_RES_FIRE, 15},
6840- {TR_RES_COLD, "resistance to cold", 2, TR_RES_COLD, 15},
6841- {TR_RES_POIS, "resistance to poison", 2, TR_RES_POIS, 25},
6842- {TR_RES_FEAR, "resistance to fear", 2, TR_RES_FEAR, 20},
6843- {TR_RES_LITE, "resistance to light", 2, TR_RES_LITE, 20},
6844- {TR_RES_DARK, "resistance to dark", 2, TR_RES_DARK, 20},
6845- {TR_RES_BLIND, "resistance to blind", 2, TR_RES_BLIND, 20},
6846- {TR_RES_CONF, "resistance to confusion", 2, TR_RES_CONF, 20},
6847- {TR_RES_SOUND, "resistance to sound", 2, TR_RES_SOUND, 20},
6848- {TR_RES_SHARDS, "resistance to shard", 2, TR_RES_SHARDS, 20},
6849- {TR_RES_NETHER, "resistance to nether", 2, TR_RES_NETHER, 20},
6850- {TR_RES_NEXUS, "resistance to nexus", 2, TR_RES_NEXUS, 20},
6851- {TR_RES_CHAOS, "resistance to chaos", 2, TR_RES_CHAOS, 20},
6852- {TR_RES_DISEN, "resistance to disenchantment", 2, TR_RES_DISEN, 20},
6853- {TR_SH_FIRE, "", 0, -2, 0},
6854- {TR_SH_ELEC, "", 0, -2, 0},
6855- {TR_SH_COLD, "", 0, -2, 0},
6856- {TR_NO_MAGIC, "anti magic", 3, TR_NO_MAGIC, 15},
6857- {TR_WARNING, "warning", 3, TR_WARNING, 20},
6858- {TR_LEVITATION, "levitation", 3, TR_LEVITATION, 20},
6859- {TR_LITE_1, "permanent light", 3, TR_LITE_1, 15},
6860- {TR_LITE_2, "", 0, -2, 0},
6861- {TR_LITE_3, "", 0, -2, 0},
6862- {TR_SEE_INVIS, "see invisible", 3, TR_SEE_INVIS, 20},
6863- {TR_TELEPATHY, "telepathy", 6, TR_TELEPATHY, 15},
6864- {TR_SLOW_DIGEST, "slow digestion", 3, TR_SLOW_DIGEST, 15},
6865- {TR_REGEN, "regeneration", 3, TR_REGEN, 20},
6866- {TR_TELEPORT, "teleport", 3, TR_TELEPORT, 25},
6867-
6868- {TR_SLAY_EVIL, "slay evil", 5, TR_SLAY_EVIL, 100},
6869- {TR_SLAY_ANIMAL, "slay animal", 5, TR_SLAY_ANIMAL, 20},
6870- {TR_KILL_ANIMAL, "kill animal", 5, TR_SLAY_ANIMAL, 60},
6871- {TR_KILL_EVIL, "kill evil", 0, TR_SLAY_EVIL, 60},
6872- {TR_SLAY_UNDEAD, "slay undead", 5, TR_SLAY_UNDEAD, 20},
6873- {TR_KILL_UNDEAD, "kill undead", 5, TR_SLAY_UNDEAD, 60},
6874- {TR_SLAY_DEMON, "slay demon", 5, TR_SLAY_DEMON, 20},
6875- {TR_KILL_DEMON, "kill demon", 5, TR_SLAY_DEMON, 60},
6876- {TR_SLAY_ORC, "slay orc", 5, TR_SLAY_ORC, 15},
6877- {TR_KILL_ORC, "kill orc", 5, TR_SLAY_ORC, 60},
6878- {TR_SLAY_TROLL, "slay troll", 5, TR_SLAY_TROLL, 15},
6879- {TR_KILL_TROLL, "kill troll", 5, TR_SLAY_TROLL, 60},
6880- {TR_SLAY_GIANT, "slay giant", 5, TR_SLAY_GIANT, 20},
6881- {TR_KILL_GIANT, "kill giant", 5, TR_SLAY_GIANT, 60},
6882- {TR_SLAY_DRAGON, "slay dragon", 5, TR_SLAY_DRAGON, 20},
6883- {TR_KILL_DRAGON, "kill dragon", 5, TR_SLAY_DRAGON, 60},
6884- {TR_SLAY_HUMAN, "slay human", 5, TR_SLAY_HUMAN, 20},
6885- {TR_KILL_HUMAN, "kill human", 5, TR_SLAY_HUMAN, 60},
6886-
6887- {TR_ESP_ANIMAL, "sense animal", 6, TR_SLAY_ANIMAL, 40},
6888- {TR_ESP_UNDEAD, "sense undead", 6, TR_SLAY_UNDEAD, 40},
6889- {TR_ESP_DEMON, "sense demon", 6, TR_SLAY_DEMON, 40},
6890- {TR_ESP_ORC, "sense orc", 6, TR_SLAY_ORC, 40},
6891- {TR_ESP_TROLL, "sense troll", 6, TR_SLAY_TROLL, 40},
6892- {TR_ESP_GIANT, "sense giant", 6, TR_SLAY_GIANT, 40},
6893- {TR_ESP_DRAGON, "sense dragon", 6, TR_SLAY_DRAGON, 40},
6894- {TR_ESP_HUMAN, "sense human", 6, TR_SLAY_HUMAN, 40},
6895-
6896- {ESSENCE_ATTACK, "weapon enchant", 10, TR_ES_ATTACK, 30},
6897- {ESSENCE_AC, "armor enchant", 10, TR_ES_AC, 15},
6898- {ESSENCE_TMP_RES_ACID, "resist acid activation", 7, TR_RES_ACID, 50},
6899- {ESSENCE_TMP_RES_ELEC, "resist electricity activation", 7, TR_RES_ELEC, 50},
6900- {ESSENCE_TMP_RES_FIRE, "resist fire activation", 7, TR_RES_FIRE, 50},
6901- {ESSENCE_TMP_RES_COLD, "resist cold activation", 7, TR_RES_COLD, 50},
6902- {ESSENCE_SH_FIRE, "fiery sheath", 7, -1, 50},
6903- {ESSENCE_SH_ELEC, "electric sheath", 7, -1, 50},
6904- {ESSENCE_SH_COLD, "sheath of coldness", 7, -1, 50},
6905- {ESSENCE_RESISTANCE, "resistance", 2, -1, 150},
6906- {ESSENCE_SUSTAIN, "elements proof", 10, -1, 10},
6907- {ESSENCE_SLAY_GLOVE, "gauntlets of slaying", 1, TR_ES_ATTACK, 200},
6908-
6909- {-1, NULL, 0, -1, 0}
6910-};
6911-#endif
6912-
6913-
6914-/*!
6915- * エッセンス名テーブル / Essense names for Weapon smith
6916- */
6917-#ifdef JP
6918-concptr essence_name[] =
6919-{
6920- "腕力",
6921- "知能",
6922- "賢さ",
6923- "器用さ",
6924- "耐久力",
6925- "魅力",
6926- "魔力支配",
6927- "",
6928- "隠密",
6929- "探索",
6930- "赤外線視力",
6931- "採掘",
6932- "スピード",
6933- "追加攻撃",
6934- "カオス攻撃",
6935- "吸血攻撃",
6936- "動物倍打",
6937- "邪悪倍打",
6938- "不死倍打",
6939- "悪魔倍打",
6940- "オーク倍打",
6941- "トロル倍打",
6942- "巨人倍打",
6943- "竜倍打",
6944- "",
6945- "",
6946- "地震",
6947- "毒殺",
6948- "溶解",
6949- "電撃",
6950- "焼棄",
6951- "凍結",
6952- "能力維持",
6953- "",
6954- "",
6955- "",
6956- "",
6957- "",
6958- "",
6959- "",
6960- "免疫",
6961- "",
6962- "",
6963- "",
6964- "",
6965- "反射",
6966- "麻痺知らず",
6967- "経験値維持",
6968- "耐酸",
6969- "耐電撃",
6970- "耐火炎",
6971- "耐冷気",
6972- "耐毒",
6973- "耐恐怖",
6974- "耐閃光",
6975- "耐暗黒",
6976- "耐盲目",
6977- "耐混乱",
6978- "耐轟音",
6979- "耐破片",
6980- "耐地獄",
6981- "耐因果混乱",
6982- "耐カオス",
6983- "耐劣化",
6984- "",
6985- "",
6986- "人間倍打",
6987- "",
6988- "",
6989- "反魔法",
6990- "",
6991- "",
6992- "警告",
6993- "",
6994- "",
6995- "",
6996- "浮遊",
6997- "永久光源",
6998- "可視透明",
6999- "テレパシー",
7000- "遅消化",
7001- "急速回復",
7002- "",
7003- "",
7004- "",
7005- "",
7006- "",
7007- "",
7008- "",
7009- "",
7010- "テレポート",
7011- "",
7012- "",
7013- "攻撃",
7014- "防御",
7015-
7016- NULL
7017-};
7018-
7019-#else
7020-
7021-concptr essence_name[] =
7022-{
7023- "strength",
7024- "intelligen.",
7025- "wisdom",
7026- "dexterity",
7027- "constitut.",
7028- "charisma",
7029- "magic mast.",
7030- "",
7031- "stealth",
7032- "serching",
7033- "infravision",
7034- "digging",
7035- "speed",
7036- "extra atk",
7037- "chaos brand",
7038- "vampiric",
7039- "slay animal",
7040- "slay evil",
7041- "slay undead",
7042- "slay demon",
7043- "slay orc",
7044- "slay troll",
7045- "slay giant",
7046- "slay dragon",
7047- "",
7048- "",
7049- "quake",
7050- "pois. brand",
7051- "acid brand",
7052- "elec. brand",
7053- "fire brand",
7054- "cold brand",
7055- "sustain",
7056- "",
7057- "",
7058- "",
7059- "",
7060- "",
7061- "",
7062- "",
7063- "immunity",
7064- "",
7065- "",
7066- "",
7067- "",
7068- "reflection",
7069- "free action",
7070- "hold exp",
7071- "res. acid",
7072- "res. elec.",
7073- "res. fire",
7074- "res. cold",
7075- "res. poison",
7076- "res. fear",
7077- "res. light",
7078- "res. dark",
7079- "res. blind",
7080- "res.confuse",
7081- "res. sound",
7082- "res. shard",
7083- "res. nether",
7084- "res. nexus",
7085- "res. chaos",
7086- "res. disen.",
7087- "",
7088- "",
7089- "slay human",
7090- "",
7091- "",
7092- "anti magic",
7093- "",
7094- "",
7095- "warning",
7096- "",
7097- "",
7098- "",
7099- "levitation",
7100- "perm. light",
7101- "see invis.",
7102- "telepathy",
7103- "slow dige.",
7104- "regen.",
7105- "",
7106- "",
7107- "",
7108- "",
7109- "",
7110- "",
7111- "",
7112- "",
7113- "teleport",
7114- "",
7115- "",
7116- "weapon enc.",
7117- "armor enc.",
7118-
7119- NULL
7120-};
7121-#endif
7122-
7123-/*!
7124- * @brief 所持しているエッセンス一覧を表示する
7125- * @return なし
7126- */
7127-static void display_essence(void)
7128-{
7129- int i, num = 0;
7130-
7131- screen_save();
7132- for (i = 1; i < 22; i++)
7133- {
7134- prt("",i,0);
7135- }
7136- prt(_("エッセンス 個数 エッセンス 個数 エッセンス 個数",
7137- "Essence Num Essence Num Essence Num "), 1, 8);
7138- for (i = 0; essence_name[i]; i++)
7139- {
7140- if (!essence_name[i][0]) continue;
7141- prt(format("%-11s %5d", essence_name[i], p_ptr->magic_num1[i]), 2+num%21, 8+num/21*22);
7142- num++;
7143- }
7144- prt(_("現在所持しているエッセンス", "List of all essences you have."), 0, 0);
7145- (void)inkey();
7146- screen_load();
7147- return;
7148-}
7149-
7150-/*!
7151- * @brief エッセンスの抽出処理
7152- * @return なし
7153- */
7154-static void drain_essence(void)
7155-{
7156- int drain_value[sizeof(p_ptr->magic_num1) / sizeof(s32b)];
7157- int i;
7158- OBJECT_IDX item;
7159- int dec = 4;
7160- bool observe = FALSE;
7161- int old_ds, old_dd, old_to_h, old_to_d, old_ac, old_to_a, old_pval, old_name2;
7162- TIME_EFFECT old_timeout;
7163- BIT_FLAGS old_flgs[TR_FLAG_SIZE], new_flgs[TR_FLAG_SIZE];
7164- object_type *o_ptr;
7165- concptr q, s;
7166- POSITION iy, ix;
7167- byte_hack marked;
7168- ITEM_NUMBER number;
7169- OBJECT_IDX next_o_idx;
7170- WEIGHT weight;
7171-
7172- for (i = 0; i < sizeof(drain_value) / sizeof(int); i++)
7173- drain_value[i] = 0;
7174-
7175- item_tester_hook = object_is_weapon_armour_ammo;
7176-
7177- q = _("どのアイテムから抽出しますか?", "Extract from which item? ");
7178- s = _("抽出できるアイテムがありません。", "You have nothing you can extract from.");
7179-
7180- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
7181- if (!o_ptr) return;
7182-
7183- if (object_is_known(o_ptr) && !object_is_nameless(o_ptr))
7184- {
7185- GAME_TEXT o_name[MAX_NLEN];
7186- object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
7187- if (!get_check(format(_("本当に%sから抽出してよろしいですか?", "Really extract from %s? "), o_name))) return;
7188- }
7189-
7190- take_turn(p_ptr, 100);
7191-
7192- object_flags(o_ptr, old_flgs);
7193- if (have_flag(old_flgs, TR_KILL_DRAGON)) add_flag(old_flgs, TR_SLAY_DRAGON);
7194- if (have_flag(old_flgs, TR_KILL_ANIMAL)) add_flag(old_flgs, TR_SLAY_ANIMAL);
7195- if (have_flag(old_flgs, TR_KILL_EVIL)) add_flag(old_flgs, TR_SLAY_EVIL);
7196- if (have_flag(old_flgs, TR_KILL_UNDEAD)) add_flag(old_flgs, TR_SLAY_UNDEAD);
7197- if (have_flag(old_flgs, TR_KILL_DEMON)) add_flag(old_flgs, TR_SLAY_DEMON);
7198- if (have_flag(old_flgs, TR_KILL_ORC)) add_flag(old_flgs, TR_SLAY_ORC);
7199- if (have_flag(old_flgs, TR_KILL_TROLL)) add_flag(old_flgs, TR_SLAY_TROLL);
7200- if (have_flag(old_flgs, TR_KILL_GIANT)) add_flag(old_flgs, TR_SLAY_GIANT);
7201- if (have_flag(old_flgs, TR_KILL_HUMAN)) add_flag(old_flgs, TR_SLAY_HUMAN);
7202-
7203- old_to_a = o_ptr->to_a;
7204- old_ac = o_ptr->ac;
7205- old_to_h = o_ptr->to_h;
7206- old_to_d = o_ptr->to_d;
7207- old_ds = o_ptr->ds;
7208- old_dd = o_ptr->dd;
7209- old_pval = o_ptr->pval;
7210- old_name2 = o_ptr->name2;
7211- old_timeout = o_ptr->timeout;
7212- if (o_ptr->curse_flags & (TRC_CURSED | TRC_HEAVY_CURSE | TRC_PERMA_CURSE)) dec--;
7213- if (have_flag(old_flgs, TR_ADD_L_CURSE)) dec--;
7214- if (have_flag(old_flgs, TR_ADD_H_CURSE)) dec--;
7215- if (have_flag(old_flgs, TR_AGGRAVATE)) dec--;
7216- if (have_flag(old_flgs, TR_NO_TELE)) dec--;
7217- if (have_flag(old_flgs, TR_DRAIN_EXP)) dec--;
7218- if (have_flag(old_flgs, TR_DRAIN_HP)) dec--;
7219- if (have_flag(old_flgs, TR_DRAIN_MANA)) dec--;
7220- if (have_flag(old_flgs, TR_CALL_ANIMAL)) dec--;
7221- if (have_flag(old_flgs, TR_CALL_DEMON)) dec--;
7222- if (have_flag(old_flgs, TR_CALL_DRAGON)) dec--;
7223- if (have_flag(old_flgs, TR_CALL_UNDEAD)) dec--;
7224- if (have_flag(old_flgs, TR_COWARDICE)) dec--;
7225- if (have_flag(old_flgs, TR_LOW_MELEE)) dec--;
7226- if (have_flag(old_flgs, TR_LOW_AC)) dec--;
7227- if (have_flag(old_flgs, TR_LOW_MAGIC)) dec--;
7228- if (have_flag(old_flgs, TR_FAST_DIGEST)) dec--;
7229- if (have_flag(old_flgs, TR_SLOW_REGEN)) dec--;
7230- if (have_flag(old_flgs, TR_TY_CURSE)) dec--;
7231-
7232- iy = o_ptr->iy;
7233- ix = o_ptr->ix;
7234- next_o_idx = o_ptr->next_o_idx;
7235- marked = o_ptr->marked;
7236- weight = o_ptr->weight;
7237- number = o_ptr->number;
7238-
7239- object_prep(o_ptr, o_ptr->k_idx);
7240-
7241- o_ptr->iy=iy;
7242- o_ptr->ix=ix;
7243- o_ptr->next_o_idx=next_o_idx;
7244- o_ptr->marked=marked;
7245- o_ptr->number = number;
7246- if (o_ptr->tval == TV_DRAG_ARMOR) o_ptr->timeout = old_timeout;
7247- if (item >= 0) p_ptr->total_weight += (o_ptr->weight*o_ptr->number - weight*number);
7248- o_ptr->ident |= (IDENT_MENTAL);
7249- object_aware(o_ptr);
7250- object_known(o_ptr);
7251-
7252- object_flags(o_ptr, new_flgs);
7253-
7254- for (i = 0; essence_info[i].add_name; i++)
7255- {
7256- essence_type *es_ptr = &essence_info[i];
7257- PARAMETER_VALUE pval = 0;
7258-
7259- if (es_ptr->add < TR_FLAG_MAX && is_pval_flag(es_ptr->add) && old_pval)
7260- pval = (have_flag(new_flgs, es_ptr->add)) ? old_pval - o_ptr->pval : old_pval;
7261-
7262- if (es_ptr->add < TR_FLAG_MAX &&
7263- (!have_flag(new_flgs, es_ptr->add) || pval) &&
7264- have_flag(old_flgs, es_ptr->add))
7265- {
7266- if (pval)
7267- {
7268- drain_value[es_ptr->essence] += 10 * pval;
7269- }
7270- else if (es_ptr->essence != -2)
7271- {
7272- drain_value[es_ptr->essence] += 10;
7273- }
7274- else if (es_ptr->add == TR_SH_FIRE)
7275- {
7276- drain_value[TR_BRAND_FIRE] += 10;
7277- drain_value[TR_RES_FIRE] += 10;
7278- }
7279- else if (es_ptr->add == TR_SH_ELEC)
7280- {
7281- drain_value[TR_BRAND_ELEC] += 10;
7282- drain_value[TR_RES_ELEC] += 10;
7283- }
7284- else if (es_ptr->add == TR_SH_COLD)
7285- {
7286- drain_value[TR_BRAND_COLD] += 10;
7287- drain_value[TR_RES_COLD] += 10;
7288- }
7289- else if (es_ptr->add == TR_LITE_2)
7290- {
7291- drain_value[TR_LITE_1] += 20;
7292- }
7293- else if (es_ptr->add == TR_LITE_3)
7294- {
7295- drain_value[TR_LITE_1] += 30;
7296- }
7297- }
7298- }
7299-
7300- if ((have_flag(old_flgs, TR_FORCE_WEAPON)) && !(have_flag(new_flgs, TR_FORCE_WEAPON)))
7301- {
7302- drain_value[TR_INT] += 5;
7303- drain_value[TR_WIS] += 5;
7304- }
7305- if ((have_flag(old_flgs, TR_VORPAL)) && !(have_flag(new_flgs, TR_VORPAL)))
7306- {
7307- drain_value[TR_BRAND_POIS] += 5;
7308- drain_value[TR_BRAND_ACID] += 5;
7309- drain_value[TR_BRAND_ELEC] += 5;
7310- drain_value[TR_BRAND_FIRE] += 5;
7311- drain_value[TR_BRAND_COLD] += 5;
7312- }
7313- if ((have_flag(old_flgs, TR_DEC_MANA)) && !(have_flag(new_flgs, TR_DEC_MANA)))
7314- {
7315- drain_value[TR_INT] += 10;
7316- }
7317- if ((have_flag(old_flgs, TR_XTRA_MIGHT)) && !(have_flag(new_flgs, TR_XTRA_MIGHT)))
7318- {
7319- drain_value[TR_STR] += 10;
7320- }
7321- if ((have_flag(old_flgs, TR_XTRA_SHOTS)) && !(have_flag(new_flgs, TR_XTRA_SHOTS)))
7322- {
7323- drain_value[TR_DEX] += 10;
7324- }
7325- if (old_name2 == EGO_2WEAPON)
7326- {
7327- drain_value[TR_DEX] += 20;
7328- }
7329- if (object_is_weapon_ammo(o_ptr))
7330- {
7331- if (old_ds > o_ptr->ds) drain_value[TR_ES_ATTACK] += (old_ds-o_ptr->ds)*10;
7332-
7333- if (old_dd > o_ptr->dd) drain_value[TR_ES_ATTACK] += (old_dd-o_ptr->dd)*10;
7334- }
7335- if (old_to_h > o_ptr->to_h) drain_value[TR_ES_ATTACK] += (old_to_h-o_ptr->to_h)*10;
7336- if (old_to_d > o_ptr->to_d) drain_value[TR_ES_ATTACK] += (old_to_d-o_ptr->to_d)*10;
7337- if (old_ac > o_ptr->ac) drain_value[TR_ES_AC] += (old_ac-o_ptr->ac)*10;
7338- if (old_to_a > o_ptr->to_a) drain_value[TR_ES_AC] += (old_to_a-o_ptr->to_a)*10;
7339-
7340- for (i = 0; i < sizeof(drain_value) / sizeof(int); i++)
7341- {
7342- drain_value[i] *= number;
7343- drain_value[i] = drain_value[i] * dec / 4;
7344- drain_value[i] = MAX(drain_value[i], 0);
7345- if ((o_ptr->tval >= TV_SHOT) && (o_ptr->tval <= TV_BOLT)) drain_value[i] /= 10;
7346- if (drain_value[i])
7347- {
7348- observe = TRUE;
7349- }
7350- }
7351- if (!observe)
7352- {
7353- msg_print(_("エッセンスは抽出できませんでした。", "You were not able to extract any essence."));
7354- }
7355- else
7356- {
7357- msg_print(_("抽出したエッセンス:", "Extracted essences:"));
7358-
7359- for (i = 0; essence_name[i]; i++)
7360- {
7361- if (!essence_name[i][0]) continue;
7362- if (!drain_value[i]) continue;
7363-
7364- p_ptr->magic_num1[i] += drain_value[i];
7365- p_ptr->magic_num1[i] = MIN(20000, p_ptr->magic_num1[i]);
7366- msg_print(NULL);
7367- msg_format("%s...%d%s", essence_name[i], drain_value[i], _("。", ". "));
7368- }
7369- }
7370-
7371- /* Apply autodestroy/inscription to the drained item */
7372- autopick_alter_item(item, TRUE);
7373- p_ptr->update |= (PU_COMBINE | PU_REORDER);
7374- p_ptr->window |= (PW_INVEN);
7375-}
7376-
7377-/*!
7378- * @brief 付加するエッセンスの大別を選択する
7379- * @return 選んだエッセンスの大別ID
7380- */
7381-static COMMAND_CODE choose_essence(void)
7382-{
7383- COMMAND_CODE mode = 0;
7384- char choice;
7385- COMMAND_CODE menu_line = (use_menu ? 1 : 0);
7386-
7387-#ifdef JP
7388- concptr menu_name[] = {
7389- "武器属性",
7390- "耐性",
7391- "能力",
7392- "数値",
7393- "スレイ",
7394- "ESP",
7395- "その他"
7396- };
7397-#else
7398- concptr menu_name[] = {
7399- "Brand weapon",
7400- "Resistance",
7401- "Ability",
7402- "Magic number",
7403- "Slay",
7404- "ESP",
7405- "Others"
7406- };
7407-#endif
7408- const COMMAND_CODE mode_max = 7;
7409-
7410- if (repeat_pull(&mode) && 1 <= mode && mode <= mode_max)
7411- return mode;
7412- mode = 0;
7413- if (use_menu)
7414- {
7415- screen_save();
7416-
7417- while(!mode)
7418- {
7419- int i;
7420- for (i = 0; i < mode_max; i++)
7421-#ifdef JP
7422- prt(format(" %s %s", (menu_line == 1+i) ? "》" : " ", menu_name[i]), 2 + i, 14);
7423- prt("どの種類のエッセンス付加を行いますか?", 0, 0);
7424-#else
7425- prt(format(" %s %s", (menu_line == 1+i) ? "> " : " ", menu_name[i]), 2 + i, 14);
7426- prt("Choose from menu.", 0, 0);
7427-#endif
7428-
7429- choice = inkey();
7430- switch(choice)
7431- {
7432- case ESCAPE:
7433- case 'z':
7434- case 'Z':
7435- screen_load();
7436- return 0;
7437- case '2':
7438- case 'j':
7439- case 'J':
7440- menu_line++;
7441- break;
7442- case '8':
7443- case 'k':
7444- case 'K':
7445- menu_line += mode_max - 1;
7446- break;
7447- case '\r':
7448- case '\n':
7449- case 'x':
7450- case 'X':
7451- mode = menu_line;
7452- break;
7453- }
7454- if (menu_line > mode_max) menu_line -= mode_max;
7455- }
7456- screen_load();
7457- }
7458- else
7459- {
7460- screen_save();
7461- while (!mode)
7462- {
7463- int i;
7464-
7465- for (i = 0; i < mode_max; i++)
7466- prt(format(" %c) %s", 'a' + i, menu_name[i]), 2 + i, 14);
7467-
7468- if (!get_com(_("何を付加しますか:", "Command :"), &choice, TRUE))
7469- {
7470- screen_load();
7471- return 0;
7472- }
7473-
7474- if (isupper(choice)) choice = (char)tolower(choice);
7475-
7476- if ('a' <= choice && choice <= 'a' + (char)mode_max - 1)
7477- mode = (int)choice - 'a' + 1;
7478- }
7479- screen_load();
7480- }
7481-
7482- repeat_push(mode);
7483- return mode;
7484-}
7485-
7486-/*!
7487- * @brief エッセンスを実際に付加する
7488- * @param mode エッセンスの大別ID
7489- * @return なし
7490- */
7491-static void add_essence(ESSENCE_IDX mode)
7492-{
7493- OBJECT_IDX item;
7494- int max_num = 0;
7495- COMMAND_CODE i;
7496- bool flag,redraw;
7497- char choice;
7498- concptr q, s;
7499- object_type *o_ptr;
7500- int ask = TRUE;
7501- char out_val[160];
7502- int num[22];
7503- GAME_TEXT o_name[MAX_NLEN];
7504- int use_essence;
7505- essence_type *es_ptr;
7506- bool able[22] = { 0 };
7507-
7508- int menu_line = (use_menu ? 1 : 0);
7509-
7510- for (i = 0; essence_info[i].add_name; i++)
7511- {
7512- es_ptr = &essence_info[i];
7513-
7514- if (es_ptr->type != mode) continue;
7515- num[max_num++] = i;
7516- }
7517-
7518- if (!repeat_pull(&i) || i<0 || i>=max_num)
7519- {
7520-
7521- /* Nothing chosen yet */
7522- flag = FALSE;
7523-
7524- /* No redraw yet */
7525- redraw = FALSE;
7526-
7527- /* Build a prompt */
7528- (void) strnfmt(out_val, 78, _("('*'で一覧, ESCで中断) どの能力を付加しますか?", "(*=List, ESC=exit) Add which ability? "));
7529- if (use_menu) screen_save();
7530-
7531- /* Get a spell from the user */
7532-
7533- choice = (always_show_list || use_menu) ? ESCAPE:1;
7534- while (!flag)
7535- {
7536- if( choice==ESCAPE ) choice = ' ';
7537- else if( !get_com(out_val, &choice, FALSE) )break;
7538-
7539- if (use_menu && choice != ' ')
7540- {
7541- switch(choice)
7542- {
7543- case '0':
7544- {
7545- screen_load();
7546- return;
7547- }
7548-
7549- case '8':
7550- case 'k':
7551- case 'K':
7552- {
7553- menu_line += (max_num-1);
7554- break;
7555- }
7556-
7557- case '2':
7558- case 'j':
7559- case 'J':
7560- {
7561- menu_line++;
7562- break;
7563- }
7564-
7565- case '4':
7566- case 'h':
7567- case 'H':
7568- {
7569- menu_line = 1;
7570- break;
7571- }
7572- case '6':
7573- case 'l':
7574- case 'L':
7575- {
7576- menu_line = max_num;
7577- break;
7578- }
7579-
7580- case 'x':
7581- case 'X':
7582- case '\r':
7583- case '\n':
7584- {
7585- i = menu_line - 1;
7586- ask = FALSE;
7587- break;
7588- }
7589- }
7590- if (menu_line > max_num) menu_line -= max_num;
7591- }
7592- /* Request redraw */
7593- if ((choice == ' ') || (choice == '*') || (choice == '?') || (use_menu && ask))
7594- {
7595- /* Show the list */
7596- if (!redraw || use_menu)
7597- {
7598- byte y, x = 10;
7599- int ctr;
7600- char dummy[80], dummy2[80];
7601- byte col;
7602-
7603- strcpy(dummy, "");
7604- redraw = TRUE;
7605- if (!use_menu) screen_save();
7606-
7607- for (y = 1; y < 24; y++)
7608- prt("", y, x);
7609-
7610- /* Print header(s) */
7611-#ifdef JP
7612- prt(format(" %-43s %6s/%s", "能力(必要エッセンス)", "必要数", "所持数"), 1, x);
7613-
7614-#else
7615- prt(format(" %-43s %6s/%s", "Ability (needed essence)", "Needs", "Possess"), 1, x);
7616-#endif
7617- /* Print list */
7618- for (ctr = 0; ctr < max_num; ctr++)
7619- {
7620- es_ptr = &essence_info[num[ctr]];
7621-
7622- if (use_menu)
7623- {
7624- if (ctr == (menu_line-1))
7625- strcpy(dummy, _("》 ", "> "));
7626- else strcpy(dummy, " ");
7627-
7628- }
7629- /* letter/number for power selection */
7630- else
7631- {
7632- sprintf(dummy, "%c) ",I2A(ctr));
7633- }
7634-
7635- strcat(dummy, es_ptr->add_name);
7636-
7637- col = TERM_WHITE;
7638- able[ctr] = TRUE;
7639-
7640- if (es_ptr->essence != -1)
7641- {
7642- strcat(dummy, format("(%s)", essence_name[es_ptr->essence]));
7643- if (p_ptr->magic_num1[es_ptr->essence] < es_ptr->value) able[ctr] = FALSE;
7644- }
7645- else
7646- {
7647- switch(es_ptr->add)
7648- {
7649- case ESSENCE_SH_FIRE:
7650- strcat(dummy, _("(焼棄+耐火炎)", "(brand fire + res.fire)"));
7651- if (p_ptr->magic_num1[TR_BRAND_FIRE] < es_ptr->value) able[ctr] = FALSE;
7652- if (p_ptr->magic_num1[TR_RES_FIRE] < es_ptr->value) able[ctr] = FALSE;
7653- break;
7654- case ESSENCE_SH_ELEC:
7655- strcat(dummy, _("(電撃+耐電撃)", "(brand elec. + res. elec.)"));
7656- if (p_ptr->magic_num1[TR_BRAND_ELEC] < es_ptr->value) able[ctr] = FALSE;
7657- if (p_ptr->magic_num1[TR_RES_ELEC] < es_ptr->value) able[ctr] = FALSE;
7658- break;
7659- case ESSENCE_SH_COLD:
7660- strcat(dummy, _("(凍結+耐冷気)", "(brand cold + res. cold)"));
7661- if (p_ptr->magic_num1[TR_BRAND_COLD] < es_ptr->value) able[ctr] = FALSE;
7662- if (p_ptr->magic_num1[TR_RES_COLD] < es_ptr->value) able[ctr] = FALSE;
7663- break;
7664- case ESSENCE_RESISTANCE:
7665- strcat(dummy, _("(耐火炎+耐冷気+耐電撃+耐酸)", "(r.fire+r.cold+r.elec+r.acid)"));
7666- if (p_ptr->magic_num1[TR_RES_FIRE] < es_ptr->value) able[ctr] = FALSE;
7667- if (p_ptr->magic_num1[TR_RES_COLD] < es_ptr->value) able[ctr] = FALSE;
7668- if (p_ptr->magic_num1[TR_RES_ELEC] < es_ptr->value) able[ctr] = FALSE;
7669- if (p_ptr->magic_num1[TR_RES_ACID] < es_ptr->value) able[ctr] = FALSE;
7670- break;
7671- case ESSENCE_SUSTAIN:
7672- strcat(dummy, _("(耐火炎+耐冷気+耐電撃+耐酸)", "(r.fire+r.cold+r.elec+r.acid)"));
7673- if (p_ptr->magic_num1[TR_RES_FIRE] < es_ptr->value) able[ctr] = FALSE;
7674- if (p_ptr->magic_num1[TR_RES_COLD] < es_ptr->value) able[ctr] = FALSE;
7675- if (p_ptr->magic_num1[TR_RES_ELEC] < es_ptr->value) able[ctr] = FALSE;
7676- if (p_ptr->magic_num1[TR_RES_ACID] < es_ptr->value) able[ctr] = FALSE;
7677- break;
7678- }
7679- }
7680-
7681- if (!able[ctr]) col = TERM_RED;
7682-
7683- if (es_ptr->essence != -1)
7684- {
7685- sprintf(dummy2, "%-49s %3d/%d", dummy, es_ptr->value, (int)p_ptr->magic_num1[es_ptr->essence]);
7686- }
7687- else
7688- {
7689- sprintf(dummy2, "%-49s %3d/(\?\?)", dummy, es_ptr->value);
7690- }
7691-
7692- c_prt(col, dummy2, ctr+2, x);
7693- }
7694- }
7695-
7696- /* Hide the list */
7697- else
7698- {
7699- /* Hide list */
7700- redraw = FALSE;
7701- screen_load();
7702- }
7703-
7704- /* Redo asking */
7705- continue;
7706- }
7707-
7708- if (!use_menu)
7709- {
7710- /* Note verify */
7711- ask = (isupper(choice));
7712-
7713- /* Lowercase */
7714- if (ask) choice = (char)tolower(choice);
7715-
7716- /* Extract request */
7717- i = (islower(choice) ? A2I(choice) : -1);
7718- }
7719-
7720- /* Totally Illegal */
7721- if ((i < 0) || (i >= max_num) || !able[i])
7722- {
7723- bell();
7724- continue;
7725- }
7726-
7727- /* Verify it */
7728- if (ask)
7729- {
7730- char tmp_val[160];
7731-
7732- /* Prompt */
7733- (void) strnfmt(tmp_val, 78, _("%sを付加しますか? ", "Add the abilitiy of %s? "), essence_info[num[i]].add_name);
7734-
7735- /* Belay that order */
7736- if (!get_check(tmp_val)) continue;
7737- }
7738-
7739- /* Stop the loop */
7740- flag = TRUE;
7741- }
7742- if (redraw) screen_load();
7743-
7744- if (!flag) return;
7745-
7746- repeat_push(i);
7747- }
7748- es_ptr = &essence_info[num[i]];
7749-
7750- if (es_ptr->add == ESSENCE_SLAY_GLOVE)
7751- item_tester_tval = TV_GLOVES;
7752- else if (mode == 1 || mode == 5)
7753- item_tester_hook = item_tester_hook_melee_ammo;
7754- else if (es_ptr->add == ESSENCE_ATTACK)
7755- item_tester_hook = object_allow_enchant_weapon;
7756- else if (es_ptr->add == ESSENCE_AC)
7757- item_tester_hook = object_is_armour;
7758- else
7759- item_tester_hook = object_is_weapon_armour_ammo;
7760-
7761- q = _("どのアイテムを改良しますか?", "Improve which item? ");
7762- s = _("改良できるアイテムがありません。", "You have nothing to improve.");
7763-
7764- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
7765- if (!o_ptr) return;
7766-
7767- if ((mode != 10) && (object_is_artifact(o_ptr) || object_is_smith(o_ptr)))
7768- {
7769- msg_print(_("そのアイテムはこれ以上改良できない。", "This item is no more able to be improved."));
7770- return;
7771- }
7772-
7773- object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
7774-
7775- use_essence = es_ptr->value;
7776- if ((o_ptr->tval >= TV_SHOT) && (o_ptr->tval <= TV_BOLT)) use_essence = (use_essence+9)/10;
7777- if (o_ptr->number > 1)
7778- {
7779- use_essence *= o_ptr->number;
7780- msg_format(_("%d個あるのでエッセンスは%d必要です。", "It will take %d essences."), o_ptr->number, use_essence);
7781- }
7782-
7783- if (es_ptr->essence != -1)
7784- {
7785- if (p_ptr->magic_num1[es_ptr->essence] < use_essence)
7786- {
7787- msg_print(_("エッセンスが足りない。", "You don't have enough essences."));
7788- return;
7789- }
7790- if (is_pval_flag(es_ptr->add))
7791- {
7792- if (o_ptr->pval < 0)
7793- {
7794- msg_print(_("このアイテムの能力修正を強化することはできない。", "You cannot increase magic number of this item."));
7795- return;
7796- }
7797- else if (es_ptr->add == TR_BLOWS)
7798- {
7799- if (o_ptr->pval > 1)
7800- {
7801- if (!get_check(_("修正値は1になります。よろしいですか?", "The magic number of this weapon will become 1. Are you sure? "))) return;
7802- }
7803-
7804- o_ptr->pval = 1;
7805- msg_format(_("エッセンスを%d個使用します。", "It will take %d essences."), use_essence);
7806- }
7807- else if (o_ptr->pval > 0)
7808- {
7809- use_essence *= o_ptr->pval;
7810- msg_format(_("エッセンスを%d個使用します。", "It will take %d essences."), use_essence);
7811- }
7812- else
7813- {
7814- char tmp[80];
7815- char tmp_val[160];
7816- PARAMETER_VALUE pval;
7817- PARAMETER_VALUE limit = MIN(5, p_ptr->magic_num1[es_ptr->essence]/es_ptr->value);
7818-
7819- sprintf(tmp, _("いくつ付加しますか? (1-%d): ", "Enchant how many? (1-%d): "), limit);
7820- strcpy(tmp_val, "1");
7821-
7822- if (!get_string(tmp, tmp_val, 1)) return;
7823- pval = (PARAMETER_VALUE)atoi(tmp_val);
7824- if (pval > limit) pval = limit;
7825- else if (pval < 1) pval = 1;
7826- o_ptr->pval += pval;
7827- use_essence *= pval;
7828- msg_format(_("エッセンスを%d個使用します。", "It will take %d essences."), use_essence);
7829- }
7830-
7831- if (p_ptr->magic_num1[es_ptr->essence] < use_essence)
7832- {
7833- msg_print(_("エッセンスが足りない。", "You don't have enough essences."));
7834- return;
7835- }
7836- }
7837- else if (es_ptr->add == ESSENCE_SLAY_GLOVE)
7838- {
7839- char tmp_val[160];
7840- int val;
7841- HIT_PROB get_to_h;
7842- HIT_POINT get_to_d;
7843-
7844- strcpy(tmp_val, "1");
7845- if (!get_string(format(_("いくつ付加しますか? (1-%d):", "Enchant how many? (1-%d):"), p_ptr->lev/7+3), tmp_val, 2)) return;
7846- val = atoi(tmp_val);
7847- if (val > p_ptr->lev/7+3) val = p_ptr->lev/7+3;
7848- else if (val < 1) val = 1;
7849- use_essence *= val;
7850- msg_format(_("エッセンスを%d個使用します。", "It will take %d essences."), use_essence);
7851- if (p_ptr->magic_num1[es_ptr->essence] < use_essence)
7852- {
7853- msg_print(_("エッセンスが足りない。", "You don't have enough essences."));
7854- return;
7855- }
7856- get_to_h = ((val+1)/2+randint0(val/2+1));
7857- get_to_d = ((val+1)/2+randint0(val/2+1));
7858- o_ptr->xtra4 = (get_to_h<<8)+get_to_d;
7859- o_ptr->to_h += get_to_h;
7860- o_ptr->to_d += get_to_d;
7861- }
7862- p_ptr->magic_num1[es_ptr->essence] -= use_essence;
7863- if (es_ptr->add == ESSENCE_ATTACK)
7864- {
7865- if ((o_ptr->to_h >= p_ptr->lev/5+5) && (o_ptr->to_d >= p_ptr->lev/5+5))
7866- {
7867- msg_print(_("改良に失敗した。", "You failed to enchant."));
7868- take_turn(p_ptr, 100);
7869- return;
7870- }
7871- else
7872- {
7873- if (o_ptr->to_h < p_ptr->lev/5+5) o_ptr->to_h++;
7874- if (o_ptr->to_d < p_ptr->lev/5+5) o_ptr->to_d++;
7875- }
7876- }
7877- else if (es_ptr->add == ESSENCE_AC)
7878- {
7879- if (o_ptr->to_a >= p_ptr->lev/5+5)
7880- {
7881- msg_print(_("改良に失敗した。", "You failed to enchant."));
7882- take_turn(p_ptr, 100);
7883- return;
7884- }
7885- else
7886- {
7887- if (o_ptr->to_a < p_ptr->lev/5+5) o_ptr->to_a++;
7888- }
7889- }
7890- else
7891- {
7892- o_ptr->xtra3 = es_ptr->add + 1;
7893- }
7894- }
7895- else
7896- {
7897- bool success = TRUE;
7898-
7899- switch(es_ptr->add)
7900- {
7901- case ESSENCE_SH_FIRE:
7902- if ((p_ptr->magic_num1[TR_BRAND_FIRE] < use_essence) || (p_ptr->magic_num1[TR_RES_FIRE] < use_essence))
7903- {
7904- success = FALSE;
7905- break;
7906- }
7907- p_ptr->magic_num1[TR_BRAND_FIRE] -= use_essence;
7908- p_ptr->magic_num1[TR_RES_FIRE] -= use_essence;
7909- break;
7910- case ESSENCE_SH_ELEC:
7911- if ((p_ptr->magic_num1[TR_BRAND_ELEC] < use_essence) || (p_ptr->magic_num1[TR_RES_ELEC] < use_essence))
7912- {
7913- success = FALSE;
7914- break;
7915- }
7916- p_ptr->magic_num1[TR_BRAND_ELEC] -= use_essence;
7917- p_ptr->magic_num1[TR_RES_ELEC] -= use_essence;
7918- break;
7919- case ESSENCE_SH_COLD:
7920- if ((p_ptr->magic_num1[TR_BRAND_COLD] < use_essence) || (p_ptr->magic_num1[TR_RES_COLD] < use_essence))
7921- {
7922- success = FALSE;
7923- break;
7924- }
7925- p_ptr->magic_num1[TR_BRAND_COLD] -= use_essence;
7926- p_ptr->magic_num1[TR_RES_COLD] -= use_essence;
7927- break;
7928- case ESSENCE_RESISTANCE:
7929- case ESSENCE_SUSTAIN:
7930- if ((p_ptr->magic_num1[TR_RES_ACID] < use_essence) || (p_ptr->magic_num1[TR_RES_ELEC] < use_essence) || (p_ptr->magic_num1[TR_RES_FIRE] < use_essence) || (p_ptr->magic_num1[TR_RES_COLD] < use_essence))
7931- {
7932- success = FALSE;
7933- break;
7934- }
7935- p_ptr->magic_num1[TR_RES_ACID] -= use_essence;
7936- p_ptr->magic_num1[TR_RES_ELEC] -= use_essence;
7937- p_ptr->magic_num1[TR_RES_FIRE] -= use_essence;
7938- p_ptr->magic_num1[TR_RES_COLD] -= use_essence;
7939- break;
7940- }
7941- if (!success)
7942- {
7943- msg_print(_("エッセンスが足りない。", "You don't have enough essences."));
7944- return;
7945- }
7946- if (es_ptr->add == ESSENCE_SUSTAIN)
7947- {
7948- add_flag(o_ptr->art_flags, TR_IGNORE_ACID);
7949- add_flag(o_ptr->art_flags, TR_IGNORE_ELEC);
7950- add_flag(o_ptr->art_flags, TR_IGNORE_FIRE);
7951- add_flag(o_ptr->art_flags, TR_IGNORE_COLD);
7952- }
7953- else
7954- {
7955- o_ptr->xtra3 = es_ptr->add + 1;
7956- }
7957- }
7958-
7959- take_turn(p_ptr, 100);
7960-
7961-#ifdef JP
7962- msg_format(_("%sに%sの能力を付加しました。", "You have added ability of %s to %s."), o_name, es_ptr->add_name);
7963-#else
7964- msg_format(, es_ptr->add_name, o_name);
7965-#endif
7966- p_ptr->update |= (PU_COMBINE | PU_REORDER);
7967- p_ptr->window |= (PW_INVEN);
7968-}
7969-
7970-/*!
7971- * @brief エッセンスを消去する
7972- * @return なし
7973- */
7974-static void erase_essence(void)
7975-{
7976- OBJECT_IDX item;
7977- concptr q, s;
7978- object_type *o_ptr;
7979- GAME_TEXT o_name[MAX_NLEN];
7980- BIT_FLAGS flgs[TR_FLAG_SIZE];
7981-
7982- item_tester_hook = object_is_smith;
7983-
7984- q = _("どのアイテムのエッセンスを消去しますか?", "Remove from which item? ");
7985- s = _("エッセンスを付加したアイテムがありません。", "You have nothing to remove essence.");
7986-
7987- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
7988- if (!o_ptr) return;
7989-
7990- object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
7991- if (!get_check(format(_("よろしいですか? [%s]", "Are you sure? [%s]"), o_name))) return;
7992-
7993- take_turn(p_ptr, 100);
7994-
7995- if (o_ptr->xtra3 == 1 + ESSENCE_SLAY_GLOVE)
7996- {
7997- o_ptr->to_h -= (o_ptr->xtra4>>8);
7998- o_ptr->to_d -= (o_ptr->xtra4 & 0x000f);
7999- o_ptr->xtra4 = 0;
8000- if (o_ptr->to_h < 0) o_ptr->to_h = 0;
8001- if (o_ptr->to_d < 0) o_ptr->to_d = 0;
8002- }
8003- o_ptr->xtra3 = 0;
8004- object_flags(o_ptr, flgs);
8005- if (!(have_pval_flags(flgs))) o_ptr->pval = 0;
8006- msg_print(_("エッセンスを取り去った。", "You removed all essence you have added."));
8007- p_ptr->update |= (PU_COMBINE | PU_REORDER);
8008- p_ptr->window |= (PW_INVEN);
8009-}
8010-
8011-/*!
8012- * @brief 鍛冶コマンドのメインルーチン
8013- * @param only_browse TRUEならばエッセンス一覧の表示のみを行う
8014- * @return なし
8015- */
8016-void do_cmd_kaji(bool only_browse)
8017-{
8018- COMMAND_CODE mode = 0;
8019- char choice;
8020-
8021- COMMAND_CODE menu_line = (use_menu ? 1 : 0);
8022-
8023- if (!only_browse)
8024- {
8025- if (cmd_limit_confused(p_ptr)) return;
8026- if (p_ptr->blind)
8027- {
8028- msg_print(_("目が見えなくて作業できない!", "You are blind!"));
8029- return;
8030- }
8031- if (p_ptr->image)
8032- {
8033- msg_print(_("うまく見えなくて作業できない!", "You are hallucinating!"));
8034- return;
8035- }
8036- }
8037-
8038- if (!(repeat_pull(&mode) && 1 <= mode && mode <= 5))
8039- {
8040- if (only_browse) screen_save();
8041- do {
8042- if (!only_browse) screen_save();
8043- if (use_menu)
8044- {
8045- while(!mode)
8046- {
8047-#ifdef JP
8048- prt(format(" %s エッセンス一覧", (menu_line == 1) ? "》" : " "), 2, 14);
8049- prt(format(" %s エッセンス抽出", (menu_line == 2) ? "》" : " "), 3, 14);
8050- prt(format(" %s エッセンス消去", (menu_line == 3) ? "》" : " "), 4, 14);
8051- prt(format(" %s エッセンス付加", (menu_line == 4) ? "》" : " "), 5, 14);
8052- prt(format(" %s 武器/防具強化", (menu_line == 5) ? "》" : " "), 6, 14);
8053- prt(format("どの種類の技術を%sますか?", only_browse ? "調べ" : "使い"), 0, 0);
8054-#else
8055- prt(format(" %s List essences", (menu_line == 1) ? "> " : " "), 2, 14);
8056- prt(format(" %s Extract essence", (menu_line == 2) ? "> " : " "), 3, 14);
8057- prt(format(" %s Remove essence", (menu_line == 3) ? "> " : " "), 4, 14);
8058- prt(format(" %s Add essence", (menu_line == 4) ? "> " : " "), 5, 14);
8059- prt(format(" %s Enchant weapon/armor", (menu_line == 5) ? "> " : " "), 6, 14);
8060- prt(format("Choose command from menu."), 0, 0);
8061-#endif
8062- choice = inkey();
8063- switch(choice)
8064- {
8065- case ESCAPE:
8066- case 'z':
8067- case 'Z':
8068- screen_load();
8069- return;
8070- case '2':
8071- case 'j':
8072- case 'J':
8073- menu_line++;
8074- break;
8075- case '8':
8076- case 'k':
8077- case 'K':
8078- menu_line+= 4;
8079- break;
8080- case '\r':
8081- case '\n':
8082- case 'x':
8083- case 'X':
8084- mode = menu_line;
8085- break;
8086- }
8087- if (menu_line > 5) menu_line -= 5;
8088- }
8089- }
8090-
8091- else
8092- {
8093- while (!mode)
8094- {
8095- prt(_(" a) エッセンス一覧", " a) List essences"), 2, 14);
8096- prt(_(" b) エッセンス抽出", " b) Extract essence"), 3, 14);
8097- prt(_(" c) エッセンス消去", " c) Remove essence"), 4, 14);
8098- prt(_(" d) エッセンス付加", " d) Add essence"), 5, 14);
8099- prt(_(" e) 武器/防具強化", " e) Enchant weapon/armor"), 6, 14);
8100-#ifdef JP
8101- if (!get_com(format("どの能力を%sますか:", only_browse ? "調べ" : "使い"), &choice, TRUE))
8102-#else
8103- if (!get_com("Command :", &choice, TRUE))
8104-#endif
8105- {
8106- screen_load();
8107- return;
8108- }
8109- switch (choice)
8110- {
8111- case 'A':
8112- case 'a':
8113- mode = 1;
8114- break;
8115- case 'B':
8116- case 'b':
8117- mode = 2;
8118- break;
8119- case 'C':
8120- case 'c':
8121- mode = 3;
8122- break;
8123- case 'D':
8124- case 'd':
8125- mode = 4;
8126- break;
8127- case 'E':
8128- case 'e':
8129- mode = 5;
8130- break;
8131- }
8132- }
8133- }
8134-
8135- if (only_browse)
8136- {
8137- char temp[62*5];
8138- int line, j;
8139-
8140- /* Clear lines, position cursor (really should use strlen here) */
8141- Term_erase(14, 21, 255);
8142- Term_erase(14, 20, 255);
8143- Term_erase(14, 19, 255);
8144- Term_erase(14, 18, 255);
8145- Term_erase(14, 17, 255);
8146- Term_erase(14, 16, 255);
8147-
8148- roff_to_buf(kaji_tips[mode-1], 62, temp, sizeof(temp));
8149- for(j=0, line = 17;temp[j];j+=(1+strlen(&temp[j])))
8150- {
8151- prt(&temp[j], line, 15);
8152- line++;
8153- }
8154- mode = 0;
8155- }
8156- if (!only_browse) screen_load();
8157- } while (only_browse);
8158- repeat_push(mode);
8159- }
8160- switch(mode)
8161- {
8162- case 1: display_essence();break;
8163- case 2: drain_essence();break;
8164- case 3: erase_essence();break;
8165- case 4:
8166- mode = choose_essence();
8167- if (mode == 0)
8168- break;
8169- add_essence(mode);
8170- break;
8171- case 5: add_essence(10);break;
8172- }
8173-}
8174-
81756656
81766657 /*!
81776658 * @brief 投擲時たいまつに投げやすい/焼棄/アンデッドスレイの特別効果を返す。
--- a/src/store.c
+++ b/src/store.c
@@ -12,6 +12,7 @@
1212
1313 #include "angband.h"
1414 #include "cmd-item.h"
15+#include "cmd-smith.h"
1516 #include "cmd-zapwand.h"
1617 #include "cmd-magiceat.h"
1718 #include "store.h"
Show on old repository browser