OSDN Git Service

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