OSDN Git Service

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