3 * @brief プレイヤーの発動コマンド実装
10 #include "cmd-activate.h"
11 #include "object-hook.h"
12 #include "spells-summon.h"
15 * @brief ペット入りモンスターボールをソートするための比較関数
16 * @param u 所持品配列の参照ポインタ
20 * @return 1の方が大であればTRUE
22 static bool ang_sort_comp_pet(vptr u, vptr v, int a, int b)
24 u16b *who = (u16b*)(u);
29 monster_type *m_ptr1 = &m_list[w1];
30 monster_type *m_ptr2 = &m_list[w2];
31 monster_race *r_ptr1 = &r_info[m_ptr1->r_idx];
32 monster_race *r_ptr2 = &r_info[m_ptr2->r_idx];
37 if (m_ptr1->nickname && !m_ptr2->nickname) return TRUE;
38 if (m_ptr2->nickname && !m_ptr1->nickname) return FALSE;
40 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return TRUE;
41 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return FALSE;
43 if (r_ptr1->level > r_ptr2->level) return TRUE;
44 if (r_ptr2->level > r_ptr1->level) return FALSE;
46 if (m_ptr1->hp > m_ptr2->hp) return TRUE;
47 if (m_ptr2->hp > m_ptr1->hp) return FALSE;
54 * @brief 装備を発動するコマンドのサブルーチン /
55 * Activate a wielded object. Wielded objects never stack.
56 * And even if they did, activatable objects never stack.
57 * @param item 発動するオブジェクトの所持品ID
61 * Currently, only (some) artifacts, and Dragon Scale Mail, can be activated.
62 * But one could, for example, easily make an activatable "Ring of Plasma".
63 * Note that it always takes a turn to activate an artifact, even if
64 * the user hits "escape" at the "direction" prompt.
67 void do_cmd_activate_aux(INVENTORY_IDX item)
69 int dir, lev, chance, fail;
74 /* Get the item (in the pack) */
77 o_ptr = &inventory[item];
80 /* Get the item (on the floor) */
83 o_ptr = &o_list[0 - item];
87 p_ptr->energy_use = 100;
89 /* Extract the item level */
90 lev = k_info[o_ptr->k_idx].level;
92 /* Hack -- use artifact level instead */
93 if (object_is_fixed_artifact(o_ptr)) lev = a_info[o_ptr->name1].level;
94 else if (object_is_random_artifact(o_ptr))
96 const activation_type* const act_ptr = find_activation_info(o_ptr);
101 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)) && o_ptr->name2) lev = e_info[o_ptr->name2].level;
103 /* Base chance of success */
104 chance = p_ptr->skill_dev;
106 /* Confusion hurts skill */
107 if (p_ptr->confused) chance = chance / 2;
110 if (chance > fail) fail -= (chance - fail)*2;
111 else chance -= (fail - chance)*2;
112 if (fail < USE_DEVICE) fail = USE_DEVICE;
113 if (chance < USE_DEVICE) chance = USE_DEVICE;
117 if (flush_failure) flush();
118 msg_print(_("止まった時の中ではうまく働かないようだ。", "It shows no reaction."));
123 if (p_ptr->pclass == CLASS_BERSERKER) success = FALSE;
124 else if (chance > fail)
126 if (randint0(chance*2) < fail) success = FALSE;
131 if (randint0(fail*2) < chance) success = TRUE;
132 else success = FALSE;
138 if (flush_failure) flush();
139 msg_print(_("うまく始動させることができなかった。", "You failed to activate it properly."));
144 /* Check the recharge */
147 msg_print(_("それは微かに音を立て、輝き、消えた...", "It whines, glows and fades..."));
151 /* Some lights need enough fuel for activation */
152 if (!o_ptr->xtra4 && (o_ptr->tval == TV_FLASK) &&
153 ((o_ptr->sval == SV_LITE_TORCH) || (o_ptr->sval == SV_LITE_LANTERN)))
155 msg_print(_("燃料がない。", "It has no fuel."));
156 p_ptr->energy_use = 0;
160 /* Activate the artifact */
161 msg_print(_("始動させた...", "You activate it..."));
165 /* Activate object */
166 if (activation_index(o_ptr))
168 (void)activate_artifact(o_ptr);
171 p_ptr->window |= (PW_INVEN | PW_EQUIP);
178 else if (o_ptr->tval == TV_WHISTLE)
180 if (music_singing_any()) stop_singing();
181 if (hex_spelling_any()) stop_hex_spell_all();
184 if (object_is_cursed(o_ptr))
186 msg_print(_("カン高い音が響き渡った。", "You produce a shrill whistling sound."));
187 aggravate_monsters(0);
197 /* Allocate the "who" array */
198 C_MAKE(who, max_m_idx, IDX);
200 /* Process the monsters (backwards) */
201 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
203 if (is_pet(&m_list[pet_ctr]) && (p_ptr->riding != pet_ctr))
204 who[max_pet++] = pet_ctr;
207 /* Select the sort method */
208 ang_sort_comp = ang_sort_comp_pet;
209 ang_sort_swap = ang_sort_swap_hook;
211 ang_sort(who, &dummy_why, max_pet);
213 /* Process the monsters (backwards) */
214 for (i = 0; i < max_pet; i++)
217 teleport_monster_to(pet_ctr, p_ptr->y, p_ptr->x, 100, TELEPORT_PASSIVE);
220 /* Free the "who" array */
221 C_KILL(who, max_m_idx, IDX);
223 o_ptr->timeout = 100+randint1(100);
226 else if (o_ptr->tval == TV_CAPTURE)
230 bool old_target_pet = target_pet;
232 if (!get_aim_dir(&dir))
234 target_pet = old_target_pet;
237 target_pet = old_target_pet;
239 if(fire_ball(GF_CAPTURE, dir, 0, 0))
241 o_ptr->pval = (PARAMETER_VALUE)cap_mon;
242 o_ptr->xtra3 = (XTRA8)cap_mspeed;
243 o_ptr->xtra4 = (XTRA16)cap_hp;
244 o_ptr->xtra5 = (XTRA16)cap_maxhp;
251 if (o_ptr->inscription)
252 strcpy(buf, quark_str(o_ptr->inscription));
254 for (s = buf;*s && (*s != '#'); s++)
257 if (iskanji(*s)) s++;
267 t = quark_str(cap_nickname);
280 o_ptr->inscription = quark_add(buf);
287 if (!get_rep_dir2(&dir)) return;
288 if (monster_can_enter(p_ptr->y + ddy[dir], p_ptr->x + ddx[dir], &r_info[o_ptr->pval], 0))
290 if (place_monster_aux(0, p_ptr->y + ddy[dir], p_ptr->x + ddx[dir], o_ptr->pval, (PM_FORCE_PET | PM_NO_KAGE)))
292 if (o_ptr->xtra3) m_list[hack_m_idx_ii].mspeed = o_ptr->xtra3;
293 if (o_ptr->xtra5) m_list[hack_m_idx_ii].max_maxhp = o_ptr->xtra5;
294 if (o_ptr->xtra4) m_list[hack_m_idx_ii].hp = o_ptr->xtra4;
295 m_list[hack_m_idx_ii].maxhp = m_list[hack_m_idx_ii].max_maxhp;
296 if (o_ptr->inscription)
304 t = quark_str(o_ptr->inscription);
305 for (t = quark_str(o_ptr->inscription);*t && (*t != '#'); t++)
308 if (iskanji(*t)) t++;
333 if (quote && *(s-1) =='\'')
337 m_list[hack_m_idx_ii].nickname = quark_add(buf);
338 t = quark_str(o_ptr->inscription);
340 while(*t && (*t != '#'))
347 o_ptr->inscription = quark_add(buf);
358 msg_print(_("おっと、解放に失敗した。", "Oops. You failed to release your pet."));
365 msg_print(_("おっと、このアイテムは始動できない。", "Oops. That object cannot be activated."));
369 * @brief 装備を発動するコマンドのメインルーチン /
372 void do_cmd_activate(void)
377 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
379 set_action(ACTION_NONE);
382 item_tester_no_ryoute = TRUE;
383 /* Prepare the hook */
384 item_tester_hook = item_tester_hook_activate;
387 q = _("どのアイテムを始動させますか? ", "Activate which item? ");
388 s = _("始動できるアイテムを装備していない。", "You have nothing to activate.");
390 if (!get_item(&item, q, s, (USE_EQUIP))) return;
392 /* Activate the item */
393 do_cmd_activate_aux(item);
397 * @brief 発動によるブレスの属性をアイテムの耐性から選択し、実行を処理する。/ Dragon breath activation
398 * @details 対象となる耐性は dragonbreath_info テーブルを参照のこと。
399 * @param o_ptr 対象のオブジェクト構造体ポインタ
400 * @return 発動実行の是非を返す。
402 static bool activate_dragon_breath(object_type *o_ptr)
404 u32b flgs[TR_FLAG_SIZE]; /* for resistance flags */
407 int i, dir, t, n = 0;
409 if (!get_aim_dir(&dir)) return FALSE;
411 object_flags(o_ptr, flgs);
413 for (i = 0; dragonbreath_info[i].flag != 0; i++)
415 if (have_flag(flgs, dragonbreath_info[i].flag))
417 type[n] = dragonbreath_info[i].type;
418 name[n] = dragonbreath_info[i].name;
424 if (n == 0) return FALSE;
427 if (music_singing_any()) stop_singing();
428 if (hex_spelling_any()) stop_hex_spell_all();
431 msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), name[t]);
432 fire_breath(type[t], dir, 250, 4);
438 * @brief アイテムの発動効果を処理する。
439 * @param o_ptr 対象のオブジェクト構造体ポインタ
440 * @return 発動実行の是非を返す。
442 bool activate_artifact(object_type *o_ptr)
444 PLAYER_LEVEL plev = p_ptr->lev;
447 cptr name = k_name + k_info[o_ptr->k_idx].name;
448 const activation_type* const act_ptr = find_activation_info(o_ptr);
452 /* Maybe forgot adding information to activation_info table ? */
453 msg_print("Activation information is not found.");
457 /* Activate for attack */
458 switch (act_ptr->index)
462 if (!get_aim_dir(&dir)) return FALSE;
463 msg_print(_("太陽光線が放たれた。", "A line of sunlight appears."));
464 (void)lite_line(dir, damroll(6, 8));
470 msg_print(_("それは眩しいくらいに明るく輝いている...", "It glows extremely brightly..."));
471 if (!get_aim_dir(&dir)) return FALSE;
472 fire_bolt(GF_MISSILE, dir, damroll(2, 6));
478 msg_print(_("それは濃緑色に脈動している...", "It throbs deep green..."));
479 if (!get_aim_dir(&dir)) return FALSE;
480 fire_ball(GF_POIS, dir, 12, 3);
486 msg_print(_("それは火花に覆われた...", "It is covered in sparks..."));
487 if (!get_aim_dir(&dir)) return FALSE;
488 fire_bolt(GF_ELEC, dir, damroll(4, 8));
494 msg_print(_("それは酸に覆われた...", "It is covered in acid..."));
495 if (!get_aim_dir(&dir)) return FALSE;
496 fire_bolt(GF_ACID, dir, damroll(5, 8));
502 msg_print(_("それは霜に覆われた...", "It is covered in frost..."));
503 if (!get_aim_dir(&dir)) return FALSE;
504 fire_bolt(GF_COLD, dir, damroll(6, 8));
510 msg_print(_("それは炎に覆われた...", "It is covered in fire..."));
511 if (!get_aim_dir(&dir)) return FALSE;
512 fire_bolt(GF_FIRE, dir, damroll(9, 8));
518 msg_print(_("それは霜に覆われた...", "It is covered in frost..."));
519 if (!get_aim_dir(&dir)) return FALSE;
520 fire_ball(GF_COLD, dir, 48, 2);
526 msg_print(_("それは青く激しく輝いた...", "It glows an intense blue..."));
527 if (!get_aim_dir(&dir)) return FALSE;
528 fire_ball(GF_COLD, dir, 100, 2);
534 msg_print(_("明るく白色に輝いている...", "It glows bright white..."));
535 if (!get_aim_dir(&dir)) return FALSE;
536 fire_ball(GF_COLD, dir, 400, 3);
542 msg_print(_("それは赤く激しく輝いた...", "It glows an intense red..."));
543 if (!get_aim_dir(&dir)) return FALSE;
544 fire_ball(GF_FIRE, dir, 72, 2);
550 msg_format(_("%sから炎が吹き出した...", "The %s rages in fire..."), name);
551 if (!get_aim_dir(&dir)) return FALSE;
552 fire_ball(GF_FIRE, dir, 120, 3);
558 msg_print(_("深赤色に輝いている...", "It glows deep red..."));
559 if (!get_aim_dir(&dir)) return FALSE;
560 fire_ball(GF_FIRE, dir, 300, 3);
566 msg_print(_("それは赤く激しく輝いた...", "It glows an intense red..."));
567 if (!get_aim_dir(&dir)) return FALSE;
568 fire_ball(GF_FIRE, dir, 100, 2);
574 msg_print(_("電気がパチパチ音を立てた...", "It crackles with electricity..."));
575 if (!get_aim_dir(&dir)) return FALSE;
576 fire_ball(GF_ELEC, dir, 100, 3);
582 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
583 if (!get_aim_dir(&dir)) return FALSE;
584 fire_ball(GF_ELEC, dir, 500, 3);
590 msg_print(_("それは黒く激しく輝いた...", "It glows an intense black..."));
591 if (!get_aim_dir(&dir)) return FALSE;
592 fire_ball(GF_ACID, dir, 100, 2);
598 msg_print(_("それは緑に激しく輝いた...", "It glows an intense green..."));
599 if (!get_aim_dir(&dir)) return FALSE;
600 fire_ball(GF_NUKE, dir, 100, 2);
604 case ACT_HYPODYNAMIA_1:
606 msg_format(_("あなたは%sに敵を締め殺すよう命じた。", "You order the %s to strangle your opponent."), name);
607 if (!get_aim_dir(&dir)) return FALSE;
608 if (hypodynamic_bolt(dir, 100))
612 case ACT_HYPODYNAMIA_2:
614 msg_print(_("黒く輝いている...", "It glows black..."));
615 if (!get_aim_dir(&dir)) return FALSE;
616 hypodynamic_bolt(dir, 120);
622 if (!get_aim_dir(&dir)) return FALSE;
623 for (dummy = 0; dummy < 3; dummy++)
625 if (hypodynamic_bolt(dir, 50))
633 msg_print(_("魔法のトゲが現れた...", "It grows magical spikes..."));
634 if (!get_aim_dir(&dir)) return FALSE;
635 fire_bolt(GF_ARROW, dir, 150);
646 for (dir = 0; dir <= 9; dir++)
648 y = p_ptr->y + ddy[dir];
649 x = p_ptr->x + ddx[dir];
652 /* Get the monster */
653 m_ptr = &m_list[c_ptr->m_idx];
655 /* Hack -- attack monsters */
656 if (c_ptr->m_idx && (m_ptr->ml || cave_have_flag_bold(y, x, FF_PROJECT)))
665 if (!get_aim_dir(&dir)) return FALSE;
666 for (dummy = 0; dummy < 3; dummy++)
668 if (hypodynamic_bolt(dir, 100))
677 msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours..."));
684 if (!get_aim_dir(&dir)) return FALSE;
685 msg_print(_("ロケットを発射した!", "You launch a rocket!"));
686 fire_ball(GF_ROCKET, dir, 250 + plev * 3, 2);
692 msg_print(_("神聖な雰囲気が充満した...", "It floods the area with goodness..."));
693 dispel_evil(p_ptr->lev * 5);
699 if (!get_aim_dir(&dir)) return FALSE;
700 msg_print(_("あなたはエレメントのブレスを吐いた。", "You breathe the elements."));
701 fire_breath(GF_MISSILE, dir, 300, 4);
707 msg_print(_("邪悪な雰囲気が充満した...", "It floods the area with evil..."));
708 dispel_good(p_ptr->lev * 5);
714 msg_format(_("%sに魔法のトゲが現れた...", "The %s grows magical spikes..."), name);
715 if (!get_aim_dir(&dir)) return FALSE;
716 fire_bolt(GF_ARROW, dir, 150);
722 msg_format(_("%sが深い青色に鼓動している...", "The %s throbs deep blue..."), name);
723 if (!get_aim_dir(&dir)) return FALSE;
724 fire_ball(GF_WATER, dir, 200, 3);
730 msg_format(_("%sが深い闇に覆われた...", "The %s is coverd in pitch-darkness..."), name);
731 if (!get_aim_dir(&dir)) return FALSE;
732 fire_ball(GF_DARK, dir, 250, 4);
738 msg_format(_("%sが青白く光った...", "The %s glows pale..."), name);
739 if (!get_aim_dir(&dir)) return FALSE;
740 fire_ball(GF_MANA, dir, 250, 4);
746 msg_print(_("あなたは害虫を一掃した。", "You exterminate small life."));
747 (void)dispel_monsters(4);
751 case ACT_BLINDING_LIGHT:
753 msg_format(_("%sが眩しい光で輝いた...", "The %s gleams with blinding light..."), name);
754 fire_ball(GF_LITE, 0, 300, 6);
755 confuse_monsters(3 * p_ptr->lev / 2);
761 msg_format(_("%sは漆黒に輝いた...", "The %s glows intensely black..."), name);
762 if (!get_aim_dir(&dir)) return FALSE;
767 case ACT_CAST_BA_STAR:
769 HIT_POINT num = damroll(5, 3);
770 POSITION y = 0, x = 0;
772 msg_format(_("%sが稲妻で覆われた...", "The %s is surrounded by lightning..."), name);
773 for (k = 0; k < num; k++)
779 scatter(&y, &x, p_ptr->y, p_ptr->x, 4, 0);
780 if (!cave_have_flag_bold(y, x, FF_PROJECT)) continue;
781 if (!player_bold(y, x)) break;
784 project(0, 3, y, x, 150, GF_ELEC,
785 (PROJECT_THRU | PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
791 case ACT_BLADETURNER:
793 if (!get_aim_dir(&dir)) return FALSE;
794 msg_print(_("あなたはエレメントのブレスを吐いた。", "You breathe the elements."));
795 fire_breath(GF_MISSILE, dir, 300, 4);
796 msg_print(_("鎧が様々な色に輝いた...", "Your armor glows many colours..."));
798 (void)set_hero(randint1(50) + 50, FALSE);
800 (void)set_blessed(randint1(50) + 50, FALSE);
801 (void)set_oppose_acid(randint1(50) + 50, FALSE);
802 (void)set_oppose_elec(randint1(50) + 50, FALSE);
803 (void)set_oppose_fire(randint1(50) + 50, FALSE);
804 (void)set_oppose_cold(randint1(50) + 50, FALSE);
805 (void)set_oppose_pois(randint1(50) + 50, FALSE);
811 if (!get_aim_dir(&dir)) return FALSE;
812 fire_breath(GF_FIRE, dir, 200, 2);
813 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
815 (void)set_oppose_fire(randint1(20) + 20, FALSE);
822 if (!get_aim_dir(&dir)) return FALSE;
823 fire_breath(GF_COLD, dir, 200, 2);
824 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
826 (void)set_oppose_cold(randint1(20) + 20, FALSE);
833 if (!activate_dragon_breath(o_ptr)) return FALSE;
837 /* Activate for other offensive action */
840 msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours..."));
841 if (!get_aim_dir(&dir)) return FALSE;
842 confuse_monster(dir, 20);
848 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
849 sleep_monsters_touch();
855 earthquake(p_ptr->y, p_ptr->x, 5);
861 turn_monsters(40 + p_ptr->lev);
867 if (!get_aim_dir(&dir)) return FALSE;
868 (void)fire_beam(GF_AWAY_ALL, dir, plev);
872 case ACT_BANISH_EVIL:
874 if (banish_evil(100))
876 msg_print(_("アーティファクトの力が邪悪を打ち払った!", "The power of the artifact banishes evil!"));
883 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
884 (void)symbol_genocide(200, TRUE);
890 msg_print(_("ひどく鋭い音が流れ出た...", "It lets out a long, shrill note..."));
891 (void)mass_genocide(200, TRUE);
897 if (music_singing_any()) stop_singing();
898 if (hex_spelling_any()) stop_hex_spell_all();
899 msg_print(_("あなたは力強い突風を吹き鳴らした。周囲の敵が震え上っている!",
900 "You wind a mighty blast; your enemies tremble!"));
901 (void)turn_monsters((3 * p_ptr->lev / 2) + 10);
907 if (o_ptr->name1 == ART_HYOUSIGI)
909 msg_print(_("拍子木を打った。", "You beat Your wooden clappers."));
913 msg_format(_("%sは不快な物音を立てた。", "The %s sounds an unpleasant noise."), name);
915 aggravate_monsters(0);
919 /* Activate for summoning / charming */
921 case ACT_CHARM_ANIMAL:
923 if (!get_aim_dir(&dir)) return FALSE;
924 (void)charm_animal(dir, plev);
928 case ACT_CHARM_UNDEAD:
930 if (!get_aim_dir(&dir)) return FALSE;
931 (void)control_one_undead(dir, plev);
935 case ACT_CHARM_OTHER:
937 if (!get_aim_dir(&dir)) return FALSE;
938 (void)charm_monster(dir, plev * 2);
942 case ACT_CHARM_ANIMALS:
944 (void)charm_animals(plev * 2);
948 case ACT_CHARM_OTHERS:
950 charm_monsters(plev * 2);
954 case ACT_SUMMON_ANIMAL:
956 (void)summon_specific(-1, p_ptr->y, p_ptr->x, plev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET));
960 case ACT_SUMMON_PHANTOM:
962 msg_print(_("幻霊を召喚した。", "You summon a phantasmal servant."));
963 (void)summon_specific(-1, p_ptr->y, p_ptr->x, dun_level, SUMMON_PHANTOM, (PM_ALLOW_GROUP | PM_FORCE_PET));
967 case ACT_SUMMON_ELEMENTAL:
969 bool pet = one_in_(3);
972 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
973 if (pet) mode |= PM_FORCE_PET;
974 else mode |= PM_NO_PET;
976 if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, ((plev * 3) / 2), SUMMON_ELEMENTAL, mode))
978 msg_print(_("エレメンタルが現れた...", "An elemental materializes..."));
980 msg_print(_("あなたに服従しているようだ。", "It seems obedient to you."));
982 msg_print(_("それをコントロールできなかった!", "You fail to control it!"));
988 case ACT_SUMMON_DEMON:
990 cast_summon_demon((plev * 3) / 2);
994 case ACT_SUMMON_UNDEAD:
996 bool pet = one_in_(3);
1000 type = (plev > 47 ? SUMMON_HI_UNDEAD : SUMMON_UNDEAD);
1002 if (!pet || ((plev > 24) && one_in_(3))) mode |= PM_ALLOW_GROUP;
1003 if (pet) mode |= PM_FORCE_PET;
1004 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
1006 if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, ((plev * 3) / 2), type, mode))
1008 msg_print(_("冷たい風があなたの周りに吹き始めた。それは腐敗臭を運んでいる...",
1009 "Cold winds begin to blow around you, carrying with them the stench of decay..."));
1011 msg_print(_("古えの死せる者共があなたに仕えるため土から甦った!",
1012 "Ancient, long-dead forms arise from the ground to serve you!"));
1014 msg_print(_("死者が甦った。眠りを妨げるあなたを罰するために!",
1015 "'The dead arise... to punish you for disturbing them!'"));
1021 case ACT_SUMMON_HOUND:
1023 BIT_FLAGS mode = PM_ALLOW_GROUP;
1024 bool pet = !one_in_(5);
1025 if (pet) mode |= PM_FORCE_PET;
1026 else mode |= PM_NO_PET;
1028 if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, ((p_ptr->lev * 3) / 2), SUMMON_HOUND, mode))
1032 msg_print(_("ハウンドがあなたの下僕として出現した。",
1033 "A group of hounds appear as your servant."));
1035 msg_print(_("ハウンドはあなたに牙を向けている!",
1036 "A group of hounds appear as your enemy!"));
1042 case ACT_SUMMON_DAWN:
1044 msg_print(_("暁の師団を召喚した。", "You summon the Legion of the Dawn."));
1045 (void)summon_specific(-1, p_ptr->y, p_ptr->x, dun_level, SUMMON_DAWN, (PM_ALLOW_GROUP | PM_FORCE_PET));
1049 case ACT_SUMMON_OCTOPUS:
1051 BIT_FLAGS mode = PM_ALLOW_GROUP;
1052 bool pet = !one_in_(5);
1053 if (pet) mode |= PM_FORCE_PET;
1055 if (summon_named_creature(0, p_ptr->y, p_ptr->x, MON_JIZOTAKO, mode))
1058 msg_print(_("蛸があなたの下僕として出現した。", "A group of octopuses appear as your servant."));
1060 msg_print(_("蛸はあなたを睨んでいる!", "A group of octopuses appear as your enemy!"));
1066 /* Activate for healing */
1068 case ACT_CHOIR_SINGS:
1070 msg_print(_("天国の歌が聞こえる...", "A heavenly choir sings..."));
1071 (void)cure_critical_wounds(777);
1072 (void)set_hero(randint1(25) + 25, FALSE);
1078 (void)set_afraid(0);
1079 (void)hp_player(30);
1085 msg_print(_("深紫色の光を発している...", "It radiates deep purple..."));
1086 (void)cure_serious_wounds(4, 8);
1090 case ACT_CURE_POISON:
1092 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
1093 (void)set_afraid(0);
1094 (void)set_poisoned(0);
1100 msg_print(_("深紅に輝いている...", "It glows a deep red..."));
1107 msg_print(_("濃緑色に輝いている...", "It glows a deep green..."));
1108 (void)restore_all_status();
1109 (void)restore_level();
1115 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
1116 msg_print(_("体内に暖かい鼓動が感じられる...", "You feel a warm tingling inside..."));
1117 (void)cure_critical_wounds(700);
1123 msg_print(_("白く明るく輝いている...", "It glows a bright white..."));
1124 msg_print(_("ひじょうに気分がよい...", "You feel much better..."));
1125 (void)cure_critical_wounds(1000);
1131 msg_format(_("%sの優しさに癒される...", "the %s cures you affectionately ..."), name);
1136 case ACT_CURE_MANA_FULL:
1138 msg_format(_("%sが青白く光った...", "The %s glows pale..."), name);
1143 /* Activate for timed effect */
1147 (void)set_tim_esp(randint1(30) + 25, FALSE);
1153 (void)berserk(randint1(25) + 25);
1159 msg_format(_("%sから鋭い音が流れ出た...", "The %s lets out a shrill wail..."), name);
1161 (void)set_protevil(randint1(25) + k, FALSE);
1165 case ACT_RESIST_ALL:
1167 msg_print(_("様々な色に輝いている...", "It glows many colours..."));
1168 (void)set_oppose_acid(randint1(40) + 40, FALSE);
1169 (void)set_oppose_elec(randint1(40) + 40, FALSE);
1170 (void)set_oppose_fire(randint1(40) + 40, FALSE);
1171 (void)set_oppose_cold(randint1(40) + 40, FALSE);
1172 (void)set_oppose_pois(randint1(40) + 40, FALSE);
1178 msg_print(_("明るく緑色に輝いている...", "It glows bright green..."));
1179 (void)set_fast(randint1(20) + 20, FALSE);
1183 case ACT_XTRA_SPEED:
1185 msg_print(_("明るく輝いている...", "It glows brightly..."));
1186 (void)set_fast(randint1(75) + 75, FALSE);
1192 set_wraith_form(randint1(plev / 2) + (plev / 2), FALSE);
1198 (void)set_invuln(randint1(8) + 8, FALSE);
1208 case ACT_HERO_SPEED:
1210 (void)set_fast(randint1(50) + 50, FALSE);
1215 case ACT_RESIST_ACID:
1217 msg_format(_("%sが黒く輝いた...", "The %s grows black."), name);
1218 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ACID))
1220 if (!get_aim_dir(&dir)) return FALSE;
1221 fire_ball(GF_ACID, dir, 100, 2);
1223 (void)set_oppose_acid(randint1(20) + 20, FALSE);
1227 case ACT_RESIST_FIRE:
1229 msg_format(_("%sが赤く輝いた...", "The %s grows red."), name);
1230 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
1232 if (!get_aim_dir(&dir)) return FALSE;
1233 fire_ball(GF_FIRE, dir, 100, 2);
1235 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1239 case ACT_RESIST_COLD:
1241 msg_format(_("%sが白く輝いた...", "The %s grows white."), name);
1242 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
1244 if (!get_aim_dir(&dir)) return FALSE;
1245 fire_ball(GF_COLD, dir, 100, 2);
1247 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1251 case ACT_RESIST_ELEC:
1253 msg_format(_("%sが青く輝いた...", "The %s grows blue."), name);
1254 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ELEC))
1256 if (!get_aim_dir(&dir)) return FALSE;
1257 fire_ball(GF_ELEC, dir, 100, 2);
1259 (void)set_oppose_elec(randint1(20) + 20, FALSE);
1263 case ACT_RESIST_POIS:
1265 msg_format(_("%sが緑に輝いた...", "The %s grows green."), name);
1266 (void)set_oppose_pois(randint1(20) + 20, FALSE);
1270 /* Activate for general purpose effect (detection etc.) */
1274 msg_format(_("%sから澄んだ光があふれ出た...", "The %s wells with clear light..."), name);
1275 lite_area(damroll(2, 15), 3);
1281 msg_print(_("眩しく輝いた...", "It shines brightly..."));
1282 map_area(DETECT_RAD_MAP);
1283 lite_area(damroll(2, 15), 3);
1287 case ACT_DETECT_ALL:
1289 msg_print(_("白く明るく輝いている...", "It glows bright white..."));
1290 msg_print(_("心にイメージが浮かんできた...", "An image forms in your mind..."));
1291 detect_all(DETECT_RAD_DEFAULT);
1295 case ACT_DETECT_XTRA:
1297 msg_print(_("明るく輝いている...", "It glows brightly..."));
1298 detect_all(DETECT_RAD_DEFAULT);
1300 identify_fully(FALSE);
1306 msg_print(_("黄色く輝いている...", "It glows yellow..."));
1307 identify_fully(FALSE);
1313 if (!ident_spell(FALSE)) return FALSE;
1317 case ACT_RUNE_EXPLO:
1319 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
1326 msg_print(_("ブルーに明るく輝いている...", "It glows light blue..."));
1333 (void)set_food(PY_FOOD_MAX - 1);
1339 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
1340 destroy_doors_touch();
1346 msg_print(_("鼓動している...", "It pulsates..."));
1347 if (!get_aim_dir(&dir)) return FALSE;
1348 wall_to_mud(dir, 20 + randint1(30));
1360 msg_print(_("明るい黄色に輝いている...", "It glows bright yellow..."));
1367 msg_print(_("次元の扉が開いた。目的地を選んで下さい。", "You open a dimensional gate. Choose a destination."));
1368 if (!dimension_door()) return FALSE;
1375 msg_print(_("周りの空間が歪んでいる...", "It twists space around you..."));
1376 teleport_player(100, 0L);
1382 msg_print(_("やわらかな白色に輝いている...", "It glows soft white..."));
1383 if (!word_of_recall()) return FALSE;
1389 msg_format(_("%sは赤く明るく光った!", "The %s flashes bright red!"), name);
1390 chg_virtue(V_KNOWLEDGE, 1);
1391 chg_virtue(V_ENLIGHTEN, 1);
1394 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
1395 take_hit(DAMAGE_LOSELIFE, damroll(3, 8), _("審判の宝石", "the Jewel of Judgement"), -1);
1397 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1398 (void)detect_doors(DETECT_RAD_DEFAULT);
1399 (void)detect_stairs(DETECT_RAD_DEFAULT);
1401 if (get_check(_("帰還の力を使いますか?", "Activate recall? ")))
1403 (void)word_of_recall();
1409 case ACT_TELEKINESIS:
1411 if (!get_aim_dir(&dir)) return FALSE;
1412 msg_format(_("%sを伸ばした。", "You stretched your %s."), name);
1413 fetch(dir, 500, TRUE);
1417 case ACT_DETECT_UNIQUE:
1420 monster_type *m_ptr;
1421 monster_race *r_ptr;
1422 msg_print(_("奇妙な場所が頭の中に浮かんだ...", "Some strange places show up in your mind. And you see ..."));
1423 /* Process the monsters (backwards) */
1424 for (i = m_max - 1; i >= 1; i--)
1426 /* Access the monster */
1429 /* Ignore "dead" monsters */
1430 if (!m_ptr->r_idx) continue;
1432 r_ptr = &r_info[m_ptr->r_idx];
1434 if (r_ptr->flags1 & RF1_UNIQUE)
1436 msg_format(_("%s. ", "%s. "), r_name + r_ptr->name);
1444 switch (randint1(13))
1446 case 1: case 2: case 3: case 4: case 5:
1447 teleport_player(10, 0L);
1449 case 6: case 7: case 8: case 9: case 10:
1450 teleport_player(222, 0L);
1453 (void)stair_creation();
1456 if (get_check(_("この階を去りますか?", "Leave this level? ")))
1458 if (autosave_l) do_cmd_save_game(TRUE);
1461 p_ptr->leaving = TRUE;
1467 case ACT_DISP_CURSE_XTRA:
1469 msg_format(_("%sが真実を照らし出す...", "The %s exhibits the truth..."), name);
1470 if (remove_all_curse())
1472 msg_print(_("誰かに見守られているような気がする。", "You feel as if someone is watching over you."));
1478 case ACT_BRAND_FIRE_BOLTS:
1480 msg_format(_("%sが深紅に輝いた...", "Your %s glows deep red..."), name);
1481 (void)brand_bolts();
1485 case ACT_RECHARGE_XTRA:
1487 msg_format(_("%sが白く輝いた...", "The %s gleams with blinding light..."), name);
1488 if (!recharge(1000)) return FALSE;
1494 msg_print(_("石が隠された秘密を写し出した...", "The stone reveals hidden mysteries..."));
1495 if (!ident_spell(FALSE)) return FALSE;
1497 if (mp_ptr->spell_book)
1499 /* Sufficient mana */
1500 if (20 <= p_ptr->csp)
1506 /* Over-exert the player */
1509 int oops = 20 - p_ptr->csp;
1513 p_ptr->csp_frac = 0;
1516 msg_print(_("石を制御できない!", "You are too weak to control the stone!"));
1517 /* Hack -- Bypass free action */
1518 (void)set_paralyzed(p_ptr->paralyzed +
1519 randint1(5 * oops + 1));
1522 (void)set_confused(p_ptr->confused +
1523 randint1(5 * oops + 1));
1527 p_ptr->redraw |= (PR_MANA);
1529 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), _("危険な秘密", "perilous secrets"), -1);
1531 if (one_in_(5)) (void)set_confused(p_ptr->confused +
1534 /* Exercise a little care... */
1536 take_hit(DAMAGE_LOSELIFE, damroll(4, 10), _("危険な秘密", "perilous secrets"), -1);
1542 msg_print(_("力強く四股を踏んだ。", "You stamp. (as if you are in a ring.)"));
1543 (void)set_afraid(0);
1544 (void)set_hero(randint1(20) + 20, FALSE);
1545 dispel_evil(p_ptr->lev * 3);
1549 case ACT_PHASE_DOOR:
1551 teleport_player(10, 0L);
1555 case ACT_DETECT_ALL_MONS:
1557 (void)detect_monsters_invis(255);
1558 (void)detect_monsters_normal(255);
1562 case ACT_ULTIMATE_RESIST:
1564 TIME_EFFECT v = randint1(25) + 25;
1565 (void)set_afraid(0);
1566 (void)set_hero(v, FALSE);
1567 (void)hp_player(10);
1568 (void)set_blessed(v, FALSE);
1569 (void)set_oppose_acid(v, FALSE);
1570 (void)set_oppose_elec(v, FALSE);
1571 (void)set_oppose_fire(v, FALSE);
1572 (void)set_oppose_cold(v, FALSE);
1573 (void)set_oppose_pois(v, FALSE);
1574 (void)set_ultimate_res(v, FALSE);
1579 /* Unique activation */
1585 char o_name[MAX_NLEN];
1588 /* Cast off activated item */
1589 for (inv = INVEN_RARM; inv <= INVEN_FEET; inv++)
1591 if (o_ptr == &inventory[inv]) break;
1595 if (inv > INVEN_FEET) return FALSE;
1597 object_copy(&forge, o_ptr);
1598 inven_item_increase(inv, (0 - o_ptr->number));
1599 inven_item_optimize(inv);
1600 o_idx = drop_near(&forge, 0, p_ptr->y, p_ptr->x);
1601 o_ptr = &o_list[o_idx];
1603 object_desc(o_name, o_ptr, OD_NAME_ONLY);
1604 msg_format(_("%sを脱ぎ捨てた。", "You cast off %s."), o_name);
1607 msg_print(_("「燃え上がれ俺の小宇宙!」", "You say, 'Burn up my cosmo!"));
1608 t = 20 + randint1(20);
1609 (void)set_blind(p_ptr->blind + t);
1610 (void)set_afraid(0);
1611 (void)set_tim_esp(p_ptr->tim_esp + t, FALSE);
1612 (void)set_tim_regen(p_ptr->tim_regen + t, FALSE);
1613 (void)set_hero(p_ptr->hero + t, FALSE);
1614 (void)set_blessed(p_ptr->blessed + t, FALSE);
1615 (void)set_fast(p_ptr->fast + t, FALSE);
1616 (void)set_shero(p_ptr->shero + t, FALSE);
1617 if (p_ptr->pclass == CLASS_FORCETRAINER)
1619 P_PTR_KI = plev * 5 + 190;
1620 msg_print(_("気が爆発寸前になった。", "Your force are immediatly before explosion."));
1626 case ACT_FALLING_STAR:
1628 msg_print(_("あなたは妖刀に魅入られた…", "You are enchanted by cursed blade..."));
1629 msg_print(_("「狂ほしく 血のごとき 月はのぼれり 秘めおきし 魔剣 いずこぞや」", "'Behold the blade arts.'"));
1634 case ACT_GRAND_CROSS:
1636 msg_print(_("「闇に還れ!」", "You say, 'Return to darkness!'"));
1637 project(0, 8, p_ptr->y, p_ptr->x, (randint1(100) + 200) * 2, GF_HOLY_FIRE, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID, -1);
1641 case ACT_TELEPORT_LEVEL:
1643 if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)"))) return FALSE;
1648 case ACT_STRAIN_HASTE:
1651 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
1652 take_hit(DAMAGE_LOSELIFE, damroll(3, 8), _("加速した疲労", "the strain of haste"), -1);
1653 t = 25 + randint1(25);
1654 (void)set_fast(p_ptr->fast + t, FALSE);
1662 if (!get_rep_dir2(&dir)) return FALSE;
1663 y = p_ptr->y + ddy[dir];
1664 x = p_ptr->x + ddx[dir];
1666 if (!cave_have_flag_bold(y, x, FF_WATER))
1668 msg_print(_("そこは水辺ではない。", "There is no fishing place."));
1671 else if (cave[y][x].m_idx)
1674 monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
1675 msg_format(_("%sが邪魔だ!", "%^s is stand in your way."), m_name);
1676 p_ptr->energy_use = 0;
1679 set_action(ACTION_FISH);
1680 p_ptr->redraw |= (PR_STATE);
1687 monster_type *m_ptr;
1690 if (summon_named_creature(0, p_ptr->y, p_ptr->x, MON_SUKE, PM_FORCE_PET))
1692 msg_print(_("『助さん』が現れた。", "Suke-san apperars."));
1693 kakusan = "Suke-san";
1696 if (summon_named_creature(0, p_ptr->y, p_ptr->x, MON_KAKU, PM_FORCE_PET))
1698 msg_print(_("『格さん』が現れた。", "Kaku-san appears."));
1699 kakusan = "Kaku-san";
1704 for (i = m_max - 1; i > 0; i--)
1707 if (!m_ptr->r_idx) continue;
1708 if (!((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) continue;
1709 if (!los(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)) continue;
1710 if (!projectable(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)) continue;
1718 msg_format(_("「者ども、ひかえおろう!!!このお方をどなたとこころえる。」",
1719 "%^s says 'WHO do you think this person is! Bow your head, down your knees!'"), kakusan);
1722 confuse_monsters(120);
1724 stasis_monsters(120);
1729 msg_print(_("しかし、何も起きなかった。", "Nothing happen."));
1736 /* Only for Muramasa */
1737 if (o_ptr->name1 != ART_MURAMASA) return FALSE;
1738 if (get_check(_("本当に使いますか?", "Are you sure?!")))
1740 msg_print(_("村正が震えた...", "The Muramasa pulsates..."));
1744 msg_print(_("村正は壊れた!", "The Muramasa is destroyed!"));
1745 curse_weapon_object(TRUE, o_ptr);
1751 case ACT_BLOODY_MOON:
1753 /* Only for Bloody Moon */
1754 if (o_ptr->name1 != ART_BLOOD) return FALSE;
1755 msg_print(_("鎌が明るく輝いた...", "Your scythe glows brightly!"));
1756 get_bloody_moon_flags(o_ptr);
1757 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
1758 p_ptr->update |= (PU_BONUS | PU_HP);
1766 BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
1769 /* Only for Crimson */
1770 if (o_ptr->name1 != ART_CRIMSON) return FALSE;
1772 msg_print(_("せっかくだから『クリムゾン』をぶっぱなすぜ!", "I'll fire CRIMSON! SEKKAKUDAKARA!"));
1774 if (!get_aim_dir(&dir)) return FALSE;
1776 /* Use the given direction */
1777 tx = p_ptr->x + 99 * ddx[dir];
1778 ty = p_ptr->y + 99 * ddy[dir];
1780 /* Hack -- Use an actual "target" */
1781 if ((dir == 5) && target_okay())
1787 if (p_ptr->pclass == CLASS_ARCHER)
1789 /* Extra shot at level 10 */
1790 if (p_ptr->lev >= 10) num++;
1792 /* Extra shot at level 30 */
1793 if (p_ptr->lev >= 30) num++;
1795 /* Extra shot at level 45 */
1796 if (p_ptr->lev >= 45) num++;
1799 for (i = 0; i < num; i++)
1800 project(0, p_ptr->lev / 20 + 1, ty, tx, p_ptr->lev*p_ptr->lev * 6 / 50, GF_ROCKET, flg, -1);
1806 msg_format(_("Unknown activation effect: %d.", "Unknown activation effect: %d."), act_ptr->index);
1811 /* Set activation timeout */
1812 if (act_ptr->timeout.constant >= 0) {
1813 o_ptr->timeout = (s16b)act_ptr->timeout.constant;
1814 if (act_ptr->timeout.dice > 0) {
1815 o_ptr->timeout += randint1(act_ptr->timeout.dice);
1819 /* Activations that have special timeout */
1820 switch (act_ptr->index) {
1822 o_ptr->timeout = ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES)) ? 200 : 250;
1825 o_ptr->timeout = ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE)) ? 200 : 250;
1828 o_ptr->timeout = 3 * (p_ptr->lev + 10);
1834 msg_format("Special timeout is not implemented: %d.", act_ptr->index);
1843 * @brief 固定アーティファクト『ブラッディムーン』の特性を変更する。
1844 * @details スレイ2d2種、及びone_resistance()による耐性1d2種、pval2種を得る。
1845 * @param o_ptr 対象のオブジェクト構造体(ブラッディムーン)のポインタ
1848 void get_bloody_moon_flags(object_type *o_ptr)
1852 for (i = 0; i < TR_FLAG_SIZE; i++)
1853 o_ptr->art_flags[i] = a_info[ART_BLOOD].flags[i];
1855 dummy = randint1(2) + randint1(2);
1856 for (i = 0; i < dummy; i++)
1858 int flag = randint0(26);
1859 if (flag >= 20) add_flag(o_ptr->art_flags, TR_KILL_UNDEAD + flag - 20);
1860 else if (flag == 19) add_flag(o_ptr->art_flags, TR_KILL_ANIMAL);
1861 else if (flag == 18) add_flag(o_ptr->art_flags, TR_SLAY_HUMAN);
1862 else add_flag(o_ptr->art_flags, TR_CHAOTIC + flag);
1865 dummy = randint1(2);
1866 for (i = 0; i < dummy; i++) one_resistance(o_ptr);
1868 for (i = 0; i < 2; i++)
1870 int tmp = randint0(11);
1871 if (tmp < 6) add_flag(o_ptr->art_flags, TR_STR + tmp);
1872 else add_flag(o_ptr->art_flags, TR_STEALTH + tmp - 6);