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 ¤â¤Î¤Þ¤Í¤Î¸úÎϤμïÎà
21 * @param dam ¤â¤Î¤Þ¤Í¤Î°ÒÎÏ
24 static void mane_info(char *p, int power, int dam)
26 int plev = p_ptr->lev;
30 cptr s_range = "ÈÏ°Ï:";
31 cptr s_heal = "²óÉü:";
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;
115 /* Assume cancelled */
118 /* Nothing chosen yet */
124 num = p_ptr->mane_num;
126 /* Build a prompt (accept all spells) */
127 (void)strnfmt(out_val, 78,
129 "(%c-%c, '*'¤Ç°ìÍ÷, ESC) ¤É¤Î%s¤ò¤Þ¤Í¤Þ¤¹¤«¡©",
131 "(%c-%c, *=List, ESC=exit) Use which %s? ",
133 I2A(0), I2A(num - 1), p);
135 /* Get a spell from the user */
137 choice= always_show_list ? ESCAPE:1 ;
140 if(choice==ESCAPE) choice = ' ';
141 else if( !get_com(out_val, &choice, TRUE) )break;
144 if ((choice == ' ') || (choice == '*') || (choice == '?'))
154 /* Save the screen */
157 /* Display a list of spells */
160 put_str("̾Á°", y, x + 5);
162 put_str("Name", y, x + 5);
166 put_str("¼ºÎ¨ ¸ú²Ì", y, x + 36);
168 put_str("Fail Info", y, x + 35);
172 /* Dump the spells */
173 for (i = 0; i < num; i++)
175 /* Access the spell */
176 spell = monster_powers[p_ptr->mane_spell[i]];
178 chance = spell.manefail;
180 /* Reduce failure rate by "effective" level adjustment */
181 if (plev > spell.level) chance -= 3 * (plev - spell.level);
183 /* Reduce failure rate by INT/WIS adjustment */
184 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[spell.use_stat]] + adj_mag_stat[p_ptr->stat_ind[A_DEX]] - 2) / 2;
186 if (spell.manedam) chance = chance * p_ptr->mane_dam[i] / spell.manedam;
188 chance += p_ptr->to_m_chance;
190 /* Extract the minimum failure rate */
191 minfail = adj_mag_fail[p_ptr->stat_ind[spell.use_stat]];
193 /* Minimum failure rate */
194 if (chance < minfail) chance = minfail;
196 /* Stunning makes spells harder */
197 if (p_ptr->stun > 50) chance += 25;
198 else if (p_ptr->stun) chance += 15;
200 /* Always a 5 percent chance of working */
201 if (chance > 95) chance = 95;
204 mane_info(comment, p_ptr->mane_spell[i], (baigaesi ? p_ptr->mane_dam[i]*2 : p_ptr->mane_dam[i]));
206 /* Dump the spell --(-- */
207 sprintf(psi_desc, " %c) %-30s %3d%%%s",
210 prt(psi_desc, y + i + 1, x);
213 /* Clear the bottom line */
214 prt("", y + i + 1, x);
223 /* Restore the screen */
232 ask = isupper(choice);
235 if (ask) choice = tolower(choice);
237 /* Extract request */
238 i = (islower(choice) ? A2I(choice) : -1);
240 /* Totally Illegal */
241 if ((i < 0) || (i >= num))
247 /* Save the spell index */
248 spell = monster_powers[p_ptr->mane_spell[i]];
257 (void) strnfmt(tmp_val, 78, "%s¤ò¤Þ¤Í¤Þ¤¹¤«¡©", monster_powers[p_ptr->mane_spell[i]].name);
259 (void)strnfmt(tmp_val, 78, "Use %s? ", monster_powers[p_ptr->mane_spell[i]].name);
263 /* Belay that order */
264 if (!get_check(tmp_val)) continue;
271 /* Restore the screen */
272 if (redraw) screen_load();
275 p_ptr->window |= (PW_SPELL);
280 /* Abort if needed */
281 if (!flag) return (FALSE);
283 /* Save the choice */
286 damage = (baigaesi ? p_ptr->mane_dam[i]*2 : p_ptr->mane_dam[i]);
294 * @brief ¤â¤Î¤Þ¤Í½èÍý¤Îȯư /
295 * do_cmd_cast calls this function if the player's class is 'imitator'.
296 * @param spell ȯư¤¹¤ë¥â¥ó¥¹¥¿¡¼¹¶·â¤ÎID
297 * @return ½èÍý¤ò¼Â¹Ô¤·¤¿¤éTRUE¡¢¥¥ã¥ó¥»¥ë¤·¤¿¾ì¹çFALSE¤òÊÖ¤¹¡£
299 static bool use_mane(int spell)
302 int plev = p_ptr->lev;
303 u32b mode = (PM_ALLOW_GROUP | PM_FORCE_PET);
306 if (randint1(50+plev) < plev/10) u_mode = PM_ALLOW_UNIQUE;
314 msg_print("¤«¤ó¹â¤¤¶âÀÚ¤êÀ¼¤ò¤¢¤²¤¿¡£");
316 msg_print("You make a high pitched shriek.");
319 aggravate_monsters(0);
327 if (!target_set(TARGET_KILL)) return FALSE;
328 m_idx = cave[target_row][target_col].m_idx;
330 if (!player_has_los_bold(target_row, target_col)) break;
331 if (!projectable(py, px, target_row, target_col)) break;
332 dispel_monster_status(m_idx);
336 if (!get_aim_dir(&dir)) return FALSE;
338 else msg_print("¥í¥±¥Ã¥È¤òȯ¼Í¤·¤¿¡£");
340 else msg_print("You fire a rocket.");
343 fire_rocket(GF_ROCKET, dir, damage, 2);
346 if (!get_aim_dir(&dir)) return FALSE;
348 else msg_print("Ìð¤òÊü¤Ã¤¿¡£");
350 else msg_print("You fire an arrow.");
353 fire_bolt(GF_ARROW, dir, damage);
362 if (!get_aim_dir(&dir)) return FALSE;
364 else msg_print("»À¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
366 else msg_print("You breathe acid.");
369 fire_ball(GF_ACID, dir, damage, (plev > 35 ? -3 : -2));
372 if (!get_aim_dir(&dir)) return FALSE;
374 else msg_print("°ðºÊ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
376 else msg_print("You breathe lightning.");
379 fire_ball(GF_ELEC, dir, damage, (plev > 35 ? -3 : -2));
382 if (!get_aim_dir(&dir)) return FALSE;
384 else msg_print("²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
386 else msg_print("You breathe fire.");
389 fire_ball(GF_FIRE, dir, damage, (plev > 35 ? -3 : -2));
392 if (!get_aim_dir(&dir)) return FALSE;
394 else msg_print("Î䵤¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
396 else msg_print("You breathe frost.");
399 fire_ball(GF_COLD, dir, damage, (plev > 35 ? -3 : -2));
402 if (!get_aim_dir(&dir)) return FALSE;
404 else msg_print("¥¬¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
406 else msg_print("You breathe gas.");
409 fire_ball(GF_POIS, dir, damage, (plev > 35 ? -3 : -2));
412 if (!get_aim_dir(&dir)) return FALSE;
414 else msg_print("ÃϹö¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
416 else msg_print("You breathe nether.");
419 fire_ball(GF_NETHER, dir, damage, (plev > 35 ? -3 : -2));
422 if (!get_aim_dir(&dir)) return FALSE;
424 else msg_print("Á®¸÷¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
426 else msg_print("You breathe light.");
429 fire_ball(GF_LITE, dir, damage, (plev > 35 ? -3 : -2));
432 if (!get_aim_dir(&dir)) return FALSE;
434 else msg_print("°Å¹õ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
436 else msg_print("You breathe darkness.");
439 fire_ball(GF_DARK, dir, damage, (plev > 35 ? -3 : -2));
442 if (!get_aim_dir(&dir)) return FALSE;
444 else msg_print("º®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
446 else msg_print("You breathe confusion.");
449 fire_ball(GF_CONFUSION, dir, damage, (plev > 35 ? -3 : -2));
452 if (!get_aim_dir(&dir)) return FALSE;
454 else msg_print("¹ì²»¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
456 else msg_print("You breathe sound.");
459 fire_ball(GF_SOUND, dir, damage, (plev > 35 ? -3 : -2));
462 if (!get_aim_dir(&dir)) return FALSE;
464 else msg_print("¥«¥ª¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
466 else msg_print("You breathe chaos.");
469 fire_ball(GF_CHAOS, dir, damage, (plev > 35 ? -3 : -2));
472 if (!get_aim_dir(&dir)) return FALSE;
474 else msg_print("Îô²½¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
476 else msg_print("You breathe disenchantment.");
479 fire_ball(GF_DISENCHANT, dir, damage, (plev > 35 ? -3 : -2));
482 if (!get_aim_dir(&dir)) return FALSE;
484 else msg_print("°ø²Ìº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
486 else msg_print("You breathe nexus.");
489 fire_ball(GF_NEXUS, dir, damage, (plev > 35 ? -3 : -2));
492 if (!get_aim_dir(&dir)) return FALSE;
494 else msg_print("»þ´ÖµÕž¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
496 else msg_print("You breathe time.");
499 fire_ball(GF_TIME, dir, damage, (plev > 35 ? -3 : -2));
502 if (!get_aim_dir(&dir)) return FALSE;
504 else msg_print("ÃÙÆߤΥ֥쥹¤òÅǤ¤¤¿¡£");
506 else msg_print("You breathe inertia.");
509 fire_ball(GF_INERTIA, dir, damage, (plev > 35 ? -3 : -2));
512 if (!get_aim_dir(&dir)) return FALSE;
514 else msg_print("½ÅÎϤΥ֥쥹¤òÅǤ¤¤¿¡£");
516 else msg_print("You breathe gravity.");
519 fire_ball(GF_GRAVITY, dir, damage, (plev > 35 ? -3 : -2));
522 if (!get_aim_dir(&dir)) return FALSE;
524 else msg_print("ÇËÊҤΥ֥쥹¤òÅǤ¤¤¿¡£");
526 else msg_print("You breathe shards.");
529 fire_ball(GF_SHARDS, dir, damage, (plev > 35 ? -3 : -2));
532 if (!get_aim_dir(&dir)) return FALSE;
534 else msg_print("¥×¥é¥º¥Þ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
536 else msg_print("You breathe plasma.");
539 fire_ball(GF_PLASMA, dir, damage, (plev > 35 ? -3 : -2));
542 if (!get_aim_dir(&dir)) return FALSE;
544 else msg_print("¥Õ¥©¡¼¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
546 else msg_print("You breathe force.");
549 fire_ball(GF_FORCE, dir, damage, (plev > 35 ? -3 : -2));
552 if (!get_aim_dir(&dir)) return FALSE;
554 else msg_print("ËâÎϤΥ֥쥹¤òÅǤ¤¤¿¡£");
556 else msg_print("You breathe mana.");
559 fire_ball(GF_MANA, dir, damage, (plev > 35 ? -3 : -2));
562 if (!get_aim_dir(&dir)) return FALSE;
564 else msg_print("Êü¼Íǽµå¤òÊü¤Ã¤¿¡£");
566 else msg_print("You cast a ball of radiation.");
569 fire_ball(GF_NUKE, dir, damage, 2);
572 if (!get_aim_dir(&dir)) return FALSE;
574 else msg_print("Êü¼ÍÀÇÑ´þʪ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
576 else msg_print("You breathe toxic waste.");
579 fire_ball(GF_NUKE, dir, damage, (plev > 35 ? -3 : -2));
582 if (!get_aim_dir(&dir)) return FALSE;
584 else msg_print("½ã¥í¥°¥ë¥¹¤òÊü¤Ã¤¿¡£");
586 else msg_print("You invoke a raw Logrus.");
589 fire_ball(GF_CHAOS, dir, damage, 4);
592 if (!get_aim_dir(&dir)) return FALSE;
594 else msg_print("ʬ²ò¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
596 else msg_print("You breathe disintegration.");
599 fire_ball(GF_DISINTEGRATE, dir, damage, (plev > 35 ? -3 : -2));
602 if (!get_aim_dir(&dir)) return FALSE;
604 else msg_print("¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
606 else msg_print("You cast an acid ball.");
609 fire_ball(GF_ACID, dir, damage, 2);
612 if (!get_aim_dir(&dir)) return FALSE;
614 else msg_print("¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
616 else msg_print("You cast a lightning ball.");
619 fire_ball(GF_ELEC, dir, damage, 2);
622 if (!get_aim_dir(&dir)) return FALSE;
624 else msg_print("¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
626 else msg_print("You cast a fire ball.");
629 fire_ball(GF_FIRE, dir, damage, 2);
632 if (!get_aim_dir(&dir)) return FALSE;
634 else msg_print("¥¢¥¤¥¹¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
636 else msg_print("You cast a frost ball.");
639 fire_ball(GF_COLD, dir, damage, 2);
642 if (!get_aim_dir(&dir)) return FALSE;
644 else msg_print("°½±À¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
646 else msg_print("You cast a stinking cloud.");
649 fire_ball(GF_POIS, dir, damage, 2);
652 if (!get_aim_dir(&dir)) return FALSE;
654 else msg_print("ÃϹöµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
656 else msg_print("You cast a nether ball.");
659 fire_ball(GF_NETHER, dir, damage, 2);
662 if (!get_aim_dir(&dir)) return FALSE;
664 else msg_print("ή¤ì¤ë¤è¤¦¤Ê¿È¿¶¤ê¤ò¤·¤¿¡£");
666 else msg_print("You gesture fluidly.");
669 fire_ball(GF_WATER, dir, damage, 4);
672 if (!get_aim_dir(&dir)) return FALSE;
674 else msg_print("ËâÎϤÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£");
676 else msg_print("You invoke a mana storm.");
679 fire_ball(GF_MANA, dir, damage, 4);
682 if (!get_aim_dir(&dir)) return FALSE;
684 else msg_print("°Å¹õ¤ÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£");
686 else msg_print("You invoke a darkness storm.");
689 fire_ball(GF_DARK, dir, damage, 4);
692 if (!get_aim_dir(&dir)) return FALSE;
693 fire_ball_hide(GF_DRAIN_MANA, dir, randint1(plev*3)+plev, 0);
696 if (!get_aim_dir(&dir)) return FALSE;
697 fire_ball_hide(GF_MIND_BLAST, dir, damage, 0);
700 if (!get_aim_dir(&dir)) return FALSE;
701 fire_ball_hide(GF_BRAIN_SMASH, dir, damage, 0);
704 if (!get_aim_dir(&dir)) return FALSE;
705 fire_ball_hide(GF_CAUSE_1, dir, damage, 0);
708 if (!get_aim_dir(&dir)) return FALSE;
709 fire_ball_hide(GF_CAUSE_2, dir, damage, 0);
712 if (!get_aim_dir(&dir)) return FALSE;
713 fire_ball_hide(GF_CAUSE_3, dir, damage, 0);
716 if (!get_aim_dir(&dir)) return FALSE;
717 fire_ball_hide(GF_CAUSE_4, dir, damage, 0);
720 if (!get_aim_dir(&dir)) return FALSE;
722 else msg_print("¥¢¥·¥Ã¥É¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
724 else msg_print("You cast an acid bolt.");
727 fire_bolt(GF_ACID, dir, damage);
730 if (!get_aim_dir(&dir)) return FALSE;
732 else msg_print("¥µ¥ó¥À¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
734 else msg_print("You cast a lightning bolt.");
737 fire_bolt(GF_ELEC, dir, damage);
740 if (!get_aim_dir(&dir)) return FALSE;
742 else msg_print("¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
744 else msg_print("You cast a fire bolt.");
747 fire_bolt(GF_FIRE, dir, damage);
750 if (!get_aim_dir(&dir)) return FALSE;
752 else msg_print("¥¢¥¤¥¹¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
754 else msg_print("You cast a frost bolt.");
757 fire_bolt(GF_COLD, dir, damage);
760 if (!get_aim_dir(&dir)) return FALSE;
762 else msg_print("¥¹¥¿¡¼¥Ð¡¼¥¹¥È¤Î¼öʸ¤òÇ°¤¸¤¿¡£");
764 else msg_print("You invoke a starburst.");
767 fire_ball(GF_LITE, dir, damage, 4);
770 if (!get_aim_dir(&dir)) return FALSE;
772 else msg_print("ÃϹö¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
774 else msg_print("You cast a nether bolt.");
777 fire_bolt(GF_NETHER, dir, damage);
780 if (!get_aim_dir(&dir)) return FALSE;
782 else msg_print("¥¦¥©¡¼¥¿¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
784 else msg_print("You cast a water bolt.");
787 fire_bolt(GF_WATER, dir, damage);
790 if (!get_aim_dir(&dir)) return FALSE;
792 else msg_print("ËâÎϤÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
794 else msg_print("You cast a mana bolt.");
797 fire_bolt(GF_MANA, dir, damage);
800 if (!get_aim_dir(&dir)) return FALSE;
802 else msg_print("¥×¥é¥º¥Þ¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
804 else msg_print("You cast a plasma bolt.");
807 fire_bolt(GF_PLASMA, dir, damage);
810 if (!get_aim_dir(&dir)) return FALSE;
812 else msg_print("¶Ë´¨¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
814 else msg_print("You cast a ice bolt.");
817 fire_bolt(GF_ICE, dir, damage);
819 case MS_MAGIC_MISSILE:
820 if (!get_aim_dir(&dir)) return FALSE;
822 else msg_print("¥Þ¥¸¥Ã¥¯¡¦¥ß¥µ¥¤¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
824 else msg_print("You cast a magic missile.");
827 fire_bolt(GF_MISSILE, dir, damage);
830 if (!get_aim_dir(&dir)) return FALSE;
832 else msg_print("¶²¤í¤·¤²¤Ê¸¸³Ð¤òºî¤ê½Ð¤·¤¿¡£");
834 else msg_print("You cast a fearful illusion.");
837 fear_monster(dir, plev+10);
840 if (!get_aim_dir(&dir)) return FALSE;
841 confuse_monster(dir, plev * 2);
844 if (!get_aim_dir(&dir)) return FALSE;
846 else msg_print("ͶÏÇŪ¤Ê¸¸³Ð¤ò¤Ä¤¯¤ê½Ð¤·¤¿¡£");
848 else msg_print("You cast a mesmerizing illusion.");
851 confuse_monster(dir, plev * 2);
854 if (!get_aim_dir(&dir)) return FALSE;
855 slow_monster(dir, plev);
858 if (!get_aim_dir(&dir)) return FALSE;
859 sleep_monster(dir, plev);
862 (void)set_fast(randint1(20 + plev) + plev, FALSE);
866 if (!get_aim_dir(&dir)) return FALSE;
868 else msg_print("<ÇËÌǤμê>¤òÊü¤Ã¤¿¡ª");
870 else msg_print("You invoke the Hand of Doom!");
873 fire_ball_hide(GF_HAND_DOOM, dir, 200, 0);
878 msg_print("¼«Ê¬¤Î½ý¤ËÇ°¤ò½¸Ã椷¤¿¡£");
880 msg_print("You concentrate on your wounds!");
882 (void)hp_player(plev*6);
888 msg_print("̵½ý¤Îµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
890 msg_print("You cast a Globe of Invulnerability.");
892 (void)set_invuln(randint1(7) + 7, FALSE);
895 teleport_player(10, 0L);
898 teleport_player(plev * 5, 0L);
902 if (damage == 1 || damage == 2)
904 msg_print("¡Ö¡Ø¥¶¡¦¥ï¡¼¥ë¥É¡Ù¡ª»þ¤Ï»ß¤Þ¤Ã¤¿¡ª¡×");
906 msg_print("You yell 'The World! Time has stopped!'");
908 else if (damage == 3 || damage == 6)
910 msg_print("¡Ö»þ¤è¡ª¡×");
912 msg_print("You yell 'Time!'");
919 p_ptr->energy_need -= 1000 + (100 + randint1(200)+200)*TURNS_PER_TICK/10;
922 p_ptr->redraw |= (PR_MAP);
924 /* Update monsters */
925 p_ptr->update |= (PU_MONSTERS);
928 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
940 if (!target_set(TARGET_KILL)) return FALSE;
941 if (!cave[target_row][target_col].m_idx) break;
942 if (!player_has_los_bold(target_row, target_col)) break;
943 if (!projectable(py, px, target_row, target_col)) break;
944 m_ptr = &m_list[cave[target_row][target_col].m_idx];
945 r_ptr = &r_info[m_ptr->r_idx];
946 monster_desc(m_name, m_ptr, 0);
947 if (r_ptr->flagsr & RFR_RES_TELE)
949 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
951 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
953 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª", m_name);
955 msg_format("%s is unaffected!", m_name);
960 else if (r_ptr->level > randint1(100))
962 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
964 msg_format("%s¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª", m_name);
966 msg_format("%s resists!", m_name);
973 msg_format("%s¤ò°ú¤Ìᤷ¤¿¡£", m_name);
975 msg_format("You command %s to return.", m_name);
978 teleport_monster_to(cave[target_row][target_col].m_idx, py, px, 100, TELEPORT_PASSIVE);
982 if (!get_aim_dir(&dir)) return FALSE;
984 (void)fire_beam(GF_AWAY_ALL, dir, plev);
993 if (!target_set(TARGET_KILL)) return FALSE;
994 target_m_idx = cave[target_row][target_col].m_idx;
995 if (!target_m_idx) break;
996 if (!player_has_los_bold(target_row, target_col)) break;
997 if (!projectable(py, px, target_row, target_col)) break;
998 m_ptr = &m_list[target_m_idx];
999 r_ptr = &r_info[m_ptr->r_idx];
1000 monster_desc(m_name, m_ptr, 0);
1002 msg_format("%^s¤Î¤ò»Ø¤µ¤·¤¿¡£", m_name);
1004 msg_format("You gesture at %^s's feet.", m_name);
1007 if ((r_ptr->flagsr & (RFR_EFF_RES_NEXU_MASK | RFR_RES_TELE)) ||
1008 (r_ptr->flags1 & RF1_QUESTOR) || (r_ptr->level + randint1(50) > plev + randint1(60)))
1011 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
1013 msg_format("%^s is unaffected!", m_name);
1016 else teleport_level(target_m_idx);
1020 if (!get_aim_dir(&dir)) return FALSE;
1023 else msg_print("¸÷¤Î·õ¤òÊü¤Ã¤¿¡£");
1025 else msg_print("You throw a psycho-spear.");
1027 (void)fire_beam(GF_PSY_SPEAR, dir, damage);
1031 msg_print("°Å°Ç¤ÎÃæ¤Ç¼ê¤ò¿¶¤Ã¤¿¡£");
1033 msg_print("You gesture in shadow.");
1035 (void)unlite_area(10, 3);
1038 if (!target_set(TARGET_KILL)) return FALSE;
1040 msg_print("¼öʸ¤ò¾§¤¨¤Æ¼Ù°¤ËÈù¾Ð¤ó¤À¡£");
1042 msg_print("You cast a spell and cackles evilly.");
1044 trap_creation(target_row, target_col);
1048 msg_print("¤·¤«¤·²¿¤âµ¯¤¤Ê¤«¤Ã¤¿¡£");
1050 msg_print("Nothing happen.");
1055 msg_print("»à¼ÔÉü³è¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1057 msg_print("You cast a animate dead.");
1059 (void)animate_dead(0, py, px);
1064 if (!target_set(TARGET_KILL)) return FALSE;
1067 msg_print("±ç·³¤ò¾¤´¤·¤¿¡£");
1069 msg_print("You summon minions.");
1071 for (k = 0;k < 4; k++)
1073 (void)summon_kin_player(plev, target_row, target_col, (PM_FORCE_PET | PM_ALLOW_GROUP));
1080 int max_cyber = (dun_level / 50) + randint1(3);
1081 if (!target_set(TARGET_KILL)) return FALSE;
1083 msg_print("¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ò¾¤´¤·¤¿¡ª");
1085 msg_print("You summon Cyberdemons!");
1087 if (max_cyber > 4) max_cyber = 4;
1088 for (k = 0;k < max_cyber; k++)
1089 summon_specific(-1, target_row, target_col, plev, SUMMON_CYBER, mode);
1095 if (!target_set(TARGET_KILL)) return FALSE;
1097 msg_print("Ãç´Ö¤ò¾¤´¤·¤¿¡£");
1099 msg_print("You summon help.");
1101 for (k = 0;k < 1; k++)
1102 summon_specific(-1, target_row, target_col, plev, 0, (mode | u_mode));
1108 if (!target_set(TARGET_KILL)) return FALSE;
1110 msg_print("¥â¥ó¥¹¥¿¡¼¤ò¾¤´¤·¤¿¡ª");
1112 msg_print("You summon monsters!");
1114 for (k = 0;k < 6; k++)
1115 summon_specific(-1, target_row, target_col, plev, 0, (mode | u_mode));
1121 if (!target_set(TARGET_KILL)) return FALSE;
1123 msg_print("¥¢¥ê¤ò¾¤´¤·¤¿¡£");
1125 msg_print("You summon ants.");
1127 for (k = 0;k < 6; k++)
1128 summon_specific(-1, target_row, target_col, plev, SUMMON_ANT, mode);
1134 if (!target_set(TARGET_KILL)) return FALSE;
1136 msg_print("ÃØéá¤ò¾¤´¤·¤¿¡£");
1138 msg_print("You summon spiders.");
1140 for (k = 0;k < 6; k++)
1141 summon_specific(-1, target_row, target_col, plev, SUMMON_SPIDER, mode);
1147 if (!target_set(TARGET_KILL)) return FALSE;
1149 msg_print("¥Ï¥¦¥ó¥É¤ò¾¤´¤·¤¿¡£");
1151 msg_print("You summon hounds.");
1153 for (k = 0;k < 4; k++)
1154 summon_specific(-1, target_row, target_col, plev, SUMMON_HOUND, mode);
1160 if (!target_set(TARGET_KILL)) return FALSE;
1162 msg_print("¥Ò¥É¥é¤ò¾¤´¤·¤¿¡£");
1164 msg_print("You summon hydras.");
1166 for (k = 0;k < 4; k++)
1167 summon_specific(-1, target_row, target_col, plev, SUMMON_HYDRA, mode);
1173 if (!target_set(TARGET_KILL)) return FALSE;
1175 msg_print("Å·»È¤ò¾¤´¤·¤¿¡ª");
1177 msg_print("You summon angel!");
1179 for (k = 0;k < 1; k++)
1180 summon_specific(-1, target_row, target_col, plev, SUMMON_ANGEL, mode);
1186 if (!target_set(TARGET_KILL)) return FALSE;
1188 msg_print("º®Æ٤εÜÄ¤é°Ëâ¤ò¾¤´¤·¤¿¡ª");
1190 msg_print("You summon a demon from the Courts of Chaos!");
1192 for (k = 0;k < 1; k++)
1193 summon_specific(-1, target_row, target_col, plev, SUMMON_DEMON, (mode | u_mode));
1199 if (!target_set(TARGET_KILL)) return FALSE;
1201 msg_print("¥¢¥ó¥Ç¥Ã¥É¤Î¶¯Å¨¤ò¾¤´¤·¤¿¡ª");
1203 msg_print("You summon an undead adversary!");
1205 for (k = 0;k < 1; k++)
1206 summon_specific(-1, target_row, target_col, plev, SUMMON_UNDEAD, (mode | u_mode));
1212 if (!target_set(TARGET_KILL)) return FALSE;
1214 msg_print("¥É¥é¥´¥ó¤ò¾¤´¤·¤¿¡ª");
1216 msg_print("You summon dragon!");
1218 for (k = 0;k < 1; k++)
1219 summon_specific(-1, target_row, target_col, plev, SUMMON_DRAGON, (mode | u_mode));
1222 case MS_S_HI_UNDEAD:
1225 if (!target_set(TARGET_KILL)) return FALSE;
1227 msg_print("¶¯ÎϤʥ¢¥ó¥Ç¥Ã¥É¤ò¾¤´¤·¤¿¡ª");
1229 msg_print("You summon greater undead!");
1231 for (k = 0;k < 6; k++)
1232 summon_specific(-1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode));
1235 case MS_S_HI_DRAGON:
1238 if (!target_set(TARGET_KILL)) return FALSE;
1240 msg_print("¸ÅÂå¥É¥é¥´¥ó¤ò¾¤´¤·¤¿¡ª");
1242 msg_print("You summon ancient dragons!");
1244 for (k = 0;k < 4; k++)
1245 summon_specific(-1, target_row, target_col, plev, SUMMON_HI_DRAGON, (mode | u_mode));
1251 if (!target_set(TARGET_KILL)) return FALSE;
1253 msg_print("¥¢¥ó¥Ð¡¼¤Î²¦Â²¤ò¾¤´¤·¤¿¡ª");
1255 msg_print("You summon Lords of Amber!");
1257 for (k = 0;k < 4; k++)
1258 summon_specific(-1, target_row, target_col, plev, SUMMON_AMBERITES, (mode | PM_ALLOW_UNIQUE));
1264 if (!target_set(TARGET_KILL)) return FALSE;
1266 msg_print("ÆÃÊ̤ʶ¯Å¨¤ò¾¤´¤·¤¿¡ª");
1268 msg_print("You summon special opponents!");
1270 for (k = 0;k < 4; k++)
1271 if (summon_specific(-1, target_row, target_col, plev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE))) count++;
1272 for (k = count;k < 4; k++)
1273 summon_specific(-1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode));
1285 * @brief ¤â¤Î¤Þ¤Í¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó /
1286 * do_cmd_cast calls this function if the player's class is 'imitator'.
1287 * @param baigaesi TRUE¤Ê¤é¤ÐÇÜÊÖ¤·¾å¤Î½èÍý¤È¤·¤Æ¹Ô¤¦
1288 * @return ½èÍý¤ò¼Â¹Ô¤·¤¿¤éTRUE¡¢¥¥ã¥ó¥»¥ë¤·¤¿¾ì¹çFALSE¤òÊÖ¤¹¡£
1290 * If a valid spell is chosen, saves it in '*sn' and returns TRUE
1291 * If the user hits escape, returns FALSE, and set '*sn' to -1
1292 * If there are no legal choices, returns FALSE, and sets '*sn' to -2
1294 * The "prompt" should be "cast", "recite", or "study"
1295 * The "known" should be TRUE for cast/pray, FALSE for study
1297 * nb: This function has a (trivial) display bug which will be obvious
1298 * when you run it. It's probably easy to fix but I haven't tried,
1301 bool do_cmd_mane(bool baigaesi)
1306 int plev = p_ptr->lev;
1307 monster_power spell;
1311 /* not if confused */
1312 if (p_ptr->confused)
1315 msg_print("º®Í𤷤Ƥ¤¤Æ½¸Ãæ¤Ç¤¤Ê¤¤¡ª");
1317 msg_print("You are too confused!");
1323 if (!p_ptr->mane_num)
1326 msg_print("¤Þ¤Í¤é¤ì¤ë¤â¤Î¤¬²¿¤â¤Ê¤¤¡ª");
1328 msg_print("You don't remember any action!");
1335 if (!get_mane_power(&n, baigaesi)) return FALSE;
1337 spell = monster_powers[p_ptr->mane_spell[n]];
1339 /* Spell failure chance */
1340 chance = spell.manefail;
1342 /* Reduce failure rate by "effective" level adjustment */
1343 if (plev > spell.level) chance -= 3 * (plev - spell.level);
1345 /* Reduce failure rate by 1 stat and DEX adjustment */
1346 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[spell.use_stat]] + adj_mag_stat[p_ptr->stat_ind[A_DEX]] - 2) / 2;
1348 if (spell.manedam) chance = chance * damage / spell.manedam;
1350 chance += p_ptr->to_m_chance;
1352 /* Extract the minimum failure rate */
1353 minfail = adj_mag_fail[p_ptr->stat_ind[spell.use_stat]];
1355 /* Minimum failure rate */
1356 if (chance < minfail) chance = minfail;
1358 /* Stunning makes spells harder */
1359 if (p_ptr->stun > 50) chance += 25;
1360 else if (p_ptr->stun) chance += 15;
1362 /* Always a 5 percent chance of working */
1363 if (chance > 95) chance = 95;
1366 if (randint0(100) < chance)
1368 if (flush_failure) flush();
1370 msg_print("¤â¤Î¤Þ¤Í¤Ë¼ºÇÔ¤·¤¿¡ª");
1372 msg_print("You failed to concentrate hard enough!");
1381 /* Cast the spell */
1382 cast = use_mane(p_ptr->mane_spell[n]);
1384 if (!cast) return FALSE;
1388 for (j = n; j < p_ptr->mane_num;j++)
1390 p_ptr->mane_spell[j] = p_ptr->mane_spell[j+1];
1391 p_ptr->mane_dam[j] = p_ptr->mane_dam[j+1];
1398 p_ptr->redraw |= (PR_IMITATION);
1399 p_ptr->window |= (PW_PLAYER);
1400 p_ptr->window |= (PW_SPELL);