OSDN Git Service

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