OSDN Git Service

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