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/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"
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
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.
89 void exe_activate(player_type *user_ptr, INVENTORY_IDX item)
97 o_ptr = ref_item(user_ptr, item);
98 take_turn(user_ptr, 100);
99 lev = k_info[o_ptr->k_idx].level;
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))
105 const activation_type* const act_ptr = find_activation_info(o_ptr);
107 lev = act_ptr->level;
110 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)) && o_ptr->name2) lev = e_info[o_ptr->name2].level;
112 /* Base chance of success */
113 chance = user_ptr->skill_dev;
115 /* Confusion hurts skill */
116 if (user_ptr->confused) chance = chance / 2;
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;
124 if (cmd_limit_time_walk(user_ptr)) return;
126 if (user_ptr->pclass == CLASS_BERSERKER) success = FALSE;
127 else if (chance > fail)
129 if (randint0(chance * 2) < fail) success = FALSE;
134 if (randint0(fail * 2) < chance) success = TRUE;
135 else success = FALSE;
141 if (flush_failure) flush();
142 msg_print(_("うまく始動させることができなかった。", "You failed to activate it properly."));
147 /* Check the recharge */
150 msg_print(_("それは微かに音を立て、輝き、消えた...", "It whines, glows and fades..."));
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)))
158 msg_print(_("燃料がない。", "It has no fuel."));
163 /* Activate the artifact */
164 msg_print(_("始動させた...", "You activate it..."));
168 /* Activate object */
169 if (activation_index(o_ptr))
171 (void)activate_artifact(user_ptr, o_ptr);
173 user_ptr->window |= (PW_INVEN | PW_EQUIP);
180 else if (o_ptr->tval == TV_WHISTLE)
182 if (music_singing_any(user_ptr)) stop_singing(user_ptr);
183 if (hex_spelling_any(user_ptr)) stop_hex_spell_all(user_ptr);
186 MONSTER_IDX pet_ctr, i;
191 /* Allocate the "who" array */
192 C_MAKE(who, current_world_ptr->max_m_idx, MONSTER_IDX);
194 /* Process the monsters (backwards) */
195 for (pet_ctr = user_ptr->current_floor_ptr->m_max - 1; pet_ctr >= 1; pet_ctr--)
197 if (is_pet(&user_ptr->current_floor_ptr->m_list[pet_ctr]) && (user_ptr->riding != pet_ctr))
198 who[max_pet++] = pet_ctr;
201 ang_sort(who, &dummy_why, max_pet, ang_sort_comp_pet, ang_sort_swap_hook);
203 /* Process the monsters (backwards) */
204 for (i = 0; i < max_pet; i++)
207 teleport_monster_to(user_ptr, pet_ctr, user_ptr->y, user_ptr->x, 100, TELEPORT_PASSIVE);
210 /* Free the "who" array */
211 C_KILL(who, current_world_ptr->max_m_idx, MONSTER_IDX);
213 o_ptr->timeout = 100 + randint1(100);
216 else if (o_ptr->tval == TV_CAPTURE)
220 bool old_target_pet = target_pet;
222 if (!get_aim_dir(user_ptr, &dir))
224 target_pet = old_target_pet;
227 target_pet = old_target_pet;
229 if (fire_ball(user_ptr, GF_CAPTURE, dir, 0, 0))
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;
241 if (o_ptr->inscription)
242 strcpy(buf, quark_str(o_ptr->inscription));
244 for (s = buf; *s && (*s != '#'); s++)
247 if (iskanji(*s)) s++;
257 t = quark_str(cap_nickname);
270 o_ptr->inscription = quark_add(buf);
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))
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)))
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)
295 t = quark_str(o_ptr->inscription);
296 for (t = quark_str(o_ptr->inscription); *t && (*t != '#'); t++)
299 if (iskanji(*t)) t++;
324 if (quote && *(s - 1) == '\'')
328 user_ptr->current_floor_ptr->m_list[hack_m_idx_ii].nickname = quark_add(buf);
329 t = quark_str(o_ptr->inscription);
331 while (*t && (*t != '#'))
338 o_ptr->inscription = quark_add(buf);
349 msg_print(_("おっと、解放に失敗した。", "Oops. You failed to release your pet."));
351 calc_android_exp(user_ptr);
356 msg_print(_("おっと、このアイテムは始動できない。", "Oops. That object cannot be activated."));
360 * @brief 装備を発動するコマンドのメインルーチン /
361 * @param user_ptr プレーヤーへの参照ポインタ
364 void do_cmd_activate(player_type *user_ptr)
369 if (user_ptr->wild_mode) return;
370 if (cmd_limit_arena(user_ptr)) return;
372 if (user_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
374 set_action(user_ptr, ACTION_NONE);
377 item_tester_hook = item_tester_hook_activate;
379 q = _("どのアイテムを始動させますか? ", "Activate which item? ");
380 s = _("始動できるアイテムを装備していない。", "You have nothing to activate.");
382 if (!choose_object(user_ptr, &item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0)) return;
384 /* Activate the item */
385 exe_activate(user_ptr, item);
389 * @brief 発動によるブレスの属性をアイテムの耐性から選択し、実行を処理する。/ Dragon breath activation
390 * @details 対象となる耐性は dragonbreath_info テーブルを参照のこと。
391 * @param user_ptr プレーヤーへの参照ポインタ
392 * @param o_ptr 対象のオブジェクト構造体ポインタ
393 * @return 発動実行の是非を返す。
395 static bool activate_dragon_breath(player_type *user_ptr, object_type *o_ptr)
397 BIT_FLAGS flgs[TR_FLAG_SIZE]; /* for resistance flags */
403 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
405 object_flags(o_ptr, flgs);
407 for (i = 0; dragonbreath_info[i].flag != 0; i++)
409 if (have_flag(flgs, dragonbreath_info[i].flag))
411 type[n] = dragonbreath_info[i].type;
412 name[n] = dragonbreath_info[i].name;
416 if (n == 0) return FALSE;
419 if (music_singing_any(user_ptr)) stop_singing(user_ptr);
420 if (hex_spelling_any(user_ptr)) stop_hex_spell_all(user_ptr);
423 msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), name[t]);
424 fire_breath(user_ptr, type[t], dir, 250, 4);
431 * @brief アイテムの発動効果を処理する。
432 * @param user_ptr プレーヤーへの参照ポインタ
433 * @param o_ptr 対象のオブジェクト構造体ポインタ
434 * @return 発動実行の是非を返す。
436 bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
438 PLAYER_LEVEL plev = user_ptr->lev;
441 concptr name = k_name + k_info[o_ptr->k_idx].name;
442 const activation_type* const act_ptr = find_activation_info(o_ptr);
444 /* Maybe forgot adding information to activation_info table ? */
445 msg_print("Activation information is not found.");
449 /* Activate for attack */
450 switch (act_ptr->index)
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));
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));
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);
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));
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));
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));
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));
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
596 case ACT_HYPODYNAMIA_1:
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);
604 case ACT_HYPODYNAMIA_2:
606 msg_print(_("黒く輝いている...", "It glows black..."));
607 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
608 hypodynamic_bolt(user_ptr, dir, 120);
614 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
615 for (dummy = 0; dummy < 3; dummy++)
617 if (hypodynamic_bolt(user_ptr, dir, 50))
618 hp_player(user_ptr, 50);
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);
639 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
640 for (dummy = 0; dummy < 3; dummy++)
642 if (hypodynamic_bolt(user_ptr, dir, 100))
643 hp_player(user_ptr, 100);
651 msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours..."));
652 call_chaos(user_ptr);
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);
666 msg_print(_("神聖な雰囲気が充満した...", "It floods the area with goodness..."));
667 dispel_evil(user_ptr, user_ptr->lev * 5);
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);
681 msg_print(_("邪悪な雰囲気が充満した...", "It floods the area with evil..."));
682 dispel_good(user_ptr, user_ptr->lev * 5);
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);
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);
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);
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);
720 msg_print(_("あなたは害虫を一掃した。", "You exterminate small life."));
721 (void)dispel_monsters(user_ptr, 4);
725 case ACT_BLINDING_LIGHT:
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);
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);
741 case ACT_CAST_BA_STAR:
743 HIT_POINT num = damroll(5, 3);
744 POSITION y = 0, x = 0;
746 msg_format(_("%sが稲妻で覆われた...", "The %s is surrounded by lightning..."), name);
747 for (k = 0; k < num; k++)
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;
758 project(user_ptr, 0, 3, y, x, 150, GF_ELEC,
759 (PROJECT_THRU | PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
765 case ACT_BLADETURNER:
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);
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))
789 (void)set_oppose_fire(user_ptr, randint1(20) + 20, FALSE);
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))
800 (void)set_oppose_cold(user_ptr, randint1(20) + 20, FALSE);
807 if (!activate_dragon_breath(user_ptr, o_ptr)) return FALSE;
811 /* Activate for other offensive action */
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);
822 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
823 sleep_monsters_touch(user_ptr);
829 earthquake(user_ptr, user_ptr->y, user_ptr->x, 5, 0);
835 turn_monsters(user_ptr, 40 + user_ptr->lev);
841 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
842 (void)fire_beam(user_ptr, GF_AWAY_ALL, dir, plev);
846 case ACT_BANISH_EVIL:
848 if (banish_evil(user_ptr, 100))
850 msg_print(_("アーティファクトの力が邪悪を打ち払った!", "The power of the artifact banishes evil!"));
857 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
858 (void)symbol_genocide(user_ptr, 200, TRUE);
864 msg_print(_("ひどく鋭い音が流れ出た...", "It lets out a long, shrill note..."));
865 (void)mass_genocide(user_ptr, 200, TRUE);
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);
881 if (o_ptr->name1 == ART_HYOUSIGI)
883 msg_print(_("拍子木を打った。", "You beat your wooden clappers."));
887 msg_format(_("%sは不快な物音を立てた。", "The %s sounds an unpleasant noise."), name);
889 aggravate_monsters(user_ptr, 0);
893 /* Activate for summoning / charming */
895 case ACT_CHARM_ANIMAL:
897 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
898 (void)charm_animal(user_ptr, dir, plev);
902 case ACT_CHARM_UNDEAD:
904 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
905 (void)control_one_undead(user_ptr, dir, plev);
909 case ACT_CHARM_OTHER:
911 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
912 (void)charm_monster(user_ptr, dir, plev * 2);
916 case ACT_CHARM_ANIMALS:
918 (void)charm_animals(user_ptr, plev * 2);
922 case ACT_CHARM_OTHERS:
924 charm_monsters(user_ptr, plev * 2);
928 case ACT_SUMMON_ANIMAL:
930 (void)summon_specific(user_ptr, -1, user_ptr->y, user_ptr->x, plev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET));
934 case ACT_SUMMON_PHANTOM:
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));
941 case ACT_SUMMON_ELEMENTAL:
942 if (!cast_summon_elemental(user_ptr, (plev * 3) / 2)) return FALSE;
945 case ACT_SUMMON_DEMON:
947 cast_summon_demon(user_ptr, (plev * 3) / 2);
951 case ACT_SUMMON_UNDEAD:
952 if (!cast_summon_undead(user_ptr, (plev * 3) / 2)) return FALSE;
955 case ACT_SUMMON_HOUND:
956 if (!cast_summon_hound(user_ptr, (plev * 3) / 2)) return FALSE;
959 case ACT_SUMMON_DAWN:
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));
966 case ACT_SUMMON_OCTOPUS:
967 if (!cast_summon_octopus(user_ptr)) return FALSE;
970 /* Activate for healing */
972 case ACT_CHOIR_SINGS:
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);
982 (void)set_afraid(user_ptr, 0);
983 (void)hp_player(user_ptr, 30);
989 msg_print(_("深紫色の光を発している...", "It radiates deep purple..."));
990 (void)cure_serious_wounds(user_ptr, 4, 8);
994 case ACT_CURE_POISON:
996 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
997 (void)set_afraid(user_ptr, 0);
998 (void)set_poisoned(user_ptr, 0);
1004 msg_print(_("深紅に輝いている...", "It glows a deep red..."));
1005 restore_level(user_ptr);
1011 msg_print(_("濃緑色に輝いている...", "It glows a deep green..."));
1012 (void)restore_all_status(user_ptr);
1013 (void)restore_level(user_ptr);
1019 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
1020 msg_print(_("体内に暖かい鼓動が感じられる...", "You feel a warm tingling inside..."));
1021 (void)cure_critical_wounds(user_ptr, 700);
1027 msg_print(_("白く明るく輝いている...", "It glows a bright white..."));
1028 msg_print(_("ひじょうに気分がよい...", "You feel much better..."));
1029 (void)cure_critical_wounds(user_ptr, 1000);
1035 msg_format(_("%sの優しさに癒される...", "the %s cures you affectionately ..."), name);
1036 true_healing(user_ptr, 0);
1040 case ACT_CURE_MANA_FULL:
1042 msg_format(_("%sが青白く光った...", "The %s glows pale..."), name);
1043 restore_mana(user_ptr, TRUE);
1047 /* Activate for timed effect */
1051 (void)set_tim_esp(user_ptr, randint1(30) + 25, FALSE);
1057 (void)berserk(user_ptr, randint1(25) + 25);
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);
1069 case ACT_RESIST_ALL:
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);
1082 msg_print(_("明るく緑色に輝いている...", "It glows bright green..."));
1083 (void)set_fast(user_ptr, randint1(20) + 20, FALSE);
1087 case ACT_XTRA_SPEED:
1089 msg_print(_("明るく輝いている...", "It glows brightly..."));
1090 (void)set_fast(user_ptr, randint1(75) + 75, FALSE);
1096 set_wraith_form(user_ptr, randint1(plev / 2) + (plev / 2), FALSE);
1102 (void)set_invuln(user_ptr, randint1(8) + 8, FALSE);
1108 (void)heroism(user_ptr, 25);
1112 case ACT_HERO_SPEED:
1114 (void)set_fast(user_ptr, randint1(50) + 50, FALSE);
1115 (void)heroism(user_ptr, 50);
1119 case ACT_RESIST_ACID:
1121 msg_format(_("%sが黒く輝いた...", "The %s grows black."), name);
1122 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ACID))
1124 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1125 fire_ball(user_ptr, GF_ACID, dir, 100, 2);
1127 (void)set_oppose_acid(user_ptr, randint1(20) + 20, FALSE);
1131 case ACT_RESIST_FIRE:
1133 msg_format(_("%sが赤く輝いた...", "The %s grows red."), name);
1134 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
1136 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1137 fire_ball(user_ptr, GF_FIRE, dir, 100, 2);
1139 (void)set_oppose_fire(user_ptr, randint1(20) + 20, FALSE);
1143 case ACT_RESIST_COLD:
1145 msg_format(_("%sが白く輝いた...", "The %s grows white."), name);
1146 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
1148 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1149 fire_ball(user_ptr, GF_COLD, dir, 100, 2);
1151 (void)set_oppose_cold(user_ptr, randint1(20) + 20, FALSE);
1155 case ACT_RESIST_ELEC:
1157 msg_format(_("%sが青く輝いた...", "The %s grows blue."), name);
1158 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ELEC))
1160 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1161 fire_ball(user_ptr, GF_ELEC, dir, 100, 2);
1163 (void)set_oppose_elec(user_ptr, randint1(20) + 20, FALSE);
1167 case ACT_RESIST_POIS:
1169 msg_format(_("%sが緑に輝いた...", "The %s grows green."), name);
1170 (void)set_oppose_pois(user_ptr, randint1(20) + 20, FALSE);
1174 /* Activate for general purpose effect (detection etc.) */
1178 msg_format(_("%sから澄んだ光があふれ出た...", "The %s wells with clear light..."), name);
1179 lite_area(user_ptr, damroll(2, 15), 3);
1185 msg_print(_("眩しく輝いた...", "It shines brightly..."));
1186 map_area(user_ptr, DETECT_RAD_MAP);
1187 lite_area(user_ptr, damroll(2, 15), 3);
1191 case ACT_DETECT_ALL:
1193 msg_print(_("白く明るく輝いている...", "It glows bright white..."));
1194 msg_print(_("心にイメージが浮かんできた...", "An image forms in your mind..."));
1195 detect_all(user_ptr, DETECT_RAD_DEFAULT);
1199 case ACT_DETECT_XTRA:
1201 msg_print(_("明るく輝いている...", "It glows brightly..."));
1202 detect_all(user_ptr, DETECT_RAD_DEFAULT);
1204 identify_fully(user_ptr, FALSE, 0);
1210 msg_print(_("黄色く輝いている...", "It glows yellow..."));
1211 identify_fully(user_ptr, FALSE, 0);
1217 if (!ident_spell(user_ptr, FALSE, 0)) return FALSE;
1221 case ACT_RUNE_EXPLO:
1223 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
1224 explosive_rune(user_ptr, user_ptr->y, user_ptr->x);
1230 msg_print(_("ブルーに明るく輝いている...", "It glows light blue..."));
1231 warding_glyph(user_ptr);
1237 (void)set_food(user_ptr, PY_FOOD_MAX - 1);
1243 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
1244 destroy_doors_touch(user_ptr);
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));
1258 recharge(user_ptr, 130);
1264 msg_print(_("明るい黄色に輝いている...", "It glows bright yellow..."));
1265 (void)alchemy(user_ptr);
1271 msg_print(_("次元の扉が開いた。目的地を選んで下さい。", "You open a dimensional gate. Choose a destination."));
1272 if (!dimension_door(user_ptr)) return FALSE;
1279 msg_print(_("周りの空間が歪んでいる...", "It twists space around you..."));
1280 teleport_player(user_ptr, 100, TELEPORT_SPONTANEOUS);
1286 msg_print(_("やわらかな白色に輝いている...", "It glows soft white..."));
1287 if (!recall_player(user_ptr, randint0(21) + 15)) return FALSE;
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);
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);
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);
1305 if (get_check(_("帰還の力を使いますか?", "Activate recall? ")))
1307 (void)recall_player(user_ptr, randint0(21) + 15);
1313 case ACT_TELEKINESIS:
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);
1321 case ACT_DETECT_UNIQUE:
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--)
1330 m_ptr = &user_ptr->current_floor_ptr->m_list[i];
1332 /* Ignore "dead" monsters */
1333 if (!monster_is_valid(m_ptr)) continue;
1335 r_ptr = &r_info[m_ptr->r_idx];
1337 if (r_ptr->flags1 & RF1_UNIQUE)
1339 msg_format(_("%s. ", "%s. "), r_name + r_ptr->name);
1347 switch (randint1(13))
1349 case 1: case 2: case 3: case 4: case 5:
1350 teleport_player(user_ptr, 10, TELEPORT_SPONTANEOUS);
1352 case 6: case 7: case 8: case 9: case 10:
1353 teleport_player(user_ptr, 222, TELEPORT_SPONTANEOUS);
1356 (void)stair_creation(user_ptr);
1359 if (get_check(_("この階を去りますか?", "Leave this level? ")))
1361 if (autosave_l) do_cmd_save_game(user_ptr, TRUE);
1362 user_ptr->leaving = TRUE;
1368 case ACT_DISP_CURSE_XTRA:
1370 msg_format(_("%sが真実を照らし出す...", "The %s exhibits the truth..."), name);
1371 (void)remove_all_curse(user_ptr);
1372 (void)probing(user_ptr);
1376 case ACT_BRAND_FIRE_BOLTS:
1378 msg_format(_("%sが深紅に輝いた...", "Your %s glows deep red..."), name);
1379 brand_bolts(user_ptr);
1383 case ACT_RECHARGE_XTRA:
1385 msg_format(_("%sが白く輝いた...", "The %s gleams with blinding light..."), name);
1386 if (!recharge(user_ptr, 1000)) return FALSE;
1391 msg_print(_("石が隠された秘密を写し出した...", "The stone reveals hidden mysteries..."));
1392 if (!perilous_secrets(user_ptr)) return FALSE;
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);
1404 case ACT_PHASE_DOOR:
1406 teleport_player(user_ptr, 10, TELEPORT_SPONTANEOUS);
1410 case ACT_DETECT_ALL_MONS:
1412 (void)detect_monsters_invis(user_ptr, 255);
1413 (void)detect_monsters_normal(user_ptr, 255);
1417 case ACT_ULTIMATE_RESIST:
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);
1434 cosmic_cast_off(user_ptr, o_ptr);
1437 case ACT_FALLING_STAR:
1439 msg_print(_("あなたは妖刀に魅入られた…", "You are enchanted by cursed blade..."));
1440 msg_print(_("「狂ほしく 血のごとき 月はのぼれり 秘めおきし 魔剣 いずこぞや」", "'Behold the blade arts.'"));
1445 case ACT_GRAND_CROSS:
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);
1452 case ACT_TELEPORT_LEVEL:
1454 if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)"))) return FALSE;
1455 teleport_level(user_ptr, 0);
1459 case ACT_STRAIN_HASTE:
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);
1470 if (!fishing(user_ptr)) return FALSE;
1474 mitokohmon(user_ptr);
1479 /* Only for Muramasa */
1480 if (o_ptr->name1 != ART_MURAMASA) return FALSE;
1481 if (get_check(_("本当に使いますか?", "Are you sure?!")))
1483 msg_print(_("村正が震えた...", "The Muramasa pulsates..."));
1484 do_inc_stat(user_ptr, A_STR);
1487 msg_print(_("村正は壊れた!", "The Muramasa is destroyed!"));
1488 curse_weapon_object(user_ptr, TRUE, o_ptr);
1494 case ACT_BLOODY_MOON:
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);
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;
1513 msg_format(_("Unknown activation effect: %d.", "Unknown activation effect: %d."), act_ptr->index);
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);
1526 /* Activations that have special timeout */
1527 switch (act_ptr->index) {
1529 o_ptr->timeout = ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES)) ? 200 : 250;
1532 o_ptr->timeout = ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE)) ? 200 : 250;
1535 o_ptr->timeout = 3 * (user_ptr->lev + 10);
1541 msg_format("Special timeout is not implemented: %d.", act_ptr->index);