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 PLAYER_LEVEL plev = p_ptr->lev;
27 cptr s_dam = _("損傷:", "dam ");
28 cptr s_dur = _("期間:", "dur ");
29 cptr s_range = _("範囲:", "range ");
30 cptr s_heal = _("回復:", "heal ");
34 if ((power > 2 && power < 41) || (power > 41 && power < 59) || (power == 75))
35 sprintf(p, " %s%d", s_dam, (int)dam);
41 sprintf(p, " %sd%d+%d", s_heal, plev * 3, plev);
44 sprintf(p, " %sd%d+%d", s_dur, 20+plev, plev);
47 sprintf(p, " %s%d", s_heal, plev*6);
50 sprintf(p, " %sd7+7", s_dur);
53 sprintf(p, " %s10", s_range);
56 sprintf(p, " %s%d", s_range, plev * 5);
59 sprintf(p, " %s5", s_range);
69 * @brief どのものまねを発動するか選択する処理 /
70 * Allow user to choose a imitation.
71 * @param sn 実行したものまねのIDを返す参照ポインタ(キャンセルなどの場合-1を返す)
72 * @param baigaesi TRUEならば倍返し上の処理として行う
73 * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。
75 * If a valid spell is chosen, saves it in '*sn' and returns TRUE
76 * If the user hits escape, returns FALSE, and set '*sn' to -1
77 * If there are no legal choices, returns FALSE, and sets '*sn' to -2
79 * The "prompt" should be "cast", "recite", or "study"
80 * The "known" should be TRUE for cast/pray, FALSE for study
82 * nb: This function has a (trivial) display bug which will be obvious
83 * when you run it. It's probably easy to fix but I haven't tried,
86 static int get_mane_power(int *sn, bool baigaesi)
93 PLAYER_LEVEL plev = p_ptr->lev;
99 cptr p = _("能力", "power");
104 /* Assume cancelled */
107 /* Nothing chosen yet */
113 num = p_ptr->mane_num;
115 /* Build a prompt (accept all spells) */
116 (void)strnfmt(out_val, 78,
117 _("(%c-%c, '*'で一覧, ESC) どの%sをまねますか?", "(%c-%c, *=List, ESC=exit) Use which %s? "),
118 I2A(0), I2A(num - 1), p);
120 /* Get a spell from the user */
122 choice= always_show_list ? ESCAPE:1 ;
125 if(choice==ESCAPE) choice = ' ';
126 else if( !get_com(out_val, &choice, TRUE) )break;
129 if ((choice == ' ') || (choice == '*') || (choice == '?'))
139 /* Save the screen */
142 /* Display a list of spells */
144 put_str(_("名前", "Name"), y, x + 5);
145 put_str(_("失率 効果", "Fail Info"), y, x + 36);
148 /* Dump the spells */
149 for (i = 0; i < num; i++)
151 /* Access the spell */
152 spell = monster_powers[p_ptr->mane_spell[i]];
154 chance = spell.manefail;
156 /* Reduce failure rate by "effective" level adjustment */
157 if (plev > spell.level) chance -= 3 * (plev - spell.level);
159 /* Reduce failure rate by INT/WIS adjustment */
160 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[spell.use_stat]] + adj_mag_stat[p_ptr->stat_ind[A_DEX]] - 2) / 2;
162 if (spell.manedam) chance = chance * (baigaesi ? p_ptr->mane_dam[i] * 2 : p_ptr->mane_dam[i]) / spell.manedam;
164 chance += p_ptr->to_m_chance;
166 /* Extract the minimum failure rate */
167 minfail = adj_mag_fail[p_ptr->stat_ind[spell.use_stat]];
169 /* Minimum failure rate */
170 if (chance < minfail) chance = minfail;
172 /* Stunning makes spells harder */
173 if (p_ptr->stun > 50) chance += 25;
174 else if (p_ptr->stun) chance += 15;
176 /* Always a 5 percent chance of working */
177 if (chance > 95) chance = 95;
180 mane_info(comment, p_ptr->mane_spell[i], (baigaesi ? p_ptr->mane_dam[i]*2 : p_ptr->mane_dam[i]));
182 /* Dump the spell --(-- */
183 sprintf(psi_desc, " %c) %-30s %3d%%%s",
186 prt(psi_desc, y + i + 1, x);
189 /* Clear the bottom line */
190 prt("", y + i + 1, x);
199 /* Restore the screen */
208 ask = isupper(choice);
211 if (ask) choice = (char)tolower(choice);
213 /* Extract request */
214 i = (islower(choice) ? A2I(choice) : -1);
216 /* Totally Illegal */
217 if ((i < 0) || (i >= num))
223 /* Save the spell index */
224 spell = monster_powers[p_ptr->mane_spell[i]];
232 (void) strnfmt(tmp_val, 78, _("%sをまねますか?", "Use %s? "), monster_powers[p_ptr->mane_spell[i]].name);
234 /* Belay that order */
235 if (!get_check(tmp_val)) continue;
242 /* Restore the screen */
243 if (redraw) screen_load();
246 p_ptr->window |= (PW_SPELL);
250 /* Abort if needed */
251 if (!flag) return (FALSE);
253 /* Save the choice */
256 damage = (baigaesi ? p_ptr->mane_dam[i]*2 : p_ptr->mane_dam[i]);
265 * do_cmd_cast calls this function if the player's class is 'imitator'.
266 * @param spell 発動するモンスター攻撃のID
267 * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。
269 static bool use_mane(int spell)
272 PLAYER_LEVEL plev = p_ptr->lev;
273 BIT_FLAGS mode = (PM_ALLOW_GROUP | PM_FORCE_PET);
274 BIT_FLAGS u_mode = 0L;
276 if (randint1(50+plev) < plev/10) u_mode = PM_ALLOW_UNIQUE;
284 msg_print(_("かん高い金切り声をあげた。", "You make a high pitched shriek."));
285 aggravate_monsters(0);
295 if (!target_set(TARGET_KILL)) return FALSE;
296 m_idx = cave[target_row][target_col].m_idx;
298 if (!player_has_los_bold(target_row, target_col)) break;
299 if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
300 dispel_monster_status(m_idx);
305 if (!get_aim_dir(&dir)) return FALSE;
306 else msg_print(_("ロケットを発射した。", "You fire a rocket."));
307 fire_rocket(GF_ROCKET, dir, damage, 2);
311 if (!get_aim_dir(&dir)) return FALSE;
312 else msg_print(_("矢を放った。", "You fire an arrow."));
313 fire_bolt(GF_ARROW, dir, damage);
326 if (!get_aim_dir(&dir)) return FALSE;
327 else msg_print(_("酸のブレスを吐いた。", "You breathe acid."));
328 fire_breath(GF_ACID, dir, damage, (plev > 35 ? 3 : 2));
332 if (!get_aim_dir(&dir)) return FALSE;
333 else msg_print(_("稲妻のブレスを吐いた。", "You breathe lightning."));
334 fire_breath(GF_ELEC, dir, damage, (plev > 35 ? 3 : 2));
338 if (!get_aim_dir(&dir)) return FALSE;
339 else msg_print(_("火炎のブレスを吐いた。", "You breathe fire."));
340 fire_breath(GF_FIRE, dir, damage, (plev > 35 ? 3 : 2));
344 if (!get_aim_dir(&dir)) return FALSE;
345 else msg_print(_("冷気のブレスを吐いた。", "You breathe frost."));
346 fire_breath(GF_COLD, dir, damage, (plev > 35 ? 3 : 2));
350 if (!get_aim_dir(&dir)) return FALSE;
351 else msg_print(_("ガスのブレスを吐いた。", "You breathe gas."));
352 fire_breath(GF_POIS, dir, damage, (plev > 35 ? 3 : 2));
356 if (!get_aim_dir(&dir)) return FALSE;
357 else msg_print(_("地獄のブレスを吐いた。", "You breathe nether."));
358 fire_breath(GF_NETHER, dir, damage, (plev > 35 ? 3 : 2));
362 if (!get_aim_dir(&dir)) return FALSE;
363 else msg_print(_("閃光のブレスを吐いた。", "You breathe light."));
364 fire_breath(GF_LITE, dir, damage, (plev > 35 ? 3 : 2));
368 if (!get_aim_dir(&dir)) return FALSE;
369 else msg_print(_("暗黒のブレスを吐いた。", "You breathe darkness."));
370 fire_breath(GF_DARK, dir, damage, (plev > 35 ? 3 : 2));
374 if (!get_aim_dir(&dir)) return FALSE;
375 else msg_print(_("混乱のブレスを吐いた。", "You breathe confusion."));
376 fire_breath(GF_CONFUSION, dir, damage, (plev > 35 ? 3 : 2));
380 if (!get_aim_dir(&dir)) return FALSE;
381 else msg_print(_("轟音のブレスを吐いた。", "You breathe sound."));
382 fire_breath(GF_SOUND, dir, damage, (plev > 35 ? 3 : 2));
386 if (!get_aim_dir(&dir)) return FALSE;
387 else msg_print(_("カオスのブレスを吐いた。", "You breathe chaos."));
388 fire_breath(GF_CHAOS, dir, damage, (plev > 35 ? 3 : 2));
392 if (!get_aim_dir(&dir)) return FALSE;
393 else msg_print(_("劣化のブレスを吐いた。", "You breathe disenchantment."));
394 fire_breath(GF_DISENCHANT, dir, damage, (plev > 35 ? 3 : 2));
398 if (!get_aim_dir(&dir)) return FALSE;
399 else msg_print(_("因果混乱のブレスを吐いた。", "You breathe nexus."));
400 fire_breath(GF_NEXUS, dir, damage, (plev > 35 ? 3 : 2));
404 if (!get_aim_dir(&dir)) return FALSE;
405 else msg_print(_("時間逆転のブレスを吐いた。", "You breathe time."));
406 fire_breath(GF_TIME, dir, damage, (plev > 35 ? 3 : 2));
410 if (!get_aim_dir(&dir)) return FALSE;
411 else msg_print(_("遅鈍のブレスを吐いた。", "You breathe inertia."));
412 fire_breath(GF_INERTIAL, dir, damage, (plev > 35 ? 3 : 2));
416 if (!get_aim_dir(&dir)) return FALSE;
417 else msg_print(_("重力のブレスを吐いた。", "You breathe gravity."));
418 fire_breath(GF_GRAVITY, dir, damage, (plev > 35 ? 3 : 2));
422 if (!get_aim_dir(&dir)) return FALSE;
423 else msg_print(_("破片のブレスを吐いた。", "You breathe shards."));
424 fire_breath(GF_SHARDS, dir, damage, (plev > 35 ? 3 : 2));
428 if (!get_aim_dir(&dir)) return FALSE;
429 else msg_print(_("プラズマのブレスを吐いた。", "You breathe plasma."));
431 fire_breath(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_breath(GF_FORCE, dir, damage, (plev > 35 ? 3 : 2));
442 if (!get_aim_dir(&dir)) return FALSE;
443 else msg_print(_("魔力のブレスを吐いた。", "You breathe mana."));
445 fire_breath(GF_MANA, dir, damage, (plev > 35 ? 3 : 2));
449 if (!get_aim_dir(&dir)) return FALSE;
450 else msg_print(_("放射能球を放った。", "You cast a ball of radiation."));
452 fire_ball(GF_NUKE, dir, damage, 2);
456 if (!get_aim_dir(&dir)) return FALSE;
457 else msg_print(_("放射性廃棄物のブレスを吐いた。", "You breathe toxic waste."));
459 fire_breath(GF_NUKE, dir, damage, (plev > 35 ? 3 : 2));
463 if (!get_aim_dir(&dir)) return FALSE;
464 else msg_print(_("純ログルスを放った。", "You invoke a raw Logrus."));
466 fire_ball(GF_CHAOS, dir, damage, 4);
469 if (!get_aim_dir(&dir)) return FALSE;
470 else msg_print(_("分解のブレスを吐いた。", "You breathe disintegration."));
472 fire_breath(GF_DISINTEGRATE, dir, damage, (plev > 35 ? 3 : 2));
475 if (!get_aim_dir(&dir)) return FALSE;
476 else msg_print(_("アシッド・ボールの呪文を唱えた。", "You cast an acid ball."));
478 fire_ball(GF_ACID, dir, damage, 2);
481 if (!get_aim_dir(&dir)) return FALSE;
482 else msg_print(_("サンダー・ボールの呪文を唱えた。", "You cast a lightning ball."));
484 fire_ball(GF_ELEC, dir, damage, 2);
487 if (!get_aim_dir(&dir)) return FALSE;
488 else msg_print(_("ファイア・ボールの呪文を唱えた。", "You cast a fire ball."));
490 fire_ball(GF_FIRE, dir, damage, 2);
493 if (!get_aim_dir(&dir)) return FALSE;
494 else msg_print(_("アイス・ボールの呪文を唱えた。", "You cast a frost ball."));
496 fire_ball(GF_COLD, dir, damage, 2);
499 if (!get_aim_dir(&dir)) return FALSE;
500 else msg_print(_("悪臭雲の呪文を唱えた。", "You cast a stinking cloud."));
502 fire_ball(GF_POIS, dir, damage, 2);
505 if (!get_aim_dir(&dir)) return FALSE;
506 else msg_print(_("地獄球の呪文を唱えた。", "You cast a nether ball."));
508 fire_ball(GF_NETHER, dir, damage, 2);
511 if (!get_aim_dir(&dir)) return FALSE;
512 else msg_print(_("流れるような身振りをした。", "You gesture fluidly."));
514 fire_ball(GF_WATER, dir, damage, 4);
517 if (!get_aim_dir(&dir)) return FALSE;
518 else msg_print(_("魔力の嵐の呪文を念じた。", "You invoke a mana storm."));
520 fire_ball(GF_MANA, dir, damage, 4);
523 if (!get_aim_dir(&dir)) return FALSE;
524 else msg_print(_("暗黒の嵐の呪文を念じた。", "You invoke a darkness storm."));
526 fire_ball(GF_DARK, dir, damage, 4);
529 if (!get_aim_dir(&dir)) return FALSE;
530 fire_ball_hide(GF_DRAIN_MANA, dir, randint1(plev*3)+plev, 0);
533 if (!get_aim_dir(&dir)) return FALSE;
534 fire_ball_hide(GF_MIND_BLAST, dir, damage, 0);
537 if (!get_aim_dir(&dir)) return FALSE;
538 fire_ball_hide(GF_BRAIN_SMASH, dir, damage, 0);
541 if (!get_aim_dir(&dir)) return FALSE;
542 fire_ball_hide(GF_CAUSE_1, dir, damage, 0);
545 if (!get_aim_dir(&dir)) return FALSE;
546 fire_ball_hide(GF_CAUSE_2, dir, damage, 0);
549 if (!get_aim_dir(&dir)) return FALSE;
550 fire_ball_hide(GF_CAUSE_3, dir, damage, 0);
553 if (!get_aim_dir(&dir)) return FALSE;
554 fire_ball_hide(GF_CAUSE_4, dir, damage, 0);
557 if (!get_aim_dir(&dir)) return FALSE;
558 else msg_print(_("アシッド・ボルトの呪文を唱えた。", "You cast an acid bolt."));
560 fire_bolt(GF_ACID, dir, damage);
563 if (!get_aim_dir(&dir)) return FALSE;
564 else msg_print(_("サンダー・ボルトの呪文を唱えた。", "You cast a lightning bolt."));
566 fire_bolt(GF_ELEC, dir, damage);
569 if (!get_aim_dir(&dir)) return FALSE;
570 else msg_print(_("ファイア・ボルトの呪文を唱えた。", "You cast a fire bolt."));
572 fire_bolt(GF_FIRE, dir, damage);
575 if (!get_aim_dir(&dir)) return FALSE;
576 else msg_print(_("アイス・ボルトの呪文を唱えた。", "You cast a frost bolt."));
578 fire_bolt(GF_COLD, dir, damage);
581 if (!get_aim_dir(&dir)) return FALSE;
582 else msg_print(_("スターバーストの呪文を念じた。", "You invoke a starburst."));
584 fire_ball(GF_LITE, dir, damage, 4);
587 if (!get_aim_dir(&dir)) return FALSE;
588 else msg_print(_("地獄の矢の呪文を唱えた。", "You cast a nether bolt."));
590 fire_bolt(GF_NETHER, dir, damage);
593 if (!get_aim_dir(&dir)) return FALSE;
594 else msg_print(_("ウォーター・ボルトの呪文を唱えた。", "You cast a water bolt."));
596 fire_bolt(GF_WATER, dir, damage);
599 if (!get_aim_dir(&dir)) return FALSE;
600 else msg_print(_("魔力の矢の呪文を唱えた。", "You cast a mana bolt."));
602 fire_bolt(GF_MANA, dir, damage);
605 if (!get_aim_dir(&dir)) return FALSE;
606 else msg_print(_("プラズマ・ボルトの呪文を唱えた。", "You cast a plasma bolt."));
608 fire_bolt(GF_PLASMA, dir, damage);
611 if (!get_aim_dir(&dir)) return FALSE;
612 else msg_print(_("極寒の矢の呪文を唱えた。", "You cast a ice bolt."));
614 fire_bolt(GF_ICE, dir, damage);
616 case MS_MAGIC_MISSILE:
617 if (!get_aim_dir(&dir)) return FALSE;
618 else msg_print(_("マジック・ミサイルの呪文を唱えた。", "You cast a magic missile."));
620 fire_bolt(GF_MISSILE, dir, damage);
623 if (!get_aim_dir(&dir)) return FALSE;
624 else msg_print(_("恐ろしげな幻覚を作り出した。", "You cast a fearful illusion."));
626 fear_monster(dir, plev+10);
629 if (!get_aim_dir(&dir)) return FALSE;
630 confuse_monster(dir, plev * 2);
633 if (!get_aim_dir(&dir)) return FALSE;
634 else msg_print(_("誘惑的な幻覚をつくり出した。", "You cast a mesmerizing illusion."));
636 confuse_monster(dir, plev * 2);
639 if (!get_aim_dir(&dir)) return FALSE;
640 slow_monster(dir, plev);
643 if (!get_aim_dir(&dir)) return FALSE;
644 sleep_monster(dir, plev);
647 (void)set_fast(randint1(20 + plev) + plev, FALSE);
651 if (!get_aim_dir(&dir)) return FALSE;
652 else msg_print(_("<破滅の手>を放った!", "You invoke the Hand of Doom!"));
654 fire_ball_hide(GF_HAND_DOOM, dir, 200, 0);
658 msg_print(_("自分の傷に念を集中した。", "You concentrate on your wounds!"));
659 (void)hp_player(plev*6);
664 msg_print(_("無傷の球の呪文を唱えた。", "You cast a Globe of Invulnerability."));
665 (void)set_invuln(randint1(7) + 7, FALSE);
668 teleport_player(10, 0L);
671 teleport_player(plev * 5, 0L);
675 if (damage == 1 || damage == 2)
676 msg_print(_("「『ザ・ワールド』!時は止まった!」", "You yell 'The World! Time has stopped!'"));
677 else if (damage == 3 || damage == 6)
678 msg_print(_("「時よ!」", "You yell 'Time!'"));
684 p_ptr->energy_need -= 1000 + (100 + randint1(200)+200)*TURNS_PER_TICK/10;
687 p_ptr->redraw |= (PR_MAP);
689 /* Update monsters */
690 p_ptr->update |= (PU_MONSTERS);
692 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
704 if (!target_set(TARGET_KILL)) return FALSE;
705 if (!cave[target_row][target_col].m_idx) break;
706 if (!player_has_los_bold(target_row, target_col)) break;
707 if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
708 m_ptr = &m_list[cave[target_row][target_col].m_idx];
709 r_ptr = &r_info[m_ptr->r_idx];
710 monster_desc(m_name, m_ptr, 0);
711 if (r_ptr->flagsr & RFR_RES_TELE)
713 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
715 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
716 msg_format(_("%sには効果がなかった!", "%s is unaffected!"), m_name);
720 else if (r_ptr->level > randint1(100))
722 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
723 msg_format(_("%sには耐性がある!", "%s resists!"), m_name);
728 msg_format(_("%sを引き戻した。", "You command %s to return."), m_name);
730 teleport_monster_to(cave[target_row][target_col].m_idx, p_ptr->y, p_ptr->x, 100, TELEPORT_PASSIVE);
734 if (!get_aim_dir(&dir)) return FALSE;
736 (void)fire_beam(GF_AWAY_ALL, dir, plev);
745 if (!target_set(TARGET_KILL)) return FALSE;
746 target_m_idx = cave[target_row][target_col].m_idx;
747 if (!target_m_idx) break;
748 if (!player_has_los_bold(target_row, target_col)) break;
749 if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
750 m_ptr = &m_list[target_m_idx];
751 r_ptr = &r_info[m_ptr->r_idx];
752 monster_desc(m_name, m_ptr, 0);
753 msg_format(_("%^sの足を指さした。", "You gesture at %^s's feet."), m_name);
755 if ((r_ptr->flagsr & (RFR_EFF_RES_NEXU_MASK | RFR_RES_TELE)) ||
756 (r_ptr->flags1 & RF1_QUESTOR) || (r_ptr->level + randint1(50) > plev + randint1(60)))
758 msg_print(_("しかし効果がなかった!", "%^s is unaffected!"));
760 else teleport_level(target_m_idx);
765 if (!get_aim_dir(&dir)) return FALSE;
766 else msg_print(_("光の剣を放った。", "You throw a psycho-spear."));
767 (void)fire_beam(GF_PSY_SPEAR, dir, damage);
771 msg_print(_("暗闇の中で手を振った。", "You gesture in shadow."));
772 (void)unlite_area(10, 3);
776 if (!target_set(TARGET_KILL)) return FALSE;
777 msg_print(_("呪文を唱えて邪悪に微笑んだ。", "You cast a spell and cackles evilly."));
778 trap_creation(target_row, target_col);
781 msg_print(_("しかし何も起きなかった。", "Nothing happen."));
784 msg_print(_("死者復活の呪文を唱えた。", "You cast a animate dead."));
785 (void)animate_dead(0, p_ptr->y, p_ptr->x);
790 if (!target_set(TARGET_KILL)) return FALSE;
792 msg_print(_("援軍を召喚した。", "You summon minions."));
793 for (k = 0;k < 4; k++)
795 (void)summon_kin_player(plev, target_row, target_col, (PM_FORCE_PET | PM_ALLOW_GROUP));
802 int max_cyber = (dun_level / 50) + randint1(3);
803 if (!target_set(TARGET_KILL)) return FALSE;
804 msg_print(_("サイバーデーモンを召喚した!", "You summon Cyberdemons!"));
805 if (max_cyber > 4) max_cyber = 4;
806 for (k = 0;k < max_cyber; k++)
807 summon_specific(-1, target_row, target_col, plev, SUMMON_CYBER, mode);
813 if (!target_set(TARGET_KILL)) return FALSE;
814 msg_print(_("仲間を召喚した。", "You summon help."));
815 for (k = 0;k < 1; k++)
816 summon_specific(-1, target_row, target_col, plev, 0, (mode | u_mode));
822 if (!target_set(TARGET_KILL)) return FALSE;
823 msg_print(_("モンスターを召喚した!", "You summon monsters!"));
824 for (k = 0;k < 6; k++)
825 summon_specific(-1, target_row, target_col, plev, 0, (mode | u_mode));
831 if (!target_set(TARGET_KILL)) return FALSE;
832 msg_print(_("アリを召喚した。", "You summon ants."));
833 for (k = 0;k < 6; k++)
834 summon_specific(-1, target_row, target_col, plev, SUMMON_ANT, mode);
840 if (!target_set(TARGET_KILL)) return FALSE;
841 msg_print(_("蜘蛛を召喚した。", "You summon spiders."));
842 for (k = 0;k < 6; k++)
843 summon_specific(-1, target_row, target_col, plev, SUMMON_SPIDER, mode);
849 if (!target_set(TARGET_KILL)) return FALSE;
850 msg_print(_("ハウンドを召喚した。", "You summon hounds."));
851 for (k = 0;k < 4; k++)
852 summon_specific(-1, target_row, target_col, plev, SUMMON_HOUND, mode);
858 if (!target_set(TARGET_KILL)) return FALSE;
859 msg_print(_("ヒドラを召喚した。", "You summon hydras."));
860 for (k = 0;k < 4; k++)
861 summon_specific(-1, target_row, target_col, plev, SUMMON_HYDRA, mode);
867 if (!target_set(TARGET_KILL)) return FALSE;
868 msg_print(_("天使を召喚した!", "You summon angel!"));
869 for (k = 0;k < 1; k++)
870 summon_specific(-1, target_row, target_col, plev, SUMMON_ANGEL, mode);
876 if (!target_set(TARGET_KILL)) return FALSE;
877 msg_print(_("混沌の宮廷から悪魔を召喚した!", "You summon a demon from the Courts of Chaos!"));
878 for (k = 0;k < 1; k++)
879 summon_specific(-1, target_row, target_col, plev, SUMMON_DEMON, (mode | u_mode));
885 if (!target_set(TARGET_KILL)) return FALSE;
886 msg_print(_("アンデッドの強敵を召喚した!", "You summon an undead adversary!"));
887 for (k = 0;k < 1; k++)
888 summon_specific(-1, target_row, target_col, plev, SUMMON_UNDEAD, (mode | u_mode));
894 if (!target_set(TARGET_KILL)) return FALSE;
895 msg_print(_("ドラゴンを召喚した!", "You summon dragon!"));
896 for (k = 0;k < 1; k++)
897 summon_specific(-1, target_row, target_col, plev, SUMMON_DRAGON, (mode | u_mode));
903 if (!target_set(TARGET_KILL)) return FALSE;
904 msg_print(_("強力なアンデッドを召喚した!", "You summon greater undead!"));
905 for (k = 0;k < 6; k++)
906 summon_specific(-1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode));
912 if (!target_set(TARGET_KILL)) return FALSE;
913 msg_print(_("古代ドラゴンを召喚した!", "You summon ancient dragons!"));
914 for (k = 0;k < 4; k++)
915 summon_specific(-1, target_row, target_col, plev, SUMMON_HI_DRAGON, (mode | u_mode));
921 if (!target_set(TARGET_KILL)) return FALSE;
922 msg_print(_("アンバーの王族を召喚した!", "You summon Lords of Amber!"));
923 for (k = 0;k < 4; k++)
924 summon_specific(-1, target_row, target_col, plev, SUMMON_AMBERITES, (mode | PM_ALLOW_UNIQUE));
930 if (!target_set(TARGET_KILL)) return FALSE;
931 msg_print(_("特別な強敵を召喚した!", "You summon special opponents!"));
932 for (k = 0;k < 4; k++)
933 if (summon_specific(-1, target_row, target_col, plev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE))) count++;
934 for (k = count;k < 4; k++)
935 summon_specific(-1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode));
947 * @brief ものまねコマンドのメインルーチン /
948 * do_cmd_cast calls this function if the player's class is 'imitator'.
949 * @param baigaesi TRUEならば倍返し上の処理として行う
950 * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。
952 * If a valid spell is chosen, saves it in '*sn' and returns TRUE
953 * If the user hits escape, returns FALSE, and set '*sn' to -1
954 * If there are no legal choices, returns FALSE, and sets '*sn' to -2
956 * The "prompt" should be "cast", "recite", or "study"
957 * The "known" should be TRUE for cast/pray, FALSE for study
959 * nb: This function has a (trivial) display bug which will be obvious
960 * when you run it. It's probably easy to fix but I haven't tried,
963 bool do_cmd_mane(bool baigaesi)
968 PLAYER_LEVEL plev = p_ptr->lev;
973 /* not if confused */
976 msg_print(_("混乱していて集中できない!", "You are too confused!"));
980 if (!p_ptr->mane_num)
982 msg_print(_("まねられるものが何もない!", "You don't remember any action!"));
987 if (!get_mane_power(&n, baigaesi)) return FALSE;
989 spell = monster_powers[p_ptr->mane_spell[n]];
991 /* Spell failure chance */
992 chance = spell.manefail;
994 /* Reduce failure rate by "effective" level adjustment */
995 if (plev > spell.level) chance -= 3 * (plev - spell.level);
997 /* Reduce failure rate by 1 stat and DEX adjustment */
998 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[spell.use_stat]] + adj_mag_stat[p_ptr->stat_ind[A_DEX]] - 2) / 2;
1000 if (spell.manedam) chance = chance * damage / spell.manedam;
1002 chance += p_ptr->to_m_chance;
1004 /* Extract the minimum failure rate */
1005 minfail = adj_mag_fail[p_ptr->stat_ind[spell.use_stat]];
1007 /* Minimum failure rate */
1008 if (chance < minfail) chance = minfail;
1010 /* Stunning makes spells harder */
1011 if (p_ptr->stun > 50) chance += 25;
1012 else if (p_ptr->stun) chance += 15;
1014 /* Always a 5 percent chance of working */
1015 if (chance > 95) chance = 95;
1018 if (randint0(100) < chance)
1020 if (flush_failure) flush();
1021 msg_print(_("ものまねに失敗した!", "You failed to concentrate hard enough!"));
1028 /* Cast the spell */
1029 cast = use_mane(p_ptr->mane_spell[n]);
1031 if (!cast) return FALSE;
1035 for (j = n; j < p_ptr->mane_num;j++)
1037 p_ptr->mane_spell[j] = p_ptr->mane_spell[j+1];
1038 p_ptr->mane_dam[j] = p_ptr->mane_dam[j+1];
1041 p_ptr->energy_use = 100;
1043 p_ptr->redraw |= (PR_IMITATION);
1044 p_ptr->window |= (PW_PLAYER);
1045 p_ptr->window |= (PW_SPELL);