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, HIT_POINT 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, (int)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 * (baigaesi ? p_ptr->mane_dam[i] * 2 : 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 = (char)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 PLAYER_LEVEL plev = p_ptr->lev;
281 BIT_FLAGS mode = (PM_ALLOW_GROUP | PM_FORCE_PET);
282 BIT_FLAGS u_mode = 0L;
284 if (randint1(50+plev) < plev/10) u_mode = PM_ALLOW_UNIQUE;
292 msg_print(_("かん高い金切り声をあげた。", "You make a high pitched shriek."));
293 aggravate_monsters(0);
303 if (!target_set(TARGET_KILL)) return FALSE;
304 m_idx = cave[target_row][target_col].m_idx;
306 if (!player_has_los_bold(target_row, target_col)) break;
307 if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
308 dispel_monster_status(m_idx);
313 if (!get_aim_dir(&dir)) return FALSE;
314 else msg_print(_("ロケットを発射した。", "You fire a rocket."));
315 fire_rocket(GF_ROCKET, dir, damage, 2);
319 if (!get_aim_dir(&dir)) return FALSE;
320 else msg_print(_("矢を放った。", "You fire an arrow."));
321 fire_bolt(GF_ARROW, dir, damage);
334 if (!get_aim_dir(&dir)) return FALSE;
335 else msg_print(_("酸のブレスを吐いた。", "You breathe acid."));
336 fire_breath(GF_ACID, dir, damage, (plev > 35 ? 3 : 2));
340 if (!get_aim_dir(&dir)) return FALSE;
341 else msg_print(_("稲妻のブレスを吐いた。", "You breathe lightning."));
342 fire_breath(GF_ELEC, dir, damage, (plev > 35 ? 3 : 2));
346 if (!get_aim_dir(&dir)) return FALSE;
347 else msg_print(_("火炎のブレスを吐いた。", "You breathe fire."));
348 fire_breath(GF_FIRE, dir, damage, (plev > 35 ? 3 : 2));
352 if (!get_aim_dir(&dir)) return FALSE;
353 else msg_print(_("冷気のブレスを吐いた。", "You breathe frost."));
354 fire_breath(GF_COLD, dir, damage, (plev > 35 ? 3 : 2));
358 if (!get_aim_dir(&dir)) return FALSE;
359 else msg_print(_("ガスのブレスを吐いた。", "You breathe gas."));
360 fire_breath(GF_POIS, dir, damage, (plev > 35 ? 3 : 2));
364 if (!get_aim_dir(&dir)) return FALSE;
365 else msg_print(_("地獄のブレスを吐いた。", "You breathe nether."));
366 fire_breath(GF_NETHER, dir, damage, (plev > 35 ? 3 : 2));
370 if (!get_aim_dir(&dir)) return FALSE;
371 else msg_print(_("閃光のブレスを吐いた。", "You breathe light."));
372 fire_breath(GF_LITE, dir, damage, (plev > 35 ? 3 : 2));
376 if (!get_aim_dir(&dir)) return FALSE;
377 else msg_print(_("暗黒のブレスを吐いた。", "You breathe darkness."));
378 fire_breath(GF_DARK, dir, damage, (plev > 35 ? 3 : 2));
382 if (!get_aim_dir(&dir)) return FALSE;
383 else msg_print(_("混乱のブレスを吐いた。", "You breathe confusion."));
384 fire_breath(GF_CONFUSION, dir, damage, (plev > 35 ? 3 : 2));
388 if (!get_aim_dir(&dir)) return FALSE;
389 else msg_print(_("轟音のブレスを吐いた。", "You breathe sound."));
390 fire_breath(GF_SOUND, dir, damage, (plev > 35 ? 3 : 2));
394 if (!get_aim_dir(&dir)) return FALSE;
395 else msg_print(_("カオスのブレスを吐いた。", "You breathe chaos."));
396 fire_breath(GF_CHAOS, dir, damage, (plev > 35 ? 3 : 2));
400 if (!get_aim_dir(&dir)) return FALSE;
401 else msg_print(_("劣化のブレスを吐いた。", "You breathe disenchantment."));
402 fire_breath(GF_DISENCHANT, dir, damage, (plev > 35 ? 3 : 2));
406 if (!get_aim_dir(&dir)) return FALSE;
407 else msg_print(_("因果混乱のブレスを吐いた。", "You breathe nexus."));
409 fire_breath(GF_NEXUS, dir, damage, (plev > 35 ? 3 : 2));
412 if (!get_aim_dir(&dir)) return FALSE;
413 else msg_print(_("時間逆転のブレスを吐いた。", "You breathe time."));
415 fire_breath(GF_TIME, dir, damage, (plev > 35 ? 3 : 2));
418 if (!get_aim_dir(&dir)) return FALSE;
419 else msg_print(_("遅鈍のブレスを吐いた。", "You breathe inertia."));
421 fire_breath(GF_INERTIAL, dir, damage, (plev > 35 ? 3 : 2));
424 if (!get_aim_dir(&dir)) return FALSE;
425 else msg_print(_("重力のブレスを吐いた。", "You breathe gravity."));
427 fire_breath(GF_GRAVITY, dir, damage, (plev > 35 ? 3 : 2));
430 if (!get_aim_dir(&dir)) return FALSE;
431 else msg_print(_("破片のブレスを吐いた。", "You breathe shards."));
433 fire_breath(GF_SHARDS, dir, damage, (plev > 35 ? 3 : 2));
436 if (!get_aim_dir(&dir)) return FALSE;
437 else msg_print(_("プラズマのブレスを吐いた。", "You breathe plasma."));
439 fire_breath(GF_PLASMA, dir, damage, (plev > 35 ? 3 : 2));
442 if (!get_aim_dir(&dir)) return FALSE;
443 else msg_print(_("フォースのブレスを吐いた。", "You breathe force."));
445 fire_breath(GF_FORCE, dir, damage, (plev > 35 ? 3 : 2));
448 if (!get_aim_dir(&dir)) return FALSE;
449 else msg_print(_("魔力のブレスを吐いた。", "You breathe mana."));
451 fire_breath(GF_MANA, dir, damage, (plev > 35 ? 3 : 2));
454 if (!get_aim_dir(&dir)) return FALSE;
455 else msg_print(_("放射能球を放った。", "You cast a ball of radiation."));
457 fire_ball(GF_NUKE, dir, damage, 2);
460 if (!get_aim_dir(&dir)) return FALSE;
461 else msg_print(_("放射性廃棄物のブレスを吐いた。", "You breathe toxic waste."));
463 fire_breath(GF_NUKE, dir, damage, (plev > 35 ? 3 : 2));
466 if (!get_aim_dir(&dir)) return FALSE;
467 else msg_print(_("純ログルスを放った。", "You invoke a raw Logrus."));
469 fire_ball(GF_CHAOS, dir, damage, 4);
472 if (!get_aim_dir(&dir)) return FALSE;
473 else msg_print(_("分解のブレスを吐いた。", "You breathe disintegration."));
475 fire_breath(GF_DISINTEGRATE, dir, damage, (plev > 35 ? 3 : 2));
478 if (!get_aim_dir(&dir)) return FALSE;
479 else msg_print(_("アシッド・ボールの呪文を唱えた。", "You cast an acid ball."));
481 fire_ball(GF_ACID, dir, damage, 2);
484 if (!get_aim_dir(&dir)) return FALSE;
485 else msg_print(_("サンダー・ボールの呪文を唱えた。", "You cast a lightning ball."));
487 fire_ball(GF_ELEC, dir, damage, 2);
490 if (!get_aim_dir(&dir)) return FALSE;
491 else msg_print(_("ファイア・ボールの呪文を唱えた。", "You cast a fire ball."));
493 fire_ball(GF_FIRE, dir, damage, 2);
496 if (!get_aim_dir(&dir)) return FALSE;
497 else msg_print(_("アイス・ボールの呪文を唱えた。", "You cast a frost ball."));
499 fire_ball(GF_COLD, dir, damage, 2);
502 if (!get_aim_dir(&dir)) return FALSE;
503 else msg_print(_("悪臭雲の呪文を唱えた。", "You cast a stinking cloud."));
505 fire_ball(GF_POIS, dir, damage, 2);
508 if (!get_aim_dir(&dir)) return FALSE;
509 else msg_print(_("地獄球の呪文を唱えた。", "You cast a nether ball."));
511 fire_ball(GF_NETHER, dir, damage, 2);
514 if (!get_aim_dir(&dir)) return FALSE;
515 else msg_print(_("流れるような身振りをした。", "You gesture fluidly."));
517 fire_ball(GF_WATER, dir, damage, 4);
520 if (!get_aim_dir(&dir)) return FALSE;
521 else msg_print(_("魔力の嵐の呪文を念じた。", "You invoke a mana storm."));
523 fire_ball(GF_MANA, dir, damage, 4);
526 if (!get_aim_dir(&dir)) return FALSE;
527 else msg_print(_("暗黒の嵐の呪文を念じた。", "You invoke a darkness storm."));
529 fire_ball(GF_DARK, dir, damage, 4);
532 if (!get_aim_dir(&dir)) return FALSE;
533 fire_ball_hide(GF_DRAIN_MANA, dir, randint1(plev*3)+plev, 0);
536 if (!get_aim_dir(&dir)) return FALSE;
537 fire_ball_hide(GF_MIND_BLAST, dir, damage, 0);
540 if (!get_aim_dir(&dir)) return FALSE;
541 fire_ball_hide(GF_BRAIN_SMASH, dir, damage, 0);
544 if (!get_aim_dir(&dir)) return FALSE;
545 fire_ball_hide(GF_CAUSE_1, dir, damage, 0);
548 if (!get_aim_dir(&dir)) return FALSE;
549 fire_ball_hide(GF_CAUSE_2, dir, damage, 0);
552 if (!get_aim_dir(&dir)) return FALSE;
553 fire_ball_hide(GF_CAUSE_3, dir, damage, 0);
556 if (!get_aim_dir(&dir)) return FALSE;
557 fire_ball_hide(GF_CAUSE_4, dir, damage, 0);
560 if (!get_aim_dir(&dir)) return FALSE;
561 else msg_print(_("アシッド・ボルトの呪文を唱えた。", "You cast an acid bolt."));
563 fire_bolt(GF_ACID, dir, damage);
566 if (!get_aim_dir(&dir)) return FALSE;
567 else msg_print(_("サンダー・ボルトの呪文を唱えた。", "You cast a lightning bolt."));
569 fire_bolt(GF_ELEC, dir, damage);
572 if (!get_aim_dir(&dir)) return FALSE;
573 else msg_print(_("ファイア・ボルトの呪文を唱えた。", "You cast a fire bolt."));
575 fire_bolt(GF_FIRE, dir, damage);
578 if (!get_aim_dir(&dir)) return FALSE;
579 else msg_print(_("アイス・ボルトの呪文を唱えた。", "You cast a frost bolt."));
581 fire_bolt(GF_COLD, dir, damage);
584 if (!get_aim_dir(&dir)) return FALSE;
585 else msg_print(_("スターバーストの呪文を念じた。", "You invoke a starburst."));
587 fire_ball(GF_LITE, dir, damage, 4);
590 if (!get_aim_dir(&dir)) return FALSE;
591 else msg_print(_("地獄の矢の呪文を唱えた。", "You cast a nether bolt."));
593 fire_bolt(GF_NETHER, dir, damage);
596 if (!get_aim_dir(&dir)) return FALSE;
597 else msg_print(_("ウォーター・ボルトの呪文を唱えた。", "You cast a water bolt."));
599 fire_bolt(GF_WATER, dir, damage);
602 if (!get_aim_dir(&dir)) return FALSE;
603 else msg_print(_("魔力の矢の呪文を唱えた。", "You cast a mana bolt."));
605 fire_bolt(GF_MANA, dir, damage);
608 if (!get_aim_dir(&dir)) return FALSE;
609 else msg_print(_("プラズマ・ボルトの呪文を唱えた。", "You cast a plasma bolt."));
611 fire_bolt(GF_PLASMA, dir, damage);
614 if (!get_aim_dir(&dir)) return FALSE;
615 else msg_print(_("極寒の矢の呪文を唱えた。", "You cast a ice bolt."));
617 fire_bolt(GF_ICE, dir, damage);
619 case MS_MAGIC_MISSILE:
620 if (!get_aim_dir(&dir)) return FALSE;
621 else msg_print(_("マジック・ミサイルの呪文を唱えた。", "You cast a magic missile."));
623 fire_bolt(GF_MISSILE, dir, damage);
626 if (!get_aim_dir(&dir)) return FALSE;
627 else msg_print(_("恐ろしげな幻覚を作り出した。", "You cast a fearful illusion."));
629 fear_monster(dir, plev+10);
632 if (!get_aim_dir(&dir)) return FALSE;
633 confuse_monster(dir, plev * 2);
636 if (!get_aim_dir(&dir)) return FALSE;
637 else msg_print(_("誘惑的な幻覚をつくり出した。", "You cast a mesmerizing illusion."));
639 confuse_monster(dir, plev * 2);
642 if (!get_aim_dir(&dir)) return FALSE;
643 slow_monster(dir, plev);
646 if (!get_aim_dir(&dir)) return FALSE;
647 sleep_monster(dir, plev);
650 (void)set_fast(randint1(20 + plev) + plev, FALSE);
654 if (!get_aim_dir(&dir)) return FALSE;
655 else msg_print(_("<破滅の手>を放った!", "You invoke the Hand of Doom!"));
657 fire_ball_hide(GF_HAND_DOOM, dir, 200, 0);
661 msg_print(_("自分の傷に念を集中した。", "You concentrate on your wounds!"));
662 (void)hp_player(plev*6);
667 msg_print(_("無傷の球の呪文を唱えた。", "You cast a Globe of Invulnerability."));
668 (void)set_invuln(randint1(7) + 7, FALSE);
671 teleport_player(10, 0L);
674 teleport_player(plev * 5, 0L);
678 if (damage == 1 || damage == 2)
679 msg_print(_("「『ザ・ワールド』!時は止まった!」", "You yell 'The World! Time has stopped!'"));
680 else if (damage == 3 || damage == 6)
681 msg_print(_("「時よ!」", "You yell 'Time!'"));
687 p_ptr->energy_need -= 1000 + (100 + randint1(200)+200)*TURNS_PER_TICK/10;
690 p_ptr->redraw |= (PR_MAP);
692 /* Update monsters */
693 p_ptr->update |= (PU_MONSTERS);
696 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
708 if (!target_set(TARGET_KILL)) return FALSE;
709 if (!cave[target_row][target_col].m_idx) break;
710 if (!player_has_los_bold(target_row, target_col)) break;
711 if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
712 m_ptr = &m_list[cave[target_row][target_col].m_idx];
713 r_ptr = &r_info[m_ptr->r_idx];
714 monster_desc(m_name, m_ptr, 0);
715 if (r_ptr->flagsr & RFR_RES_TELE)
717 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
719 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
720 msg_format(_("%sには効果がなかった!", "%s is unaffected!"), m_name);
724 else if (r_ptr->level > randint1(100))
726 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
727 msg_format(_("%sには耐性がある!", "%s resists!"), m_name);
732 msg_format(_("%sを引き戻した。", "You command %s to return."), m_name);
734 teleport_monster_to(cave[target_row][target_col].m_idx, p_ptr->y, p_ptr->x, 100, TELEPORT_PASSIVE);
738 if (!get_aim_dir(&dir)) return FALSE;
740 (void)fire_beam(GF_AWAY_ALL, dir, plev);
749 if (!target_set(TARGET_KILL)) return FALSE;
750 target_m_idx = cave[target_row][target_col].m_idx;
751 if (!target_m_idx) break;
752 if (!player_has_los_bold(target_row, target_col)) break;
753 if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
754 m_ptr = &m_list[target_m_idx];
755 r_ptr = &r_info[m_ptr->r_idx];
756 monster_desc(m_name, m_ptr, 0);
757 msg_format(_("%^sの足を指さした。", "You gesture at %^s's feet."), m_name);
759 if ((r_ptr->flagsr & (RFR_EFF_RES_NEXU_MASK | RFR_RES_TELE)) ||
760 (r_ptr->flags1 & RF1_QUESTOR) || (r_ptr->level + randint1(50) > plev + randint1(60)))
762 msg_print(_("しかし効果がなかった!", "%^s is unaffected!"));
764 else teleport_level(target_m_idx);
768 if (!get_aim_dir(&dir)) return FALSE;
769 else msg_print(_("光の剣を放った。", "You throw a psycho-spear."));
770 (void)fire_beam(GF_PSY_SPEAR, dir, damage);
773 msg_print(_("暗闇の中で手を振った。", "You gesture in shadow."));
774 (void)unlite_area(10, 3);
777 if (!target_set(TARGET_KILL)) return FALSE;
778 msg_print(_("呪文を唱えて邪悪に微笑んだ。", "You cast a spell and cackles evilly."));
779 trap_creation(target_row, target_col);
782 msg_print(_("しかし何も起きなかった。", "Nothing happen."));
785 msg_print(_("死者復活の呪文を唱えた。", "You cast a animate dead."));
786 (void)animate_dead(0, p_ptr->y, p_ptr->x);
791 if (!target_set(TARGET_KILL)) return FALSE;
793 msg_print(_("援軍を召喚した。", "You summon minions."));
794 for (k = 0;k < 4; k++)
796 (void)summon_kin_player(plev, target_row, target_col, (PM_FORCE_PET | PM_ALLOW_GROUP));
803 int max_cyber = (dun_level / 50) + randint1(3);
804 if (!target_set(TARGET_KILL)) return FALSE;
805 msg_print(_("サイバーデーモンを召喚した!", "You summon Cyberdemons!"));
806 if (max_cyber > 4) max_cyber = 4;
807 for (k = 0;k < max_cyber; k++)
808 summon_specific(-1, target_row, target_col, plev, SUMMON_CYBER, mode);
814 if (!target_set(TARGET_KILL)) return FALSE;
815 msg_print(_("仲間を召喚した。", "You summon help."));
816 for (k = 0;k < 1; k++)
817 summon_specific(-1, target_row, target_col, plev, 0, (mode | u_mode));
823 if (!target_set(TARGET_KILL)) return FALSE;
824 msg_print(_("モンスターを召喚した!", "You summon monsters!"));
825 for (k = 0;k < 6; k++)
826 summon_specific(-1, target_row, target_col, plev, 0, (mode | u_mode));
832 if (!target_set(TARGET_KILL)) return FALSE;
833 msg_print(_("アリを召喚した。", "You summon ants."));
834 for (k = 0;k < 6; k++)
835 summon_specific(-1, target_row, target_col, plev, SUMMON_ANT, mode);
841 if (!target_set(TARGET_KILL)) return FALSE;
842 msg_print(_("蜘蛛を召喚した。", "You summon spiders."));
843 for (k = 0;k < 6; k++)
844 summon_specific(-1, target_row, target_col, plev, SUMMON_SPIDER, mode);
850 if (!target_set(TARGET_KILL)) return FALSE;
851 msg_print(_("ハウンドを召喚した。", "You summon hounds."));
852 for (k = 0;k < 4; k++)
853 summon_specific(-1, target_row, target_col, plev, SUMMON_HOUND, mode);
859 if (!target_set(TARGET_KILL)) return FALSE;
860 msg_print(_("ヒドラを召喚した。", "You summon hydras."));
861 for (k = 0;k < 4; k++)
862 summon_specific(-1, target_row, target_col, plev, SUMMON_HYDRA, mode);
868 if (!target_set(TARGET_KILL)) return FALSE;
869 msg_print(_("天使を召喚した!", "You summon angel!"));
870 for (k = 0;k < 1; k++)
871 summon_specific(-1, target_row, target_col, plev, SUMMON_ANGEL, mode);
877 if (!target_set(TARGET_KILL)) return FALSE;
878 msg_print(_("混沌の宮廷から悪魔を召喚した!", "You summon a demon from the Courts of Chaos!"));
879 for (k = 0;k < 1; k++)
880 summon_specific(-1, target_row, target_col, plev, SUMMON_DEMON, (mode | u_mode));
886 if (!target_set(TARGET_KILL)) return FALSE;
887 msg_print(_("アンデッドの強敵を召喚した!", "You summon an undead adversary!"));
888 for (k = 0;k < 1; k++)
889 summon_specific(-1, target_row, target_col, plev, SUMMON_UNDEAD, (mode | u_mode));
895 if (!target_set(TARGET_KILL)) return FALSE;
896 msg_print(_("ドラゴンを召喚した!", "You summon dragon!"));
897 for (k = 0;k < 1; k++)
898 summon_specific(-1, target_row, target_col, plev, SUMMON_DRAGON, (mode | u_mode));
904 if (!target_set(TARGET_KILL)) return FALSE;
905 msg_print(_("強力なアンデッドを召喚した!", "You summon greater undead!"));
906 for (k = 0;k < 6; k++)
907 summon_specific(-1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode));
913 if (!target_set(TARGET_KILL)) return FALSE;
914 msg_print(_("古代ドラゴンを召喚した!", "You summon ancient dragons!"));
915 for (k = 0;k < 4; k++)
916 summon_specific(-1, target_row, target_col, plev, SUMMON_HI_DRAGON, (mode | u_mode));
922 if (!target_set(TARGET_KILL)) return FALSE;
923 msg_print(_("アンバーの王族を召喚した!", "You summon Lords of Amber!"));
924 for (k = 0;k < 4; k++)
925 summon_specific(-1, target_row, target_col, plev, SUMMON_AMBERITES, (mode | PM_ALLOW_UNIQUE));
931 if (!target_set(TARGET_KILL)) return FALSE;
932 msg_print(_("特別な強敵を召喚した!", "You summon special opponents!"));
933 for (k = 0;k < 4; k++)
934 if (summon_specific(-1, target_row, target_col, plev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE))) count++;
935 for (k = count;k < 4; k++)
936 summon_specific(-1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode));
948 * @brief ものまねコマンドのメインルーチン /
949 * do_cmd_cast calls this function if the player's class is 'imitator'.
950 * @param baigaesi TRUEならば倍返し上の処理として行う
951 * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。
953 * If a valid spell is chosen, saves it in '*sn' and returns TRUE
954 * If the user hits escape, returns FALSE, and set '*sn' to -1
955 * If there are no legal choices, returns FALSE, and sets '*sn' to -2
957 * The "prompt" should be "cast", "recite", or "study"
958 * The "known" should be TRUE for cast/pray, FALSE for study
960 * nb: This function has a (trivial) display bug which will be obvious
961 * when you run it. It's probably easy to fix but I haven't tried,
964 bool do_cmd_mane(bool baigaesi)
969 int plev = p_ptr->lev;
974 /* not if confused */
977 msg_print(_("混乱していて集中できない!", "You are too confused!"));
981 if (!p_ptr->mane_num)
983 msg_print(_("まねられるものが何もない!", "You don't remember any action!"));
988 if (!get_mane_power(&n, baigaesi)) return FALSE;
990 spell = monster_powers[p_ptr->mane_spell[n]];
992 /* Spell failure chance */
993 chance = spell.manefail;
995 /* Reduce failure rate by "effective" level adjustment */
996 if (plev > spell.level) chance -= 3 * (plev - spell.level);
998 /* Reduce failure rate by 1 stat and DEX adjustment */
999 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[spell.use_stat]] + adj_mag_stat[p_ptr->stat_ind[A_DEX]] - 2) / 2;
1001 if (spell.manedam) chance = chance * damage / spell.manedam;
1003 chance += p_ptr->to_m_chance;
1005 /* Extract the minimum failure rate */
1006 minfail = adj_mag_fail[p_ptr->stat_ind[spell.use_stat]];
1008 /* Minimum failure rate */
1009 if (chance < minfail) chance = minfail;
1011 /* Stunning makes spells harder */
1012 if (p_ptr->stun > 50) chance += 25;
1013 else if (p_ptr->stun) chance += 15;
1015 /* Always a 5 percent chance of working */
1016 if (chance > 95) chance = 95;
1019 if (randint0(100) < chance)
1021 if (flush_failure) flush();
1022 msg_print(_("ものまねに失敗した!", "You failed to concentrate hard enough!"));
1029 /* Cast the spell */
1030 cast = use_mane(p_ptr->mane_spell[n]);
1032 if (!cast) return FALSE;
1036 for (j = n; j < p_ptr->mane_num;j++)
1038 p_ptr->mane_spell[j] = p_ptr->mane_spell[j+1];
1039 p_ptr->mane_dam[j] = p_ptr->mane_dam[j+1];
1043 p_ptr->energy_use = 100;
1046 p_ptr->redraw |= (PR_IMITATION);
1047 p_ptr->window |= (PW_PLAYER);
1048 p_ptr->window |= (PW_SPELL);