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
14 #include "spells-summon.h"
19 * @brief 受け取ったパラメータに応じてものまねの効果情報をまとめたフォーマットを返す
20 * @param p 情報を返す文字列参照ポインタ
21 * @param power ものまねの効力の種類
25 static void mane_info(char *p, int power, HIT_POINT dam)
27 PLAYER_LEVEL plev = p_ptr->lev;
28 cptr s_dam = _("損傷:", "dam ");
29 cptr s_dur = _("期間:", "dur ");
30 cptr s_range = _("範囲:", "range ");
31 cptr s_heal = _("回復:", "heal ");
35 if ((power > 2 && power < 41) || (power > 41 && power < 59) || (power == 75))
36 sprintf(p, " %s%d", s_dam, (int)dam);
42 sprintf(p, " %sd%d+%d", s_heal, plev * 3, plev);
45 sprintf(p, " %sd%d+%d", s_dur, 20+plev, plev);
48 sprintf(p, " %s%d", s_heal, plev*6);
51 sprintf(p, " %sd7+7", s_dur);
54 sprintf(p, " %s10", s_range);
57 sprintf(p, " %s%d", s_range, plev * 5);
60 sprintf(p, " %s5", s_range);
70 * @brief どのものまねを発動するか選択する処理 /
71 * Allow user to choose a imitation.
72 * @param sn 実行したものまねのIDを返す参照ポインタ(キャンセルなどの場合-1を返す)
73 * @param baigaesi TRUEならば倍返し上の処理として行う
74 * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。
76 * If a valid spell is chosen, saves it in '*sn' and returns TRUE
77 * If the user hits escape, returns FALSE, and set '*sn' to -1
78 * If there are no legal choices, returns FALSE, and sets '*sn' to -2
80 * The "prompt" should be "cast", "recite", or "study"
81 * The "known" should be TRUE for cast/pray, FALSE for study
83 * nb: This function has a (trivial) display bug which will be obvious
84 * when you run it. It's probably easy to fix but I haven't tried,
87 static int get_mane_power(int *sn, bool baigaesi)
94 PLAYER_LEVEL plev = p_ptr->lev;
100 cptr p = _("能力", "power");
105 /* Assume cancelled */
108 /* Nothing chosen yet */
114 num = p_ptr->mane_num;
116 /* Build a prompt (accept all spells) */
117 (void)strnfmt(out_val, 78,
118 _("(%c-%c, '*'で一覧, ESC) どの%sをまねますか?", "(%c-%c, *=List, ESC=exit) Use which %s? "),
119 I2A(0), I2A(num - 1), p);
121 /* Get a spell from the user */
123 choice= always_show_list ? ESCAPE:1 ;
126 if(choice==ESCAPE) choice = ' ';
127 else if( !get_com(out_val, &choice, TRUE) )break;
130 if ((choice == ' ') || (choice == '*') || (choice == '?'))
141 /* Display a list of spells */
143 put_str(_("名前", "Name"), y, x + 5);
144 put_str(_("失率 効果", "Fail Info"), y, x + 36);
147 /* Dump the spells */
148 for (i = 0; i < num; i++)
150 /* Access the spell */
151 spell = monster_powers[p_ptr->mane_spell[i]];
153 chance = spell.manefail;
155 /* Reduce failure rate by "effective" level adjustment */
156 if (plev > spell.level) chance -= 3 * (plev - spell.level);
158 /* Reduce failure rate by INT/WIS adjustment */
159 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[spell.use_stat]] + adj_mag_stat[p_ptr->stat_ind[A_DEX]] - 2) / 2;
161 if (spell.manedam) chance = chance * (baigaesi ? p_ptr->mane_dam[i] * 2 : p_ptr->mane_dam[i]) / spell.manedam;
163 chance += p_ptr->to_m_chance;
165 /* Extract the minimum failure rate */
166 minfail = adj_mag_fail[p_ptr->stat_ind[spell.use_stat]];
168 /* Minimum failure rate */
169 if (chance < minfail) chance = minfail;
171 /* Stunning makes spells harder */
172 if (p_ptr->stun > 50) chance += 25;
173 else if (p_ptr->stun) chance += 15;
175 /* Always a 5 percent chance of working */
176 if (chance > 95) chance = 95;
179 mane_info(comment, p_ptr->mane_spell[i], (baigaesi ? p_ptr->mane_dam[i]*2 : p_ptr->mane_dam[i]));
181 /* Dump the spell --(-- */
182 sprintf(psi_desc, " %c) %-30s %3d%%%s",
185 prt(psi_desc, y + i + 1, x);
188 /* Clear the bottom line */
189 prt("", y + i + 1, x);
205 ask = isupper(choice);
208 if (ask) choice = (char)tolower(choice);
210 /* Extract request */
211 i = (islower(choice) ? A2I(choice) : -1);
213 /* Totally Illegal */
214 if ((i < 0) || (i >= num))
220 /* Save the spell index */
221 spell = monster_powers[p_ptr->mane_spell[i]];
229 (void) strnfmt(tmp_val, 78, _("%sをまねますか?", "Use %s? "), monster_powers[p_ptr->mane_spell[i]].name);
231 /* Belay that order */
232 if (!get_check(tmp_val)) continue;
238 if (redraw) screen_load();
240 p_ptr->window |= (PW_SPELL);
243 /* Abort if needed */
244 if (!flag) return (FALSE);
246 /* Save the choice */
249 damage = (baigaesi ? p_ptr->mane_dam[i]*2 : p_ptr->mane_dam[i]);
258 * do_cmd_cast calls this function if the player's class is 'imitator'.
259 * @param spell 発動するモンスター攻撃のID
260 * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。
262 static bool use_mane(int spell)
265 PLAYER_LEVEL plev = p_ptr->lev;
266 BIT_FLAGS mode = (PM_ALLOW_GROUP | PM_FORCE_PET);
267 BIT_FLAGS u_mode = 0L;
269 if (randint1(50+plev) < plev/10) u_mode = PM_ALLOW_UNIQUE;
277 msg_print(_("かん高い金切り声をあげた。", "You make a high pitched shriek."));
278 aggravate_monsters(0);
288 if (!target_set(TARGET_KILL)) return FALSE;
289 m_idx = cave[target_row][target_col].m_idx;
291 if (!player_has_los_bold(target_row, target_col)) break;
292 if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
293 dispel_monster_status(m_idx);
298 if (!get_aim_dir(&dir)) return FALSE;
299 else msg_print(_("ロケットを発射した。", "You fire a rocket."));
300 fire_rocket(GF_ROCKET, dir, damage, 2);
304 if (!get_aim_dir(&dir)) return FALSE;
305 else msg_print(_("矢を放った。", "You fire an arrow."));
306 fire_bolt(GF_ARROW, dir, damage);
319 if (!get_aim_dir(&dir)) return FALSE;
320 else msg_print(_("酸のブレスを吐いた。", "You breathe acid."));
321 fire_breath(GF_ACID, dir, damage, (plev > 35 ? 3 : 2));
325 if (!get_aim_dir(&dir)) return FALSE;
326 else msg_print(_("稲妻のブレスを吐いた。", "You breathe lightning."));
327 fire_breath(GF_ELEC, dir, damage, (plev > 35 ? 3 : 2));
331 if (!get_aim_dir(&dir)) return FALSE;
332 else msg_print(_("火炎のブレスを吐いた。", "You breathe fire."));
333 fire_breath(GF_FIRE, dir, damage, (plev > 35 ? 3 : 2));
337 if (!get_aim_dir(&dir)) return FALSE;
338 else msg_print(_("冷気のブレスを吐いた。", "You breathe frost."));
339 fire_breath(GF_COLD, dir, damage, (plev > 35 ? 3 : 2));
343 if (!get_aim_dir(&dir)) return FALSE;
344 else msg_print(_("ガスのブレスを吐いた。", "You breathe gas."));
345 fire_breath(GF_POIS, dir, damage, (plev > 35 ? 3 : 2));
349 if (!get_aim_dir(&dir)) return FALSE;
350 else msg_print(_("地獄のブレスを吐いた。", "You breathe nether."));
351 fire_breath(GF_NETHER, dir, damage, (plev > 35 ? 3 : 2));
355 if (!get_aim_dir(&dir)) return FALSE;
356 else msg_print(_("閃光のブレスを吐いた。", "You breathe light."));
357 fire_breath(GF_LITE, dir, damage, (plev > 35 ? 3 : 2));
361 if (!get_aim_dir(&dir)) return FALSE;
362 else msg_print(_("暗黒のブレスを吐いた。", "You breathe darkness."));
363 fire_breath(GF_DARK, dir, damage, (plev > 35 ? 3 : 2));
367 if (!get_aim_dir(&dir)) return FALSE;
368 else msg_print(_("混乱のブレスを吐いた。", "You breathe confusion."));
369 fire_breath(GF_CONFUSION, dir, damage, (plev > 35 ? 3 : 2));
373 if (!get_aim_dir(&dir)) return FALSE;
374 else msg_print(_("轟音のブレスを吐いた。", "You breathe sound."));
375 fire_breath(GF_SOUND, dir, damage, (plev > 35 ? 3 : 2));
379 if (!get_aim_dir(&dir)) return FALSE;
380 else msg_print(_("カオスのブレスを吐いた。", "You breathe chaos."));
381 fire_breath(GF_CHAOS, dir, damage, (plev > 35 ? 3 : 2));
385 if (!get_aim_dir(&dir)) return FALSE;
386 else msg_print(_("劣化のブレスを吐いた。", "You breathe disenchantment."));
387 fire_breath(GF_DISENCHANT, dir, damage, (plev > 35 ? 3 : 2));
391 if (!get_aim_dir(&dir)) return FALSE;
392 else msg_print(_("因果混乱のブレスを吐いた。", "You breathe nexus."));
393 fire_breath(GF_NEXUS, dir, damage, (plev > 35 ? 3 : 2));
397 if (!get_aim_dir(&dir)) return FALSE;
398 else msg_print(_("時間逆転のブレスを吐いた。", "You breathe time."));
399 fire_breath(GF_TIME, dir, damage, (plev > 35 ? 3 : 2));
403 if (!get_aim_dir(&dir)) return FALSE;
404 else msg_print(_("遅鈍のブレスを吐いた。", "You breathe inertia."));
405 fire_breath(GF_INERTIAL, dir, damage, (plev > 35 ? 3 : 2));
409 if (!get_aim_dir(&dir)) return FALSE;
410 else msg_print(_("重力のブレスを吐いた。", "You breathe gravity."));
411 fire_breath(GF_GRAVITY, dir, damage, (plev > 35 ? 3 : 2));
415 if (!get_aim_dir(&dir)) return FALSE;
416 else msg_print(_("破片のブレスを吐いた。", "You breathe shards."));
417 fire_breath(GF_SHARDS, dir, damage, (plev > 35 ? 3 : 2));
421 if (!get_aim_dir(&dir)) return FALSE;
422 else msg_print(_("プラズマのブレスを吐いた。", "You breathe plasma."));
424 fire_breath(GF_PLASMA, dir, damage, (plev > 35 ? 3 : 2));
428 if (!get_aim_dir(&dir)) return FALSE;
429 else msg_print(_("フォースのブレスを吐いた。", "You breathe force."));
431 fire_breath(GF_FORCE, dir, damage, (plev > 35 ? 3 : 2));
435 if (!get_aim_dir(&dir)) return FALSE;
436 else msg_print(_("魔力のブレスを吐いた。", "You breathe mana."));
438 fire_breath(GF_MANA, dir, damage, (plev > 35 ? 3 : 2));
442 if (!get_aim_dir(&dir)) return FALSE;
443 else msg_print(_("放射能球を放った。", "You cast a ball of radiation."));
445 fire_ball(GF_NUKE, dir, damage, 2);
449 if (!get_aim_dir(&dir)) return FALSE;
450 else msg_print(_("放射性廃棄物のブレスを吐いた。", "You breathe toxic waste."));
452 fire_breath(GF_NUKE, dir, damage, (plev > 35 ? 3 : 2));
456 if (!get_aim_dir(&dir)) return FALSE;
457 else msg_print(_("純ログルスを放った。", "You invoke a raw Logrus."));
459 fire_ball(GF_CHAOS, dir, damage, 4);
462 if (!get_aim_dir(&dir)) return FALSE;
463 else msg_print(_("分解のブレスを吐いた。", "You breathe disintegration."));
465 fire_breath(GF_DISINTEGRATE, dir, damage, (plev > 35 ? 3 : 2));
468 if (!get_aim_dir(&dir)) return FALSE;
469 else msg_print(_("アシッド・ボールの呪文を唱えた。", "You cast an acid ball."));
471 fire_ball(GF_ACID, dir, damage, 2);
474 if (!get_aim_dir(&dir)) return FALSE;
475 else msg_print(_("サンダー・ボールの呪文を唱えた。", "You cast a lightning ball."));
477 fire_ball(GF_ELEC, dir, damage, 2);
480 if (!get_aim_dir(&dir)) return FALSE;
481 else msg_print(_("ファイア・ボールの呪文を唱えた。", "You cast a fire ball."));
483 fire_ball(GF_FIRE, dir, damage, 2);
486 if (!get_aim_dir(&dir)) return FALSE;
487 else msg_print(_("アイス・ボールの呪文を唱えた。", "You cast a frost ball."));
489 fire_ball(GF_COLD, dir, damage, 2);
492 if (!get_aim_dir(&dir)) return FALSE;
493 else msg_print(_("悪臭雲の呪文を唱えた。", "You cast a stinking cloud."));
495 fire_ball(GF_POIS, dir, damage, 2);
498 if (!get_aim_dir(&dir)) return FALSE;
499 else msg_print(_("地獄球の呪文を唱えた。", "You cast a nether ball."));
501 fire_ball(GF_NETHER, dir, damage, 2);
504 if (!get_aim_dir(&dir)) return FALSE;
505 else msg_print(_("流れるような身振りをした。", "You gesture fluidly."));
507 fire_ball(GF_WATER, dir, damage, 4);
510 if (!get_aim_dir(&dir)) return FALSE;
511 else msg_print(_("魔力の嵐の呪文を念じた。", "You invoke a mana storm."));
513 fire_ball(GF_MANA, dir, damage, 4);
516 if (!get_aim_dir(&dir)) return FALSE;
517 else msg_print(_("暗黒の嵐の呪文を念じた。", "You invoke a darkness storm."));
519 fire_ball(GF_DARK, dir, damage, 4);
522 if (!get_aim_dir(&dir)) return FALSE;
523 fire_ball_hide(GF_DRAIN_MANA, dir, randint1(plev*3)+plev, 0);
526 if (!get_aim_dir(&dir)) return FALSE;
527 fire_ball_hide(GF_MIND_BLAST, dir, damage, 0);
530 if (!get_aim_dir(&dir)) return FALSE;
531 fire_ball_hide(GF_BRAIN_SMASH, dir, damage, 0);
534 if (!get_aim_dir(&dir)) return FALSE;
535 fire_ball_hide(GF_CAUSE_1, dir, damage, 0);
538 if (!get_aim_dir(&dir)) return FALSE;
539 fire_ball_hide(GF_CAUSE_2, dir, damage, 0);
542 if (!get_aim_dir(&dir)) return FALSE;
543 fire_ball_hide(GF_CAUSE_3, dir, damage, 0);
546 if (!get_aim_dir(&dir)) return FALSE;
547 fire_ball_hide(GF_CAUSE_4, dir, damage, 0);
550 if (!get_aim_dir(&dir)) return FALSE;
551 else msg_print(_("アシッド・ボルトの呪文を唱えた。", "You cast an acid bolt."));
553 fire_bolt(GF_ACID, dir, damage);
556 if (!get_aim_dir(&dir)) return FALSE;
557 else msg_print(_("サンダー・ボルトの呪文を唱えた。", "You cast a lightning bolt."));
559 fire_bolt(GF_ELEC, dir, damage);
562 if (!get_aim_dir(&dir)) return FALSE;
563 else msg_print(_("ファイア・ボルトの呪文を唱えた。", "You cast a fire bolt."));
565 fire_bolt(GF_FIRE, dir, damage);
568 if (!get_aim_dir(&dir)) return FALSE;
569 else msg_print(_("アイス・ボルトの呪文を唱えた。", "You cast a frost bolt."));
571 fire_bolt(GF_COLD, dir, damage);
574 if (!get_aim_dir(&dir)) return FALSE;
575 else msg_print(_("スターバーストの呪文を念じた。", "You invoke a starburst."));
577 fire_ball(GF_LITE, dir, damage, 4);
580 if (!get_aim_dir(&dir)) return FALSE;
581 else msg_print(_("地獄の矢の呪文を唱えた。", "You cast a nether bolt."));
583 fire_bolt(GF_NETHER, dir, damage);
586 if (!get_aim_dir(&dir)) return FALSE;
587 else msg_print(_("ウォーター・ボルトの呪文を唱えた。", "You cast a water bolt."));
589 fire_bolt(GF_WATER, dir, damage);
592 if (!get_aim_dir(&dir)) return FALSE;
593 else msg_print(_("魔力の矢の呪文を唱えた。", "You cast a mana bolt."));
595 fire_bolt(GF_MANA, dir, damage);
598 if (!get_aim_dir(&dir)) return FALSE;
599 else msg_print(_("プラズマ・ボルトの呪文を唱えた。", "You cast a plasma bolt."));
601 fire_bolt(GF_PLASMA, dir, damage);
604 if (!get_aim_dir(&dir)) return FALSE;
605 else msg_print(_("極寒の矢の呪文を唱えた。", "You cast a ice bolt."));
607 fire_bolt(GF_ICE, dir, damage);
609 case MS_MAGIC_MISSILE:
610 if (!get_aim_dir(&dir)) return FALSE;
611 else msg_print(_("マジック・ミサイルの呪文を唱えた。", "You cast a magic missile."));
613 fire_bolt(GF_MISSILE, dir, damage);
616 if (!get_aim_dir(&dir)) return FALSE;
617 else msg_print(_("恐ろしげな幻覚を作り出した。", "You cast a fearful illusion."));
619 fear_monster(dir, plev+10);
622 if (!get_aim_dir(&dir)) return FALSE;
623 confuse_monster(dir, plev * 2);
626 if (!get_aim_dir(&dir)) return FALSE;
627 else msg_print(_("誘惑的な幻覚をつくり出した。", "You cast a mesmerizing illusion."));
629 confuse_monster(dir, plev * 2);
632 if (!get_aim_dir(&dir)) return FALSE;
633 slow_monster(dir, plev);
636 if (!get_aim_dir(&dir)) return FALSE;
637 sleep_monster(dir, plev);
640 (void)set_fast(randint1(20 + plev) + plev, FALSE);
644 if (!get_aim_dir(&dir)) return FALSE;
645 else msg_print(_("<破滅の手>を放った!", "You invoke the Hand of Doom!"));
647 fire_ball_hide(GF_HAND_DOOM, dir, 200, 0);
651 msg_print(_("自分の傷に念を集中した。", "You concentrate on your wounds!"));
652 (void)hp_player(plev*6);
657 msg_print(_("無傷の球の呪文を唱えた。", "You cast a Globe of Invulnerability."));
658 (void)set_invuln(randint1(7) + 7, FALSE);
661 teleport_player(10, 0L);
664 teleport_player(plev * 5, 0L);
668 if (damage == 1 || damage == 2)
669 msg_print(_("「『ザ・ワールド』!時は止まった!」", "You yell 'The World! Time has stopped!'"));
670 else if (damage == 3 || damage == 6)
671 msg_print(_("「時よ!」", "You yell 'Time!'"));
677 p_ptr->energy_need -= 1000 + (100 + randint1(200)+200)*TURNS_PER_TICK/10;
679 p_ptr->redraw |= (PR_MAP);
680 p_ptr->update |= (PU_MONSTERS);
682 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
692 GAME_TEXT m_name[MAX_NLEN];
694 if (!target_set(TARGET_KILL)) return FALSE;
695 if (!cave[target_row][target_col].m_idx) break;
696 if (!player_has_los_bold(target_row, target_col)) break;
697 if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
698 m_ptr = &m_list[cave[target_row][target_col].m_idx];
699 r_ptr = &r_info[m_ptr->r_idx];
700 monster_desc(m_name, m_ptr, 0);
701 if (r_ptr->flagsr & RFR_RES_TELE)
703 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
705 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
706 msg_format(_("%sには効果がなかった!", "%s is unaffected!"), m_name);
710 else if (r_ptr->level > randint1(100))
712 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
713 msg_format(_("%sには耐性がある!", "%s resists!"), m_name);
718 msg_format(_("%sを引き戻した。", "You command %s to return."), m_name);
720 teleport_monster_to(cave[target_row][target_col].m_idx, p_ptr->y, p_ptr->x, 100, TELEPORT_PASSIVE);
724 if (!get_aim_dir(&dir)) return FALSE;
726 (void)fire_beam(GF_AWAY_ALL, dir, plev);
733 GAME_TEXT m_name[MAX_NLEN];
735 if (!target_set(TARGET_KILL)) return FALSE;
736 target_m_idx = cave[target_row][target_col].m_idx;
737 if (!target_m_idx) break;
738 if (!player_has_los_bold(target_row, target_col)) break;
739 if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
740 m_ptr = &m_list[target_m_idx];
741 r_ptr = &r_info[m_ptr->r_idx];
742 monster_desc(m_name, m_ptr, 0);
743 msg_format(_("%^sの足を指さした。", "You gesture at %^s's feet."), m_name);
745 if ((r_ptr->flagsr & (RFR_EFF_RES_NEXU_MASK | RFR_RES_TELE)) ||
746 (r_ptr->flags1 & RF1_QUESTOR) || (r_ptr->level + randint1(50) > plev + randint1(60)))
748 msg_print(_("しかし効果がなかった!", "%^s is unaffected!"));
750 else teleport_level(target_m_idx);
755 if (!get_aim_dir(&dir)) return FALSE;
756 else msg_print(_("光の剣を放った。", "You throw a psycho-spear."));
757 (void)fire_beam(GF_PSY_SPEAR, dir, damage);
761 msg_print(_("暗闇の中で手を振った。", "You gesture in shadow."));
762 (void)unlite_area(10, 3);
766 if (!target_set(TARGET_KILL)) return FALSE;
767 msg_print(_("呪文を唱えて邪悪に微笑んだ。", "You cast a spell and cackles evilly."));
768 trap_creation(target_row, target_col);
771 msg_print(_("しかし何も起きなかった。", "Nothing happen."));
774 msg_print(_("死者復活の呪文を唱えた。", "You cast a animate dead."));
775 (void)animate_dead(0, p_ptr->y, p_ptr->x);
780 if (!target_set(TARGET_KILL)) return FALSE;
782 msg_print(_("援軍を召喚した。", "You summon minions."));
783 for (k = 0;k < 4; k++)
785 (void)summon_kin_player(plev, target_row, target_col, (PM_FORCE_PET | PM_ALLOW_GROUP));
792 int max_cyber = (dun_level / 50) + randint1(3);
793 if (!target_set(TARGET_KILL)) return FALSE;
794 msg_print(_("サイバーデーモンを召喚した!", "You summon Cyberdemons!"));
795 if (max_cyber > 4) max_cyber = 4;
796 for (k = 0;k < max_cyber; k++)
797 summon_specific(-1, target_row, target_col, plev, SUMMON_CYBER, mode, '\0');
803 if (!target_set(TARGET_KILL)) return FALSE;
804 msg_print(_("仲間を召喚した。", "You summon help."));
805 for (k = 0;k < 1; k++)
806 summon_specific(-1, target_row, target_col, plev, 0, (mode | u_mode), '\0');
812 if (!target_set(TARGET_KILL)) return FALSE;
813 msg_print(_("モンスターを召喚した!", "You summon monsters!"));
814 for (k = 0;k < 6; k++)
815 summon_specific(-1, target_row, target_col, plev, 0, (mode | u_mode), '\0');
821 if (!target_set(TARGET_KILL)) return FALSE;
822 msg_print(_("アリを召喚した。", "You summon ants."));
823 for (k = 0;k < 6; k++)
824 summon_specific(-1, target_row, target_col, plev, SUMMON_ANT, mode, '\0');
830 if (!target_set(TARGET_KILL)) return FALSE;
831 msg_print(_("蜘蛛を召喚した。", "You summon spiders."));
832 for (k = 0;k < 6; k++)
833 summon_specific(-1, target_row, target_col, plev, SUMMON_SPIDER, mode, '\0');
839 if (!target_set(TARGET_KILL)) return FALSE;
840 msg_print(_("ハウンドを召喚した。", "You summon hounds."));
841 for (k = 0;k < 4; k++)
842 summon_specific(-1, target_row, target_col, plev, SUMMON_HOUND, mode, '\0');
848 if (!target_set(TARGET_KILL)) return FALSE;
849 msg_print(_("ヒドラを召喚した。", "You summon hydras."));
850 for (k = 0;k < 4; k++)
851 summon_specific(-1, target_row, target_col, plev, SUMMON_HYDRA, mode, '\0');
857 if (!target_set(TARGET_KILL)) return FALSE;
858 msg_print(_("天使を召喚した!", "You summon angel!"));
859 for (k = 0;k < 1; k++)
860 summon_specific(-1, target_row, target_col, plev, SUMMON_ANGEL, mode, '\0');
866 if (!target_set(TARGET_KILL)) return FALSE;
867 msg_print(_("混沌の宮廷から悪魔を召喚した!", "You summon a demon from the Courts of Chaos!"));
868 for (k = 0;k < 1; k++)
869 summon_specific(-1, target_row, target_col, plev, SUMMON_DEMON, (mode | u_mode), '\0');
875 if (!target_set(TARGET_KILL)) return FALSE;
876 msg_print(_("アンデッドの強敵を召喚した!", "You summon an undead adversary!"));
877 for (k = 0;k < 1; k++)
878 summon_specific(-1, target_row, target_col, plev, SUMMON_UNDEAD, (mode | u_mode), '\0');
884 if (!target_set(TARGET_KILL)) return FALSE;
885 msg_print(_("ドラゴンを召喚した!", "You summon dragon!"));
886 for (k = 0;k < 1; k++)
887 summon_specific(-1, target_row, target_col, plev, SUMMON_DRAGON, (mode | u_mode), '\0');
893 if (!target_set(TARGET_KILL)) return FALSE;
894 msg_print(_("強力なアンデッドを召喚した!", "You summon greater undead!"));
895 for (k = 0;k < 6; k++)
896 summon_specific(-1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode), '\0');
902 if (!target_set(TARGET_KILL)) return FALSE;
903 msg_print(_("古代ドラゴンを召喚した!", "You summon ancient dragons!"));
904 for (k = 0;k < 4; k++)
905 summon_specific(-1, target_row, target_col, plev, SUMMON_HI_DRAGON, (mode | u_mode), '\0');
911 if (!target_set(TARGET_KILL)) return FALSE;
912 msg_print(_("アンバーの王族を召喚した!", "You summon Lords of Amber!"));
913 for (k = 0;k < 4; k++)
914 summon_specific(-1, target_row, target_col, plev, SUMMON_AMBERITES, (mode | PM_ALLOW_UNIQUE), '\0');
920 if (!target_set(TARGET_KILL)) return FALSE;
921 msg_print(_("特別な強敵を召喚した!", "You summon special opponents!"));
922 for (k = 0;k < 4; k++)
923 if (summon_specific(-1, target_row, target_col, plev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE), '\0')) count++;
924 for (k = count;k < 4; k++)
925 summon_specific(-1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode), '\0');
937 * @brief ものまねコマンドのメインルーチン /
938 * do_cmd_cast calls this function if the player's class is 'imitator'.
939 * @param baigaesi TRUEならば倍返し上の処理として行う
940 * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。
942 * If a valid spell is chosen, saves it in '*sn' and returns TRUE
943 * If the user hits escape, returns FALSE, and set '*sn' to -1
944 * If there are no legal choices, returns FALSE, and sets '*sn' to -2
946 * The "prompt" should be "cast", "recite", or "study"
947 * The "known" should be TRUE for cast/pray, FALSE for study
949 * nb: This function has a (trivial) display bug which will be obvious
950 * when you run it. It's probably easy to fix but I haven't tried,
953 bool do_cmd_mane(bool baigaesi)
958 PLAYER_LEVEL plev = p_ptr->lev;
963 /* not if confused */
966 msg_print(_("混乱していて集中できない!", "You are too confused!"));
970 if (!p_ptr->mane_num)
972 msg_print(_("まねられるものが何もない!", "You don't remember any action!"));
977 if (!get_mane_power(&n, baigaesi)) return FALSE;
979 spell = monster_powers[p_ptr->mane_spell[n]];
981 /* Spell failure chance */
982 chance = spell.manefail;
984 /* Reduce failure rate by "effective" level adjustment */
985 if (plev > spell.level) chance -= 3 * (plev - spell.level);
987 /* Reduce failure rate by 1 stat and DEX adjustment */
988 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[spell.use_stat]] + adj_mag_stat[p_ptr->stat_ind[A_DEX]] - 2) / 2;
990 if (spell.manedam) chance = chance * damage / spell.manedam;
992 chance += p_ptr->to_m_chance;
994 /* Extract the minimum failure rate */
995 minfail = adj_mag_fail[p_ptr->stat_ind[spell.use_stat]];
997 /* Minimum failure rate */
998 if (chance < minfail) chance = minfail;
1000 /* Stunning makes spells harder */
1001 if (p_ptr->stun > 50) chance += 25;
1002 else if (p_ptr->stun) chance += 15;
1004 /* Always a 5 percent chance of working */
1005 if (chance > 95) chance = 95;
1008 if (randint0(100) < chance)
1010 if (flush_failure) flush();
1011 msg_print(_("ものまねに失敗した!", "You failed to concentrate hard enough!"));
1018 /* Cast the spell */
1019 cast = use_mane(p_ptr->mane_spell[n]);
1021 if (!cast) return FALSE;
1025 for (j = n; j < p_ptr->mane_num;j++)
1027 p_ptr->mane_spell[j] = p_ptr->mane_spell[j+1];
1028 p_ptr->mane_dam[j] = p_ptr->mane_dam[j+1];
1031 p_ptr->energy_use = 100;
1033 p_ptr->redraw |= (PR_IMITATION);
1034 p_ptr->window |= (PW_PLAYER);
1035 p_ptr->window |= (PW_SPELL);