3 * @brief ものまねの処理実装 / Imitation code
6 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke\n
7 * This software may be copied and distributed for educational, research,\n
8 * and not for profit purposes provided that this copyright and statement\n
9 * are included in all such copies. Other copyrights may also apply.\n
10 * 2014 Deskull rearranged comment for Doxygen.\n
18 * @brief 受け取ったパラメータに応じてものまねの効果情報をまとめたフォーマットを返す
19 * @param p 情報を返す文字列参照ポインタ
20 * @param power ものまねの効力の種類
24 static void mane_info(char *p, int power, int dam)
26 int plev = p_ptr->lev;
35 cptr s_range = "range ";
36 cptr s_heal = "heal ";
41 if ((power > 2 && power < 41) || (power > 41 && power < 59) || (power == 75))
42 sprintf(p, " %s%d", s_dam, dam);
48 sprintf(p, " %sd%d+%d", s_heal, plev * 3, plev);
51 sprintf(p, " %sd%d+%d", s_dur, 20+plev, plev);
54 sprintf(p, " %s%d", s_heal, plev*6);
57 sprintf(p, " %sd7+7", s_dur);
60 sprintf(p, " %s10", s_range);
63 sprintf(p, " %s%d", s_range, plev * 5);
66 sprintf(p, " %s5", s_range);
76 * @brief どのものまねを発動するか選択する処理 /
77 * Allow user to choose a imitation.
78 * @param sn 実行したものまねのIDを返す参照ポインタ(キャンセルなどの場合-1を返す)
79 * @param baigaesi TRUEならば倍返し上の処理として行う
80 * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。
82 * If a valid spell is chosen, saves it in '*sn' and returns TRUE
83 * If the user hits escape, returns FALSE, and set '*sn' to -1
84 * If there are no legal choices, returns FALSE, and sets '*sn' to -2
86 * The "prompt" should be "cast", "recite", or "study"
87 * The "known" should be TRUE for cast/pray, FALSE for study
89 * nb: This function has a (trivial) display bug which will be obvious
90 * when you run it. It's probably easy to fix but I haven't tried,
93 static int get_mane_power(int *sn, bool baigaesi)
100 int plev = p_ptr->lev;
106 cptr p = _("能力", "power");
111 /* Assume cancelled */
114 /* Nothing chosen yet */
120 num = p_ptr->mane_num;
122 /* Build a prompt (accept all spells) */
123 (void)strnfmt(out_val, 78,
124 _("(%c-%c, '*'で一覧, ESC) どの%sをまねますか?", "(%c-%c, *=List, ESC=exit) Use which %s? "),
125 I2A(0), I2A(num - 1), p);
127 /* Get a spell from the user */
129 choice= always_show_list ? ESCAPE:1 ;
132 if(choice==ESCAPE) choice = ' ';
133 else if( !get_com(out_val, &choice, TRUE) )break;
136 if ((choice == ' ') || (choice == '*') || (choice == '?'))
146 /* Save the screen */
149 /* Display a list of spells */
151 put_str(_("名前", "Name"), y, x + 5);
152 put_str(_("失率 効果", "Fail Info"), y, x + 36);
155 /* Dump the spells */
156 for (i = 0; i < num; i++)
158 /* Access the spell */
159 spell = monster_powers[p_ptr->mane_spell[i]];
161 chance = spell.manefail;
163 /* Reduce failure rate by "effective" level adjustment */
164 if (plev > spell.level) chance -= 3 * (plev - spell.level);
166 /* Reduce failure rate by INT/WIS adjustment */
167 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[spell.use_stat]] + adj_mag_stat[p_ptr->stat_ind[A_DEX]] - 2) / 2;
169 if (spell.manedam) chance = chance * p_ptr->mane_dam[i] / spell.manedam;
171 chance += p_ptr->to_m_chance;
173 /* Extract the minimum failure rate */
174 minfail = adj_mag_fail[p_ptr->stat_ind[spell.use_stat]];
176 /* Minimum failure rate */
177 if (chance < minfail) chance = minfail;
179 /* Stunning makes spells harder */
180 if (p_ptr->stun > 50) chance += 25;
181 else if (p_ptr->stun) chance += 15;
183 /* Always a 5 percent chance of working */
184 if (chance > 95) chance = 95;
187 mane_info(comment, p_ptr->mane_spell[i], (baigaesi ? p_ptr->mane_dam[i]*2 : p_ptr->mane_dam[i]));
189 /* Dump the spell --(-- */
190 sprintf(psi_desc, " %c) %-30s %3d%%%s",
193 prt(psi_desc, y + i + 1, x);
196 /* Clear the bottom line */
197 prt("", y + i + 1, x);
206 /* Restore the screen */
215 ask = isupper(choice);
218 if (ask) choice = tolower(choice);
220 /* Extract request */
221 i = (islower(choice) ? A2I(choice) : -1);
223 /* Totally Illegal */
224 if ((i < 0) || (i >= num))
230 /* Save the spell index */
231 spell = monster_powers[p_ptr->mane_spell[i]];
239 (void) strnfmt(tmp_val, 78, _("%sをまねますか?", "Use %s? "), monster_powers[p_ptr->mane_spell[i]].name);
241 /* Belay that order */
242 if (!get_check(tmp_val)) continue;
249 /* Restore the screen */
250 if (redraw) screen_load();
253 p_ptr->window |= (PW_SPELL);
258 /* Abort if needed */
259 if (!flag) return (FALSE);
261 /* Save the choice */
264 damage = (baigaesi ? p_ptr->mane_dam[i]*2 : p_ptr->mane_dam[i]);
273 * do_cmd_cast calls this function if the player's class is 'imitator'.
274 * @param spell 発動するモンスター攻撃のID
275 * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。
277 static bool use_mane(int spell)
280 int plev = p_ptr->lev;
281 u32b mode = (PM_ALLOW_GROUP | PM_FORCE_PET);
284 if (randint1(50+plev) < plev/10) u_mode = PM_ALLOW_UNIQUE;
291 msg_print(_("かん高い金切り声をあげた。", "You make a high pitched shriek."));
292 aggravate_monsters(0);
300 if (!target_set(TARGET_KILL)) return FALSE;
301 m_idx = cave[target_row][target_col].m_idx;
303 if (!player_has_los_bold(target_row, target_col)) break;
304 if (!projectable(py, px, target_row, target_col)) break;
305 dispel_monster_status(m_idx);
309 if (!get_aim_dir(&dir)) return FALSE;
310 else msg_print(_("ロケットを発射した。", "You fire a rocket."));
312 fire_rocket(GF_ROCKET, dir, damage, 2);
315 if (!get_aim_dir(&dir)) return FALSE;
316 else msg_print(_("矢を放った。", "You fire an arrow."));
318 fire_bolt(GF_ARROW, dir, damage);
327 if (!get_aim_dir(&dir)) return FALSE;
328 else msg_print(_("酸のブレスを吐いた。", "You breathe acid."));
330 fire_ball(GF_ACID, dir, damage, (plev > 35 ? -3 : -2));
333 if (!get_aim_dir(&dir)) return FALSE;
334 else msg_print(_("稲妻のブレスを吐いた。", "You breathe lightning."));
336 fire_ball(GF_ELEC, dir, damage, (plev > 35 ? -3 : -2));
339 if (!get_aim_dir(&dir)) return FALSE;
340 else msg_print(_("火炎のブレスを吐いた。", "You breathe fire."));
342 fire_ball(GF_FIRE, dir, damage, (plev > 35 ? -3 : -2));
345 if (!get_aim_dir(&dir)) return FALSE;
346 else msg_print(_("冷気のブレスを吐いた。", "You breathe frost."));
348 fire_ball(GF_COLD, dir, damage, (plev > 35 ? -3 : -2));
351 if (!get_aim_dir(&dir)) return FALSE;
352 else msg_print(_("ガスのブレスを吐いた。", "You breathe gas."));
354 fire_ball(GF_POIS, dir, damage, (plev > 35 ? -3 : -2));
357 if (!get_aim_dir(&dir)) return FALSE;
358 else msg_print(_("地獄のブレスを吐いた。", "You breathe nether."));
360 fire_ball(GF_NETHER, dir, damage, (plev > 35 ? -3 : -2));
363 if (!get_aim_dir(&dir)) return FALSE;
364 else msg_print(_("閃光のブレスを吐いた。", "You breathe light."));
366 fire_ball(GF_LITE, dir, damage, (plev > 35 ? -3 : -2));
369 if (!get_aim_dir(&dir)) return FALSE;
370 else msg_print(_("暗黒のブレスを吐いた。", "You breathe darkness."));
372 fire_ball(GF_DARK, dir, damage, (plev > 35 ? -3 : -2));
375 if (!get_aim_dir(&dir)) return FALSE;
376 else msg_print(_("混乱のブレスを吐いた。", "You breathe confusion."));
378 fire_ball(GF_CONFUSION, dir, damage, (plev > 35 ? -3 : -2));
381 if (!get_aim_dir(&dir)) return FALSE;
382 else msg_print(_("轟音のブレスを吐いた。", "You breathe sound."));
384 fire_ball(GF_SOUND, dir, damage, (plev > 35 ? -3 : -2));
387 if (!get_aim_dir(&dir)) return FALSE;
388 else msg_print(_("カオスのブレスを吐いた。", "You breathe chaos."));
390 fire_ball(GF_CHAOS, dir, damage, (plev > 35 ? -3 : -2));
393 if (!get_aim_dir(&dir)) return FALSE;
394 else msg_print(_("劣化のブレスを吐いた。", "You breathe disenchantment."));
396 fire_ball(GF_DISENCHANT, dir, damage, (plev > 35 ? -3 : -2));
399 if (!get_aim_dir(&dir)) return FALSE;
400 else msg_print(_("因果混乱のブレスを吐いた。", "You breathe nexus."));
402 fire_ball(GF_NEXUS, dir, damage, (plev > 35 ? -3 : -2));
405 if (!get_aim_dir(&dir)) return FALSE;
406 else msg_print(_("時間逆転のブレスを吐いた。", "You breathe time."));
408 fire_ball(GF_TIME, dir, damage, (plev > 35 ? -3 : -2));
411 if (!get_aim_dir(&dir)) return FALSE;
412 else msg_print(_("遅鈍のブレスを吐いた。", "You breathe inertia."));
414 fire_ball(GF_INERTIA, dir, damage, (plev > 35 ? -3 : -2));
417 if (!get_aim_dir(&dir)) return FALSE;
418 else msg_print(_("重力のブレスを吐いた。", "You breathe gravity."));
420 fire_ball(GF_GRAVITY, dir, damage, (plev > 35 ? -3 : -2));
423 if (!get_aim_dir(&dir)) return FALSE;
424 else msg_print(_("破片のブレスを吐いた。", "You breathe shards."));
426 fire_ball(GF_SHARDS, dir, damage, (plev > 35 ? -3 : -2));
429 if (!get_aim_dir(&dir)) return FALSE;
430 else msg_print(_("プラズマのブレスを吐いた。", "You breathe plasma."));
432 fire_ball(GF_PLASMA, dir, damage, (plev > 35 ? -3 : -2));
435 if (!get_aim_dir(&dir)) return FALSE;
436 else msg_print(_("フォースのブレスを吐いた。", "You breathe force."));
438 fire_ball(GF_FORCE, dir, damage, (plev > 35 ? -3 : -2));
441 if (!get_aim_dir(&dir)) return FALSE;
442 else msg_print(_("魔力のブレスを吐いた。", "You breathe mana."));
444 fire_ball(GF_MANA, dir, damage, (plev > 35 ? -3 : -2));
447 if (!get_aim_dir(&dir)) return FALSE;
448 else msg_print(_("放射能球を放った。", "You cast a ball of radiation."));
450 fire_ball(GF_NUKE, dir, damage, 2);
453 if (!get_aim_dir(&dir)) return FALSE;
454 else msg_print(_("放射性廃棄物のブレスを吐いた。", "You breathe toxic waste."));
456 fire_ball(GF_NUKE, dir, damage, (plev > 35 ? -3 : -2));
459 if (!get_aim_dir(&dir)) return FALSE;
460 else msg_print(_("純ログルスを放った。", "You invoke a raw Logrus."));
462 fire_ball(GF_CHAOS, dir, damage, 4);
465 if (!get_aim_dir(&dir)) return FALSE;
466 else msg_print(_("分解のブレスを吐いた。", "You breathe disintegration."));
468 fire_ball(GF_DISINTEGRATE, dir, damage, (plev > 35 ? -3 : -2));
471 if (!get_aim_dir(&dir)) return FALSE;
472 else msg_print(_("アシッド・ボールの呪文を唱えた。", "You cast an acid ball."));
474 fire_ball(GF_ACID, dir, damage, 2);
477 if (!get_aim_dir(&dir)) return FALSE;
478 else msg_print(_("サンダー・ボールの呪文を唱えた。", "You cast a lightning ball."));
480 fire_ball(GF_ELEC, dir, damage, 2);
483 if (!get_aim_dir(&dir)) return FALSE;
484 else msg_print(_("ファイア・ボールの呪文を唱えた。", "You cast a fire ball."));
486 fire_ball(GF_FIRE, dir, damage, 2);
489 if (!get_aim_dir(&dir)) return FALSE;
490 else msg_print(_("アイス・ボールの呪文を唱えた。", "You cast a frost ball."));
492 fire_ball(GF_COLD, dir, damage, 2);
495 if (!get_aim_dir(&dir)) return FALSE;
496 else msg_print(_("悪臭雲の呪文を唱えた。", "You cast a stinking cloud."));
498 fire_ball(GF_POIS, dir, damage, 2);
501 if (!get_aim_dir(&dir)) return FALSE;
502 else msg_print(_("地獄球の呪文を唱えた。", "You cast a nether ball."));
504 fire_ball(GF_NETHER, dir, damage, 2);
507 if (!get_aim_dir(&dir)) return FALSE;
508 else msg_print(_("流れるような身振りをした。", "You gesture fluidly."));
510 fire_ball(GF_WATER, dir, damage, 4);
513 if (!get_aim_dir(&dir)) return FALSE;
514 else msg_print(_("魔力の嵐の呪文を念じた。", "You invoke a mana storm."));
516 fire_ball(GF_MANA, dir, damage, 4);
519 if (!get_aim_dir(&dir)) return FALSE;
520 else msg_print(_("暗黒の嵐の呪文を念じた。", "You invoke a darkness storm."));
522 fire_ball(GF_DARK, dir, damage, 4);
525 if (!get_aim_dir(&dir)) return FALSE;
526 fire_ball_hide(GF_DRAIN_MANA, dir, randint1(plev*3)+plev, 0);
529 if (!get_aim_dir(&dir)) return FALSE;
530 fire_ball_hide(GF_MIND_BLAST, dir, damage, 0);
533 if (!get_aim_dir(&dir)) return FALSE;
534 fire_ball_hide(GF_BRAIN_SMASH, dir, damage, 0);
537 if (!get_aim_dir(&dir)) return FALSE;
538 fire_ball_hide(GF_CAUSE_1, dir, damage, 0);
541 if (!get_aim_dir(&dir)) return FALSE;
542 fire_ball_hide(GF_CAUSE_2, dir, damage, 0);
545 if (!get_aim_dir(&dir)) return FALSE;
546 fire_ball_hide(GF_CAUSE_3, dir, damage, 0);
549 if (!get_aim_dir(&dir)) return FALSE;
550 fire_ball_hide(GF_CAUSE_4, dir, damage, 0);
553 if (!get_aim_dir(&dir)) return FALSE;
554 else msg_print(_("アシッド・ボルトの呪文を唱えた。", "You cast an acid bolt."));
556 fire_bolt(GF_ACID, dir, damage);
559 if (!get_aim_dir(&dir)) return FALSE;
560 else msg_print(_("サンダー・ボルトの呪文を唱えた。", "You cast a lightning bolt."));
562 fire_bolt(GF_ELEC, dir, damage);
565 if (!get_aim_dir(&dir)) return FALSE;
566 else msg_print(_("ファイア・ボルトの呪文を唱えた。", "You cast a fire bolt."));
568 fire_bolt(GF_FIRE, dir, damage);
571 if (!get_aim_dir(&dir)) return FALSE;
572 else msg_print(_("アイス・ボルトの呪文を唱えた。", "You cast a frost bolt."));
574 fire_bolt(GF_COLD, dir, damage);
577 if (!get_aim_dir(&dir)) return FALSE;
578 else msg_print(_("スターバーストの呪文を念じた。", "You invoke a starburst."));
580 fire_ball(GF_LITE, dir, damage, 4);
583 if (!get_aim_dir(&dir)) return FALSE;
584 else msg_print(_("地獄の矢の呪文を唱えた。", "You cast a nether bolt."));
586 fire_bolt(GF_NETHER, dir, damage);
589 if (!get_aim_dir(&dir)) return FALSE;
590 else msg_print(_("ウォーター・ボルトの呪文を唱えた。", "You cast a water bolt."));
592 fire_bolt(GF_WATER, dir, damage);
595 if (!get_aim_dir(&dir)) return FALSE;
596 else msg_print(_("魔力の矢の呪文を唱えた。", "You cast a mana bolt."));
598 fire_bolt(GF_MANA, dir, damage);
601 if (!get_aim_dir(&dir)) return FALSE;
602 else msg_print(_("プラズマ・ボルトの呪文を唱えた。", "You cast a plasma bolt."));
604 fire_bolt(GF_PLASMA, dir, damage);
607 if (!get_aim_dir(&dir)) return FALSE;
608 else msg_print(_("極寒の矢の呪文を唱えた。", "You cast a ice bolt."));
610 fire_bolt(GF_ICE, dir, damage);
612 case MS_MAGIC_MISSILE:
613 if (!get_aim_dir(&dir)) return FALSE;
614 else msg_print(_("マジック・ミサイルの呪文を唱えた。", "You cast a magic missile."));
616 fire_bolt(GF_MISSILE, dir, damage);
619 if (!get_aim_dir(&dir)) return FALSE;
620 else msg_print(_("恐ろしげな幻覚を作り出した。", "You cast a fearful illusion."));
622 fear_monster(dir, plev+10);
625 if (!get_aim_dir(&dir)) return FALSE;
626 confuse_monster(dir, plev * 2);
629 if (!get_aim_dir(&dir)) return FALSE;
630 else msg_print(_("誘惑的な幻覚をつくり出した。", "You cast a mesmerizing illusion."));
632 confuse_monster(dir, plev * 2);
635 if (!get_aim_dir(&dir)) return FALSE;
636 slow_monster(dir, plev);
639 if (!get_aim_dir(&dir)) return FALSE;
640 sleep_monster(dir, plev);
643 (void)set_fast(randint1(20 + plev) + plev, FALSE);
647 if (!get_aim_dir(&dir)) return FALSE;
648 else msg_print(_("<破滅の手>を放った!", "You invoke the Hand of Doom!"));
650 fire_ball_hide(GF_HAND_DOOM, dir, 200, 0);
654 msg_print(_("自分の傷に念を集中した。", "You concentrate on your wounds!"));
655 (void)hp_player(plev*6);
660 msg_print(_("無傷の球の呪文を唱えた。", "You cast a Globe of Invulnerability."));
661 (void)set_invuln(randint1(7) + 7, FALSE);
664 teleport_player(10, 0L);
667 teleport_player(plev * 5, 0L);
671 if (damage == 1 || damage == 2)
672 msg_print(_("「『ザ・ワールド』!時は止まった!」", "You yell 'The World! Time has stopped!'"));
673 else if (damage == 3 || damage == 6)
674 msg_print(_("「時よ!」", "You yell 'Time!'"));
680 p_ptr->energy_need -= 1000 + (100 + randint1(200)+200)*TURNS_PER_TICK/10;
683 p_ptr->redraw |= (PR_MAP);
685 /* Update monsters */
686 p_ptr->update |= (PU_MONSTERS);
689 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
701 if (!target_set(TARGET_KILL)) return FALSE;
702 if (!cave[target_row][target_col].m_idx) break;
703 if (!player_has_los_bold(target_row, target_col)) break;
704 if (!projectable(py, px, target_row, target_col)) break;
705 m_ptr = &m_list[cave[target_row][target_col].m_idx];
706 r_ptr = &r_info[m_ptr->r_idx];
707 monster_desc(m_name, m_ptr, 0);
708 if (r_ptr->flagsr & RFR_RES_TELE)
710 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
712 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
713 msg_format(_("%sには効果がなかった!", "%s is unaffected!"), m_name);
717 else if (r_ptr->level > randint1(100))
719 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
720 msg_format(_("%sには耐性がある!", "%s resists!"), m_name);
725 msg_format(_("%sを引き戻した。", "You command %s to return."), m_name);
727 teleport_monster_to(cave[target_row][target_col].m_idx, py, px, 100, TELEPORT_PASSIVE);
731 if (!get_aim_dir(&dir)) return FALSE;
733 (void)fire_beam(GF_AWAY_ALL, dir, plev);
742 if (!target_set(TARGET_KILL)) return FALSE;
743 target_m_idx = cave[target_row][target_col].m_idx;
744 if (!target_m_idx) break;
745 if (!player_has_los_bold(target_row, target_col)) break;
746 if (!projectable(py, px, target_row, target_col)) break;
747 m_ptr = &m_list[target_m_idx];
748 r_ptr = &r_info[m_ptr->r_idx];
749 monster_desc(m_name, m_ptr, 0);
750 msg_format(_("%^sの足を指さした。", "You gesture at %^s's feet."), m_name);
752 if ((r_ptr->flagsr & (RFR_EFF_RES_NEXU_MASK | RFR_RES_TELE)) ||
753 (r_ptr->flags1 & RF1_QUESTOR) || (r_ptr->level + randint1(50) > plev + randint1(60)))
755 msg_print(_("しかし効果がなかった!", "%^s is unaffected!"));
757 else teleport_level(target_m_idx);
761 if (!get_aim_dir(&dir)) return FALSE;
762 else msg_print(_("光の剣を放った。", "You throw a psycho-spear."));
763 (void)fire_beam(GF_PSY_SPEAR, dir, damage);
766 msg_print(_("暗闇の中で手を振った。", "You gesture in shadow."));
767 (void)unlite_area(10, 3);
770 if (!target_set(TARGET_KILL)) return FALSE;
771 msg_print(_("呪文を唱えて邪悪に微笑んだ。", "You cast a spell and cackles evilly."));
772 trap_creation(target_row, target_col);
775 msg_print(_("しかし何も起きなかった。", "Nothing happen."));
778 msg_print(_("死者復活の呪文を唱えた。", "You cast a animate dead."));
779 (void)animate_dead(0, py, px);
784 if (!target_set(TARGET_KILL)) return FALSE;
786 msg_print(_("援軍を召喚した。", "You summon minions."));
787 for (k = 0;k < 4; k++)
789 (void)summon_kin_player(plev, target_row, target_col, (PM_FORCE_PET | PM_ALLOW_GROUP));
796 int max_cyber = (dun_level / 50) + randint1(3);
797 if (!target_set(TARGET_KILL)) return FALSE;
798 msg_print(_("サイバーデーモンを召喚した!", "You summon Cyberdemons!"));
799 if (max_cyber > 4) max_cyber = 4;
800 for (k = 0;k < max_cyber; k++)
801 summon_specific(-1, target_row, target_col, plev, SUMMON_CYBER, mode);
807 if (!target_set(TARGET_KILL)) return FALSE;
808 msg_print(_("仲間を召喚した。", "You summon help."));
809 for (k = 0;k < 1; k++)
810 summon_specific(-1, target_row, target_col, plev, 0, (mode | u_mode));
816 if (!target_set(TARGET_KILL)) return FALSE;
817 msg_print(_("モンスターを召喚した!", "You summon monsters!"));
818 for (k = 0;k < 6; k++)
819 summon_specific(-1, target_row, target_col, plev, 0, (mode | u_mode));
825 if (!target_set(TARGET_KILL)) return FALSE;
826 msg_print(_("アリを召喚した。", "You summon ants."));
827 for (k = 0;k < 6; k++)
828 summon_specific(-1, target_row, target_col, plev, SUMMON_ANT, mode);
834 if (!target_set(TARGET_KILL)) return FALSE;
835 msg_print(_("蜘蛛を召喚した。", "You summon spiders."));
836 for (k = 0;k < 6; k++)
837 summon_specific(-1, target_row, target_col, plev, SUMMON_SPIDER, mode);
843 if (!target_set(TARGET_KILL)) return FALSE;
844 msg_print(_("ハウンドを召喚した。", "You summon hounds."));
845 for (k = 0;k < 4; k++)
846 summon_specific(-1, target_row, target_col, plev, SUMMON_HOUND, mode);
852 if (!target_set(TARGET_KILL)) return FALSE;
853 msg_print(_("ヒドラを召喚した。", "You summon hydras."));
854 for (k = 0;k < 4; k++)
855 summon_specific(-1, target_row, target_col, plev, SUMMON_HYDRA, mode);
861 if (!target_set(TARGET_KILL)) return FALSE;
862 msg_print(_("天使を召喚した!", "You summon angel!"));
863 for (k = 0;k < 1; k++)
864 summon_specific(-1, target_row, target_col, plev, SUMMON_ANGEL, mode);
870 if (!target_set(TARGET_KILL)) return FALSE;
871 msg_print(_("混沌の宮廷から悪魔を召喚した!", "You summon a demon from the Courts of Chaos!"));
872 for (k = 0;k < 1; k++)
873 summon_specific(-1, target_row, target_col, plev, SUMMON_DEMON, (mode | u_mode));
879 if (!target_set(TARGET_KILL)) return FALSE;
880 msg_print(_("アンデッドの強敵を召喚した!", "You summon an undead adversary!"));
881 for (k = 0;k < 1; k++)
882 summon_specific(-1, target_row, target_col, plev, SUMMON_UNDEAD, (mode | u_mode));
888 if (!target_set(TARGET_KILL)) return FALSE;
889 msg_print(_("ドラゴンを召喚した!", "You summon dragon!"));
890 for (k = 0;k < 1; k++)
891 summon_specific(-1, target_row, target_col, plev, SUMMON_DRAGON, (mode | u_mode));
897 if (!target_set(TARGET_KILL)) return FALSE;
898 msg_print(_("強力なアンデッドを召喚した!", "You summon greater undead!"));
899 for (k = 0;k < 6; k++)
900 summon_specific(-1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode));
906 if (!target_set(TARGET_KILL)) return FALSE;
907 msg_print(_("古代ドラゴンを召喚した!", "You summon ancient dragons!"));
908 for (k = 0;k < 4; k++)
909 summon_specific(-1, target_row, target_col, plev, SUMMON_HI_DRAGON, (mode | u_mode));
915 if (!target_set(TARGET_KILL)) return FALSE;
916 msg_print(_("アンバーの王族を召喚した!", "You summon Lords of Amber!"));
917 for (k = 0;k < 4; k++)
918 summon_specific(-1, target_row, target_col, plev, SUMMON_AMBERITES, (mode | PM_ALLOW_UNIQUE));
924 if (!target_set(TARGET_KILL)) return FALSE;
925 msg_print(_("特別な強敵を召喚した!", "You summon special opponents!"));
926 for (k = 0;k < 4; k++)
927 if (summon_specific(-1, target_row, target_col, plev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE))) count++;
928 for (k = count;k < 4; k++)
929 summon_specific(-1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode));
941 * @brief ものまねコマンドのメインルーチン /
942 * do_cmd_cast calls this function if the player's class is 'imitator'.
943 * @param baigaesi TRUEならば倍返し上の処理として行う
944 * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。
946 * If a valid spell is chosen, saves it in '*sn' and returns TRUE
947 * If the user hits escape, returns FALSE, and set '*sn' to -1
948 * If there are no legal choices, returns FALSE, and sets '*sn' to -2
950 * The "prompt" should be "cast", "recite", or "study"
951 * The "known" should be TRUE for cast/pray, FALSE for study
953 * nb: This function has a (trivial) display bug which will be obvious
954 * when you run it. It's probably easy to fix but I haven't tried,
957 bool do_cmd_mane(bool baigaesi)
962 int plev = p_ptr->lev;
967 /* not if confused */
970 msg_print(_("混乱していて集中できない!", "You are too confused!"));
974 if (!p_ptr->mane_num)
976 msg_print(_("まねられるものが何もない!", "You don't remember any action!"));
981 if (!get_mane_power(&n, baigaesi)) return FALSE;
983 spell = monster_powers[p_ptr->mane_spell[n]];
985 /* Spell failure chance */
986 chance = spell.manefail;
988 /* Reduce failure rate by "effective" level adjustment */
989 if (plev > spell.level) chance -= 3 * (plev - spell.level);
991 /* Reduce failure rate by 1 stat and DEX adjustment */
992 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[spell.use_stat]] + adj_mag_stat[p_ptr->stat_ind[A_DEX]] - 2) / 2;
994 if (spell.manedam) chance = chance * damage / spell.manedam;
996 chance += p_ptr->to_m_chance;
998 /* Extract the minimum failure rate */
999 minfail = adj_mag_fail[p_ptr->stat_ind[spell.use_stat]];
1001 /* Minimum failure rate */
1002 if (chance < minfail) chance = minfail;
1004 /* Stunning makes spells harder */
1005 if (p_ptr->stun > 50) chance += 25;
1006 else if (p_ptr->stun) chance += 15;
1008 /* Always a 5 percent chance of working */
1009 if (chance > 95) chance = 95;
1012 if (randint0(100) < chance)
1014 if (flush_failure) flush();
1015 msg_print(_("ものまねに失敗した!", "You failed to concentrate hard enough!"));
1022 /* Cast the spell */
1023 cast = use_mane(p_ptr->mane_spell[n]);
1025 if (!cast) return FALSE;
1029 for (j = n; j < p_ptr->mane_num;j++)
1031 p_ptr->mane_spell[j] = p_ptr->mane_spell[j+1];
1032 p_ptr->mane_dam[j] = p_ptr->mane_dam[j+1];
1039 p_ptr->redraw |= (PR_IMITATION);
1040 p_ptr->window |= (PW_PLAYER);
1041 p_ptr->window |= (PW_SPELL);