OSDN Git Service

[Refactor] #40014 Separated monster2.h from monster.h
[hengband/hengband.git] / src / cmd-item / cmd-activate.c
1 /*!
2  * @brief プレイヤーの発動コマンド実装
3  * @date 2018/09/07
4  * @author deskull
5  */
6
7 #include "cmd-item/cmd-activate.h"
8 #include "art-definition/art-bow-types.h"
9 #include "art-definition/art-sword-types.h"
10 #include "art-definition/art-weapon-types.h"
11 #include "art-definition/random-art-effects.h"
12 #include "cmd-io/cmd-save.h"
13 #include "cmd/cmd-basic.h"
14 #include "core/sort.h"
15 #include "effect/effect-characteristics.h"
16 #include "effect/spells-effect-util.h"
17 #include "floor/floor.h"
18 #include "inventory/player-inventory.h"
19 #include "io/files-util.h"
20 #include "io/targeting.h"
21 #include "main/sound-definitions-table.h"
22 #include "monster/monster-status.h"
23 #include "monster/monster2.h"
24 #include "object-enchant/activation-info-table.h"
25 #include "object-enchant/artifact.h"
26 #include "object-enchant/dragon-breaths-table.h"
27 #include "object-enchant/object-ego.h"
28 #include "object/item-use-flags.h"
29 #include "object/object-flags.h"
30 #include "object/object-hook.h"
31 #include "object/object-kind.h"
32 #include "object/object-info.h"
33 #include "monster/place-monster-types.h"
34 #include "monster/smart-learn-types.h"
35 #include "player/avatar.h"
36 #include "player/player-damage.h"
37 #include "player/player-effects.h"
38 #include "player/player-races-table.h"
39 #include "spell-kind/earthquake.h"
40 #include "spell-kind/spells-beam.h"
41 #include "spell-kind/spells-charm.h"
42 #include "spell-kind/spells-detection.h"
43 #include "spell-kind/spells-floor.h"
44 #include "spell-kind/spells-genocide.h"
45 #include "spell-kind/spells-grid.h"
46 #include "spell-kind/spells-launcher.h"
47 #include "spell-kind/spells-lite.h"
48 #include "spell-kind/spells-neighbor.h"
49 #include "spell-kind/spells-random.h"
50 #include "spell-kind/spells-sight.h"
51 #include "spell-kind/spells-specific-bolt.h"
52 #include "spell-kind/spells-teleport.h"
53 #include "spell-realm/spells-hex.h"
54 #include "spell/process-effect.h"
55 #include "spell/spells-object.h"
56 #include "spell/spells-status.h"
57 #include "spell/spells-summon.h"
58 #include "spell/spells-type.h"
59 #include "spell/spells3.h"
60 #include "sv-definition/sv-lite-types.h"
61 #include "sv-definition/sv-ring-types.h"
62 #include "world/world.h"
63
64 /*!
65  * @brief 装備を発動するコマンドのサブルーチン /
66  * Activate a wielded object.  Wielded objects never stack.
67  * And even if they did, activatable objects never stack.
68  * @param item 発動するオブジェクトの所持品ID
69  * @return なし
70  * @details
71  * <pre>
72  * Currently, only (some) artifacts, and Dragon Scale Mail, can be activated.
73  * But one could, for example, easily make an activatable "Ring of Plasma".
74  * Note that it always takes a turn to activate an artifact, even if
75  * the user hits "escape" at the "direction" prompt.
76  * </pre>
77  */
78 void exe_activate(player_type *user_ptr, INVENTORY_IDX item)
79 {
80         DIRECTION dir;
81         DEPTH lev;
82         int chance, fail;
83         object_type *o_ptr;
84         bool success;
85
86         o_ptr = ref_item(user_ptr, item);
87         take_turn(user_ptr, 100);
88         lev = k_info[o_ptr->k_idx].level;
89
90         /* Hack -- use artifact level instead */
91         if (object_is_fixed_artifact(o_ptr)) lev = a_info[o_ptr->name1].level;
92         else if (object_is_random_artifact(o_ptr))
93         {
94                 const activation_type* const act_ptr = find_activation_info(o_ptr);
95                 if (act_ptr) {
96                         lev = act_ptr->level;
97                 }
98         }
99         else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)) && o_ptr->name2) lev = e_info[o_ptr->name2].level;
100
101         /* Base chance of success */
102         chance = user_ptr->skill_dev;
103
104         /* Confusion hurts skill */
105         if (user_ptr->confused) chance = chance / 2;
106
107         fail = lev + 5;
108         if (chance > fail) fail -= (chance - fail) * 2;
109         else chance -= (fail - chance) * 2;
110         if (fail < USE_DEVICE) fail = USE_DEVICE;
111         if (chance < USE_DEVICE) chance = USE_DEVICE;
112
113         if (cmd_limit_time_walk(user_ptr)) return;
114
115         if (user_ptr->pclass == CLASS_BERSERKER) success = FALSE;
116         else if (chance > fail)
117         {
118                 if (randint0(chance * 2) < fail) success = FALSE;
119                 else success = TRUE;
120         }
121         else
122         {
123                 if (randint0(fail * 2) < chance) success = TRUE;
124                 else success = FALSE;
125         }
126
127         /* Roll for usage */
128         if (!success)
129         {
130                 if (flush_failure) flush();
131                 msg_print(_("うまく始動させることができなかった。", "You failed to activate it properly."));
132                 sound(SOUND_FAIL);
133                 return;
134         }
135
136         /* Check the recharge */
137         if (o_ptr->timeout)
138         {
139                 msg_print(_("それは微かに音を立て、輝き、消えた...", "It whines, glows and fades..."));
140                 return;
141         }
142
143         /* Some lights need enough fuel for activation */
144         if (!o_ptr->xtra4 && (o_ptr->tval == TV_FLASK) &&
145                 ((o_ptr->sval == SV_LITE_TORCH) || (o_ptr->sval == SV_LITE_LANTERN)))
146         {
147                 msg_print(_("燃料がない。", "It has no fuel."));
148                 free_turn(user_ptr);
149                 return;
150         }
151
152         /* Activate the artifact */
153         msg_print(_("始動させた...", "You activate it..."));
154
155         sound(SOUND_ZAP);
156
157         /* Activate object */
158         if (activation_index(o_ptr))
159         {
160                 (void)activate_artifact(user_ptr, o_ptr);
161
162                 user_ptr->window |= (PW_INVEN | PW_EQUIP);
163
164                 /* Success */
165                 return;
166         }
167
168         /* Special items */
169         else if (o_ptr->tval == TV_WHISTLE)
170         {
171                 if (music_singing_any(user_ptr)) stop_singing(user_ptr);
172                 if (hex_spelling_any(user_ptr)) stop_hex_spell_all(user_ptr);
173
174                 {
175                         MONSTER_IDX pet_ctr, i;
176                         MONSTER_IDX *who;
177                         int max_pet = 0;
178                         u16b dummy_why;
179
180                         /* Allocate the "who" array */
181                         C_MAKE(who, current_world_ptr->max_m_idx, MONSTER_IDX);
182
183                         /* Process the monsters (backwards) */
184                         for (pet_ctr = user_ptr->current_floor_ptr->m_max - 1; pet_ctr >= 1; pet_ctr--)
185                         {
186                                 if (is_pet(&user_ptr->current_floor_ptr->m_list[pet_ctr]) && (user_ptr->riding != pet_ctr))
187                                         who[max_pet++] = pet_ctr;
188                         }
189
190                         ang_sort(who, &dummy_why, max_pet, ang_sort_comp_pet, ang_sort_swap_hook);
191
192                         /* Process the monsters (backwards) */
193                         for (i = 0; i < max_pet; i++)
194                         {
195                                 pet_ctr = who[i];
196                                 teleport_monster_to(user_ptr, pet_ctr, user_ptr->y, user_ptr->x, 100, TELEPORT_PASSIVE);
197                         }
198
199                         /* Free the "who" array */
200                         C_KILL(who, current_world_ptr->max_m_idx, MONSTER_IDX);
201                 }
202                 o_ptr->timeout = 100 + randint1(100);
203                 return;
204         }
205         else if (o_ptr->tval == TV_CAPTURE)
206         {
207                 if (!o_ptr->pval)
208                 {
209                         bool old_target_pet = target_pet;
210                         target_pet = TRUE;
211                         if (!get_aim_dir(user_ptr, &dir))
212                         {
213                                 target_pet = old_target_pet;
214                                 return;
215                         }
216                         target_pet = old_target_pet;
217
218                         if (fire_ball(user_ptr, GF_CAPTURE, dir, 0, 0))
219                         {
220                                 o_ptr->pval = (PARAMETER_VALUE)cap_mon;
221                                 o_ptr->xtra3 = (XTRA8)cap_mspeed;
222                                 o_ptr->xtra4 = (XTRA16)cap_hp;
223                                 o_ptr->xtra5 = (XTRA16)cap_maxhp;
224                                 if (cap_nickname)
225                                 {
226                                         concptr t;
227                                         char *s;
228                                         char buf[80] = "";
229
230                                         if (o_ptr->inscription)
231                                                 strcpy(buf, quark_str(o_ptr->inscription));
232                                         s = buf;
233                                         for (s = buf; *s && (*s != '#'); s++)
234                                         {
235 #ifdef JP
236                                                 if (iskanji(*s)) s++;
237 #endif
238                                         }
239                                         *s = '#';
240                                         s++;
241 #ifdef JP
242                                         /*nothing*/
243 #else
244                                         *s++ = '\'';
245 #endif
246                                         t = quark_str(cap_nickname);
247                                         while (*t)
248                                         {
249                                                 *s = *t;
250                                                 s++;
251                                                 t++;
252                                         }
253 #ifdef JP
254                                         /*nothing*/
255 #else
256                                         *s++ = '\'';
257 #endif
258                                         *s = '\0';
259                                         o_ptr->inscription = quark_add(buf);
260                                 }
261                         }
262                 }
263                 else
264                 {
265                         success = FALSE;
266                         if (!get_direction(user_ptr, &dir, FALSE, FALSE)) return;
267                         if (monster_can_enter(user_ptr, user_ptr->y + ddy[dir], user_ptr->x + ddx[dir], &r_info[o_ptr->pval], 0))
268                         {
269                                 if (place_monster_aux(user_ptr, 0, user_ptr->y + ddy[dir], user_ptr->x + ddx[dir], o_ptr->pval, (PM_FORCE_PET | PM_NO_KAGE)))
270                                 {
271                                         if (o_ptr->xtra3) user_ptr->current_floor_ptr->m_list[hack_m_idx_ii].mspeed = o_ptr->xtra3;
272                                         if (o_ptr->xtra5) user_ptr->current_floor_ptr->m_list[hack_m_idx_ii].max_maxhp = o_ptr->xtra5;
273                                         if (o_ptr->xtra4) user_ptr->current_floor_ptr->m_list[hack_m_idx_ii].hp = o_ptr->xtra4;
274                                         user_ptr->current_floor_ptr->m_list[hack_m_idx_ii].maxhp = user_ptr->current_floor_ptr->m_list[hack_m_idx_ii].max_maxhp;
275                                         if (o_ptr->inscription)
276                                         {
277                                                 char buf[80];
278                                                 concptr t;
279 #ifdef JP
280 #else
281                                                 bool quote = FALSE;
282 #endif
283
284                                                 t = quark_str(o_ptr->inscription);
285                                                 for (t = quark_str(o_ptr->inscription); *t && (*t != '#'); t++)
286                                                 {
287 #ifdef JP
288                                                         if (iskanji(*t)) t++;
289 #endif
290                                                 }
291                                                 if (*t)
292                                                 {
293                                                         char *s = buf;
294                                                         t++;
295 #ifdef JP
296                                                         /* nothing */
297 #else
298                                                         if (*t == '\'')
299                                                         {
300                                                                 t++;
301                                                                 quote = TRUE;
302                                                         }
303 #endif
304                                                         while (*t)
305                                                         {
306                                                                 *s = *t;
307                                                                 t++;
308                                                                 s++;
309                                                         }
310 #ifdef JP
311                                                         /* nothing */
312 #else
313                                                         if (quote && *(s - 1) == '\'')
314                                                                 s--;
315 #endif
316                                                         *s = '\0';
317                                                         user_ptr->current_floor_ptr->m_list[hack_m_idx_ii].nickname = quark_add(buf);
318                                                         t = quark_str(o_ptr->inscription);
319                                                         s = buf;
320                                                         while (*t && (*t != '#'))
321                                                         {
322                                                                 *s = *t;
323                                                                 t++;
324                                                                 s++;
325                                                         }
326                                                         *s = '\0';
327                                                         o_ptr->inscription = quark_add(buf);
328                                                 }
329                                         }
330                                         o_ptr->pval = 0;
331                                         o_ptr->xtra3 = 0;
332                                         o_ptr->xtra4 = 0;
333                                         o_ptr->xtra5 = 0;
334                                         success = TRUE;
335                                 }
336                         }
337                         if (!success)
338                                 msg_print(_("おっと、解放に失敗した。", "Oops.  You failed to release your pet."));
339                 }
340                 calc_android_exp(user_ptr);
341                 return;
342         }
343
344         /* Mistake */
345         msg_print(_("おっと、このアイテムは始動できない。", "Oops.  That object cannot be activated."));
346 }
347
348 /*!
349  * @brief 装備を発動するコマンドのメインルーチン /
350  * @param user_ptr プレーヤーへの参照ポインタ
351  * @return なし
352  */
353 void do_cmd_activate(player_type *user_ptr)
354 {
355         OBJECT_IDX item;
356         concptr q, s;
357
358         if (user_ptr->wild_mode) return;
359         if (cmd_limit_arena(user_ptr)) return;
360
361         if (user_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
362         {
363                 set_action(user_ptr, ACTION_NONE);
364         }
365
366         item_tester_hook = item_tester_hook_activate;
367
368         q = _("どのアイテムを始動させますか? ", "Activate which item? ");
369         s = _("始動できるアイテムを装備していない。", "You have nothing to activate.");
370
371         if (!choose_object(user_ptr, &item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0)) return;
372
373         /* Activate the item */
374         exe_activate(user_ptr, item);
375 }
376
377 /*!
378 * @brief 発動によるブレスの属性をアイテムの耐性から選択し、実行を処理する。/ Dragon breath activation
379 * @details 対象となる耐性は dragonbreath_info テーブルを参照のこと。
380 * @param user_ptr プレーヤーへの参照ポインタ
381 * @param o_ptr 対象のオブジェクト構造体ポインタ
382 * @return 発動実行の是非を返す。
383 */
384 static bool activate_dragon_breath(player_type *user_ptr, object_type *o_ptr)
385 {
386         BIT_FLAGS flgs[TR_FLAG_SIZE]; /* for resistance flags */
387         int type[20];
388         concptr name[20];
389         int i, t, n = 0;
390         DIRECTION dir;
391
392         if (!get_aim_dir(user_ptr, &dir)) return FALSE;
393
394         object_flags(o_ptr, flgs);
395
396         for (i = 0; dragonbreath_info[i].flag != 0; i++)
397         {
398                 if (have_flag(flgs, dragonbreath_info[i].flag))
399                 {
400                         type[n] = dragonbreath_info[i].type;
401                         name[n] = dragonbreath_info[i].name;
402                         n++;
403                 }
404         }
405         if (n == 0) return FALSE;
406
407         /* Stop speaking */
408         if (music_singing_any(user_ptr)) stop_singing(user_ptr);
409         if (hex_spelling_any(user_ptr)) stop_hex_spell_all(user_ptr);
410
411         t = randint0(n);
412         msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), name[t]);
413         fire_breath(user_ptr, type[t], dir, 250, 4);
414
415         return TRUE;
416 }
417
418
419 /*!
420  * @brief アイテムの発動効果を処理する。
421  * @param user_ptr プレーヤーへの参照ポインタ
422  * @param o_ptr 対象のオブジェクト構造体ポインタ
423  * @return 発動実行の是非を返す。
424  */
425 bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
426 {
427         PLAYER_LEVEL plev = user_ptr->lev;
428         int k, dummy = 0;
429         DIRECTION dir;
430         concptr name = k_name + k_info[o_ptr->k_idx].name;
431         const activation_type* const act_ptr = find_activation_info(o_ptr);
432         if (!act_ptr) {
433                 /* Maybe forgot adding information to activation_info table ? */
434                 msg_print("Activation information is not found.");
435                 return FALSE;
436         }
437
438         /* Activate for attack */
439         switch (act_ptr->index)
440         {
441         case ACT_SUNLIGHT:
442         {
443                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
444                 msg_print(_("太陽光線が放たれた。", "A line of sunlight appears."));
445                 (void)lite_line(user_ptr, dir, damroll(6, 8));
446                 break;
447         }
448
449         case ACT_BO_MISS_1:
450         {
451                 msg_print(_("それは眩しいくらいに明るく輝いている...", "It glows extremely brightly..."));
452                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
453                 fire_bolt(user_ptr, GF_MISSILE, dir, damroll(2, 6));
454                 break;
455         }
456
457         case ACT_BA_POIS_1:
458         {
459                 msg_print(_("それは濃緑色に脈動している...", "It throbs deep green..."));
460                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
461                 fire_ball(user_ptr, GF_POIS, dir, 12, 3);
462                 break;
463         }
464
465         case ACT_BO_ELEC_1:
466         {
467                 msg_print(_("それは火花に覆われた...", "It is covered in sparks..."));
468                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
469                 fire_bolt(user_ptr, GF_ELEC, dir, damroll(4, 8));
470                 break;
471         }
472
473         case ACT_BO_ACID_1:
474         {
475                 msg_print(_("それは酸に覆われた...", "It is covered in acid..."));
476                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
477                 fire_bolt(user_ptr, GF_ACID, dir, damroll(5, 8));
478                 break;
479         }
480
481         case ACT_BO_COLD_1:
482         {
483                 msg_print(_("それは霜に覆われた...", "It is covered in frost..."));
484                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
485                 fire_bolt(user_ptr, GF_COLD, dir, damroll(6, 8));
486                 break;
487         }
488
489         case ACT_BO_FIRE_1:
490         {
491                 msg_print(_("それは炎に覆われた...", "It is covered in fire..."));
492                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
493                 fire_bolt(user_ptr, GF_FIRE, dir, damroll(9, 8));
494                 break;
495         }
496
497         case ACT_BA_COLD_1:
498         {
499                 msg_print(_("それは霜に覆われた...", "It is covered in frost..."));
500                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
501                 fire_ball(user_ptr, GF_COLD, dir, 48, 2);
502                 break;
503         }
504
505         case ACT_BA_COLD_2:
506         {
507                 msg_print(_("それは青く激しく輝いた...", "It glows an intense blue..."));
508                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
509                 fire_ball(user_ptr, GF_COLD, dir, 100, 2);
510                 break;
511         }
512
513         case ACT_BA_COLD_3:
514         {
515                 msg_print(_("明るく白色に輝いている...", "It glows bright white..."));
516                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
517                 fire_ball(user_ptr, GF_COLD, dir, 400, 3);
518                 break;
519         }
520
521         case ACT_BA_FIRE_1:
522         {
523                 msg_print(_("それは赤く激しく輝いた...", "It glows an intense red..."));
524                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
525                 fire_ball(user_ptr, GF_FIRE, dir, 72, 2);
526                 break;
527         }
528
529         case ACT_BA_FIRE_2:
530         {
531                 msg_format(_("%sから炎が吹き出した...", "The %s rages in fire..."), name);
532                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
533                 fire_ball(user_ptr, GF_FIRE, dir, 120, 3);
534                 break;
535         }
536
537         case ACT_BA_FIRE_3:
538         {
539                 msg_print(_("深赤色に輝いている...", "It glows deep red..."));
540                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
541                 fire_ball(user_ptr, GF_FIRE, dir, 300, 3);
542                 break;
543         }
544
545         case ACT_BA_FIRE_4:
546         {
547                 msg_print(_("それは赤く激しく輝いた...", "It glows an intense red..."));
548                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
549                 fire_ball(user_ptr, GF_FIRE, dir, 100, 2);
550                 break;
551         }
552
553         case ACT_BA_ELEC_2:
554         {
555                 msg_print(_("電気がパチパチ音を立てた...", "It crackles with electricity..."));
556                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
557                 fire_ball(user_ptr, GF_ELEC, dir, 100, 3);
558                 break;
559         }
560
561         case ACT_BA_ELEC_3:
562         {
563                 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
564                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
565                 fire_ball(user_ptr, GF_ELEC, dir, 500, 3);
566                 break;
567         }
568
569         case ACT_BA_ACID_1:
570         {
571                 msg_print(_("それは黒く激しく輝いた...", "It glows an intense black..."));
572                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
573                 fire_ball(user_ptr, GF_ACID, dir, 100, 2);
574                 break;
575         }
576
577         case ACT_BA_NUKE_1:
578         {
579                 msg_print(_("それは緑に激しく輝いた...", "It glows an intense green..."));
580                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
581                 fire_ball(user_ptr, GF_NUKE, dir, 100, 2);
582                 break;
583         }
584
585         case ACT_HYPODYNAMIA_1:
586         {
587                 msg_format(_("あなたは%sに敵を締め殺すよう命じた。", "You order the %s to strangle your opponent."), name);
588                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
589                 hypodynamic_bolt(user_ptr, dir, 100);
590                 break;
591         }
592
593         case ACT_HYPODYNAMIA_2:
594         {
595                 msg_print(_("黒く輝いている...", "It glows black..."));
596                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
597                 hypodynamic_bolt(user_ptr, dir, 120);
598                 break;
599         }
600
601         case ACT_DRAIN_1:
602         {
603                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
604                 for (dummy = 0; dummy < 3; dummy++)
605                 {
606                         if (hypodynamic_bolt(user_ptr, dir, 50))
607                                 hp_player(user_ptr, 50);
608                 }
609                 break;
610         }
611
612         case ACT_BO_MISS_2:
613         {
614                 msg_print(_("魔法のトゲが現れた...", "It grows magical spikes..."));
615                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
616                 fire_bolt(user_ptr, GF_ARROW, dir, 150);
617                 break;
618         }
619
620         case ACT_WHIRLWIND:
621         {
622                 massacre(user_ptr);
623                 break;
624         }
625
626         case ACT_DRAIN_2:
627         {
628                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
629                 for (dummy = 0; dummy < 3; dummy++)
630                 {
631                         if (hypodynamic_bolt(user_ptr, dir, 100))
632                                 hp_player(user_ptr, 100);
633                 }
634                 break;
635         }
636
637
638         case ACT_CALL_CHAOS:
639         {
640                 msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours..."));
641                 call_chaos(user_ptr);
642                 break;
643         }
644
645         case ACT_ROCKET:
646         {
647                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
648                 msg_print(_("ロケットを発射した!", "You launch a rocket!"));
649                 fire_ball(user_ptr, GF_ROCKET, dir, 250 + plev * 3, 2);
650                 break;
651         }
652
653         case ACT_DISP_EVIL:
654         {
655                 msg_print(_("神聖な雰囲気が充満した...", "It floods the area with goodness..."));
656                 dispel_evil(user_ptr, user_ptr->lev * 5);
657                 break;
658         }
659
660         case ACT_BA_MISS_3:
661         {
662                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
663                 msg_print(_("あなたはエレメントのブレスを吐いた。", "You breathe the elements."));
664                 fire_breath(user_ptr, GF_MISSILE, dir, 300, 4);
665                 break;
666         }
667
668         case ACT_DISP_GOOD:
669         {
670                 msg_print(_("邪悪な雰囲気が充満した...", "It floods the area with evil..."));
671                 dispel_good(user_ptr, user_ptr->lev * 5);
672                 break;
673         }
674
675         case ACT_BO_MANA:
676         {
677                 msg_format(_("%sに魔法のトゲが現れた...", "The %s grows magical spikes..."), name);
678                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
679                 fire_bolt(user_ptr, GF_ARROW, dir, 150);
680                 break;
681         }
682
683         case ACT_BA_WATER:
684         {
685                 msg_format(_("%sが深い青色に鼓動している...", "The %s throbs deep blue..."), name);
686                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
687                 fire_ball(user_ptr, GF_WATER, dir, 200, 3);
688                 break;
689         }
690
691         case ACT_BA_DARK:
692         {
693                 msg_format(_("%sが深い闇に覆われた...", "The %s is coverd in pitch-darkness..."), name);
694                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
695                 fire_ball(user_ptr, GF_DARK, dir, 250, 4);
696                 break;
697         }
698
699         case ACT_BA_MANA:
700         {
701                 msg_format(_("%sが青白く光った...", "The %s glows pale..."), name);
702                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
703                 fire_ball(user_ptr, GF_MANA, dir, 250, 4);
704                 break;
705         }
706
707         case ACT_PESTICIDE:
708         {
709                 msg_print(_("あなたは害虫を一掃した。", "You exterminate small life."));
710                 (void)dispel_monsters(user_ptr, 4);
711                 break;
712         }
713
714         case ACT_BLINDING_LIGHT:
715         {
716                 msg_format(_("%sが眩しい光で輝いた...", "The %s gleams with blinding light..."), name);
717                 fire_ball(user_ptr, GF_LITE, 0, 300, 6);
718                 confuse_monsters(user_ptr, 3 * user_ptr->lev / 2);
719                 break;
720         }
721
722         case ACT_BIZARRE:
723         {
724                 msg_format(_("%sは漆黒に輝いた...", "The %s glows intensely black..."), name);
725                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
726                 ring_of_power(user_ptr, dir);
727                 break;
728         }
729
730         case ACT_CAST_BA_STAR:
731         {
732                 HIT_POINT num = damroll(5, 3);
733                 POSITION y = 0, x = 0;
734                 int attempts;
735                 msg_format(_("%sが稲妻で覆われた...", "The %s is surrounded by lightning..."), name);
736                 for (k = 0; k < num; k++)
737                 {
738                         attempts = 1000;
739
740                         while (attempts--)
741                         {
742                                 scatter(user_ptr, &y, &x, user_ptr->y, user_ptr->x, 4, 0);
743                                 if (!cave_have_flag_bold(user_ptr->current_floor_ptr, y, x, FF_PROJECT)) continue;
744                                 if (!player_bold(user_ptr, y, x)) break;
745                         }
746
747                         project(user_ptr, 0, 3, y, x, 150, GF_ELEC,
748                                 (PROJECT_THRU | PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
749                 }
750
751                 break;
752         }
753
754         case ACT_BLADETURNER:
755         {
756                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
757                 msg_print(_("あなたはエレメントのブレスを吐いた。", "You breathe the elements."));
758                 fire_breath(user_ptr, GF_MISSILE, dir, 300, 4);
759                 msg_print(_("鎧が様々な色に輝いた...", "Your armor glows many colours..."));
760                 (void)set_afraid(user_ptr, 0);
761                 (void)set_hero(user_ptr, randint1(50) + 50, FALSE);
762                 (void)hp_player(user_ptr, 10);
763                 (void)set_blessed(user_ptr, randint1(50) + 50, FALSE);
764                 (void)set_oppose_acid(user_ptr, randint1(50) + 50, FALSE);
765                 (void)set_oppose_elec(user_ptr, randint1(50) + 50, FALSE);
766                 (void)set_oppose_fire(user_ptr, randint1(50) + 50, FALSE);
767                 (void)set_oppose_cold(user_ptr, randint1(50) + 50, FALSE);
768                 (void)set_oppose_pois(user_ptr, randint1(50) + 50, FALSE);
769                 break;
770         }
771
772         case ACT_BR_FIRE:
773         {
774                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
775                 fire_breath(user_ptr, GF_FIRE, dir, 200, 2);
776                 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
777                 {
778                         (void)set_oppose_fire(user_ptr, randint1(20) + 20, FALSE);
779                 }
780                 break;
781         }
782
783         case ACT_BR_COLD:
784         {
785                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
786                 fire_breath(user_ptr, GF_COLD, dir, 200, 2);
787                 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
788                 {
789                         (void)set_oppose_cold(user_ptr, randint1(20) + 20, FALSE);
790                 }
791                 break;
792         }
793
794         case ACT_BR_DRAGON:
795         {
796                 if (!activate_dragon_breath(user_ptr, o_ptr)) return FALSE;
797                 break;
798         }
799
800         /* Activate for other offensive action */
801         case ACT_CONFUSE:
802         {
803                 msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours..."));
804                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
805                 confuse_monster(user_ptr, dir, 20);
806                 break;
807         }
808
809         case ACT_SLEEP:
810         {
811                 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
812                 sleep_monsters_touch(user_ptr);
813                 break;
814         }
815
816         case ACT_QUAKE:
817         {
818                 earthquake(user_ptr, user_ptr->y, user_ptr->x, 5, 0);
819                 break;
820         }
821
822         case ACT_TERROR:
823         {
824                 turn_monsters(user_ptr, 40 + user_ptr->lev);
825                 break;
826         }
827
828         case ACT_TELE_AWAY:
829         {
830                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
831                 (void)fire_beam(user_ptr, GF_AWAY_ALL, dir, plev);
832                 break;
833         }
834
835         case ACT_BANISH_EVIL:
836         {
837                 if (banish_evil(user_ptr, 100))
838                 {
839                         msg_print(_("アーティファクトの力が邪悪を打ち払った!", "The power of the artifact banishes evil!"));
840                 }
841                 break;
842         }
843
844         case ACT_GENOCIDE:
845         {
846                 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
847                 (void)symbol_genocide(user_ptr, 200, TRUE);
848                 break;
849         }
850
851         case ACT_MASS_GENO:
852         {
853                 msg_print(_("ひどく鋭い音が流れ出た...", "It lets out a long, shrill note..."));
854                 (void)mass_genocide(user_ptr, 200, TRUE);
855                 break;
856         }
857
858         case ACT_SCARE_AREA:
859         {
860                 if (music_singing_any(user_ptr)) stop_singing(user_ptr);
861                 if (hex_spelling_any(user_ptr)) stop_hex_spell_all(user_ptr);
862                 msg_print(_("あなたは力強い突風を吹き鳴らした。周囲の敵が震え上っている!",
863                         "You wind a mighty blast; your enemies tremble!"));
864                 (void)turn_monsters(user_ptr, (3 * user_ptr->lev / 2) + 10);
865                 break;
866         }
867
868         case ACT_AGGRAVATE:
869         {
870                 if (o_ptr->name1 == ART_HYOUSIGI)
871                 {
872                         msg_print(_("拍子木を打った。", "You beat your wooden clappers."));
873                 }
874                 else
875                 {
876                         msg_format(_("%sは不快な物音を立てた。", "The %s sounds an unpleasant noise."), name);
877                 }
878                 aggravate_monsters(user_ptr, 0);
879                 break;
880         }
881
882         /* Activate for summoning / charming */
883
884         case ACT_CHARM_ANIMAL:
885         {
886                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
887                 (void)charm_animal(user_ptr, dir, plev);
888                 break;
889         }
890
891         case ACT_CHARM_UNDEAD:
892         {
893                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
894                 (void)control_one_undead(user_ptr, dir, plev);
895                 break;
896         }
897
898         case ACT_CHARM_OTHER:
899         {
900                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
901                 (void)charm_monster(user_ptr, dir, plev * 2);
902                 break;
903         }
904
905         case ACT_CHARM_ANIMALS:
906         {
907                 (void)charm_animals(user_ptr, plev * 2);
908                 break;
909         }
910
911         case ACT_CHARM_OTHERS:
912         {
913                 charm_monsters(user_ptr, plev * 2);
914                 break;
915         }
916
917         case ACT_SUMMON_ANIMAL:
918         {
919                 (void)summon_specific(user_ptr, -1, user_ptr->y, user_ptr->x, plev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET));
920                 break;
921         }
922
923         case ACT_SUMMON_PHANTOM:
924         {
925                 msg_print(_("幻霊を召喚した。", "You summon a phantasmal servant."));
926                 (void)summon_specific(user_ptr, -1, user_ptr->y, user_ptr->x, user_ptr->current_floor_ptr->dun_level, SUMMON_PHANTOM, (PM_ALLOW_GROUP | PM_FORCE_PET));
927                 break;
928         }
929
930         case ACT_SUMMON_ELEMENTAL:
931                 if (!cast_summon_elemental(user_ptr, (plev * 3) / 2)) return FALSE;
932                 break;
933
934         case ACT_SUMMON_DEMON:
935         {
936                 cast_summon_demon(user_ptr, (plev * 3) / 2);
937                 break;
938         }
939
940         case ACT_SUMMON_UNDEAD:
941                 if (!cast_summon_undead(user_ptr, (plev * 3) / 2)) return FALSE;
942                 break;
943
944         case ACT_SUMMON_HOUND:
945                 if (!cast_summon_hound(user_ptr, (plev * 3) / 2)) return FALSE;
946                 break;
947
948         case ACT_SUMMON_DAWN:
949         {
950                 msg_print(_("暁の師団を召喚した。", "You summon the Legion of the Dawn."));
951                 (void)summon_specific(user_ptr, -1, user_ptr->y, user_ptr->x, user_ptr->current_floor_ptr->dun_level, SUMMON_DAWN, (PM_ALLOW_GROUP | PM_FORCE_PET));
952                 break;
953         }
954
955         case ACT_SUMMON_OCTOPUS:
956                 if (!cast_summon_octopus(user_ptr)) return FALSE;
957                 break;
958
959                 /* Activate for healing */
960
961         case ACT_CHOIR_SINGS:
962         {
963                 msg_print(_("天国の歌が聞こえる...", "A heavenly choir sings..."));
964                 (void)cure_critical_wounds(user_ptr, 777);
965                 (void)set_hero(user_ptr, randint1(25) + 25, FALSE);
966                 break;
967         }
968
969         case ACT_CURE_LW:
970         {
971                 (void)set_afraid(user_ptr, 0);
972                 (void)hp_player(user_ptr, 30);
973                 break;
974         }
975
976         case ACT_CURE_MW:
977         {
978                 msg_print(_("深紫色の光を発している...", "It radiates deep purple..."));
979                 (void)cure_serious_wounds(user_ptr, 4, 8);
980                 break;
981         }
982
983         case ACT_CURE_POISON:
984         {
985                 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
986                 (void)set_afraid(user_ptr, 0);
987                 (void)set_poisoned(user_ptr, 0);
988                 break;
989         }
990
991         case ACT_REST_EXP:
992         {
993                 msg_print(_("深紅に輝いている...", "It glows a deep red..."));
994                 restore_level(user_ptr);
995                 break;
996         }
997
998         case ACT_REST_ALL:
999         {
1000                 msg_print(_("濃緑色に輝いている...", "It glows a deep green..."));
1001                 (void)restore_all_status(user_ptr);
1002                 (void)restore_level(user_ptr);
1003                 break;
1004         }
1005
1006         case ACT_CURE_700:
1007         {
1008                 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
1009                 msg_print(_("体内に暖かい鼓動が感じられる...", "You feel a warm tingling inside..."));
1010                 (void)cure_critical_wounds(user_ptr, 700);
1011                 break;
1012         }
1013
1014         case ACT_CURE_1000:
1015         {
1016                 msg_print(_("白く明るく輝いている...", "It glows a bright white..."));
1017                 msg_print(_("ひじょうに気分がよい...", "You feel much better..."));
1018                 (void)cure_critical_wounds(user_ptr, 1000);
1019                 break;
1020         }
1021
1022         case ACT_CURING:
1023         {
1024                 msg_format(_("%sの優しさに癒される...", "the %s cures you affectionately ..."), name);
1025                 true_healing(user_ptr, 0);
1026                 break;
1027         }
1028
1029         case ACT_CURE_MANA_FULL:
1030         {
1031                 msg_format(_("%sが青白く光った...", "The %s glows pale..."), name);
1032                 restore_mana(user_ptr, TRUE);
1033                 break;
1034         }
1035
1036         /* Activate for timed effect */
1037
1038         case ACT_ESP:
1039         {
1040                 (void)set_tim_esp(user_ptr, randint1(30) + 25, FALSE);
1041                 break;
1042         }
1043
1044         case ACT_BERSERK:
1045         {
1046                 (void)berserk(user_ptr, randint1(25) + 25);
1047                 break;
1048         }
1049
1050         case ACT_PROT_EVIL:
1051         {
1052                 msg_format(_("%sから鋭い音が流れ出た...", "The %s lets out a shrill wail..."), name);
1053                 k = 3 * user_ptr->lev;
1054                 (void)set_protevil(user_ptr, randint1(25) + k, FALSE);
1055                 break;
1056         }
1057
1058         case ACT_RESIST_ALL:
1059         {
1060                 msg_print(_("様々な色に輝いている...", "It glows many colours..."));
1061                 (void)set_oppose_acid(user_ptr, randint1(40) + 40, FALSE);
1062                 (void)set_oppose_elec(user_ptr, randint1(40) + 40, FALSE);
1063                 (void)set_oppose_fire(user_ptr, randint1(40) + 40, FALSE);
1064                 (void)set_oppose_cold(user_ptr, randint1(40) + 40, FALSE);
1065                 (void)set_oppose_pois(user_ptr, randint1(40) + 40, FALSE);
1066                 break;
1067         }
1068
1069         case ACT_SPEED:
1070         {
1071                 msg_print(_("明るく緑色に輝いている...", "It glows bright green..."));
1072                 (void)set_fast(user_ptr, randint1(20) + 20, FALSE);
1073                 break;
1074         }
1075
1076         case ACT_XTRA_SPEED:
1077         {
1078                 msg_print(_("明るく輝いている...", "It glows brightly..."));
1079                 (void)set_fast(user_ptr, randint1(75) + 75, FALSE);
1080                 break;
1081         }
1082
1083         case ACT_WRAITH:
1084         {
1085                 set_wraith_form(user_ptr, randint1(plev / 2) + (plev / 2), FALSE);
1086                 break;
1087         }
1088
1089         case ACT_INVULN:
1090         {
1091                 (void)set_invuln(user_ptr, randint1(8) + 8, FALSE);
1092                 break;
1093         }
1094
1095         case ACT_HERO:
1096         {
1097                 (void)heroism(user_ptr, 25);
1098                 break;
1099         }
1100
1101         case ACT_HERO_SPEED:
1102         {
1103                 (void)set_fast(user_ptr, randint1(50) + 50, FALSE);
1104                 (void)heroism(user_ptr, 50);
1105                 break;
1106         }
1107
1108         case ACT_RESIST_ACID:
1109         {
1110                 msg_format(_("%sが黒く輝いた...", "The %s grows black."), name);
1111                 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ACID))
1112                 {
1113                         if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1114                         fire_ball(user_ptr, GF_ACID, dir, 100, 2);
1115                 }
1116                 (void)set_oppose_acid(user_ptr, randint1(20) + 20, FALSE);
1117                 break;
1118         }
1119
1120         case ACT_RESIST_FIRE:
1121         {
1122                 msg_format(_("%sが赤く輝いた...", "The %s grows red."), name);
1123                 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
1124                 {
1125                         if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1126                         fire_ball(user_ptr, GF_FIRE, dir, 100, 2);
1127                 }
1128                 (void)set_oppose_fire(user_ptr, randint1(20) + 20, FALSE);
1129                 break;
1130         }
1131
1132         case ACT_RESIST_COLD:
1133         {
1134                 msg_format(_("%sが白く輝いた...", "The %s grows white."), name);
1135                 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
1136                 {
1137                         if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1138                         fire_ball(user_ptr, GF_COLD, dir, 100, 2);
1139                 }
1140                 (void)set_oppose_cold(user_ptr, randint1(20) + 20, FALSE);
1141                 break;
1142         }
1143
1144         case ACT_RESIST_ELEC:
1145         {
1146                 msg_format(_("%sが青く輝いた...", "The %s grows blue."), name);
1147                 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ELEC))
1148                 {
1149                         if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1150                         fire_ball(user_ptr, GF_ELEC, dir, 100, 2);
1151                 }
1152                 (void)set_oppose_elec(user_ptr, randint1(20) + 20, FALSE);
1153                 break;
1154         }
1155
1156         case ACT_RESIST_POIS:
1157         {
1158                 msg_format(_("%sが緑に輝いた...", "The %s grows green."), name);
1159                 (void)set_oppose_pois(user_ptr, randint1(20) + 20, FALSE);
1160                 break;
1161         }
1162
1163         /* Activate for general purpose effect (detection etc.) */
1164
1165         case ACT_LIGHT:
1166         {
1167                 msg_format(_("%sから澄んだ光があふれ出た...", "The %s wells with clear light..."), name);
1168                 lite_area(user_ptr, damroll(2, 15), 3);
1169                 break;
1170         }
1171
1172         case ACT_MAP_LIGHT:
1173         {
1174                 msg_print(_("眩しく輝いた...", "It shines brightly..."));
1175                 map_area(user_ptr, DETECT_RAD_MAP);
1176                 lite_area(user_ptr, damroll(2, 15), 3);
1177                 break;
1178         }
1179
1180         case ACT_DETECT_ALL:
1181         {
1182                 msg_print(_("白く明るく輝いている...", "It glows bright white..."));
1183                 msg_print(_("心にイメージが浮かんできた...", "An image forms in your mind..."));
1184                 detect_all(user_ptr, DETECT_RAD_DEFAULT);
1185                 break;
1186         }
1187
1188         case ACT_DETECT_XTRA:
1189         {
1190                 msg_print(_("明るく輝いている...", "It glows brightly..."));
1191                 detect_all(user_ptr, DETECT_RAD_DEFAULT);
1192                 probing(user_ptr);
1193                 identify_fully(user_ptr, FALSE, 0);
1194                 break;
1195         }
1196
1197         case ACT_ID_FULL:
1198         {
1199                 msg_print(_("黄色く輝いている...", "It glows yellow..."));
1200                 identify_fully(user_ptr, FALSE, 0);
1201                 break;
1202         }
1203
1204         case ACT_ID_PLAIN:
1205         {
1206                 if (!ident_spell(user_ptr, FALSE, 0)) return FALSE;
1207                 break;
1208         }
1209
1210         case ACT_RUNE_EXPLO:
1211         {
1212                 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
1213                 explosive_rune(user_ptr, user_ptr->y, user_ptr->x);
1214                 break;
1215         }
1216
1217         case ACT_RUNE_PROT:
1218         {
1219                 msg_print(_("ブルーに明るく輝いている...", "It glows light blue..."));
1220                 warding_glyph(user_ptr);
1221                 break;
1222         }
1223
1224         case ACT_SATIATE:
1225         {
1226                 (void)set_food(user_ptr, PY_FOOD_MAX - 1);
1227                 break;
1228         }
1229
1230         case ACT_DEST_DOOR:
1231         {
1232                 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
1233                 destroy_doors_touch(user_ptr);
1234                 break;
1235         }
1236
1237         case ACT_STONE_MUD:
1238         {
1239                 msg_print(_("鼓動している...", "It pulsates..."));
1240                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1241                 wall_to_mud(user_ptr, dir, 20 + randint1(30));
1242                 break;
1243         }
1244
1245         case ACT_RECHARGE:
1246         {
1247                 recharge(user_ptr, 130);
1248                 break;
1249         }
1250
1251         case ACT_ALCHEMY:
1252         {
1253                 msg_print(_("明るい黄色に輝いている...", "It glows bright yellow..."));
1254                 (void)alchemy(user_ptr);
1255                 break;
1256         }
1257
1258         case ACT_DIM_DOOR:
1259         {
1260                 msg_print(_("次元の扉が開いた。目的地を選んで下さい。", "You open a dimensional gate. Choose a destination."));
1261                 if (!dimension_door(user_ptr)) return FALSE;
1262                 break;
1263         }
1264
1265
1266         case ACT_TELEPORT:
1267         {
1268                 msg_print(_("周りの空間が歪んでいる...", "It twists space around you..."));
1269                 teleport_player(user_ptr, 100, TELEPORT_SPONTANEOUS);
1270                 break;
1271         }
1272
1273         case ACT_RECALL:
1274         {
1275                 msg_print(_("やわらかな白色に輝いている...", "It glows soft white..."));
1276                 if (!recall_player(user_ptr, randint0(21) + 15)) return FALSE;
1277                 break;
1278         }
1279
1280         case ACT_JUDGE:
1281         {
1282                 msg_format(_("%sは赤く明るく光った!", "The %s flashes bright red!"), name);
1283                 chg_virtue(user_ptr, V_KNOWLEDGE, 1);
1284                 chg_virtue(user_ptr, V_ENLIGHTEN, 1);
1285                 wiz_lite(user_ptr, FALSE);
1286
1287                 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
1288                 take_hit(user_ptr, DAMAGE_LOSELIFE, damroll(3, 8), _("審判の宝石", "the Jewel of Judgement"), -1);
1289
1290                 (void)detect_traps(user_ptr, DETECT_RAD_DEFAULT, TRUE);
1291                 (void)detect_doors(user_ptr, DETECT_RAD_DEFAULT);
1292                 (void)detect_stairs(user_ptr, DETECT_RAD_DEFAULT);
1293
1294                 if (get_check(_("帰還の力を使いますか?", "Activate recall? ")))
1295                 {
1296                         (void)recall_player(user_ptr, randint0(21) + 15);
1297                 }
1298
1299                 break;
1300         }
1301
1302         case ACT_TELEKINESIS:
1303         {
1304                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1305                 msg_format(_("%sを伸ばした。", "You stretched your %s."), name);
1306                 fetch(user_ptr, dir, 500, TRUE);
1307                 break;
1308         }
1309
1310         case ACT_DETECT_UNIQUE:
1311         {
1312                 int i;
1313                 monster_type *m_ptr;
1314                 monster_race *r_ptr;
1315                 msg_print(_("奇妙な場所が頭の中に浮かんだ...", "Some strange places show up in your mind. And you see ..."));
1316                 /* Process the monsters (backwards) */
1317                 for (i = user_ptr->current_floor_ptr->m_max - 1; i >= 1; i--)
1318                 {
1319                         m_ptr = &user_ptr->current_floor_ptr->m_list[i];
1320
1321                         /* Ignore "dead" monsters */
1322                         if (!monster_is_valid(m_ptr)) continue;
1323
1324                         r_ptr = &r_info[m_ptr->r_idx];
1325
1326                         if (r_ptr->flags1 & RF1_UNIQUE)
1327                         {
1328                                 msg_format(_("%s. ", "%s. "), r_name + r_ptr->name);
1329                         }
1330                 }
1331                 break;
1332         }
1333
1334         case ACT_ESCAPE:
1335         {
1336                 switch (randint1(13))
1337                 {
1338                 case 1: case 2: case 3: case 4: case 5:
1339                         teleport_player(user_ptr, 10, TELEPORT_SPONTANEOUS);
1340                         break;
1341                 case 6: case 7: case 8: case 9: case 10:
1342                         teleport_player(user_ptr, 222, TELEPORT_SPONTANEOUS);
1343                         break;
1344                 case 11: case 12:
1345                         (void)stair_creation(user_ptr);
1346                         break;
1347                 default:
1348                         if (get_check(_("この階を去りますか?", "Leave this level? ")))
1349                         {
1350                                 if (autosave_l) do_cmd_save_game(user_ptr, TRUE);
1351                                 user_ptr->leaving = TRUE;
1352                         }
1353                 }
1354                 break;
1355         }
1356
1357         case ACT_DISP_CURSE_XTRA:
1358         {
1359                 msg_format(_("%sが真実を照らし出す...", "The %s exhibits the truth..."), name);
1360                 (void)remove_all_curse(user_ptr);
1361                 (void)probing(user_ptr);
1362                 break;
1363         }
1364
1365         case ACT_BRAND_FIRE_BOLTS:
1366         {
1367                 msg_format(_("%sが深紅に輝いた...", "Your %s glows deep red..."), name);
1368                 brand_bolts(user_ptr);
1369                 break;
1370         }
1371
1372         case ACT_RECHARGE_XTRA:
1373         {
1374                 msg_format(_("%sが白く輝いた...", "The %s gleams with blinding light..."), name);
1375                 if (!recharge(user_ptr, 1000)) return FALSE;
1376                 break;
1377         }
1378
1379         case ACT_LORE:
1380                 msg_print(_("石が隠された秘密を写し出した...", "The stone reveals hidden mysteries..."));
1381                 if (!perilous_secrets(user_ptr)) return FALSE;
1382                 break;
1383
1384         case ACT_SHIKOFUMI:
1385         {
1386                 msg_print(_("力強く四股を踏んだ。", "You stamp. (as if you are in a ring.)"));
1387                 (void)set_afraid(user_ptr, 0);
1388                 (void)set_hero(user_ptr, randint1(20) + 20, FALSE);
1389                 dispel_evil(user_ptr, user_ptr->lev * 3);
1390                 break;
1391         }
1392
1393         case ACT_PHASE_DOOR:
1394         {
1395                 teleport_player(user_ptr, 10, TELEPORT_SPONTANEOUS);
1396                 break;
1397         }
1398
1399         case ACT_DETECT_ALL_MONS:
1400         {
1401                 (void)detect_monsters_invis(user_ptr, 255);
1402                 (void)detect_monsters_normal(user_ptr, 255);
1403                 break;
1404         }
1405
1406         case ACT_ULTIMATE_RESIST:
1407         {
1408                 TIME_EFFECT v = randint1(25) + 25;
1409                 (void)set_afraid(user_ptr, 0);
1410                 (void)set_hero(user_ptr, v, FALSE);
1411                 (void)hp_player(user_ptr, 10);
1412                 (void)set_blessed(user_ptr, v, FALSE);
1413                 (void)set_oppose_acid(user_ptr, v, FALSE);
1414                 (void)set_oppose_elec(user_ptr, v, FALSE);
1415                 (void)set_oppose_fire(user_ptr, v, FALSE);
1416                 (void)set_oppose_cold(user_ptr, v, FALSE);
1417                 (void)set_oppose_pois(user_ptr, v, FALSE);
1418                 (void)set_ultimate_res(user_ptr, v, FALSE);
1419                 break;
1420         }
1421
1422         case ACT_CAST_OFF:
1423                 cosmic_cast_off(user_ptr, o_ptr);
1424                 break;
1425
1426         case ACT_FALLING_STAR:
1427         {
1428                 msg_print(_("あなたは妖刀に魅入られた…", "You are enchanted by cursed blade..."));
1429                 msg_print(_("「狂ほしく 血のごとき 月はのぼれり 秘めおきし 魔剣 いずこぞや」", "'Behold the blade arts.'"));
1430                 massacre(user_ptr);
1431                 break;
1432         }
1433
1434         case ACT_GRAND_CROSS:
1435         {
1436                 msg_print(_("「闇に還れ!」", "You say, 'Return to darkness!'"));
1437                 project(user_ptr, 0, 8, user_ptr->y, user_ptr->x, (randint1(100) + 200) * 2, GF_HOLY_FIRE, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID, -1);
1438                 break;
1439         }
1440
1441         case ACT_TELEPORT_LEVEL:
1442         {
1443                 if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)"))) return FALSE;
1444                 teleport_level(user_ptr, 0);
1445                 break;
1446         }
1447
1448         case ACT_STRAIN_HASTE:
1449         {
1450                 int t;
1451                 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
1452                 take_hit(user_ptr, DAMAGE_LOSELIFE, damroll(3, 8), _("加速した疲労", "the strain of haste"), -1);
1453                 t = 25 + randint1(25);
1454                 (void)set_fast(user_ptr, user_ptr->fast + t, FALSE);
1455                 break;
1456         }
1457
1458         case ACT_FISHING:
1459                 if (!fishing(user_ptr)) return FALSE;
1460                 break;
1461
1462         case ACT_INROU:
1463                 mitokohmon(user_ptr);
1464                 break;
1465
1466         case ACT_MURAMASA:
1467         {
1468                 /* Only for Muramasa */
1469                 if (o_ptr->name1 != ART_MURAMASA) return FALSE;
1470                 if (get_check(_("本当に使いますか?", "Are you sure?!")))
1471                 {
1472                         msg_print(_("村正が震えた...", "The Muramasa pulsates..."));
1473                         do_inc_stat(user_ptr, A_STR);
1474                         if (one_in_(2))
1475                         {
1476                                 msg_print(_("村正は壊れた!", "The Muramasa is destroyed!"));
1477                                 curse_weapon_object(user_ptr, TRUE, o_ptr);
1478                         }
1479                 }
1480                 break;
1481         }
1482
1483         case ACT_BLOODY_MOON:
1484         {
1485                 /* Only for Bloody Moon */
1486                 if (o_ptr->name1 != ART_BLOOD) return FALSE;
1487                 msg_print(_("鎌が明るく輝いた...", "Your scythe glows brightly!"));
1488                 get_bloody_moon_flags(o_ptr);
1489                 if (user_ptr->prace == RACE_ANDROID) calc_android_exp(user_ptr);
1490                 user_ptr->update |= (PU_BONUS | PU_HP);
1491                 break;
1492         }
1493
1494         case ACT_CRIMSON:
1495                 if (o_ptr->name1 != ART_CRIMSON) return FALSE;
1496                 msg_print(_("せっかくだから『クリムゾン』をぶっぱなすぜ!", "I'll fire CRIMSON! SEKKAKUDAKARA!"));
1497                 if (!fire_crimson(user_ptr)) return FALSE;
1498                 break;
1499
1500         default:
1501         {
1502                 msg_format(_("Unknown activation effect: %d.", "Unknown activation effect: %d."), act_ptr->index);
1503                 return FALSE;
1504         }
1505         }
1506
1507         /* Set activation timeout */
1508         if (act_ptr->timeout.constant >= 0) {
1509                 o_ptr->timeout = (s16b)act_ptr->timeout.constant;
1510                 if (act_ptr->timeout.dice > 0) {
1511                         o_ptr->timeout += randint1(act_ptr->timeout.dice);
1512                 }
1513         }
1514         else {
1515                 /* Activations that have special timeout */
1516                 switch (act_ptr->index) {
1517                 case ACT_BR_FIRE:
1518                         o_ptr->timeout = ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES)) ? 200 : 250;
1519                         break;
1520                 case ACT_BR_COLD:
1521                         o_ptr->timeout = ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE)) ? 200 : 250;
1522                         break;
1523                 case ACT_TERROR:
1524                         o_ptr->timeout = 3 * (user_ptr->lev + 10);
1525                         break;
1526                 case ACT_MURAMASA:
1527                         /* Nothing to do */
1528                         break;
1529                 default:
1530                         msg_format("Special timeout is not implemented: %d.", act_ptr->index);
1531                         return FALSE;
1532                 }
1533         }
1534
1535         return TRUE;
1536 }