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)
76 /* Get the item (in the pack) */
79 o_ptr = &inventory[item];
82 /* Get the item (on the floor) */
85 o_ptr = &o_list[0 - item];
88 p_ptr->energy_use = 100;
90 /* Extract the item level */
91 lev = k_info[o_ptr->k_idx].level;
93 /* Hack -- use artifact level instead */
94 if (object_is_fixed_artifact(o_ptr)) lev = a_info[o_ptr->name1].level;
95 else if (object_is_random_artifact(o_ptr))
97 const activation_type* const act_ptr = find_activation_info(o_ptr);
102 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)) && o_ptr->name2) lev = e_info[o_ptr->name2].level;
104 /* Base chance of success */
105 chance = p_ptr->skill_dev;
107 /* Confusion hurts skill */
108 if (p_ptr->confused) chance = chance / 2;
111 if (chance > fail) fail -= (chance - fail)*2;
112 else chance -= (fail - chance)*2;
113 if (fail < USE_DEVICE) fail = USE_DEVICE;
114 if (chance < USE_DEVICE) chance = USE_DEVICE;
118 if (flush_failure) flush();
119 msg_print(_("止まった時の中ではうまく働かないようだ。", "It shows no reaction."));
124 if (p_ptr->pclass == CLASS_BERSERKER) success = FALSE;
125 else if (chance > fail)
127 if (randint0(chance*2) < fail) success = FALSE;
132 if (randint0(fail*2) < chance) success = TRUE;
133 else success = FALSE;
139 if (flush_failure) flush();
140 msg_print(_("うまく始動させることができなかった。", "You failed to activate it properly."));
145 /* Check the recharge */
148 msg_print(_("それは微かに音を立て、輝き、消えた...", "It whines, glows and fades..."));
152 /* Some lights need enough fuel for activation */
153 if (!o_ptr->xtra4 && (o_ptr->tval == TV_FLASK) &&
154 ((o_ptr->sval == SV_LITE_TORCH) || (o_ptr->sval == SV_LITE_LANTERN)))
156 msg_print(_("燃料がない。", "It has no fuel."));
157 p_ptr->energy_use = 0;
161 /* Activate the artifact */
162 msg_print(_("始動させた...", "You activate it..."));
166 /* Activate object */
167 if (activation_index(o_ptr))
169 (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();
189 /* Allocate the "who" array */
190 C_MAKE(who, max_m_idx, IDX);
192 /* Process the monsters (backwards) */
193 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
195 if (is_pet(&m_list[pet_ctr]) && (p_ptr->riding != pet_ctr))
196 who[max_pet++] = pet_ctr;
199 /* Select the sort method */
200 ang_sort_comp = ang_sort_comp_pet;
201 ang_sort_swap = ang_sort_swap_hook;
203 ang_sort(who, &dummy_why, max_pet);
205 /* Process the monsters (backwards) */
206 for (i = 0; i < max_pet; i++)
209 teleport_monster_to(pet_ctr, p_ptr->y, p_ptr->x, 100, TELEPORT_PASSIVE);
212 /* Free the "who" array */
213 C_KILL(who, max_m_idx, IDX);
215 o_ptr->timeout = 100 + randint1(100);
218 else if (o_ptr->tval == TV_CAPTURE)
222 bool old_target_pet = target_pet;
224 if (!get_aim_dir(&dir))
226 target_pet = old_target_pet;
229 target_pet = old_target_pet;
231 if(fire_ball(GF_CAPTURE, dir, 0, 0))
233 o_ptr->pval = (PARAMETER_VALUE)cap_mon;
234 o_ptr->xtra3 = (XTRA8)cap_mspeed;
235 o_ptr->xtra4 = (XTRA16)cap_hp;
236 o_ptr->xtra5 = (XTRA16)cap_maxhp;
243 if (o_ptr->inscription)
244 strcpy(buf, quark_str(o_ptr->inscription));
246 for (s = buf;*s && (*s != '#'); s++)
249 if (iskanji(*s)) s++;
259 t = quark_str(cap_nickname);
272 o_ptr->inscription = quark_add(buf);
279 if (!get_direction(&dir, FALSE, FALSE)) return;
280 if (monster_can_enter(p_ptr->y + ddy[dir], p_ptr->x + ddx[dir], &r_info[o_ptr->pval], 0))
282 if (place_monster_aux(0, p_ptr->y + ddy[dir], p_ptr->x + ddx[dir], o_ptr->pval, (PM_FORCE_PET | PM_NO_KAGE)))
284 if (o_ptr->xtra3) m_list[hack_m_idx_ii].mspeed = o_ptr->xtra3;
285 if (o_ptr->xtra5) m_list[hack_m_idx_ii].max_maxhp = o_ptr->xtra5;
286 if (o_ptr->xtra4) m_list[hack_m_idx_ii].hp = o_ptr->xtra4;
287 m_list[hack_m_idx_ii].maxhp = m_list[hack_m_idx_ii].max_maxhp;
288 if (o_ptr->inscription)
296 t = quark_str(o_ptr->inscription);
297 for (t = quark_str(o_ptr->inscription);*t && (*t != '#'); t++)
300 if (iskanji(*t)) t++;
325 if (quote && *(s-1) =='\'')
329 m_list[hack_m_idx_ii].nickname = quark_add(buf);
330 t = quark_str(o_ptr->inscription);
332 while(*t && (*t != '#'))
339 o_ptr->inscription = quark_add(buf);
350 msg_print(_("おっと、解放に失敗した。", "Oops. You failed to release your pet."));
357 msg_print(_("おっと、このアイテムは始動できない。", "Oops. That object cannot be activated."));
361 * @brief 装備を発動するコマンドのメインルーチン /
364 void do_cmd_activate(void)
369 if (p_ptr->wild_mode) return;
371 if (p_ptr->inside_arena)
373 msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!"));
378 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
380 set_action(ACTION_NONE);
383 item_tester_hook = item_tester_hook_activate;
385 q = _("どのアイテムを始動させますか? ", "Activate which item? ");
386 s = _("始動できるアイテムを装備していない。", "You have nothing to activate.");
388 if (!choose_object(&item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT))) return;
390 /* Activate the item */
391 do_cmd_activate_aux(item);
395 * @brief 発動によるブレスの属性をアイテムの耐性から選択し、実行を処理する。/ Dragon breath activation
396 * @details 対象となる耐性は dragonbreath_info テーブルを参照のこと。
397 * @param o_ptr 対象のオブジェクト構造体ポインタ
398 * @return 発動実行の是非を返す。
400 static bool activate_dragon_breath(object_type *o_ptr)
402 BIT_FLAGS flgs[TR_FLAG_SIZE]; /* for resistance flags */
408 if (!get_aim_dir(&dir)) return FALSE;
410 object_flags(o_ptr, flgs);
412 for (i = 0; dragonbreath_info[i].flag != 0; i++)
414 if (have_flag(flgs, dragonbreath_info[i].flag))
416 type[n] = dragonbreath_info[i].type;
417 name[n] = dragonbreath_info[i].name;
423 if (n == 0) return FALSE;
426 if (music_singing_any()) stop_singing();
427 if (hex_spelling_any()) stop_hex_spell_all();
430 msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), name[t]);
431 fire_breath(type[t], dir, 250, 4);
437 * @brief アイテムの発動効果を処理する。
438 * @param o_ptr 対象のオブジェクト構造体ポインタ
439 * @return 発動実行の是非を返す。
441 bool activate_artifact(object_type *o_ptr)
443 PLAYER_LEVEL plev = p_ptr->lev;
446 cptr name = k_name + k_info[o_ptr->k_idx].name;
447 const activation_type* const act_ptr = find_activation_info(o_ptr);
451 /* Maybe forgot adding information to activation_info table ? */
452 msg_print("Activation information is not found.");
456 /* Activate for attack */
457 switch (act_ptr->index)
461 if (!get_aim_dir(&dir)) return FALSE;
462 msg_print(_("太陽光線が放たれた。", "A line of sunlight appears."));
463 (void)lite_line(dir, damroll(6, 8));
469 msg_print(_("それは眩しいくらいに明るく輝いている...", "It glows extremely brightly..."));
470 if (!get_aim_dir(&dir)) return FALSE;
471 fire_bolt(GF_MISSILE, dir, damroll(2, 6));
477 msg_print(_("それは濃緑色に脈動している...", "It throbs deep green..."));
478 if (!get_aim_dir(&dir)) return FALSE;
479 fire_ball(GF_POIS, dir, 12, 3);
485 msg_print(_("それは火花に覆われた...", "It is covered in sparks..."));
486 if (!get_aim_dir(&dir)) return FALSE;
487 fire_bolt(GF_ELEC, dir, damroll(4, 8));
493 msg_print(_("それは酸に覆われた...", "It is covered in acid..."));
494 if (!get_aim_dir(&dir)) return FALSE;
495 fire_bolt(GF_ACID, dir, damroll(5, 8));
501 msg_print(_("それは霜に覆われた...", "It is covered in frost..."));
502 if (!get_aim_dir(&dir)) return FALSE;
503 fire_bolt(GF_COLD, dir, damroll(6, 8));
509 msg_print(_("それは炎に覆われた...", "It is covered in fire..."));
510 if (!get_aim_dir(&dir)) return FALSE;
511 fire_bolt(GF_FIRE, dir, damroll(9, 8));
517 msg_print(_("それは霜に覆われた...", "It is covered in frost..."));
518 if (!get_aim_dir(&dir)) return FALSE;
519 fire_ball(GF_COLD, dir, 48, 2);
525 msg_print(_("それは青く激しく輝いた...", "It glows an intense blue..."));
526 if (!get_aim_dir(&dir)) return FALSE;
527 fire_ball(GF_COLD, dir, 100, 2);
533 msg_print(_("明るく白色に輝いている...", "It glows bright white..."));
534 if (!get_aim_dir(&dir)) return FALSE;
535 fire_ball(GF_COLD, dir, 400, 3);
541 msg_print(_("それは赤く激しく輝いた...", "It glows an intense red..."));
542 if (!get_aim_dir(&dir)) return FALSE;
543 fire_ball(GF_FIRE, dir, 72, 2);
549 msg_format(_("%sから炎が吹き出した...", "The %s rages in fire..."), name);
550 if (!get_aim_dir(&dir)) return FALSE;
551 fire_ball(GF_FIRE, dir, 120, 3);
557 msg_print(_("深赤色に輝いている...", "It glows deep red..."));
558 if (!get_aim_dir(&dir)) return FALSE;
559 fire_ball(GF_FIRE, dir, 300, 3);
565 msg_print(_("それは赤く激しく輝いた...", "It glows an intense red..."));
566 if (!get_aim_dir(&dir)) return FALSE;
567 fire_ball(GF_FIRE, dir, 100, 2);
573 msg_print(_("電気がパチパチ音を立てた...", "It crackles with electricity..."));
574 if (!get_aim_dir(&dir)) return FALSE;
575 fire_ball(GF_ELEC, dir, 100, 3);
581 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
582 if (!get_aim_dir(&dir)) return FALSE;
583 fire_ball(GF_ELEC, dir, 500, 3);
589 msg_print(_("それは黒く激しく輝いた...", "It glows an intense black..."));
590 if (!get_aim_dir(&dir)) return FALSE;
591 fire_ball(GF_ACID, dir, 100, 2);
597 msg_print(_("それは緑に激しく輝いた...", "It glows an intense green..."));
598 if (!get_aim_dir(&dir)) return FALSE;
599 fire_ball(GF_NUKE, dir, 100, 2);
603 case ACT_HYPODYNAMIA_1:
605 msg_format(_("あなたは%sに敵を締め殺すよう命じた。", "You order the %s to strangle your opponent."), name);
606 if (!get_aim_dir(&dir)) return FALSE;
607 if (hypodynamic_bolt(dir, 100))
611 case ACT_HYPODYNAMIA_2:
613 msg_print(_("黒く輝いている...", "It glows black..."));
614 if (!get_aim_dir(&dir)) return FALSE;
615 hypodynamic_bolt(dir, 120);
621 if (!get_aim_dir(&dir)) return FALSE;
622 for (dummy = 0; dummy < 3; dummy++)
624 if (hypodynamic_bolt(dir, 50))
632 msg_print(_("魔法のトゲが現れた...", "It grows magical spikes..."));
633 if (!get_aim_dir(&dir)) return FALSE;
634 fire_bolt(GF_ARROW, dir, 150);
646 if (!get_aim_dir(&dir)) return FALSE;
647 for (dummy = 0; dummy < 3; dummy++)
649 if (hypodynamic_bolt(dir, 100))
658 msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours..."));
665 if (!get_aim_dir(&dir)) return FALSE;
666 msg_print(_("ロケットを発射した!", "You launch a rocket!"));
667 fire_ball(GF_ROCKET, dir, 250 + plev * 3, 2);
673 msg_print(_("神聖な雰囲気が充満した...", "It floods the area with goodness..."));
674 dispel_evil(p_ptr->lev * 5);
680 if (!get_aim_dir(&dir)) return FALSE;
681 msg_print(_("あなたはエレメントのブレスを吐いた。", "You breathe the elements."));
682 fire_breath(GF_MISSILE, dir, 300, 4);
688 msg_print(_("邪悪な雰囲気が充満した...", "It floods the area with evil..."));
689 dispel_good(p_ptr->lev * 5);
695 msg_format(_("%sに魔法のトゲが現れた...", "The %s grows magical spikes..."), name);
696 if (!get_aim_dir(&dir)) return FALSE;
697 fire_bolt(GF_ARROW, dir, 150);
703 msg_format(_("%sが深い青色に鼓動している...", "The %s throbs deep blue..."), name);
704 if (!get_aim_dir(&dir)) return FALSE;
705 fire_ball(GF_WATER, dir, 200, 3);
711 msg_format(_("%sが深い闇に覆われた...", "The %s is coverd in pitch-darkness..."), name);
712 if (!get_aim_dir(&dir)) return FALSE;
713 fire_ball(GF_DARK, dir, 250, 4);
719 msg_format(_("%sが青白く光った...", "The %s glows pale..."), name);
720 if (!get_aim_dir(&dir)) return FALSE;
721 fire_ball(GF_MANA, dir, 250, 4);
727 msg_print(_("あなたは害虫を一掃した。", "You exterminate small life."));
728 (void)dispel_monsters(4);
732 case ACT_BLINDING_LIGHT:
734 msg_format(_("%sが眩しい光で輝いた...", "The %s gleams with blinding light..."), name);
735 fire_ball(GF_LITE, 0, 300, 6);
736 confuse_monsters(3 * p_ptr->lev / 2);
742 msg_format(_("%sは漆黒に輝いた...", "The %s glows intensely black..."), name);
743 if (!get_aim_dir(&dir)) return FALSE;
748 case ACT_CAST_BA_STAR:
750 HIT_POINT num = damroll(5, 3);
751 POSITION y = 0, x = 0;
753 msg_format(_("%sが稲妻で覆われた...", "The %s is surrounded by lightning..."), name);
754 for (k = 0; k < num; k++)
760 scatter(&y, &x, p_ptr->y, p_ptr->x, 4, 0);
761 if (!cave_have_flag_bold(y, x, FF_PROJECT)) continue;
762 if (!player_bold(y, x)) break;
765 project(0, 3, y, x, 150, GF_ELEC,
766 (PROJECT_THRU | PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
772 case ACT_BLADETURNER:
774 if (!get_aim_dir(&dir)) return FALSE;
775 msg_print(_("あなたはエレメントのブレスを吐いた。", "You breathe the elements."));
776 fire_breath(GF_MISSILE, dir, 300, 4);
777 msg_print(_("鎧が様々な色に輝いた...", "Your armor glows many colours..."));
779 (void)set_hero(randint1(50) + 50, FALSE);
781 (void)set_blessed(randint1(50) + 50, FALSE);
782 (void)set_oppose_acid(randint1(50) + 50, FALSE);
783 (void)set_oppose_elec(randint1(50) + 50, FALSE);
784 (void)set_oppose_fire(randint1(50) + 50, FALSE);
785 (void)set_oppose_cold(randint1(50) + 50, FALSE);
786 (void)set_oppose_pois(randint1(50) + 50, FALSE);
792 if (!get_aim_dir(&dir)) return FALSE;
793 fire_breath(GF_FIRE, dir, 200, 2);
794 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
796 (void)set_oppose_fire(randint1(20) + 20, FALSE);
803 if (!get_aim_dir(&dir)) return FALSE;
804 fire_breath(GF_COLD, dir, 200, 2);
805 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
807 (void)set_oppose_cold(randint1(20) + 20, FALSE);
814 if (!activate_dragon_breath(o_ptr)) return FALSE;
818 /* Activate for other offensive action */
821 msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours..."));
822 if (!get_aim_dir(&dir)) return FALSE;
823 confuse_monster(dir, 20);
829 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
830 sleep_monsters_touch();
836 earthquake(p_ptr->y, p_ptr->x, 5);
842 turn_monsters(40 + p_ptr->lev);
848 if (!get_aim_dir(&dir)) return FALSE;
849 (void)fire_beam(GF_AWAY_ALL, dir, plev);
853 case ACT_BANISH_EVIL:
855 if (banish_evil(100))
857 msg_print(_("アーティファクトの力が邪悪を打ち払った!", "The power of the artifact banishes evil!"));
864 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
865 (void)symbol_genocide(200, TRUE);
871 msg_print(_("ひどく鋭い音が流れ出た...", "It lets out a long, shrill note..."));
872 (void)mass_genocide(200, TRUE);
878 if (music_singing_any()) stop_singing();
879 if (hex_spelling_any()) stop_hex_spell_all();
880 msg_print(_("あなたは力強い突風を吹き鳴らした。周囲の敵が震え上っている!",
881 "You wind a mighty blast; your enemies tremble!"));
882 (void)turn_monsters((3 * p_ptr->lev / 2) + 10);
888 if (o_ptr->name1 == ART_HYOUSIGI)
890 msg_print(_("拍子木を打った。", "You beat Your wooden clappers."));
894 msg_format(_("%sは不快な物音を立てた。", "The %s sounds an unpleasant noise."), name);
896 aggravate_monsters(0);
900 /* Activate for summoning / charming */
902 case ACT_CHARM_ANIMAL:
904 if (!get_aim_dir(&dir)) return FALSE;
905 (void)charm_animal(dir, plev);
909 case ACT_CHARM_UNDEAD:
911 if (!get_aim_dir(&dir)) return FALSE;
912 (void)control_one_undead(dir, plev);
916 case ACT_CHARM_OTHER:
918 if (!get_aim_dir(&dir)) return FALSE;
919 (void)charm_monster(dir, plev * 2);
923 case ACT_CHARM_ANIMALS:
925 (void)charm_animals(plev * 2);
929 case ACT_CHARM_OTHERS:
931 charm_monsters(plev * 2);
935 case ACT_SUMMON_ANIMAL:
937 (void)summon_specific(-1, p_ptr->y, p_ptr->x, plev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET), '\0');
941 case ACT_SUMMON_PHANTOM:
943 msg_print(_("幻霊を召喚した。", "You summon a phantasmal servant."));
944 (void)summon_specific(-1, p_ptr->y, p_ptr->x, dun_level, SUMMON_PHANTOM, (PM_ALLOW_GROUP | PM_FORCE_PET), '\0');
948 case ACT_SUMMON_ELEMENTAL:
950 bool pet = one_in_(3);
953 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
954 if (pet) mode |= PM_FORCE_PET;
955 else mode |= PM_NO_PET;
957 if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, ((plev * 3) / 2), SUMMON_ELEMENTAL, mode, '\0'))
959 msg_print(_("エレメンタルが現れた...", "An elemental materializes..."));
961 msg_print(_("あなたに服従しているようだ。", "It seems obedient to you."));
963 msg_print(_("それをコントロールできなかった!", "You fail to control it!"));
969 case ACT_SUMMON_DEMON:
971 cast_summon_demon((plev * 3) / 2);
975 case ACT_SUMMON_UNDEAD:
977 bool pet = one_in_(3);
981 type = (plev > 47 ? SUMMON_HI_UNDEAD : SUMMON_UNDEAD);
983 if (!pet || ((plev > 24) && one_in_(3))) mode |= PM_ALLOW_GROUP;
984 if (pet) mode |= PM_FORCE_PET;
985 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
987 if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, ((plev * 3) / 2), type, mode, '\0'))
989 msg_print(_("冷たい風があなたの周りに吹き始めた。それは腐敗臭を運んでいる...",
990 "Cold winds begin to blow around you, carrying with them the stench of decay..."));
992 msg_print(_("古えの死せる者共があなたに仕えるため土から甦った!",
993 "Ancient, long-dead forms arise from the ground to serve you!"));
995 msg_print(_("死者が甦った。眠りを妨げるあなたを罰するために!",
996 "'The dead arise... to punish you for disturbing them!'"));
1002 case ACT_SUMMON_HOUND:
1004 BIT_FLAGS mode = PM_ALLOW_GROUP;
1005 bool pet = !one_in_(5);
1006 if (pet) mode |= PM_FORCE_PET;
1007 else mode |= PM_NO_PET;
1009 if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, ((p_ptr->lev * 3) / 2), SUMMON_HOUND, mode, '\0'))
1013 msg_print(_("ハウンドがあなたの下僕として出現した。",
1014 "A group of hounds appear as your servant."));
1016 msg_print(_("ハウンドはあなたに牙を向けている!",
1017 "A group of hounds appear as your enemy!"));
1023 case ACT_SUMMON_DAWN:
1025 msg_print(_("暁の師団を召喚した。", "You summon the Legion of the Dawn."));
1026 (void)summon_specific(-1, p_ptr->y, p_ptr->x, dun_level, SUMMON_DAWN, (PM_ALLOW_GROUP | PM_FORCE_PET), '\0');
1030 case ACT_SUMMON_OCTOPUS:
1032 BIT_FLAGS mode = PM_ALLOW_GROUP;
1033 bool pet = !one_in_(5);
1034 if (pet) mode |= PM_FORCE_PET;
1036 if (summon_named_creature(0, p_ptr->y, p_ptr->x, MON_JIZOTAKO, mode))
1039 msg_print(_("蛸があなたの下僕として出現した。", "A group of octopuses appear as your servant."));
1041 msg_print(_("蛸はあなたを睨んでいる!", "A group of octopuses appear as your enemy!"));
1047 /* Activate for healing */
1049 case ACT_CHOIR_SINGS:
1051 msg_print(_("天国の歌が聞こえる...", "A heavenly choir sings..."));
1052 (void)cure_critical_wounds(777);
1053 (void)set_hero(randint1(25) + 25, FALSE);
1059 (void)set_afraid(0);
1060 (void)hp_player(30);
1066 msg_print(_("深紫色の光を発している...", "It radiates deep purple..."));
1067 (void)cure_serious_wounds(4, 8);
1071 case ACT_CURE_POISON:
1073 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
1074 (void)set_afraid(0);
1075 (void)set_poisoned(0);
1081 msg_print(_("深紅に輝いている...", "It glows a deep red..."));
1088 msg_print(_("濃緑色に輝いている...", "It glows a deep green..."));
1089 (void)restore_all_status();
1090 (void)restore_level();
1096 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
1097 msg_print(_("体内に暖かい鼓動が感じられる...", "You feel a warm tingling inside..."));
1098 (void)cure_critical_wounds(700);
1104 msg_print(_("白く明るく輝いている...", "It glows a bright white..."));
1105 msg_print(_("ひじょうに気分がよい...", "You feel much better..."));
1106 (void)cure_critical_wounds(1000);
1112 msg_format(_("%sの優しさに癒される...", "the %s cures you affectionately ..."), name);
1117 case ACT_CURE_MANA_FULL:
1119 msg_format(_("%sが青白く光った...", "The %s glows pale..."), name);
1124 /* Activate for timed effect */
1128 (void)set_tim_esp(randint1(30) + 25, FALSE);
1134 (void)berserk(randint1(25) + 25);
1140 msg_format(_("%sから鋭い音が流れ出た...", "The %s lets out a shrill wail..."), name);
1142 (void)set_protevil(randint1(25) + k, FALSE);
1146 case ACT_RESIST_ALL:
1148 msg_print(_("様々な色に輝いている...", "It glows many colours..."));
1149 (void)set_oppose_acid(randint1(40) + 40, FALSE);
1150 (void)set_oppose_elec(randint1(40) + 40, FALSE);
1151 (void)set_oppose_fire(randint1(40) + 40, FALSE);
1152 (void)set_oppose_cold(randint1(40) + 40, FALSE);
1153 (void)set_oppose_pois(randint1(40) + 40, FALSE);
1159 msg_print(_("明るく緑色に輝いている...", "It glows bright green..."));
1160 (void)set_fast(randint1(20) + 20, FALSE);
1164 case ACT_XTRA_SPEED:
1166 msg_print(_("明るく輝いている...", "It glows brightly..."));
1167 (void)set_fast(randint1(75) + 75, FALSE);
1173 set_wraith_form(randint1(plev / 2) + (plev / 2), FALSE);
1179 (void)set_invuln(randint1(8) + 8, FALSE);
1189 case ACT_HERO_SPEED:
1191 (void)set_fast(randint1(50) + 50, FALSE);
1196 case ACT_RESIST_ACID:
1198 msg_format(_("%sが黒く輝いた...", "The %s grows black."), name);
1199 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ACID))
1201 if (!get_aim_dir(&dir)) return FALSE;
1202 fire_ball(GF_ACID, dir, 100, 2);
1204 (void)set_oppose_acid(randint1(20) + 20, FALSE);
1208 case ACT_RESIST_FIRE:
1210 msg_format(_("%sが赤く輝いた...", "The %s grows red."), name);
1211 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
1213 if (!get_aim_dir(&dir)) return FALSE;
1214 fire_ball(GF_FIRE, dir, 100, 2);
1216 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1220 case ACT_RESIST_COLD:
1222 msg_format(_("%sが白く輝いた...", "The %s grows white."), name);
1223 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
1225 if (!get_aim_dir(&dir)) return FALSE;
1226 fire_ball(GF_COLD, dir, 100, 2);
1228 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1232 case ACT_RESIST_ELEC:
1234 msg_format(_("%sが青く輝いた...", "The %s grows blue."), name);
1235 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ELEC))
1237 if (!get_aim_dir(&dir)) return FALSE;
1238 fire_ball(GF_ELEC, dir, 100, 2);
1240 (void)set_oppose_elec(randint1(20) + 20, FALSE);
1244 case ACT_RESIST_POIS:
1246 msg_format(_("%sが緑に輝いた...", "The %s grows green."), name);
1247 (void)set_oppose_pois(randint1(20) + 20, FALSE);
1251 /* Activate for general purpose effect (detection etc.) */
1255 msg_format(_("%sから澄んだ光があふれ出た...", "The %s wells with clear light..."), name);
1256 lite_area(damroll(2, 15), 3);
1262 msg_print(_("眩しく輝いた...", "It shines brightly..."));
1263 map_area(DETECT_RAD_MAP);
1264 lite_area(damroll(2, 15), 3);
1268 case ACT_DETECT_ALL:
1270 msg_print(_("白く明るく輝いている...", "It glows bright white..."));
1271 msg_print(_("心にイメージが浮かんできた...", "An image forms in your mind..."));
1272 detect_all(DETECT_RAD_DEFAULT);
1276 case ACT_DETECT_XTRA:
1278 msg_print(_("明るく輝いている...", "It glows brightly..."));
1279 detect_all(DETECT_RAD_DEFAULT);
1281 identify_fully(FALSE);
1287 msg_print(_("黄色く輝いている...", "It glows yellow..."));
1288 identify_fully(FALSE);
1294 if (!ident_spell(FALSE)) return FALSE;
1298 case ACT_RUNE_EXPLO:
1300 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
1307 msg_print(_("ブルーに明るく輝いている...", "It glows light blue..."));
1314 (void)set_food(PY_FOOD_MAX - 1);
1320 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
1321 destroy_doors_touch();
1327 msg_print(_("鼓動している...", "It pulsates..."));
1328 if (!get_aim_dir(&dir)) return FALSE;
1329 wall_to_mud(dir, 20 + randint1(30));
1341 msg_print(_("明るい黄色に輝いている...", "It glows bright yellow..."));
1348 msg_print(_("次元の扉が開いた。目的地を選んで下さい。", "You open a dimensional gate. Choose a destination."));
1349 if (!dimension_door()) return FALSE;
1356 msg_print(_("周りの空間が歪んでいる...", "It twists space around you..."));
1357 teleport_player(100, 0L);
1363 msg_print(_("やわらかな白色に輝いている...", "It glows soft white..."));
1364 if (!word_of_recall()) return FALSE;
1370 msg_format(_("%sは赤く明るく光った!", "The %s flashes bright red!"), name);
1371 chg_virtue(V_KNOWLEDGE, 1);
1372 chg_virtue(V_ENLIGHTEN, 1);
1375 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
1376 take_hit(DAMAGE_LOSELIFE, damroll(3, 8), _("審判の宝石", "the Jewel of Judgement"), -1);
1378 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1379 (void)detect_doors(DETECT_RAD_DEFAULT);
1380 (void)detect_stairs(DETECT_RAD_DEFAULT);
1382 if (get_check(_("帰還の力を使いますか?", "Activate recall? ")))
1384 (void)word_of_recall();
1390 case ACT_TELEKINESIS:
1392 if (!get_aim_dir(&dir)) return FALSE;
1393 msg_format(_("%sを伸ばした。", "You stretched your %s."), name);
1394 fetch(dir, 500, TRUE);
1398 case ACT_DETECT_UNIQUE:
1401 monster_type *m_ptr;
1402 monster_race *r_ptr;
1403 msg_print(_("奇妙な場所が頭の中に浮かんだ...", "Some strange places show up in your mind. And you see ..."));
1404 /* Process the monsters (backwards) */
1405 for (i = m_max - 1; i >= 1; i--)
1407 /* Access the monster */
1410 /* Ignore "dead" monsters */
1411 if (!m_ptr->r_idx) continue;
1413 r_ptr = &r_info[m_ptr->r_idx];
1415 if (r_ptr->flags1 & RF1_UNIQUE)
1417 msg_format(_("%s. ", "%s. "), r_name + r_ptr->name);
1425 switch (randint1(13))
1427 case 1: case 2: case 3: case 4: case 5:
1428 teleport_player(10, 0L);
1430 case 6: case 7: case 8: case 9: case 10:
1431 teleport_player(222, 0L);
1434 (void)stair_creation();
1437 if (get_check(_("この階を去りますか?", "Leave this level? ")))
1439 if (autosave_l) do_cmd_save_game(TRUE);
1442 p_ptr->leaving = TRUE;
1448 case ACT_DISP_CURSE_XTRA:
1450 msg_format(_("%sが真実を照らし出す...", "The %s exhibits the truth..."), name);
1451 (void)remove_all_curse();
1456 case ACT_BRAND_FIRE_BOLTS:
1458 msg_format(_("%sが深紅に輝いた...", "Your %s glows deep red..."), name);
1459 (void)brand_bolts();
1463 case ACT_RECHARGE_XTRA:
1465 msg_format(_("%sが白く輝いた...", "The %s gleams with blinding light..."), name);
1466 if (!recharge(1000)) return FALSE;
1472 msg_print(_("石が隠された秘密を写し出した...", "The stone reveals hidden mysteries..."));
1473 if (!ident_spell(FALSE)) return FALSE;
1475 if (mp_ptr->spell_book)
1477 /* Sufficient mana */
1478 if (20 <= p_ptr->csp)
1484 /* Over-exert the player */
1487 int oops = 20 - p_ptr->csp;
1491 p_ptr->csp_frac = 0;
1493 msg_print(_("石を制御できない!", "You are too weak to control the stone!"));
1494 /* Hack -- Bypass free action */
1495 (void)set_paralyzed(p_ptr->paralyzed + randint1(5 * oops + 1));
1498 (void)set_confused(p_ptr->confused + randint1(5 * oops + 1));
1500 p_ptr->redraw |= (PR_MANA);
1502 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), _("危険な秘密", "perilous secrets"), -1);
1504 if (one_in_(5)) (void)set_confused(p_ptr->confused + randint1(10));
1506 /* Exercise a little care... */
1507 if (one_in_(20)) take_hit(DAMAGE_LOSELIFE, damroll(4, 10), _("危険な秘密", "perilous secrets"), -1);
1513 msg_print(_("力強く四股を踏んだ。", "You stamp. (as if you are in a ring.)"));
1514 (void)set_afraid(0);
1515 (void)set_hero(randint1(20) + 20, FALSE);
1516 dispel_evil(p_ptr->lev * 3);
1520 case ACT_PHASE_DOOR:
1522 teleport_player(10, 0L);
1526 case ACT_DETECT_ALL_MONS:
1528 (void)detect_monsters_invis(255);
1529 (void)detect_monsters_normal(255);
1533 case ACT_ULTIMATE_RESIST:
1535 TIME_EFFECT v = randint1(25) + 25;
1536 (void)set_afraid(0);
1537 (void)set_hero(v, FALSE);
1538 (void)hp_player(10);
1539 (void)set_blessed(v, FALSE);
1540 (void)set_oppose_acid(v, FALSE);
1541 (void)set_oppose_elec(v, FALSE);
1542 (void)set_oppose_fire(v, FALSE);
1543 (void)set_oppose_cold(v, FALSE);
1544 (void)set_oppose_pois(v, FALSE);
1545 (void)set_ultimate_res(v, FALSE);
1550 /* Unique activation */
1556 GAME_TEXT o_name[MAX_NLEN];
1559 /* Cast off activated item */
1560 for (inv = INVEN_RARM; inv <= INVEN_FEET; inv++)
1562 if (o_ptr == &inventory[inv]) break;
1566 if (inv > INVEN_FEET) return FALSE;
1568 object_copy(&forge, o_ptr);
1569 inven_item_increase(inv, (0 - o_ptr->number));
1570 inven_item_optimize(inv);
1571 o_idx = drop_near(&forge, 0, p_ptr->y, p_ptr->x);
1572 o_ptr = &o_list[o_idx];
1574 object_desc(o_name, o_ptr, OD_NAME_ONLY);
1575 msg_format(_("%sを脱ぎ捨てた。", "You cast off %s."), o_name);
1578 msg_print(_("「燃え上がれ俺の小宇宙!」", "You say, 'Burn up my cosmo!"));
1579 t = 20 + randint1(20);
1580 (void)set_blind(p_ptr->blind + t);
1581 (void)set_afraid(0);
1582 (void)set_tim_esp(p_ptr->tim_esp + t, FALSE);
1583 (void)set_tim_regen(p_ptr->tim_regen + t, FALSE);
1584 (void)set_hero(p_ptr->hero + t, FALSE);
1585 (void)set_blessed(p_ptr->blessed + t, FALSE);
1586 (void)set_fast(p_ptr->fast + t, FALSE);
1587 (void)set_shero(p_ptr->shero + t, FALSE);
1588 if (p_ptr->pclass == CLASS_FORCETRAINER)
1590 P_PTR_KI = plev * 5 + 190;
1591 msg_print(_("気が爆発寸前になった。", "Your force are immediatly before explosion."));
1597 case ACT_FALLING_STAR:
1599 msg_print(_("あなたは妖刀に魅入られた…", "You are enchanted by cursed blade..."));
1600 msg_print(_("「狂ほしく 血のごとき 月はのぼれり 秘めおきし 魔剣 いずこぞや」", "'Behold the blade arts.'"));
1605 case ACT_GRAND_CROSS:
1607 msg_print(_("「闇に還れ!」", "You say, 'Return to darkness!'"));
1608 project(0, 8, p_ptr->y, p_ptr->x, (randint1(100) + 200) * 2, GF_HOLY_FIRE, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID, -1);
1612 case ACT_TELEPORT_LEVEL:
1614 if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)"))) return FALSE;
1619 case ACT_STRAIN_HASTE:
1622 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
1623 take_hit(DAMAGE_LOSELIFE, damroll(3, 8), _("加速した疲労", "the strain of haste"), -1);
1624 t = 25 + randint1(25);
1625 (void)set_fast(p_ptr->fast + t, FALSE);
1633 if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
1634 y = p_ptr->y + ddy[dir];
1635 x = p_ptr->x + ddx[dir];
1636 p_ptr->fishing_dir = dir;
1637 if (!cave_have_flag_bold(y, x, FF_WATER))
1639 msg_print(_("そこは水辺ではない。", "There is no fishing place."));
1642 else if (cave[y][x].m_idx)
1644 GAME_TEXT m_name[MAX_NLEN];
1645 monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
1646 msg_format(_("%sが邪魔だ!", "%^s is stand in your way."), m_name);
1647 p_ptr->energy_use = 0;
1650 set_action(ACTION_FISH);
1651 p_ptr->redraw |= (PR_STATE);
1658 monster_type *m_ptr;
1661 if (summon_named_creature(0, p_ptr->y, p_ptr->x, MON_SUKE, PM_FORCE_PET))
1663 msg_print(_("『助さん』が現れた。", "Suke-san apperars."));
1664 kakusan = "Suke-san";
1667 if (summon_named_creature(0, p_ptr->y, p_ptr->x, MON_KAKU, PM_FORCE_PET))
1669 msg_print(_("『格さん』が現れた。", "Kaku-san appears."));
1670 kakusan = "Kaku-san";
1675 for (i = m_max - 1; i > 0; i--)
1678 if (!m_ptr->r_idx) continue;
1679 if (!((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) continue;
1680 if (!los(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)) continue;
1681 if (!projectable(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)) continue;
1689 msg_format(_("「者ども、ひかえおろう!!!このお方をどなたとこころえる。」",
1690 "%^s says 'WHO do you think this person is! Bow your head, down your knees!'"), kakusan);
1693 confuse_monsters(120);
1695 stasis_monsters(120);
1700 msg_print(_("しかし、何も起きなかった。", "Nothing happen."));
1707 /* Only for Muramasa */
1708 if (o_ptr->name1 != ART_MURAMASA) return FALSE;
1709 if (get_check(_("本当に使いますか?", "Are you sure?!")))
1711 msg_print(_("村正が震えた...", "The Muramasa pulsates..."));
1715 msg_print(_("村正は壊れた!", "The Muramasa is destroyed!"));
1716 curse_weapon_object(TRUE, o_ptr);
1722 case ACT_BLOODY_MOON:
1724 /* Only for Bloody Moon */
1725 if (o_ptr->name1 != ART_BLOOD) return FALSE;
1726 msg_print(_("鎌が明るく輝いた...", "Your scythe glows brightly!"));
1727 get_bloody_moon_flags(o_ptr);
1728 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
1729 p_ptr->update |= (PU_BONUS | PU_HP);
1737 BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
1740 /* Only for Crimson */
1741 if (o_ptr->name1 != ART_CRIMSON) return FALSE;
1743 msg_print(_("せっかくだから『クリムゾン』をぶっぱなすぜ!", "I'll fire CRIMSON! SEKKAKUDAKARA!"));
1745 if (!get_aim_dir(&dir)) return FALSE;
1747 /* Use the given direction */
1748 tx = p_ptr->x + 99 * ddx[dir];
1749 ty = p_ptr->y + 99 * ddy[dir];
1751 /* Hack -- Use an actual "target" */
1752 if ((dir == 5) && target_okay())
1758 if (p_ptr->pclass == CLASS_ARCHER)
1760 /* Extra shot at level 10 */
1761 if (p_ptr->lev >= 10) num++;
1763 /* Extra shot at level 30 */
1764 if (p_ptr->lev >= 30) num++;
1766 /* Extra shot at level 45 */
1767 if (p_ptr->lev >= 45) num++;
1770 for (i = 0; i < num; i++)
1771 project(0, p_ptr->lev / 20 + 1, ty, tx, p_ptr->lev*p_ptr->lev * 6 / 50, GF_ROCKET, flg, -1);
1777 msg_format(_("Unknown activation effect: %d.", "Unknown activation effect: %d."), act_ptr->index);
1782 /* Set activation timeout */
1783 if (act_ptr->timeout.constant >= 0) {
1784 o_ptr->timeout = (s16b)act_ptr->timeout.constant;
1785 if (act_ptr->timeout.dice > 0) {
1786 o_ptr->timeout += randint1(act_ptr->timeout.dice);
1790 /* Activations that have special timeout */
1791 switch (act_ptr->index) {
1793 o_ptr->timeout = ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES)) ? 200 : 250;
1796 o_ptr->timeout = ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE)) ? 200 : 250;
1799 o_ptr->timeout = 3 * (p_ptr->lev + 10);
1805 msg_format("Special timeout is not implemented: %d.", act_ptr->index);
1814 * @brief 固定アーティファクト『ブラッディムーン』の特性を変更する。
1815 * @details スレイ2d2種、及びone_resistance()による耐性1d2種、pval2種を得る。
1816 * @param o_ptr 対象のオブジェクト構造体(ブラッディムーン)のポインタ
1819 void get_bloody_moon_flags(object_type *o_ptr)
1823 for (i = 0; i < TR_FLAG_SIZE; i++)
1824 o_ptr->art_flags[i] = a_info[ART_BLOOD].flags[i];
1826 dummy = randint1(2) + randint1(2);
1827 for (i = 0; i < dummy; i++)
1829 int flag = randint0(26);
1830 if (flag >= 20) add_flag(o_ptr->art_flags, TR_KILL_UNDEAD + flag - 20);
1831 else if (flag == 19) add_flag(o_ptr->art_flags, TR_KILL_ANIMAL);
1832 else if (flag == 18) add_flag(o_ptr->art_flags, TR_SLAY_HUMAN);
1833 else add_flag(o_ptr->art_flags, TR_CHAOTIC + flag);
1836 dummy = randint1(2);
1837 for (i = 0; i < dummy; i++) one_resistance(o_ptr);
1839 for (i = 0; i < 2; i++)
1841 int tmp = randint0(11);
1842 if (tmp < 6) add_flag(o_ptr->art_flags, TR_STR + tmp);
1843 else add_flag(o_ptr->art_flags, TR_STEALTH + tmp - 6);