OSDN Git Service

9e3850d5395dab03d0a5250e057cb12caeb3e3f5
[hengband/hengband.git] / src / cmd-activate.c
1 /*!
2 * @file cmd-activate.c
3 * @brief プレイヤーの発動コマンド実装
4 * @date 2018/09/07
5 * @details
6 * cmd6.cより分離。
7 */
8
9 #include "angband.h"
10 #include "util.h"
11
12 #include "cmd-activate.h"
13 #include "cmd-basic.h"
14 #include "floor.h"
15 #include "object-hook.h"
16 #include "sort.h"
17 #include "artifact.h"
18 #include "avatar.h"
19 #include "spells.h"
20 #include "spells-summon.h"
21 #include "spells-status.h"
22 #include "spells-object.h"
23 #include "spells-floor.h"
24 #include "realm-hex.h"
25 #include "player-status.h"
26 #include "player-effects.h"
27 #include "monster-status.h"
28 #include "files.h"
29 #include "objectkind.h"
30 #include "object-ego.h"
31 #include "grid.h"
32
33 /*!
34  * @brief アイテムの発動効果テーブル /
35  * Define flags, levels, values of activations
36  */
37 const activation_type activation_info[] =
38 {
39         { "SUNLIGHT", ACT_SUNLIGHT, 10, 250, {10, 0},
40           _("太陽光線", "beam of sunlight") },
41         { "BO_MISS_1", ACT_BO_MISS_1, 10, 250, {2, 0},
42           _("マジック・ミサイル(2d6)", "magic missile (2d6)") },
43         { "BA_POIS_1", ACT_BA_POIS_1, 10, 300, {4, 0},
44           _("悪臭雲(12)", "stinking cloud (12)") },
45         { "BO_ELEC_1", ACT_BO_ELEC_1, 20, 250, {5, 0},
46           _("サンダー・ボルト(4d8)", "lightning bolt (4d8)") },
47         { "BO_ACID_1", ACT_BO_ACID_1, 20, 250, {6, 0},
48           _("アシッド・ボルト(5d8)", "acid bolt (5d8)") },
49         { "BO_COLD_1", ACT_BO_COLD_1, 20, 250, {7, 0},
50           _("アイス・ボルト(6d8)", "frost bolt (6d8)") },
51         { "BO_FIRE_1", ACT_BO_FIRE_1, 20, 250, {8, 0},
52           _("ファイア・ボルト(9d8)", "fire bolt (9d8)") },
53         { "BA_COLD_1", ACT_BA_COLD_1, 30, 750, {6, 0},
54           _("アイス・ボール(48)", "ball of cold (48)") },
55         { "BA_COLD_2", ACT_BA_COLD_2, 40, 1000, {12, 0},
56           _("アイス・ボール(100)", "ball of cold (100)") },
57         { "BA_COLD_3", ACT_BA_COLD_3, 70, 2500, {50, 0},
58           _("巨大アイス・ボール(400)", "ball of cold (400)") },
59         { "BA_FIRE_1", ACT_BA_FIRE_1, 30, 1000, {9, 0},
60           _("ファイア・ボール(72)", "ball of fire (72)") },
61         { "BA_FIRE_2", ACT_BA_FIRE_2, 40, 1500, {15, 0},
62           _("巨大ファイア・ボール(120)", "large fire ball (120)") },
63         { "BA_FIRE_3", ACT_BA_FIRE_3, 60, 1750, {40, 0},
64           _("巨大ファイア・ボール(300)", "fire ball (300)") },
65         { "BA_FIRE_4", ACT_BA_FIRE_4, 40, 1000, {12, 0},
66           _("ファイア・ボール(100)", "fire ball (100)") },
67         { "BA_ELEC_2", ACT_BA_ELEC_2, 40, 1000, {12, 0},
68           _("サンダー・ボール(100)", "ball of lightning (100)") },
69         { "BA_ELEC_3", ACT_BA_ELEC_3, 70, 2500, {70, 0},
70           _("巨大サンダー・ボール(500)", "ball of lightning (500)") },
71         { "BA_ACID_1", ACT_BA_ACID_1, 30, 1000, {12, 0},
72           _("アシッド・ボール(100)", "ball of acid (100)") },
73         { "BA_NUKE_1", ACT_BA_NUKE_1, 50, 1000, {12, 0},
74           _("放射能球(100)", "ball of nuke (100)") },
75         { "HYPODYNAMIA_1", ACT_HYPODYNAMIA_1, 30, 500, {12, 0},
76           _("窒息攻撃(100)", "a strangling attack (100)") },
77         { "HYPODYNAMIA_2", ACT_HYPODYNAMIA_2, 40, 750, {15, 0},
78           _("衰弱の矢(120)", "hypodynamic bolt (120)") },
79         { "DRAIN_1", ACT_DRAIN_1, 40, 1000, {20, 0},
80           _("吸収の矢(3*50)", "drain bolt (3*50)") },
81         { "BO_MISS_2", ACT_BO_MISS_2, 40, 1000, {20, 0},
82           _("矢(150)", "arrows (150)") },
83         { "WHIRLWIND", ACT_WHIRLWIND, 50, 7500, {25, 0},
84           _("カマイタチ", "whirlwind attack") },
85         { "DRAIN_2", ACT_DRAIN_2, 50, 2500, {40, 0},
86           _("吸収の矢(3*100)", "drain bolt (3*100)") },
87         { "CALL_CHAOS", ACT_CALL_CHAOS, 70, 5000, {35, 0},
88           _("混沌召来", "call chaos") },
89         { "ROCKET", ACT_ROCKET, 70, 5000, {20, 0},
90           _("ロケット(120+レベル)", "launch rocket (120+level)") },
91         { "DISP_EVIL", ACT_DISP_EVIL, 50, 4000, {50, 0},
92           _("邪悪退散(x5)", "dispel evil (x5)") },
93         { "BA_MISS_3", ACT_BA_MISS_3, 50, 1500, {50, 0},
94           _("エレメントのブレス(300)", "elemental breath (300)") },
95         { "DISP_GOOD", ACT_DISP_GOOD, 50, 3500, {50, 0},
96           _("善良退散(x5)", "dispel good (x5)") },
97         { "BO_MANA", ACT_BO_MANA, 40, 1500, {20, 0},
98           _("魔法の矢(150)", "a magical arrow (150)") },
99         { "BA_WATER", ACT_BA_WATER, 50, 2000, {25, 0},
100           _("ウォーター・ボール(200)", "water ball (200)") },
101         { "BA_STAR", ACT_BA_STAR, 50, 2200, {25, 0},
102           _("巨大スター・ボール(200)", "large star ball (200)") },
103         { "BA_DARK", ACT_BA_DARK, 50, 2200, {30, 0},
104           _("暗黒の嵐(250)", "darkness storm (250)") },
105         { "BA_MANA", ACT_BA_MANA, 70, 2500, {30, 0},
106           _("魔力の嵐(250)", "a mana storm (250)") },
107         { "PESTICIDE", ACT_PESTICIDE, 10, 500, {10, 0},
108           _("害虫の駆除", "dispel small life") },
109         { "BLINDING_LIGHT", ACT_BLINDING_LIGHT, 30, 5000, {40, 0},
110           _("眩しい光", "blinding light") },
111         { "BIZARRE", ACT_BIZARRE, 90, 10000, {50, 0},
112           _("信じ難いこと", "bizarre things") },
113         { "CAST_BA_STAR", ACT_CAST_BA_STAR, 70, 7500, {100, 0},
114           _("スター・ボール・ダスト(150)", "cast star balls (150)") },
115         { "BLADETURNER", ACT_BLADETURNER, 80, 20000, {80, 0},
116           _("エレメントのブレス(300), 士気高揚、祝福、耐性", "breathe elements (300), hero, bless, and resistance") },
117         { "BR_FIRE", ACT_BR_FIRE, 50, 5000, {-1, 0},
118           _("火炎のブレス (200)", "fire breath (200)") },
119         { "BR_COLD", ACT_BR_COLD, 50, 5000, {-1, 0},
120           _("冷気のブレス (200)", "cold breath (200)") },
121         { "BR_DRAGON", ACT_BR_DRAGON, 70, 10000, { 30, 0 },
122           "" /* built by item_activation_dragon_breath() */ },
123
124         { "CONFUSE", ACT_CONFUSE, 10, 500, {10, 0},
125           _("パニック・モンスター", "confuse monster") },
126         { "SLEEP", ACT_SLEEP, 10, 750, {15, 0},
127           _("周囲のモンスターを眠らせる", "sleep nearby monsters") },
128         { "QUAKE", ACT_QUAKE, 30, 600, {20, 0},
129           _("地震", "earthquake") },
130         { "TERROR", ACT_TERROR, 20, 2500, {-1, 0},
131           _("恐慌", "terror") },
132         { "TELE_AWAY", ACT_TELE_AWAY, 20, 2000, {15, 0},
133           _("テレポート・アウェイ", "teleport away") },
134         { "BANISH_EVIL", ACT_BANISH_EVIL, 40, 2000, {250, 0},
135           _("邪悪消滅", "banish evil") },
136         { "GENOCIDE", ACT_GENOCIDE, 50, 10000, {500, 0},
137           _("抹殺", "genocide") },
138         { "MASS_GENO", ACT_MASS_GENO, 50, 10000, {1000, 0},
139           _("周辺抹殺", "mass genocide") },
140         { "SCARE_AREA", ACT_SCARE_AREA, 20, 2500, {20, 0},
141           _("モンスター恐慌", "frighten monsters") },
142         { "AGGRAVATE", ACT_AGGRAVATE, 0, 100, {0, 0},
143           _("モンスターを怒らせる", "aggravete monsters") },
144
145         { "CHARM_ANIMAL", ACT_CHARM_ANIMAL, 40, 7500, {200, 0},
146           _("動物魅了", "charm animal") },
147         { "CHARM_UNDEAD", ACT_CHARM_UNDEAD, 40, 10000, {333, 0},
148           _("アンデッド従属", "enslave undead") },
149         { "CHARM_OTHER", ACT_CHARM_OTHER, 40, 10000, {400, 0},
150           _("モンスター魅了", "charm monster") },
151         { "CHARM_ANIMALS", ACT_CHARM_ANIMALS, 40, 12500, {500, 0},
152           _("動物友和", "animal friendship") },
153         { "CHARM_OTHERS", ACT_CHARM_OTHERS, 40, 17500, {750, 0},
154           _("周辺魅了", "mass charm") },
155         { "SUMMON_ANIMAL", ACT_SUMMON_ANIMAL, 50, 10000, {200, 300},
156           _("動物召喚", "summon animal") },
157         { "SUMMON_PHANTOM", ACT_SUMMON_PHANTOM, 50, 12000, {200, 200},
158           _("幻霊召喚", "summon phantasmal servant") },
159         { "SUMMON_ELEMENTAL", ACT_SUMMON_ELEMENTAL, 50, 15000, {750, 0},
160           _("エレメンタル召喚", "summon elemental") },
161         { "SUMMON_DEMON", ACT_SUMMON_DEMON, 50, 20000, {666, 0},
162           _("悪魔召喚", "summon demon") },
163         { "SUMMON_UNDEAD", ACT_SUMMON_UNDEAD, 50, 20000, {666, 0},
164           _("アンデッド召喚", "summon undead") },
165         { "SUMMON_HOUND", ACT_SUMMON_HOUND, 50, 15000, {300, 0},
166           _("ハウンド召喚", "summon hound") },
167         { "SUMMON_DAWN", ACT_SUMMON_DAWN, 50, 15000, {500, 0},
168           _("暁の師団召喚", "summon the Legion of the Dawn") },
169         { "SUMMON_OCTOPUS", ACT_SUMMON_OCTOPUS, 50, 15000, {300, 0},
170           _("蛸の大群召喚", "summon octopus") },
171
172         { "CHOIR_SINGS", ACT_CHOIR_SINGS, 60, 20000, {300, 0},
173           _("回復(777)、癒し、士気高揚", "heal 777 hit points, curing and HEROism") },
174         { "CURE_LW", ACT_CURE_LW, 10, 500, {10, 0},
175           _("恐怖除去/体力回復(30)", "remove fear and heal 30 hp") },
176         { "CURE_MW", ACT_CURE_MW, 20, 750, {3, 3},
177           _("傷回復(4d8)", "heal 4d8 and wounds") },
178         { "CURE_POISON", ACT_CURE_POISON, 10, 1000, {5, 0},
179           _("恐怖除去/毒消し", "remove fear and cure poison") },
180         { "REST_LIFE", ACT_REST_EXP, 40, 7500, {450, 0},
181           _("経験値復活", "restore experience") },
182         { "REST_ALL", ACT_REST_ALL, 30, 15000, {750, 0},
183           _("全ステータスと経験値復活", "restore stats and experience") },
184         { "CURE_700", ACT_CURE_700, 40, 10000, {250, 0},
185           _("体力回復(700)", "heal 700 hit points") },
186         { "CURE_1000", ACT_CURE_1000, 50, 15000, {888, 0},
187           _("体力回復(1000)", "heal 1000 hit points") },
188         { "CURING", ACT_CURING, 30, 5000, {100, 0},
189           _("癒し", "curing") },
190         { "CURE_MANA_FULL", ACT_CURE_MANA_FULL, 60, 20000, {777, 0},
191           _("魔力復活", "restore mana") },
192
193         { "ESP", ACT_ESP, 30, 1500, {100, 0},
194           _("テレパシー(期間 25+d30)", "telepathy (dur 25+d30)") },
195         { "BERSERK", ACT_BERSERK, 10, 800, {75, 0},
196           _("狂戦士化(25+d25ターン)", "berserk (25+d25 turns)") },
197         { "PROT_EVIL", ACT_PROT_EVIL, 30, 5000, {100, 0},
198           _("対邪悪結界(期間 3*レベル+d25)", "protect evil (dur level*3 + d25)") },
199         { "RESIST_ALL", ACT_RESIST_ALL, 30, 5000, {111, 0},
200           _("全耐性(期間 20+d20)", "resist elements (dur 20+d20)") },
201         { "SPEED", ACT_SPEED, 40, 15000, {250, 0},
202           _("加速(期間 20+d20)", "speed (dur 20+d20)") },
203         { "XTRA_SPEED", ACT_XTRA_SPEED, 40, 25000, {200, 200},
204           _("加速(期間 75+d75)", "speed (dur 75+d75)") },
205         { "WRAITH", ACT_WRAITH, 90, 25000, {1000, 0},
206           _("幽体化(期間 (レベル/2)+d(レベル/2))", "wraith form (dur level/2 + d(level/2))") },
207         { "INVULN", ACT_INVULN, 90, 25000, {1000, 0},
208           _("無敵化(期間 8+d8)", "invulnerability (dur 8+d8)") },
209         { "HERO", ACT_HERO, 10, 500, {30, 30},
210           _("士気高揚", "heroism") },
211         { "HERO_SPEED", ACT_HERO_SPEED, 30, 20000, {100, 200},
212           _("士気高揚, スピード(期間 50+d50ターン)", "hero and +10 to speed (50)") },
213         { "RESIST_ACID", ACT_RESIST_ACID, 20, 2000, {40, 40},
214           _("酸への耐性(期間 20+d20)", "resist acid (dur 20+d20)") },
215         { "RESIST_FIRE", ACT_RESIST_FIRE, 20, 2000, {40, 40},
216           _("火炎への耐性(期間 20+d20)", "resist fire (dur 20+d20)") },
217         { "RESIST_COLD", ACT_RESIST_COLD, 20, 2000, {40, 40},
218           _("冷気への耐性(期間 20+d20)", "resist cold (dur 20+d20)") },
219         { "RESIST_ELEC", ACT_RESIST_ELEC, 20, 2000, {40, 40},
220           _("電撃への耐性(期間 20+d20)", "resist elec (dur 20+d20)") },
221         { "RESIST_POIS", ACT_RESIST_POIS, 20, 2000, {40, 40},
222           _("毒への耐性(期間 20+d20)", "resist poison (dur 20+d20)") },
223
224         { "LIGHT", ACT_LIGHT, 10, 150, {10, 10},
225           _("イルミネーション", "light area (dam 2d15)") },
226         { "MAP_LIGHT", ACT_MAP_LIGHT, 30, 500, {50, 50},
227           _("魔法の地図と光", "light (dam 2d15) & map area") },
228         { "DETECT_ALL", ACT_DETECT_ALL, 30, 1000, {55, 55},
229           _("全感知", "detection") },
230         { "DETECT_XTRA", ACT_DETECT_XTRA, 50, 12500, {100, 0},
231           _("全感知、探索、*鑑定*", "detection, probing and identify true") },
232         { "ID_FULL", ACT_ID_FULL, 50, 10000, {75, 0},
233           _("*鑑定*", "identify true") },
234         { "ID_PLAIN", ACT_ID_PLAIN, 20, 1250, {10, 0},
235           _("鑑定", "identify spell") },
236         { "RUNE_EXPLO", ACT_RUNE_EXPLO, 40, 4000, {200, 0},
237           _("爆発のルーン", "explosive rune") },
238         { "RUNE_PROT", ACT_RUNE_PROT, 60, 10000, {400, 0},
239           _("守りのルーン", "rune of protection") },
240         { "SATIATE", ACT_SATIATE, 10, 2000, {200, 0},
241           _("空腹充足", "satisfy hunger") },
242         { "DEST_DOOR", ACT_DEST_DOOR, 10, 100, {10, 0},
243           _("ドア破壊", "destroy doors") },
244         { "STONE_MUD", ACT_STONE_MUD, 20, 1000, {3, 0},
245           _("岩石溶解", "stone to mud") },
246         { "RECHARGE", ACT_RECHARGE, 30, 1000, {70, 0},
247           _("魔力充填", "recharging") },
248         { "ALCHEMY", ACT_ALCHEMY, 50, 10000, {500, 0},
249           _("錬金術", "alchemy") },
250         { "DIM_DOOR", ACT_DIM_DOOR, 50, 10000, {100, 0},
251           _("次元の扉", "dimension door") },
252         { "TELEPORT", ACT_TELEPORT, 10, 2000, {25, 0},
253           _("テレポート", "teleport") },
254         { "RECALL", ACT_RECALL, 30, 7500, {200, 0},
255           _("帰還の詔", "word of recall") },
256         { "JUDGE", ACT_JUDGE, 90, 50000, {20, 20},
257           _("体力と引き替えに千里眼と帰還", "a telekinesis (500 lb)") },
258         { "TELEKINESIS", ACT_TELEKINESIS, 20, 5500, {25, 25},
259           _("物体を引き寄せる(重量25kgまで)", "clairvoyance and recall, draining you") },
260         { "DETECT_UNIQUE", ACT_DETECT_UNIQUE, 40, 10000, {200, 0},
261           _("この階にいるユニークモンスターを表示", "list of the uniques on the level") },
262         { "ESCAPE", ACT_ESCAPE, 10, 3000, {35, 0},
263           _("逃走", "a getaway") },
264         { "DISP_CURSE_XTRA", ACT_DISP_CURSE_XTRA, 40, 30000, {0, 0},
265           _("*解呪*と調査", "dispel curse and probing") },
266         { "BRAND_FIRE_BOLTS", ACT_BRAND_FIRE_BOLTS, 40, 20000, {999, 0},
267           _("刃先のファイア・ボルト", "fire branding of bolts") },
268         { "RECHARGE_XTRA", ACT_RECHARGE_XTRA, 70, 30000, {200, 0},
269           _("魔力充填", "recharge item") },
270         { "LORE", ACT_LORE, 10, 30000, {0, 0},
271           _("危険を伴う鑑定", "perilous identify") },
272         { "SHIKOFUMI", ACT_SHIKOFUMI, 10, 10000, {100, 100},
273           _("四股踏み", "shiko") },
274         { "PHASE_DOOR", ACT_PHASE_DOOR, 10, 1500, {10, 0},
275           _("ショート・テレポート", "blink") },
276         { "DETECT_ALL_MONS", ACT_DETECT_ALL_MONS, 30, 3000, {150, 0},
277           _("全モンスター感知", "detect all monsters") },
278         { "ULTIMATE_RESIST", ACT_ULTIMATE_RESIST, 90, 20000, {777, 0},
279           _("士気高揚、祝福、究極の耐性", "hero, bless, and ultimate resistance") },
280
281         { "CAST_OFF", ACT_CAST_OFF, 30, 15000, {100, 0},
282           _("脱衣と小宇宙燃焼", "cast it off and cosmic heroism") },
283         { "FISHING", ACT_FISHING, 0, 100, {0, 0},
284           _("釣りをする", "fishing") },
285         { "INROU", ACT_INROU, 40, 15000, {150, 150},
286           _("例のアレ", "reveal your identity") },
287         { "MURAMASA", ACT_MURAMASA, 0, 0, {-1, 0},
288           _("腕力の上昇", "increase STR") },
289         { "BLOODY_MOON", ACT_BLOODY_MOON, 0, 0, {3333, 0},
290           _("属性変更", "change zokusei") },
291         { "CRIMSON", ACT_CRIMSON, 0, 50000, {15, 0},
292           _("ファイア!", "fire!") },
293
294         { "STRAIN_HASTE", ACT_STRAIN_HASTE, 10, 1000, {120, 100},
295           _("体力と引き換えに加速", "haste with strain") },
296         { "GRAND_CROSS", ACT_GRAND_CROSS, 30, 15000, {250, 200},
297           _("グランド・クロス", "grand cross") },
298         { "TELEPORT_LEVEL", ACT_TELEPORT_LEVEL, 10, 1500, {100, 200},
299           _("テレポート・レベル", "teleort level") },
300         { "ARTS_FALLING_STAR", ACT_FALLING_STAR, 20, 5500, {30, 50},
301           _("魔剣・流れ星", "blade arts 'falling star'") },
302         { NULL, 0, 0, 0, {0, 0},
303           "" }
304 };
305
306 /*!
307  * @brief 装備を発動するコマンドのサブルーチン /
308  * Activate a wielded object.  Wielded objects never stack.
309  * And even if they did, activatable objects never stack.
310  * @param item 発動するオブジェクトの所持品ID
311  * @return なし
312  * @details
313  * <pre>
314  * Currently, only (some) artifacts, and Dragon Scale Mail, can be activated.
315  * But one could, for example, easily make an activatable "Ring of Plasma".
316  * Note that it always takes a current_world_ptr->game_turn to activate an artifact, even if
317  * the user hits "escape" at the "direction" prompt.
318  * </pre>
319  */
320 void do_cmd_activate_aux(INVENTORY_IDX item)
321 {
322         DIRECTION dir;
323         DEPTH lev;
324         int chance, fail;
325         object_type *o_ptr;
326         bool success;
327
328
329         /* Get the item (in the pack) */
330         if (item >= 0)
331         {
332                 o_ptr = &p_ptr->inventory_list[item];
333         }
334
335         /* Get the item (on the floor) */
336         else
337         {
338                 o_ptr = &current_floor_ptr->o_list[0 - item];
339         }
340
341         take_turn(p_ptr, 100);
342
343         /* Extract the item level */
344         lev = k_info[o_ptr->k_idx].level;
345
346         /* Hack -- use artifact level instead */
347         if (object_is_fixed_artifact(o_ptr)) lev = a_info[o_ptr->name1].level;
348         else if (object_is_random_artifact(o_ptr))
349         {
350                 const activation_type* const act_ptr = find_activation_info(o_ptr);
351                 if (act_ptr) {
352                         lev = act_ptr->level;
353                 }
354         }
355         else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)) && o_ptr->name2) lev = e_info[o_ptr->name2].level;
356
357         /* Base chance of success */
358         chance = p_ptr->skill_dev;
359
360         /* Confusion hurts skill */
361         if (p_ptr->confused) chance = chance / 2;
362
363         fail = lev+5;
364         if (chance > fail) fail -= (chance - fail)*2;
365         else chance -= (fail - chance)*2;
366         if (fail < USE_DEVICE) fail = USE_DEVICE;
367         if (chance < USE_DEVICE) chance = USE_DEVICE;
368
369         if(cmd_limit_time_walk(p_ptr)) return;
370
371         if (p_ptr->pclass == CLASS_BERSERKER) success = FALSE;
372         else if (chance > fail)
373         {
374                 if (randint0(chance*2) < fail) success = FALSE;
375                 else success = TRUE;
376         }
377         else
378         {
379                 if (randint0(fail*2) < chance) success = TRUE;
380                 else success = FALSE;
381         }
382
383         /* Roll for usage */
384         if (!success)
385         {
386                 if (flush_failure) flush();
387                 msg_print(_("うまく始動させることができなかった。", "You failed to activate it properly."));
388                 sound(SOUND_FAIL);
389                 return;
390         }
391
392         /* Check the recharge */
393         if (o_ptr->timeout)
394         {
395                 msg_print(_("それは微かに音を立て、輝き、消えた...", "It whines, glows and fades..."));
396                 return;
397         }
398
399         /* Some lights need enough fuel for activation */
400         if (!o_ptr->xtra4 && (o_ptr->tval == TV_FLASK) &&
401                 ((o_ptr->sval == SV_LITE_TORCH) || (o_ptr->sval == SV_LITE_LANTERN)))
402         {
403                 msg_print(_("燃料がない。", "It has no fuel."));
404                 free_turn(p_ptr);
405                 return;
406         }
407
408         /* Activate the artifact */
409         msg_print(_("始動させた...", "You activate it..."));
410
411         sound(SOUND_ZAP);
412
413         /* Activate object */
414         if (activation_index(o_ptr))
415         {
416                 (void)activate_artifact(o_ptr);
417
418                 p_ptr->window |= (PW_INVEN | PW_EQUIP);
419
420                 /* Success */
421                 return;
422         }
423
424         /* Special items */
425         else if (o_ptr->tval == TV_WHISTLE)
426         {
427                 if (music_singing_any()) stop_singing(p_ptr);
428                 if (hex_spelling_any()) stop_hex_spell_all();
429
430                 {
431                         MONSTER_IDX pet_ctr, i;
432                         MONSTER_IDX *who;
433                         int max_pet = 0;
434                         u16b dummy_why;
435
436                         /* Allocate the "who" array */
437                         C_MAKE(who, current_floor_ptr->max_m_idx, MONSTER_IDX);
438
439                         /* Process the monsters (backwards) */
440                         for (pet_ctr = current_floor_ptr->m_max - 1; pet_ctr >= 1; pet_ctr--)
441                         {
442                                 if (is_pet(&current_floor_ptr->m_list[pet_ctr]) && (p_ptr->riding != pet_ctr))
443                                   who[max_pet++] = pet_ctr;
444                         }
445
446                         ang_sort(who, &dummy_why, max_pet, ang_sort_comp_pet, ang_sort_swap_hook);
447
448                         /* Process the monsters (backwards) */
449                         for (i = 0; i < max_pet; i++)
450                         {
451                                 pet_ctr = who[i];
452                                 teleport_monster_to(pet_ctr, p_ptr->y, p_ptr->x, 100, TELEPORT_PASSIVE);
453                         }
454
455                         /* Free the "who" array */
456                         C_KILL(who, current_floor_ptr->max_m_idx, IDX);
457                 }
458                 o_ptr->timeout = 100 + randint1(100);
459                 return;
460         }
461         else if (o_ptr->tval == TV_CAPTURE)
462         {
463                 if(!o_ptr->pval)
464                 {
465                         bool old_target_pet = target_pet;
466                         target_pet = TRUE;
467                         if (!get_aim_dir(&dir))
468                         {
469                                 target_pet = old_target_pet;
470                                 return;
471                         }
472                         target_pet = old_target_pet;
473
474                         if(fire_ball(GF_CAPTURE, dir, 0, 0))
475                         {
476                                 o_ptr->pval = (PARAMETER_VALUE)cap_mon;
477                                 o_ptr->xtra3 = (XTRA8)cap_mspeed;
478                                 o_ptr->xtra4 = (XTRA16)cap_hp;
479                                 o_ptr->xtra5 = (XTRA16)cap_maxhp;
480                                 if (cap_nickname)
481                                 {
482                                         concptr t;
483                                         char *s;
484                                         char buf[80] = "";
485
486                                         if (o_ptr->inscription)
487                                                 strcpy(buf, quark_str(o_ptr->inscription));
488                                         s = buf;
489                                         for (s = buf;*s && (*s != '#'); s++)
490                                         {
491 #ifdef JP
492                                                 if (iskanji(*s)) s++;
493 #endif
494                                         }
495                                         *s = '#';
496                                         s++;
497 #ifdef JP
498  /*nothing*/
499 #else
500                                         *s++ = '\'';
501 #endif
502                                         t = quark_str(cap_nickname);
503                                         while (*t)
504                                         {
505                                                 *s = *t;
506                                                 s++;
507                                                 t++;
508                                         }
509 #ifdef JP
510  /*nothing*/
511 #else
512                                         *s++ = '\'';
513 #endif
514                                         *s = '\0';
515                                         o_ptr->inscription = quark_add(buf);
516                                 }
517                         }
518                 }
519                 else
520                 {
521                         success = FALSE;
522                         if (!get_direction(&dir, FALSE, FALSE)) return;
523                         if (monster_can_enter(p_ptr->y + ddy[dir], p_ptr->x + ddx[dir], &r_info[o_ptr->pval], 0))
524                         {
525                                 if (place_monster_aux(0, p_ptr->y + ddy[dir], p_ptr->x + ddx[dir], o_ptr->pval, (PM_FORCE_PET | PM_NO_KAGE)))
526                                 {
527                                         if (o_ptr->xtra3) current_floor_ptr->m_list[hack_m_idx_ii].mspeed = o_ptr->xtra3;
528                                         if (o_ptr->xtra5) current_floor_ptr->m_list[hack_m_idx_ii].max_maxhp = o_ptr->xtra5;
529                                         if (o_ptr->xtra4) current_floor_ptr->m_list[hack_m_idx_ii].hp = o_ptr->xtra4;
530                                         current_floor_ptr->m_list[hack_m_idx_ii].maxhp = current_floor_ptr->m_list[hack_m_idx_ii].max_maxhp;
531                                         if (o_ptr->inscription)
532                                         {
533                                                 char buf[80];
534                                                 concptr t;
535 #ifndef JP
536                                                 bool quote = FALSE;
537 #endif
538
539                                                 t = quark_str(o_ptr->inscription);
540                                                 for (t = quark_str(o_ptr->inscription);*t && (*t != '#'); t++)
541                                                 {
542 #ifdef JP
543                                                         if (iskanji(*t)) t++;
544 #endif
545                                                 }
546                                                 if (*t)
547                                                 {
548                                                         char *s = buf;
549                                                         t++;
550 #ifdef JP
551                                                         /* nothing */
552 #else
553                                                         if (*t =='\'')
554                                                         {
555                                                                 t++;
556                                                                 quote = TRUE;
557                                                         }
558 #endif
559                                                         while(*t)
560                                                         {
561                                                                 *s = *t;
562                                                                 t++;
563                                                                 s++;
564                                                         }
565 #ifdef JP
566                                                         /* nothing */
567 #else
568                                                         if (quote && *(s-1) =='\'')
569                                                                 s--;
570 #endif
571                                                         *s = '\0';
572                                                         current_floor_ptr->m_list[hack_m_idx_ii].nickname = quark_add(buf);
573                                                         t = quark_str(o_ptr->inscription);
574                                                         s = buf;
575                                                         while(*t && (*t != '#'))
576                                                         {
577                                                                 *s = *t;
578                                                                 t++;
579                                                                 s++;
580                                                         }
581                                                         *s = '\0';
582                                                         o_ptr->inscription = quark_add(buf);
583                                                 }
584                                         }
585                                         o_ptr->pval = 0;
586                                         o_ptr->xtra3 = 0;
587                                         o_ptr->xtra4 = 0;
588                                         o_ptr->xtra5 = 0;
589                                         success = TRUE;
590                                 }
591                         }
592                         if (!success)
593                                 msg_print(_("おっと、解放に失敗した。", "Oops.  You failed to release your pet."));
594                 }
595                 calc_android_exp();
596                 return;
597         }
598
599         /* Mistake */
600         msg_print(_("おっと、このアイテムは始動できない。", "Oops.  That object cannot be activated."));
601 }
602
603 /*!
604  * @brief 装備を発動するコマンドのメインルーチン /
605  * @return なし
606  */
607 void do_cmd_activate(void)
608 {
609         OBJECT_IDX item;
610         concptr q, s;
611
612         if (p_ptr->wild_mode) return;
613         if (cmd_limit_arena(p_ptr)) return;
614
615         if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
616         {
617                 set_action(ACTION_NONE);
618         }
619
620         item_tester_hook = item_tester_hook_activate;
621
622         q = _("どのアイテムを始動させますか? ", "Activate which item? ");
623         s = _("始動できるアイテムを装備していない。", "You have nothing to activate.");
624
625         if (!choose_object(&item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT))) return;
626
627         /* Activate the item */
628         do_cmd_activate_aux(item);
629 }
630
631 /*!
632 * @brief 発動によるブレスの属性をアイテムの耐性から選択し、実行を処理する。/ Dragon breath activation
633 * @details 対象となる耐性は dragonbreath_info テーブルを参照のこと。
634 * @param o_ptr 対象のオブジェクト構造体ポインタ
635 * @return 発動実行の是非を返す。
636 */
637 static bool activate_dragon_breath(object_type *o_ptr)
638 {
639         BIT_FLAGS flgs[TR_FLAG_SIZE]; /* for resistance flags */
640         int type[20];
641         concptr name[20];
642         int i, t, n = 0;
643         DIRECTION dir;
644
645         if (!get_aim_dir(&dir)) return FALSE;
646
647         object_flags(o_ptr, flgs);
648
649         for (i = 0; dragonbreath_info[i].flag != 0; i++)
650         {
651                 if (have_flag(flgs, dragonbreath_info[i].flag))
652                 {
653                         type[n] = dragonbreath_info[i].type;
654                         name[n] = dragonbreath_info[i].name;
655                         n++;
656                 }
657         }
658         if (n == 0) return FALSE;
659
660         /* Stop speaking */
661         if (music_singing_any()) stop_singing(p_ptr);
662         if (hex_spelling_any()) stop_hex_spell_all();
663
664         t = randint0(n);
665         msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), name[t]);
666         fire_breath(type[t], dir, 250, 4);
667
668         return TRUE;
669 }
670
671 /*!
672  * @brief アイテムの発動効果を処理する。
673  * @param o_ptr 対象のオブジェクト構造体ポインタ
674  * @return 発動実行の是非を返す。
675  */
676 bool activate_artifact(object_type *o_ptr)
677 {
678         PLAYER_LEVEL plev = p_ptr->lev;
679         int k, dummy = 0;
680         DIRECTION dir;
681         concptr name = k_name + k_info[o_ptr->k_idx].name;
682         const activation_type* const act_ptr = find_activation_info(o_ptr);
683         if (!act_ptr) {
684                 /* Maybe forgot adding information to activation_info table ? */
685                 msg_print("Activation information is not found.");
686                 return FALSE;
687         }
688
689         /* Activate for attack */
690         switch (act_ptr->index)
691         {
692         case ACT_SUNLIGHT:
693         {
694                 if (!get_aim_dir(&dir)) return FALSE;
695                 msg_print(_("太陽光線が放たれた。", "A line of sunlight appears."));
696                 (void)lite_line(dir, damroll(6, 8));
697                 break;
698         }
699
700         case ACT_BO_MISS_1:
701         {
702                 msg_print(_("それは眩しいくらいに明るく輝いている...", "It glows extremely brightly..."));
703                 if (!get_aim_dir(&dir)) return FALSE;
704                 fire_bolt(GF_MISSILE, dir, damroll(2, 6));
705                 break;
706         }
707
708         case ACT_BA_POIS_1:
709         {
710                 msg_print(_("それは濃緑色に脈動している...", "It throbs deep green..."));
711                 if (!get_aim_dir(&dir)) return FALSE;
712                 fire_ball(GF_POIS, dir, 12, 3);
713                 break;
714         }
715
716         case ACT_BO_ELEC_1:
717         {
718                 msg_print(_("それは火花に覆われた...", "It is covered in sparks..."));
719                 if (!get_aim_dir(&dir)) return FALSE;
720                 fire_bolt(GF_ELEC, dir, damroll(4, 8));
721                 break;
722         }
723
724         case ACT_BO_ACID_1:
725         {
726                 msg_print(_("それは酸に覆われた...", "It is covered in acid..."));
727                 if (!get_aim_dir(&dir)) return FALSE;
728                 fire_bolt(GF_ACID, dir, damroll(5, 8));
729                 break;
730         }
731
732         case ACT_BO_COLD_1:
733         {
734                 msg_print(_("それは霜に覆われた...", "It is covered in frost..."));
735                 if (!get_aim_dir(&dir)) return FALSE;
736                 fire_bolt(GF_COLD, dir, damroll(6, 8));
737                 break;
738         }
739
740         case ACT_BO_FIRE_1:
741         {
742                 msg_print(_("それは炎に覆われた...", "It is covered in fire..."));
743                 if (!get_aim_dir(&dir)) return FALSE;
744                 fire_bolt(GF_FIRE, dir, damroll(9, 8));
745                 break;
746         }
747
748         case ACT_BA_COLD_1:
749         {
750                 msg_print(_("それは霜に覆われた...", "It is covered in frost..."));
751                 if (!get_aim_dir(&dir)) return FALSE;
752                 fire_ball(GF_COLD, dir, 48, 2);
753                 break;
754         }
755
756         case ACT_BA_COLD_2:
757         {
758                 msg_print(_("それは青く激しく輝いた...", "It glows an intense blue..."));
759                 if (!get_aim_dir(&dir)) return FALSE;
760                 fire_ball(GF_COLD, dir, 100, 2);
761                 break;
762         }
763
764         case ACT_BA_COLD_3:
765         {
766                 msg_print(_("明るく白色に輝いている...", "It glows bright white..."));
767                 if (!get_aim_dir(&dir)) return FALSE;
768                 fire_ball(GF_COLD, dir, 400, 3);
769                 break;
770         }
771
772         case ACT_BA_FIRE_1:
773         {
774                 msg_print(_("それは赤く激しく輝いた...", "It glows an intense red..."));
775                 if (!get_aim_dir(&dir)) return FALSE;
776                 fire_ball(GF_FIRE, dir, 72, 2);
777                 break;
778         }
779
780         case ACT_BA_FIRE_2:
781         {
782                 msg_format(_("%sから炎が吹き出した...", "The %s rages in fire..."), name);
783                 if (!get_aim_dir(&dir)) return FALSE;
784                 fire_ball(GF_FIRE, dir, 120, 3);
785                 break;
786         }
787
788         case ACT_BA_FIRE_3:
789         {
790                 msg_print(_("深赤色に輝いている...", "It glows deep red..."));
791                 if (!get_aim_dir(&dir)) return FALSE;
792                 fire_ball(GF_FIRE, dir, 300, 3);
793                 break;
794         }
795
796         case ACT_BA_FIRE_4:
797         {
798                 msg_print(_("それは赤く激しく輝いた...", "It glows an intense red..."));
799                 if (!get_aim_dir(&dir)) return FALSE;
800                 fire_ball(GF_FIRE, dir, 100, 2);
801                 break;
802         }
803
804         case ACT_BA_ELEC_2:
805         {
806                 msg_print(_("電気がパチパチ音を立てた...", "It crackles with electricity..."));
807                 if (!get_aim_dir(&dir)) return FALSE;
808                 fire_ball(GF_ELEC, dir, 100, 3);
809                 break;
810         }
811
812         case ACT_BA_ELEC_3:
813         {
814                 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
815                 if (!get_aim_dir(&dir)) return FALSE;
816                 fire_ball(GF_ELEC, dir, 500, 3);
817                 break;
818         }
819
820         case ACT_BA_ACID_1:
821         {
822                 msg_print(_("それは黒く激しく輝いた...", "It glows an intense black..."));
823                 if (!get_aim_dir(&dir)) return FALSE;
824                 fire_ball(GF_ACID, dir, 100, 2);
825                 break;
826         }
827
828         case ACT_BA_NUKE_1:
829         {
830                 msg_print(_("それは緑に激しく輝いた...", "It glows an intense green..."));
831                 if (!get_aim_dir(&dir)) return FALSE;
832                 fire_ball(GF_NUKE, dir, 100, 2);
833                 break;
834         }
835
836         case ACT_HYPODYNAMIA_1:
837         {
838                 msg_format(_("あなたは%sに敵を締め殺すよう命じた。", "You order the %s to strangle your opponent."), name);
839                 if (!get_aim_dir(&dir)) return FALSE;
840                 if (hypodynamic_bolt(dir, 100))
841                         break;
842         }
843
844         case ACT_HYPODYNAMIA_2:
845         {
846                 msg_print(_("黒く輝いている...", "It glows black..."));
847                 if (!get_aim_dir(&dir)) return FALSE;
848                 hypodynamic_bolt(dir, 120);
849                 break;
850         }
851
852         case ACT_DRAIN_1:
853         {
854                 if (!get_aim_dir(&dir)) return FALSE;
855                 for (dummy = 0; dummy < 3; dummy++)
856                 {
857                         if (hypodynamic_bolt(dir, 50))
858                                 hp_player(50);
859                 }
860                 break;
861         }
862
863         case ACT_BO_MISS_2:
864         {
865                 msg_print(_("魔法のトゲが現れた...", "It grows magical spikes..."));
866                 if (!get_aim_dir(&dir)) return FALSE;
867                 fire_bolt(GF_ARROW, dir, 150);
868                 break;
869         }
870
871         case ACT_WHIRLWIND:
872         {
873                 massacre();
874                 break;
875         }
876
877         case ACT_DRAIN_2:
878         {
879                 if (!get_aim_dir(&dir)) return FALSE;
880                 for (dummy = 0; dummy < 3; dummy++)
881                 {
882                         if (hypodynamic_bolt(dir, 100))
883                                 hp_player(100);
884                 }
885                 break;
886         }
887
888
889         case ACT_CALL_CHAOS:
890         {
891                 msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours..."));
892                 call_chaos();
893                 break;
894         }
895
896         case ACT_ROCKET:
897         {
898                 if (!get_aim_dir(&dir)) return FALSE;
899                 msg_print(_("ロケットを発射した!", "You launch a rocket!"));
900                 fire_ball(GF_ROCKET, dir, 250 + plev * 3, 2);
901                 break;
902         }
903
904         case ACT_DISP_EVIL:
905         {
906                 msg_print(_("神聖な雰囲気が充満した...", "It floods the area with goodness..."));
907                 dispel_evil(p_ptr->lev * 5);
908                 break;
909         }
910
911         case ACT_BA_MISS_3:
912         {
913                 if (!get_aim_dir(&dir)) return FALSE;
914                 msg_print(_("あなたはエレメントのブレスを吐いた。", "You breathe the elements."));
915                 fire_breath(GF_MISSILE, dir, 300, 4);
916                 break;
917         }
918
919         case ACT_DISP_GOOD:
920         {
921                 msg_print(_("邪悪な雰囲気が充満した...", "It floods the area with evil..."));
922                 dispel_good(p_ptr->lev * 5);
923                 break;
924         }
925
926         case ACT_BO_MANA:
927         {
928                 msg_format(_("%sに魔法のトゲが現れた...", "The %s grows magical spikes..."), name);
929                 if (!get_aim_dir(&dir)) return FALSE;
930                 fire_bolt(GF_ARROW, dir, 150);
931                 break;
932         }
933
934         case ACT_BA_WATER:
935         {
936                 msg_format(_("%sが深い青色に鼓動している...", "The %s throbs deep blue..."), name);
937                 if (!get_aim_dir(&dir)) return FALSE;
938                 fire_ball(GF_WATER, dir, 200, 3);
939                 break;
940         }
941
942         case ACT_BA_DARK:
943         {
944                 msg_format(_("%sが深い闇に覆われた...", "The %s is coverd in pitch-darkness..."), name);
945                 if (!get_aim_dir(&dir)) return FALSE;
946                 fire_ball(GF_DARK, dir, 250, 4);
947                 break;
948         }
949
950         case ACT_BA_MANA:
951         {
952                 msg_format(_("%sが青白く光った...", "The %s glows pale..."), name);
953                 if (!get_aim_dir(&dir)) return FALSE;
954                 fire_ball(GF_MANA, dir, 250, 4);
955                 break;
956         }
957
958         case ACT_PESTICIDE:
959         {
960                 msg_print(_("あなたは害虫を一掃した。", "You exterminate small life."));
961                 (void)dispel_monsters(4);
962                 break;
963         }
964
965         case ACT_BLINDING_LIGHT:
966         {
967                 msg_format(_("%sが眩しい光で輝いた...", "The %s gleams with blinding light..."), name);
968                 fire_ball(GF_LITE, 0, 300, 6);
969                 confuse_monsters(3 * p_ptr->lev / 2);
970                 break;
971         }
972
973         case ACT_BIZARRE:
974         {
975                 msg_format(_("%sは漆黒に輝いた...", "The %s glows intensely black..."), name);
976                 if (!get_aim_dir(&dir)) return FALSE;
977                 ring_of_power(dir);
978                 break;
979         }
980
981         case ACT_CAST_BA_STAR:
982         {
983                 HIT_POINT num = damroll(5, 3);
984                 POSITION y = 0, x = 0;
985                 int attempts;
986                 msg_format(_("%sが稲妻で覆われた...", "The %s is surrounded by lightning..."), name);
987                 for (k = 0; k < num; k++)
988                 {
989                         attempts = 1000;
990
991                         while (attempts--)
992                         {
993                                 scatter(&y, &x, p_ptr->y, p_ptr->x, 4, 0);
994                                 if (!cave_have_flag_bold(y, x, FF_PROJECT)) continue;
995                                 if (!player_bold(y, x)) break;
996                         }
997
998                         project(0, 3, y, x, 150, GF_ELEC,
999                                 (PROJECT_THRU | PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
1000                 }
1001
1002                 break;
1003         }
1004
1005         case ACT_BLADETURNER:
1006         {
1007                 if (!get_aim_dir(&dir)) return FALSE;
1008                 msg_print(_("あなたはエレメントのブレスを吐いた。", "You breathe the elements."));
1009                 fire_breath(GF_MISSILE, dir, 300, 4);
1010                 msg_print(_("鎧が様々な色に輝いた...", "Your armor glows many colours..."));
1011                 (void)set_afraid(0);
1012                 (void)set_hero(randint1(50) + 50, FALSE);
1013                 (void)hp_player(10);
1014                 (void)set_blessed(randint1(50) + 50, FALSE);
1015                 (void)set_oppose_acid(randint1(50) + 50, FALSE);
1016                 (void)set_oppose_elec(randint1(50) + 50, FALSE);
1017                 (void)set_oppose_fire(randint1(50) + 50, FALSE);
1018                 (void)set_oppose_cold(randint1(50) + 50, FALSE);
1019                 (void)set_oppose_pois(randint1(50) + 50, FALSE);
1020                 break;
1021         }
1022
1023         case ACT_BR_FIRE:
1024         {
1025                 if (!get_aim_dir(&dir)) return FALSE;
1026                 fire_breath(GF_FIRE, dir, 200, 2);
1027                 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
1028                 {
1029                         (void)set_oppose_fire(randint1(20) + 20, FALSE);
1030                 }
1031                 break;
1032         }
1033
1034         case ACT_BR_COLD:
1035         {
1036                 if (!get_aim_dir(&dir)) return FALSE;
1037                 fire_breath(GF_COLD, dir, 200, 2);
1038                 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
1039                 {
1040                         (void)set_oppose_cold(randint1(20) + 20, FALSE);
1041                 }
1042                 break;
1043         }
1044
1045         case ACT_BR_DRAGON:
1046         {
1047                 if (!activate_dragon_breath(o_ptr)) return FALSE;
1048                 break;
1049         }
1050
1051         /* Activate for other offensive action */
1052         case ACT_CONFUSE:
1053         {
1054                 msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours..."));
1055                 if (!get_aim_dir(&dir)) return FALSE;
1056                 confuse_monster(dir, 20);
1057                 break;
1058         }
1059
1060         case ACT_SLEEP:
1061         {
1062                 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
1063                 sleep_monsters_touch();
1064                 break;
1065         }
1066
1067         case ACT_QUAKE:
1068         {
1069                 earthquake(p_ptr->y, p_ptr->x, 5);
1070                 break;
1071         }
1072
1073         case ACT_TERROR:
1074         {
1075                 turn_monsters(40 + p_ptr->lev);
1076                 break;
1077         }
1078
1079         case ACT_TELE_AWAY:
1080         {
1081                 if (!get_aim_dir(&dir)) return FALSE;
1082                 (void)fire_beam(GF_AWAY_ALL, dir, plev);
1083                 break;
1084         }
1085
1086         case ACT_BANISH_EVIL:
1087         {
1088                 if (banish_evil(100))
1089                 {
1090                         msg_print(_("アーティファクトの力が邪悪を打ち払った!", "The power of the artifact banishes evil!"));
1091                 }
1092                 break;
1093         }
1094
1095         case ACT_GENOCIDE:
1096         {
1097                 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
1098                 (void)symbol_genocide(200, TRUE);
1099                 break;
1100         }
1101
1102         case ACT_MASS_GENO:
1103         {
1104                 msg_print(_("ひどく鋭い音が流れ出た...", "It lets out a long, shrill note..."));
1105                 (void)mass_genocide(200, TRUE);
1106                 break;
1107         }
1108
1109         case ACT_SCARE_AREA:
1110         {
1111                 if (music_singing_any()) stop_singing(p_ptr);
1112                 if (hex_spelling_any()) stop_hex_spell_all();
1113                 msg_print(_("あなたは力強い突風を吹き鳴らした。周囲の敵が震え上っている!",
1114                         "You wind a mighty blast; your enemies tremble!"));
1115                 (void)turn_monsters((3 * p_ptr->lev / 2) + 10);
1116                 break;
1117         }
1118
1119         case ACT_AGGRAVATE:
1120         {
1121                 if (o_ptr->name1 == ART_HYOUSIGI)
1122                 {
1123                         msg_print(_("拍子木を打った。", "You beat Your wooden clappers."));
1124                 }
1125                 else
1126                 {
1127                         msg_format(_("%sは不快な物音を立てた。", "The %s sounds an unpleasant noise."), name);
1128                 }
1129                 aggravate_monsters(0);
1130                 break;
1131         }
1132
1133         /* Activate for summoning / charming */
1134
1135         case ACT_CHARM_ANIMAL:
1136         {
1137                 if (!get_aim_dir(&dir)) return FALSE;
1138                 (void)charm_animal(dir, plev);
1139                 break;
1140         }
1141
1142         case ACT_CHARM_UNDEAD:
1143         {
1144                 if (!get_aim_dir(&dir)) return FALSE;
1145                 (void)control_one_undead(dir, plev);
1146                 break;
1147         }
1148
1149         case ACT_CHARM_OTHER:
1150         {
1151                 if (!get_aim_dir(&dir)) return FALSE;
1152                 (void)charm_monster(dir, plev * 2);
1153                 break;
1154         }
1155
1156         case ACT_CHARM_ANIMALS:
1157         {
1158                 (void)charm_animals(plev * 2);
1159                 break;
1160         }
1161
1162         case ACT_CHARM_OTHERS:
1163         {
1164                 charm_monsters(plev * 2);
1165                 break;
1166         }
1167
1168         case ACT_SUMMON_ANIMAL:
1169         {
1170                 (void)summon_specific(-1, p_ptr->y, p_ptr->x, plev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET), '\0');
1171                 break;
1172         }
1173
1174         case ACT_SUMMON_PHANTOM:
1175         {
1176                 msg_print(_("幻霊を召喚した。", "You summon a phantasmal servant."));
1177                 (void)summon_specific(-1, p_ptr->y, p_ptr->x, current_floor_ptr->dun_level, SUMMON_PHANTOM, (PM_ALLOW_GROUP | PM_FORCE_PET), '\0');
1178                 break;
1179         }
1180
1181         case ACT_SUMMON_ELEMENTAL:
1182                 if (!cast_summon_elemental(p_ptr, (plev * 3) / 2)) return FALSE;
1183                 break;
1184
1185         case ACT_SUMMON_DEMON:
1186         {
1187                 cast_summon_demon((plev * 3) / 2);
1188                 break;
1189         }
1190
1191         case ACT_SUMMON_UNDEAD:
1192                 if (!cast_summon_undead(p_ptr, (plev * 3) / 2)) return FALSE;
1193                 break;
1194
1195         case ACT_SUMMON_HOUND:
1196                 if (!cast_summon_hound(p_ptr, (plev * 3) / 2)) return FALSE;
1197                 break;
1198
1199         case ACT_SUMMON_DAWN:
1200         {
1201                 msg_print(_("暁の師団を召喚した。", "You summon the Legion of the Dawn."));
1202                 (void)summon_specific(-1, p_ptr->y, p_ptr->x, current_floor_ptr->dun_level, SUMMON_DAWN, (PM_ALLOW_GROUP | PM_FORCE_PET), '\0');
1203                 break;
1204         }
1205
1206         case ACT_SUMMON_OCTOPUS:
1207                 if(!cast_summon_octopus(p_ptr)) return FALSE;
1208                 break;
1209
1210         /* Activate for healing */
1211
1212         case ACT_CHOIR_SINGS:
1213         {
1214                 msg_print(_("天国の歌が聞こえる...", "A heavenly choir sings..."));
1215                 (void)cure_critical_wounds(777);
1216                 (void)set_hero(randint1(25) + 25, FALSE);
1217                 break;
1218         }
1219
1220         case ACT_CURE_LW:
1221         {
1222                 (void)set_afraid(0);
1223                 (void)hp_player(30);
1224                 break;
1225         }
1226
1227         case ACT_CURE_MW:
1228         {
1229                 msg_print(_("深紫色の光を発している...", "It radiates deep purple..."));
1230                 (void)cure_serious_wounds(4, 8);
1231                 break;
1232         }
1233
1234         case ACT_CURE_POISON:
1235         {
1236                 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
1237                 (void)set_afraid(0);
1238                 (void)set_poisoned(0);
1239                 break;
1240         }
1241
1242         case ACT_REST_EXP:
1243         {
1244                 msg_print(_("深紅に輝いている...", "It glows a deep red..."));
1245                 restore_level();
1246                 break;
1247         }
1248
1249         case ACT_REST_ALL:
1250         {
1251                 msg_print(_("濃緑色に輝いている...", "It glows a deep green..."));
1252                 (void)restore_all_status();
1253                 (void)restore_level();
1254                 break;
1255         }
1256
1257         case ACT_CURE_700:
1258         {
1259                 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
1260                 msg_print(_("体内に暖かい鼓動が感じられる...", "You feel a warm tingling inside..."));
1261                 (void)cure_critical_wounds(700);
1262                 break;
1263         }
1264
1265         case ACT_CURE_1000:
1266         {
1267                 msg_print(_("白く明るく輝いている...", "It glows a bright white..."));
1268                 msg_print(_("ひじょうに気分がよい...", "You feel much better..."));
1269                 (void)cure_critical_wounds(1000);
1270                 break;
1271         }
1272
1273         case ACT_CURING:
1274         {
1275                 msg_format(_("%sの優しさに癒される...", "the %s cures you affectionately ..."), name);
1276                 true_healing(0);
1277                 break;
1278         }
1279
1280         case ACT_CURE_MANA_FULL:
1281         {
1282                 msg_format(_("%sが青白く光った...", "The %s glows pale..."), name);
1283                 restore_mana(TRUE);
1284                 break;
1285         }
1286
1287         /* Activate for timed effect */
1288
1289         case ACT_ESP:
1290         {
1291                 (void)set_tim_esp(randint1(30) + 25, FALSE);
1292                 break;
1293         }
1294
1295         case ACT_BERSERK:
1296         {
1297                 (void)berserk(randint1(25) + 25);
1298                 break;
1299         }
1300
1301         case ACT_PROT_EVIL:
1302         {
1303                 msg_format(_("%sから鋭い音が流れ出た...", "The %s lets out a shrill wail..."), name);
1304                 k = 3 * p_ptr->lev;
1305                 (void)set_protevil(randint1(25) + k, FALSE);
1306                 break;
1307         }
1308
1309         case ACT_RESIST_ALL:
1310         {
1311                 msg_print(_("様々な色に輝いている...", "It glows many colours..."));
1312                 (void)set_oppose_acid(randint1(40) + 40, FALSE);
1313                 (void)set_oppose_elec(randint1(40) + 40, FALSE);
1314                 (void)set_oppose_fire(randint1(40) + 40, FALSE);
1315                 (void)set_oppose_cold(randint1(40) + 40, FALSE);
1316                 (void)set_oppose_pois(randint1(40) + 40, FALSE);
1317                 break;
1318         }
1319
1320         case ACT_SPEED:
1321         {
1322                 msg_print(_("明るく緑色に輝いている...", "It glows bright green..."));
1323                 (void)set_fast(randint1(20) + 20, FALSE);
1324                 break;
1325         }
1326
1327         case ACT_XTRA_SPEED:
1328         {
1329                 msg_print(_("明るく輝いている...", "It glows brightly..."));
1330                 (void)set_fast(randint1(75) + 75, FALSE);
1331                 break;
1332         }
1333
1334         case ACT_WRAITH:
1335         {
1336                 set_wraith_form(randint1(plev / 2) + (plev / 2), FALSE);
1337                 break;
1338         }
1339
1340         case ACT_INVULN:
1341         {
1342                 (void)set_invuln(randint1(8) + 8, FALSE);
1343                 break;
1344         }
1345
1346         case ACT_HERO:
1347         {
1348                 (void)heroism(25);
1349                 break;
1350         }
1351
1352         case ACT_HERO_SPEED:
1353         {
1354                 (void)set_fast(randint1(50) + 50, FALSE);
1355                 (void)heroism(50);
1356                 break;
1357         }
1358
1359         case ACT_RESIST_ACID:
1360         {
1361                 msg_format(_("%sが黒く輝いた...", "The %s grows black."), name);
1362                 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ACID))
1363                 {
1364                         if (!get_aim_dir(&dir)) return FALSE;
1365                         fire_ball(GF_ACID, dir, 100, 2);
1366                 }
1367                 (void)set_oppose_acid(randint1(20) + 20, FALSE);
1368                 break;
1369         }
1370
1371         case ACT_RESIST_FIRE:
1372         {
1373                 msg_format(_("%sが赤く輝いた...", "The %s grows red."), name);
1374                 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
1375                 {
1376                         if (!get_aim_dir(&dir)) return FALSE;
1377                         fire_ball(GF_FIRE, dir, 100, 2);
1378                 }
1379                 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1380                 break;
1381         }
1382
1383         case ACT_RESIST_COLD:
1384         {
1385                 msg_format(_("%sが白く輝いた...", "The %s grows white."), name);
1386                 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
1387                 {
1388                         if (!get_aim_dir(&dir)) return FALSE;
1389                         fire_ball(GF_COLD, dir, 100, 2);
1390                 }
1391                 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1392                 break;
1393         }
1394
1395         case ACT_RESIST_ELEC:
1396         {
1397                 msg_format(_("%sが青く輝いた...", "The %s grows blue."), name);
1398                 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ELEC))
1399                 {
1400                         if (!get_aim_dir(&dir)) return FALSE;
1401                         fire_ball(GF_ELEC, dir, 100, 2);
1402                 }
1403                 (void)set_oppose_elec(randint1(20) + 20, FALSE);
1404                 break;
1405         }
1406
1407         case ACT_RESIST_POIS:
1408         {
1409                 msg_format(_("%sが緑に輝いた...", "The %s grows green."), name);
1410                 (void)set_oppose_pois(randint1(20) + 20, FALSE);
1411                 break;
1412         }
1413
1414         /* Activate for general purpose effect (detection etc.) */
1415
1416         case ACT_LIGHT:
1417         {
1418                 msg_format(_("%sから澄んだ光があふれ出た...", "The %s wells with clear light..."), name);
1419                 lite_area(damroll(2, 15), 3);
1420                 break;
1421         }
1422
1423         case ACT_MAP_LIGHT:
1424         {
1425                 msg_print(_("眩しく輝いた...", "It shines brightly..."));
1426                 map_area(DETECT_RAD_MAP);
1427                 lite_area(damroll(2, 15), 3);
1428                 break;
1429         }
1430
1431         case ACT_DETECT_ALL:
1432         {
1433                 msg_print(_("白く明るく輝いている...", "It glows bright white..."));
1434                 msg_print(_("心にイメージが浮かんできた...", "An image forms in your mind..."));
1435                 detect_all(DETECT_RAD_DEFAULT);
1436                 break;
1437         }
1438
1439         case ACT_DETECT_XTRA:
1440         {
1441                 msg_print(_("明るく輝いている...", "It glows brightly..."));
1442                 detect_all(DETECT_RAD_DEFAULT);
1443                 probing();
1444                 identify_fully(FALSE);
1445                 break;
1446         }
1447
1448         case ACT_ID_FULL:
1449         {
1450                 msg_print(_("黄色く輝いている...", "It glows yellow..."));
1451                 identify_fully(FALSE);
1452                 break;
1453         }
1454
1455         case ACT_ID_PLAIN:
1456         {
1457                 if (!ident_spell(FALSE)) return FALSE;
1458                 break;
1459         }
1460
1461         case ACT_RUNE_EXPLO:
1462         {
1463                 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
1464                 explosive_rune();
1465                 break;
1466         }
1467
1468         case ACT_RUNE_PROT:
1469         {
1470                 msg_print(_("ブルーに明るく輝いている...", "It glows light blue..."));
1471                 warding_glyph();
1472                 break;
1473         }
1474
1475         case ACT_SATIATE:
1476         {
1477                 (void)set_food(PY_FOOD_MAX - 1);
1478                 break;
1479         }
1480
1481         case ACT_DEST_DOOR:
1482         {
1483                 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
1484                 destroy_doors_touch();
1485                 break;
1486         }
1487
1488         case ACT_STONE_MUD:
1489         {
1490                 msg_print(_("鼓動している...", "It pulsates..."));
1491                 if (!get_aim_dir(&dir)) return FALSE;
1492                 wall_to_mud(dir, 20 + randint1(30));
1493                 break;
1494         }
1495
1496         case ACT_RECHARGE:
1497         {
1498                 recharge(130);
1499                 break;
1500         }
1501
1502         case ACT_ALCHEMY:
1503         {
1504                 msg_print(_("明るい黄色に輝いている...", "It glows bright yellow..."));
1505                 (void)alchemy();
1506                 break;
1507         }
1508
1509         case ACT_DIM_DOOR:
1510         {
1511                 msg_print(_("次元の扉が開いた。目的地を選んで下さい。", "You open a dimensional gate. Choose a destination."));
1512                 if (!dimension_door()) return FALSE;
1513                 break;
1514         }
1515
1516
1517         case ACT_TELEPORT:
1518         {
1519                 msg_print(_("周りの空間が歪んでいる...", "It twists space around you..."));
1520                 teleport_player(100, 0L);
1521                 break;
1522         }
1523
1524         case ACT_RECALL:
1525         {
1526                 msg_print(_("やわらかな白色に輝いている...", "It glows soft white..."));
1527                 if (!recall_player(p_ptr, randint0(21) + 15)) return FALSE;
1528                 break;
1529         }
1530
1531         case ACT_JUDGE:
1532         {
1533                 msg_format(_("%sは赤く明るく光った!", "The %s flashes bright red!"), name);
1534                 chg_virtue(V_KNOWLEDGE, 1);
1535                 chg_virtue(V_ENLIGHTEN, 1);
1536                 wiz_lite(FALSE);
1537
1538                 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
1539                 take_hit(DAMAGE_LOSELIFE, damroll(3, 8), _("審判の宝石", "the Jewel of Judgement"), -1);
1540
1541                 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1542                 (void)detect_doors(DETECT_RAD_DEFAULT);
1543                 (void)detect_stairs(DETECT_RAD_DEFAULT);
1544
1545                 if (get_check(_("帰還の力を使いますか?", "Activate recall? ")))
1546                 {
1547                         (void)recall_player(p_ptr, randint0(21) + 15);
1548                 }
1549
1550                 break;
1551         }
1552
1553         case ACT_TELEKINESIS:
1554         {
1555                 if (!get_aim_dir(&dir)) return FALSE;
1556                 msg_format(_("%sを伸ばした。", "You stretched your %s."), name);
1557                 fetch(dir, 500, TRUE);
1558                 break;
1559         }
1560
1561         case ACT_DETECT_UNIQUE:
1562         {
1563                 int i;
1564                 monster_type *m_ptr;
1565                 monster_race *r_ptr;
1566                 msg_print(_("奇妙な場所が頭の中に浮かんだ...", "Some strange places show up in your mind. And you see ..."));
1567                 /* Process the monsters (backwards) */
1568                 for (i = current_floor_ptr->m_max - 1; i >= 1; i--)
1569                 {
1570                         /* Access the monster */
1571                         m_ptr = &current_floor_ptr->m_list[i];
1572
1573                         /* Ignore "dead" monsters */
1574                         if (!monster_is_valid(m_ptr)) continue;
1575
1576                         r_ptr = &r_info[m_ptr->r_idx];
1577
1578                         if (r_ptr->flags1 & RF1_UNIQUE)
1579                         {
1580                                 msg_format(_("%s. ", "%s. "), r_name + r_ptr->name);
1581                         }
1582                 }
1583                 break;
1584         }
1585
1586         case ACT_ESCAPE:
1587         {
1588                 switch (randint1(13))
1589                 {
1590                 case 1: case 2: case 3: case 4: case 5:
1591                         teleport_player(10, 0L);
1592                         break;
1593                 case 6: case 7: case 8: case 9: case 10:
1594                         teleport_player(222, 0L);
1595                         break;
1596                 case 11: case 12:
1597                         (void)stair_creation();
1598                         break;
1599                 default:
1600                         if (get_check(_("この階を去りますか?", "Leave this level? ")))
1601                         {
1602                                 if (autosave_l) do_cmd_save_game(TRUE);
1603                                 p_ptr->leaving = TRUE;
1604                         }
1605                 }
1606                 break;
1607         }
1608
1609         case ACT_DISP_CURSE_XTRA:
1610         {
1611                 msg_format(_("%sが真実を照らし出す...", "The %s exhibits the truth..."), name);
1612                 (void)remove_all_curse();
1613                 (void)probing();
1614                 break;
1615         }
1616
1617         case ACT_BRAND_FIRE_BOLTS:
1618         {
1619                 msg_format(_("%sが深紅に輝いた...", "Your %s glows deep red..."), name);
1620                 (void)brand_bolts();
1621                 break;
1622         }
1623
1624         case ACT_RECHARGE_XTRA:
1625         {
1626                 msg_format(_("%sが白く輝いた...", "The %s gleams with blinding light..."), name);
1627                 if (!recharge(1000)) return FALSE;
1628                 break;
1629         }
1630
1631         case ACT_LORE:
1632                 msg_print(_("石が隠された秘密を写し出した...", "The stone reveals hidden mysteries..."));
1633                 if(!perilous_secrets(p_ptr)) return FALSE;
1634                 break;
1635
1636         case ACT_SHIKOFUMI:
1637         {
1638                 msg_print(_("力強く四股を踏んだ。", "You stamp. (as if you are in a ring.)"));
1639                 (void)set_afraid(0);
1640                 (void)set_hero(randint1(20) + 20, FALSE);
1641                 dispel_evil(p_ptr->lev * 3);
1642                 break;
1643         }
1644
1645         case ACT_PHASE_DOOR:
1646         {
1647                 teleport_player(10, 0L);
1648                 break;
1649         }
1650
1651         case ACT_DETECT_ALL_MONS:
1652         {
1653                 (void)detect_monsters_invis(255);
1654                 (void)detect_monsters_normal(255);
1655                 break;
1656         }
1657
1658         case ACT_ULTIMATE_RESIST:
1659         {
1660                 TIME_EFFECT v = randint1(25) + 25;
1661                 (void)set_afraid(0);
1662                 (void)set_hero(v, FALSE);
1663                 (void)hp_player(10);
1664                 (void)set_blessed(v, FALSE);
1665                 (void)set_oppose_acid(v, FALSE);
1666                 (void)set_oppose_elec(v, FALSE);
1667                 (void)set_oppose_fire(v, FALSE);
1668                 (void)set_oppose_cold(v, FALSE);
1669                 (void)set_oppose_pois(v, FALSE);
1670                 (void)set_ultimate_res(v, FALSE);
1671                 break;
1672         }
1673
1674         case ACT_CAST_OFF:
1675                 cosmic_cast_off(p_ptr, o_ptr);
1676                 break;
1677
1678         case ACT_FALLING_STAR:
1679         {
1680                 msg_print(_("あなたは妖刀に魅入られた…", "You are enchanted by cursed blade..."));
1681                 msg_print(_("「狂ほしく 血のごとき 月はのぼれり 秘めおきし 魔剣 いずこぞや」", "'Behold the blade arts.'"));
1682                 massacre();
1683                 break;
1684         }
1685
1686         case ACT_GRAND_CROSS:
1687         {
1688                 msg_print(_("「闇に還れ!」", "You say, 'Return to darkness!'"));
1689                 project(0, 8, p_ptr->y, p_ptr->x, (randint1(100) + 200) * 2, GF_HOLY_FIRE, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID, -1);
1690                 break;
1691         }
1692
1693         case ACT_TELEPORT_LEVEL:
1694         {
1695                 if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)"))) return FALSE;
1696                 teleport_level(0);
1697                 break;
1698         }
1699
1700         case ACT_STRAIN_HASTE:
1701         {
1702                 int t;
1703                 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
1704                 take_hit(DAMAGE_LOSELIFE, damroll(3, 8), _("加速した疲労", "the strain of haste"), -1);
1705                 t = 25 + randint1(25);
1706                 (void)set_fast(p_ptr->fast + t, FALSE);
1707                 break;
1708         }
1709
1710         case ACT_FISHING:
1711                 if(!fishing(p_ptr)) return FALSE;
1712                 break;
1713
1714         case ACT_INROU:
1715                 mitokohmon();
1716                 break;
1717
1718         case ACT_MURAMASA:
1719         {
1720                 /* Only for Muramasa */
1721                 if (o_ptr->name1 != ART_MURAMASA) return FALSE;
1722                 if (get_check(_("本当に使いますか?", "Are you sure?!")))
1723                 {
1724                         msg_print(_("村正が震えた...", "The Muramasa pulsates..."));
1725                         do_inc_stat(A_STR);
1726                         if (one_in_(2))
1727                         {
1728                                 msg_print(_("村正は壊れた!", "The Muramasa is destroyed!"));
1729                                 curse_weapon_object(TRUE, o_ptr);
1730                         }
1731                 }
1732                 break;
1733         }
1734
1735         case ACT_BLOODY_MOON:
1736         {
1737                 /* Only for Bloody Moon */
1738                 if (o_ptr->name1 != ART_BLOOD) return FALSE;
1739                 msg_print(_("鎌が明るく輝いた...", "Your scythe glows brightly!"));
1740                 get_bloody_moon_flags(o_ptr);
1741                 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
1742                 p_ptr->update |= (PU_BONUS | PU_HP);
1743                 break;
1744         }
1745
1746         case ACT_CRIMSON:
1747                 if (o_ptr->name1 != ART_CRIMSON) return FALSE;
1748                 msg_print(_("せっかくだから『クリムゾン』をぶっぱなすぜ!", "I'll fire CRIMSON! SEKKAKUDAKARA!"));
1749                 if(!fire_crimson()) return FALSE;
1750                 break;
1751
1752         default:
1753         {
1754                 msg_format(_("Unknown activation effect: %d.", "Unknown activation effect: %d."), act_ptr->index);
1755                 return FALSE;
1756         }
1757         }
1758
1759         /* Set activation timeout */
1760         if (act_ptr->timeout.constant >= 0) {
1761                 o_ptr->timeout = (s16b)act_ptr->timeout.constant;
1762                 if (act_ptr->timeout.dice > 0) {
1763                         o_ptr->timeout += randint1(act_ptr->timeout.dice);
1764                 }
1765         }
1766         else {
1767                 /* Activations that have special timeout */
1768                 switch (act_ptr->index) {
1769                 case ACT_BR_FIRE:
1770                         o_ptr->timeout = ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES)) ? 200 : 250;
1771                         break;
1772                 case ACT_BR_COLD:
1773                         o_ptr->timeout = ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE)) ? 200 : 250;
1774                         break;
1775                 case ACT_TERROR:
1776                         o_ptr->timeout = 3 * (p_ptr->lev + 10);
1777                         break;
1778                 case ACT_MURAMASA:
1779                         /* Nothing to do */
1780                         break;
1781                 default:
1782                         msg_format("Special timeout is not implemented: %d.", act_ptr->index);
1783                         return FALSE;
1784                 }
1785         }
1786
1787         return TRUE;
1788 }
1789