OSDN Git Service

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