2 * @brief プレイヤーの発動コマンド実装
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"
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
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.
82 void exe_activate(player_type *user_ptr, INVENTORY_IDX item)
90 o_ptr = ref_item(user_ptr, item);
91 take_turn(user_ptr, 100);
92 lev = k_info[o_ptr->k_idx].level;
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))
98 const activation_type* const act_ptr = find_activation_info(o_ptr);
100 lev = act_ptr->level;
103 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)) && o_ptr->name2) lev = e_info[o_ptr->name2].level;
105 /* Base chance of success */
106 chance = user_ptr->skill_dev;
108 /* Confusion hurts skill */
109 if (user_ptr->confused) chance = chance / 2;
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;
117 if (cmd_limit_time_walk(user_ptr)) return;
119 if (user_ptr->pclass == CLASS_BERSERKER) success = FALSE;
120 else if (chance > fail)
122 if (randint0(chance * 2) < fail) success = FALSE;
127 if (randint0(fail * 2) < chance) success = TRUE;
128 else success = FALSE;
134 if (flush_failure) flush();
135 msg_print(_("うまく始動させることができなかった。", "You failed to activate it properly."));
140 /* Check the recharge */
143 msg_print(_("それは微かに音を立て、輝き、消えた...", "It whines, glows and fades..."));
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)))
151 msg_print(_("燃料がない。", "It has no fuel."));
156 /* Activate the artifact */
157 msg_print(_("始動させた...", "You activate it..."));
161 /* Activate object */
162 if (activation_index(o_ptr))
164 (void)activate_artifact(user_ptr, o_ptr);
166 user_ptr->window |= (PW_INVEN | PW_EQUIP);
173 else if (o_ptr->tval == TV_WHISTLE)
175 if (music_singing_any(user_ptr)) stop_singing(user_ptr);
176 if (hex_spelling_any(user_ptr)) stop_hex_spell_all(user_ptr);
179 MONSTER_IDX pet_ctr, i;
184 /* Allocate the "who" array */
185 C_MAKE(who, current_world_ptr->max_m_idx, MONSTER_IDX);
187 /* Process the monsters (backwards) */
188 for (pet_ctr = user_ptr->current_floor_ptr->m_max - 1; pet_ctr >= 1; pet_ctr--)
190 if (is_pet(&user_ptr->current_floor_ptr->m_list[pet_ctr]) && (user_ptr->riding != pet_ctr))
191 who[max_pet++] = pet_ctr;
194 ang_sort(who, &dummy_why, max_pet, ang_sort_comp_pet, ang_sort_swap_hook);
196 /* Process the monsters (backwards) */
197 for (i = 0; i < max_pet; i++)
200 teleport_monster_to(user_ptr, pet_ctr, user_ptr->y, user_ptr->x, 100, TELEPORT_PASSIVE);
203 /* Free the "who" array */
204 C_KILL(who, current_world_ptr->max_m_idx, MONSTER_IDX);
206 o_ptr->timeout = 100 + randint1(100);
209 else if (o_ptr->tval == TV_CAPTURE)
213 bool old_target_pet = target_pet;
215 if (!get_aim_dir(user_ptr, &dir))
217 target_pet = old_target_pet;
220 target_pet = old_target_pet;
222 if (fire_ball(user_ptr, GF_CAPTURE, dir, 0, 0))
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;
234 if (o_ptr->inscription)
235 strcpy(buf, quark_str(o_ptr->inscription));
237 for (s = buf; *s && (*s != '#'); s++)
240 if (iskanji(*s)) s++;
250 t = quark_str(cap_nickname);
263 o_ptr->inscription = quark_add(buf);
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))
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)))
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)
288 t = quark_str(o_ptr->inscription);
289 for (t = quark_str(o_ptr->inscription); *t && (*t != '#'); t++)
292 if (iskanji(*t)) t++;
317 if (quote && *(s - 1) == '\'')
321 user_ptr->current_floor_ptr->m_list[hack_m_idx_ii].nickname = quark_add(buf);
322 t = quark_str(o_ptr->inscription);
324 while (*t && (*t != '#'))
331 o_ptr->inscription = quark_add(buf);
342 msg_print(_("おっと、解放に失敗した。", "Oops. You failed to release your pet."));
344 calc_android_exp(user_ptr);
349 msg_print(_("おっと、このアイテムは始動できない。", "Oops. That object cannot be activated."));
353 * @brief 装備を発動するコマンドのメインルーチン /
354 * @param user_ptr プレーヤーへの参照ポインタ
357 void do_cmd_activate(player_type *user_ptr)
362 if (user_ptr->wild_mode) return;
363 if (cmd_limit_arena(user_ptr)) return;
365 if (user_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
367 set_action(user_ptr, ACTION_NONE);
370 item_tester_hook = item_tester_hook_activate;
372 q = _("どのアイテムを始動させますか? ", "Activate which item? ");
373 s = _("始動できるアイテムを装備していない。", "You have nothing to activate.");
375 if (!choose_object(user_ptr, &item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0)) return;
377 /* Activate the item */
378 exe_activate(user_ptr, item);
382 * @brief 発動によるブレスの属性をアイテムの耐性から選択し、実行を処理する。/ Dragon breath activation
383 * @details 対象となる耐性は dragonbreath_info テーブルを参照のこと。
384 * @param user_ptr プレーヤーへの参照ポインタ
385 * @param o_ptr 対象のオブジェクト構造体ポインタ
386 * @return 発動実行の是非を返す。
388 static bool activate_dragon_breath(player_type *user_ptr, object_type *o_ptr)
390 BIT_FLAGS flgs[TR_FLAG_SIZE]; /* for resistance flags */
396 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
398 object_flags(o_ptr, flgs);
400 for (i = 0; dragonbreath_info[i].flag != 0; i++)
402 if (have_flag(flgs, dragonbreath_info[i].flag))
404 type[n] = dragonbreath_info[i].type;
405 name[n] = dragonbreath_info[i].name;
409 if (n == 0) return FALSE;
412 if (music_singing_any(user_ptr)) stop_singing(user_ptr);
413 if (hex_spelling_any(user_ptr)) stop_hex_spell_all(user_ptr);
416 msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), name[t]);
417 fire_breath(user_ptr, type[t], dir, 250, 4);
424 * @brief アイテムの発動効果を処理する。
425 * @param user_ptr プレーヤーへの参照ポインタ
426 * @param o_ptr 対象のオブジェクト構造体ポインタ
427 * @return 発動実行の是非を返す。
429 bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
431 PLAYER_LEVEL plev = user_ptr->lev;
434 concptr name = k_name + k_info[o_ptr->k_idx].name;
435 const activation_type* const act_ptr = find_activation_info(o_ptr);
437 /* Maybe forgot adding information to activation_info table ? */
438 msg_print("Activation information is not found.");
442 /* Activate for attack */
443 switch (act_ptr->index)
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));
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));
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);
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));
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));
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));
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));
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
589 case ACT_HYPODYNAMIA_1:
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);
597 case ACT_HYPODYNAMIA_2:
599 msg_print(_("黒く輝いている...", "It glows black..."));
600 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
601 hypodynamic_bolt(user_ptr, dir, 120);
607 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
608 for (dummy = 0; dummy < 3; dummy++)
610 if (hypodynamic_bolt(user_ptr, dir, 50))
611 hp_player(user_ptr, 50);
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);
632 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
633 for (dummy = 0; dummy < 3; dummy++)
635 if (hypodynamic_bolt(user_ptr, dir, 100))
636 hp_player(user_ptr, 100);
644 msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours..."));
645 call_chaos(user_ptr);
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);
659 msg_print(_("神聖な雰囲気が充満した...", "It floods the area with goodness..."));
660 dispel_evil(user_ptr, user_ptr->lev * 5);
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);
674 msg_print(_("邪悪な雰囲気が充満した...", "It floods the area with evil..."));
675 dispel_good(user_ptr, user_ptr->lev * 5);
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);
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);
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);
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);
713 msg_print(_("あなたは害虫を一掃した。", "You exterminate small life."));
714 (void)dispel_monsters(user_ptr, 4);
718 case ACT_BLINDING_LIGHT:
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);
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);
734 case ACT_CAST_BA_STAR:
736 HIT_POINT num = damroll(5, 3);
737 POSITION y = 0, x = 0;
739 msg_format(_("%sが稲妻で覆われた...", "The %s is surrounded by lightning..."), name);
740 for (k = 0; k < num; k++)
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;
751 project(user_ptr, 0, 3, y, x, 150, GF_ELEC,
752 (PROJECT_THRU | PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
758 case ACT_BLADETURNER:
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);
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))
782 (void)set_oppose_fire(user_ptr, randint1(20) + 20, FALSE);
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))
793 (void)set_oppose_cold(user_ptr, randint1(20) + 20, FALSE);
800 if (!activate_dragon_breath(user_ptr, o_ptr)) return FALSE;
804 /* Activate for other offensive action */
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);
815 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
816 sleep_monsters_touch(user_ptr);
822 earthquake(user_ptr, user_ptr->y, user_ptr->x, 5, 0);
828 turn_monsters(user_ptr, 40 + user_ptr->lev);
834 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
835 (void)fire_beam(user_ptr, GF_AWAY_ALL, dir, plev);
839 case ACT_BANISH_EVIL:
841 if (banish_evil(user_ptr, 100))
843 msg_print(_("アーティファクトの力が邪悪を打ち払った!", "The power of the artifact banishes evil!"));
850 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
851 (void)symbol_genocide(user_ptr, 200, TRUE);
857 msg_print(_("ひどく鋭い音が流れ出た...", "It lets out a long, shrill note..."));
858 (void)mass_genocide(user_ptr, 200, TRUE);
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);
874 if (o_ptr->name1 == ART_HYOUSIGI)
876 msg_print(_("拍子木を打った。", "You beat your wooden clappers."));
880 msg_format(_("%sは不快な物音を立てた。", "The %s sounds an unpleasant noise."), name);
882 aggravate_monsters(user_ptr, 0);
886 /* Activate for summoning / charming */
888 case ACT_CHARM_ANIMAL:
890 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
891 (void)charm_animal(user_ptr, dir, plev);
895 case ACT_CHARM_UNDEAD:
897 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
898 (void)control_one_undead(user_ptr, dir, plev);
902 case ACT_CHARM_OTHER:
904 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
905 (void)charm_monster(user_ptr, dir, plev * 2);
909 case ACT_CHARM_ANIMALS:
911 (void)charm_animals(user_ptr, plev * 2);
915 case ACT_CHARM_OTHERS:
917 charm_monsters(user_ptr, plev * 2);
921 case ACT_SUMMON_ANIMAL:
923 (void)summon_specific(user_ptr, -1, user_ptr->y, user_ptr->x, plev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET));
927 case ACT_SUMMON_PHANTOM:
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));
934 case ACT_SUMMON_ELEMENTAL:
935 if (!cast_summon_elemental(user_ptr, (plev * 3) / 2)) return FALSE;
938 case ACT_SUMMON_DEMON:
940 cast_summon_demon(user_ptr, (plev * 3) / 2);
944 case ACT_SUMMON_UNDEAD:
945 if (!cast_summon_undead(user_ptr, (plev * 3) / 2)) return FALSE;
948 case ACT_SUMMON_HOUND:
949 if (!cast_summon_hound(user_ptr, (plev * 3) / 2)) return FALSE;
952 case ACT_SUMMON_DAWN:
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));
959 case ACT_SUMMON_OCTOPUS:
960 if (!cast_summon_octopus(user_ptr)) return FALSE;
963 /* Activate for healing */
965 case ACT_CHOIR_SINGS:
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);
975 (void)set_afraid(user_ptr, 0);
976 (void)hp_player(user_ptr, 30);
982 msg_print(_("深紫色の光を発している...", "It radiates deep purple..."));
983 (void)cure_serious_wounds(user_ptr, 4, 8);
987 case ACT_CURE_POISON:
989 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
990 (void)set_afraid(user_ptr, 0);
991 (void)set_poisoned(user_ptr, 0);
997 msg_print(_("深紅に輝いている...", "It glows a deep red..."));
998 restore_level(user_ptr);
1004 msg_print(_("濃緑色に輝いている...", "It glows a deep green..."));
1005 (void)restore_all_status(user_ptr);
1006 (void)restore_level(user_ptr);
1012 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
1013 msg_print(_("体内に暖かい鼓動が感じられる...", "You feel a warm tingling inside..."));
1014 (void)cure_critical_wounds(user_ptr, 700);
1020 msg_print(_("白く明るく輝いている...", "It glows a bright white..."));
1021 msg_print(_("ひじょうに気分がよい...", "You feel much better..."));
1022 (void)cure_critical_wounds(user_ptr, 1000);
1028 msg_format(_("%sの優しさに癒される...", "the %s cures you affectionately ..."), name);
1029 true_healing(user_ptr, 0);
1033 case ACT_CURE_MANA_FULL:
1035 msg_format(_("%sが青白く光った...", "The %s glows pale..."), name);
1036 restore_mana(user_ptr, TRUE);
1040 /* Activate for timed effect */
1044 (void)set_tim_esp(user_ptr, randint1(30) + 25, FALSE);
1050 (void)berserk(user_ptr, randint1(25) + 25);
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);
1062 case ACT_RESIST_ALL:
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);
1075 msg_print(_("明るく緑色に輝いている...", "It glows bright green..."));
1076 (void)set_fast(user_ptr, randint1(20) + 20, FALSE);
1080 case ACT_XTRA_SPEED:
1082 msg_print(_("明るく輝いている...", "It glows brightly..."));
1083 (void)set_fast(user_ptr, randint1(75) + 75, FALSE);
1089 set_wraith_form(user_ptr, randint1(plev / 2) + (plev / 2), FALSE);
1095 (void)set_invuln(user_ptr, randint1(8) + 8, FALSE);
1101 (void)heroism(user_ptr, 25);
1105 case ACT_HERO_SPEED:
1107 (void)set_fast(user_ptr, randint1(50) + 50, FALSE);
1108 (void)heroism(user_ptr, 50);
1112 case ACT_RESIST_ACID:
1114 msg_format(_("%sが黒く輝いた...", "The %s grows black."), name);
1115 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ACID))
1117 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1118 fire_ball(user_ptr, GF_ACID, dir, 100, 2);
1120 (void)set_oppose_acid(user_ptr, randint1(20) + 20, FALSE);
1124 case ACT_RESIST_FIRE:
1126 msg_format(_("%sが赤く輝いた...", "The %s grows red."), name);
1127 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
1129 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1130 fire_ball(user_ptr, GF_FIRE, dir, 100, 2);
1132 (void)set_oppose_fire(user_ptr, randint1(20) + 20, FALSE);
1136 case ACT_RESIST_COLD:
1138 msg_format(_("%sが白く輝いた...", "The %s grows white."), name);
1139 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
1141 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1142 fire_ball(user_ptr, GF_COLD, dir, 100, 2);
1144 (void)set_oppose_cold(user_ptr, randint1(20) + 20, FALSE);
1148 case ACT_RESIST_ELEC:
1150 msg_format(_("%sが青く輝いた...", "The %s grows blue."), name);
1151 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ELEC))
1153 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1154 fire_ball(user_ptr, GF_ELEC, dir, 100, 2);
1156 (void)set_oppose_elec(user_ptr, randint1(20) + 20, FALSE);
1160 case ACT_RESIST_POIS:
1162 msg_format(_("%sが緑に輝いた...", "The %s grows green."), name);
1163 (void)set_oppose_pois(user_ptr, randint1(20) + 20, FALSE);
1167 /* Activate for general purpose effect (detection etc.) */
1171 msg_format(_("%sから澄んだ光があふれ出た...", "The %s wells with clear light..."), name);
1172 lite_area(user_ptr, damroll(2, 15), 3);
1178 msg_print(_("眩しく輝いた...", "It shines brightly..."));
1179 map_area(user_ptr, DETECT_RAD_MAP);
1180 lite_area(user_ptr, damroll(2, 15), 3);
1184 case ACT_DETECT_ALL:
1186 msg_print(_("白く明るく輝いている...", "It glows bright white..."));
1187 msg_print(_("心にイメージが浮かんできた...", "An image forms in your mind..."));
1188 detect_all(user_ptr, DETECT_RAD_DEFAULT);
1192 case ACT_DETECT_XTRA:
1194 msg_print(_("明るく輝いている...", "It glows brightly..."));
1195 detect_all(user_ptr, DETECT_RAD_DEFAULT);
1197 identify_fully(user_ptr, FALSE, 0);
1203 msg_print(_("黄色く輝いている...", "It glows yellow..."));
1204 identify_fully(user_ptr, FALSE, 0);
1210 if (!ident_spell(user_ptr, FALSE, 0)) return FALSE;
1214 case ACT_RUNE_EXPLO:
1216 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
1217 explosive_rune(user_ptr, user_ptr->y, user_ptr->x);
1223 msg_print(_("ブルーに明るく輝いている...", "It glows light blue..."));
1224 warding_glyph(user_ptr);
1230 (void)set_food(user_ptr, PY_FOOD_MAX - 1);
1236 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
1237 destroy_doors_touch(user_ptr);
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));
1251 recharge(user_ptr, 130);
1257 msg_print(_("明るい黄色に輝いている...", "It glows bright yellow..."));
1258 (void)alchemy(user_ptr);
1264 msg_print(_("次元の扉が開いた。目的地を選んで下さい。", "You open a dimensional gate. Choose a destination."));
1265 if (!dimension_door(user_ptr)) return FALSE;
1272 msg_print(_("周りの空間が歪んでいる...", "It twists space around you..."));
1273 teleport_player(user_ptr, 100, TELEPORT_SPONTANEOUS);
1279 msg_print(_("やわらかな白色に輝いている...", "It glows soft white..."));
1280 if (!recall_player(user_ptr, randint0(21) + 15)) return FALSE;
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);
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);
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);
1298 if (get_check(_("帰還の力を使いますか?", "Activate recall? ")))
1300 (void)recall_player(user_ptr, randint0(21) + 15);
1306 case ACT_TELEKINESIS:
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);
1314 case ACT_DETECT_UNIQUE:
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--)
1323 m_ptr = &user_ptr->current_floor_ptr->m_list[i];
1325 /* Ignore "dead" monsters */
1326 if (!monster_is_valid(m_ptr)) continue;
1328 r_ptr = &r_info[m_ptr->r_idx];
1330 if (r_ptr->flags1 & RF1_UNIQUE)
1332 msg_format(_("%s. ", "%s. "), r_name + r_ptr->name);
1340 switch (randint1(13))
1342 case 1: case 2: case 3: case 4: case 5:
1343 teleport_player(user_ptr, 10, TELEPORT_SPONTANEOUS);
1345 case 6: case 7: case 8: case 9: case 10:
1346 teleport_player(user_ptr, 222, TELEPORT_SPONTANEOUS);
1349 (void)stair_creation(user_ptr);
1352 if (get_check(_("この階を去りますか?", "Leave this level? ")))
1354 if (autosave_l) do_cmd_save_game(user_ptr, TRUE);
1355 user_ptr->leaving = TRUE;
1361 case ACT_DISP_CURSE_XTRA:
1363 msg_format(_("%sが真実を照らし出す...", "The %s exhibits the truth..."), name);
1364 (void)remove_all_curse(user_ptr);
1365 (void)probing(user_ptr);
1369 case ACT_BRAND_FIRE_BOLTS:
1371 msg_format(_("%sが深紅に輝いた...", "Your %s glows deep red..."), name);
1372 brand_bolts(user_ptr);
1376 case ACT_RECHARGE_XTRA:
1378 msg_format(_("%sが白く輝いた...", "The %s gleams with blinding light..."), name);
1379 if (!recharge(user_ptr, 1000)) return FALSE;
1384 msg_print(_("石が隠された秘密を写し出した...", "The stone reveals hidden mysteries..."));
1385 if (!perilous_secrets(user_ptr)) return FALSE;
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);
1397 case ACT_PHASE_DOOR:
1399 teleport_player(user_ptr, 10, TELEPORT_SPONTANEOUS);
1403 case ACT_DETECT_ALL_MONS:
1405 (void)detect_monsters_invis(user_ptr, 255);
1406 (void)detect_monsters_normal(user_ptr, 255);
1410 case ACT_ULTIMATE_RESIST:
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);
1427 cosmic_cast_off(user_ptr, o_ptr);
1430 case ACT_FALLING_STAR:
1432 msg_print(_("あなたは妖刀に魅入られた…", "You are enchanted by cursed blade..."));
1433 msg_print(_("「狂ほしく 血のごとき 月はのぼれり 秘めおきし 魔剣 いずこぞや」", "'Behold the blade arts.'"));
1438 case ACT_GRAND_CROSS:
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);
1445 case ACT_TELEPORT_LEVEL:
1447 if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)"))) return FALSE;
1448 teleport_level(user_ptr, 0);
1452 case ACT_STRAIN_HASTE:
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);
1463 if (!fishing(user_ptr)) return FALSE;
1467 mitokohmon(user_ptr);
1472 /* Only for Muramasa */
1473 if (o_ptr->name1 != ART_MURAMASA) return FALSE;
1474 if (get_check(_("本当に使いますか?", "Are you sure?!")))
1476 msg_print(_("村正が震えた...", "The Muramasa pulsates..."));
1477 do_inc_stat(user_ptr, A_STR);
1480 msg_print(_("村正は壊れた!", "The Muramasa is destroyed!"));
1481 curse_weapon_object(user_ptr, TRUE, o_ptr);
1487 case ACT_BLOODY_MOON:
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);
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;
1506 msg_format(_("Unknown activation effect: %d.", "Unknown activation effect: %d."), act_ptr->index);
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);
1519 /* Activations that have special timeout */
1520 switch (act_ptr->index) {
1522 o_ptr->timeout = ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES)) ? 200 : 250;
1525 o_ptr->timeout = ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE)) ? 200 : 250;
1528 o_ptr->timeout = 3 * (user_ptr->lev + 10);
1534 msg_format("Special timeout is not implemented: %d.", act_ptr->index);