4 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
6 * This software may be copied and distributed for educational, research,
7 * and not for profit purposes provided that this copyright and statement
8 * are included in all such copies. Other copyrights may also apply.
11 /* Purpose: Imitation code */
18 static void mane_info(char *p, int power, int dam)
20 int plev = p_ptr->lev;
24 cptr s_range = "ÈÏ°Ï:";
25 cptr s_heal = "²óÉü:";
29 cptr s_range = "range ";
30 cptr s_heal = "heal ";
35 if ((power > 2 && power < 41) || (power > 41 && power < 59) || (power == 75))
36 sprintf(p, " %s%d", s_dam, 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 * Allow user to choose a imitation.
72 * If a valid spell is chosen, saves it in '*sn' and returns TRUE
73 * If the user hits escape, returns FALSE, and set '*sn' to -1
74 * If there are no legal choices, returns FALSE, and sets '*sn' to -2
76 * The "prompt" should be "cast", "recite", or "study"
77 * The "known" should be TRUE for cast/pray, FALSE for study
79 * nb: This function has a (trivial) display bug which will be obvious
80 * when you run it. It's probably easy to fix but I haven't tried,
83 static int get_mane_power(int *sn, bool baigaesi)
90 int plev = p_ptr->lev;
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,
119 "(%c-%c, '*'¤Ç°ìÍ÷, ESC) ¤É¤Î%s¤ò¤Þ¤Í¤Þ¤¹¤«¡©",
121 "(%c-%c, *=List, ESC=exit) Use which %s? ",
123 I2A(0), I2A(num - 1), p);
125 /* Get a spell from the user */
127 choice= always_show_list ? ESCAPE:1 ;
130 if(choice==ESCAPE) choice = ' ';
131 else if( !get_com(out_val, &choice, TRUE) )break;
134 if ((choice == ' ') || (choice == '*') || (choice == '?'))
144 /* Save the screen */
147 /* Display a list of spells */
150 put_str("̾Á°", y, x + 5);
152 put_str("Name", y, x + 5);
156 put_str("¼ºÎ¨ ¸ú²Ì", y, x + 36);
158 put_str("Fail Info", y, x + 35);
162 /* Dump the spells */
163 for (i = 0; i < num; i++)
165 /* Access the spell */
166 spell = monster_powers[p_ptr->mane_spell[i]];
168 chance = spell.manefail;
170 /* Reduce failure rate by "effective" level adjustment */
171 if (plev > spell.level) chance -= 3 * (plev - spell.level);
173 /* Reduce failure rate by INT/WIS adjustment */
174 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[spell.use_stat]] + adj_mag_stat[p_ptr->stat_ind[A_DEX]] - 2) / 2;
176 if (spell.manedam) chance = chance * p_ptr->mane_dam[i] / spell.manedam;
178 chance += p_ptr->to_m_chance;
180 /* Extract the minimum failure rate */
181 minfail = adj_mag_fail[p_ptr->stat_ind[spell.use_stat]];
183 /* Minimum failure rate */
184 if (chance < minfail) chance = minfail;
186 /* Stunning makes spells harder */
187 if (p_ptr->stun > 50) chance += 25;
188 else if (p_ptr->stun) chance += 15;
190 /* Always a 5 percent chance of working */
191 if (chance > 95) chance = 95;
194 mane_info(comment, p_ptr->mane_spell[i], (baigaesi ? p_ptr->mane_dam[i]*2 : p_ptr->mane_dam[i]));
196 /* Dump the spell --(-- */
197 sprintf(psi_desc, " %c) %-30s %3d%%%s",
200 prt(psi_desc, y + i + 1, x);
203 /* Clear the bottom line */
204 prt("", y + i + 1, x);
213 /* Restore the screen */
222 ask = isupper(choice);
225 if (ask) choice = tolower(choice);
227 /* Extract request */
228 i = (islower(choice) ? A2I(choice) : -1);
230 /* Totally Illegal */
231 if ((i < 0) || (i >= num))
237 /* Save the spell index */
238 spell = monster_powers[p_ptr->mane_spell[i]];
247 (void) strnfmt(tmp_val, 78, "%s¤ò¤Þ¤Í¤Þ¤¹¤«¡©", monster_powers[p_ptr->mane_spell[i]].name);
249 (void)strnfmt(tmp_val, 78, "Use %s? ", monster_powers[p_ptr->mane_spell[i]].name);
253 /* Belay that order */
254 if (!get_check(tmp_val)) continue;
261 /* Restore the screen */
262 if (redraw) screen_load();
265 p_ptr->window |= (PW_SPELL);
270 /* Abort if needed */
271 if (!flag) return (FALSE);
273 /* Save the choice */
276 damage = (baigaesi ? p_ptr->mane_dam[i]*2 : p_ptr->mane_dam[i]);
284 * do_cmd_cast calls this function if the player's class
287 static bool use_mane(int spell)
290 int plev = p_ptr->lev;
291 u32b mode = (PM_ALLOW_GROUP | PM_FORCE_PET);
294 if (randint1(50+plev) < plev/10) u_mode = PM_ALLOW_UNIQUE;
302 msg_print("¤«¤ó¹â¤¤¶âÀÚ¤êÀ¼¤ò¤¢¤²¤¿¡£");
304 msg_print("You make a high pitched shriek.");
307 aggravate_monsters(0);
315 if (!target_set(TARGET_KILL)) return FALSE;
316 m_idx = cave[target_row][target_col].m_idx;
318 if (!player_has_los_bold(target_row, target_col)) break;
319 if (!projectable(py, px, target_row, target_col)) break;
320 dispel_monster_status(m_idx);
324 if (!get_aim_dir(&dir)) return FALSE;
326 else msg_print("¥í¥±¥Ã¥È¤òȯ¼Í¤·¤¿¡£");
328 else msg_print("You fire a rocket.");
331 fire_rocket(GF_ROCKET, dir, damage, 2);
334 if (!get_aim_dir(&dir)) return FALSE;
336 else msg_print("Ìð¤òÊü¤Ã¤¿¡£");
338 else msg_print("You fire an arrow.");
341 fire_bolt(GF_ARROW, dir, damage);
350 if (!get_aim_dir(&dir)) return FALSE;
352 else msg_print("»À¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
354 else msg_print("You breathe acid.");
357 fire_ball(GF_ACID, dir, damage, (plev > 35 ? -3 : -2));
360 if (!get_aim_dir(&dir)) return FALSE;
362 else msg_print("°ðºÊ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
364 else msg_print("You breathe lightning.");
367 fire_ball(GF_ELEC, dir, damage, (plev > 35 ? -3 : -2));
370 if (!get_aim_dir(&dir)) return FALSE;
372 else msg_print("²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
374 else msg_print("You breathe fire.");
377 fire_ball(GF_FIRE, dir, damage, (plev > 35 ? -3 : -2));
380 if (!get_aim_dir(&dir)) return FALSE;
382 else msg_print("Î䵤¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
384 else msg_print("You breathe frost.");
387 fire_ball(GF_COLD, dir, damage, (plev > 35 ? -3 : -2));
390 if (!get_aim_dir(&dir)) return FALSE;
392 else msg_print("¥¬¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
394 else msg_print("You breathe gas.");
397 fire_ball(GF_POIS, dir, damage, (plev > 35 ? -3 : -2));
400 if (!get_aim_dir(&dir)) return FALSE;
402 else msg_print("ÃϹö¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
404 else msg_print("You breathe nether.");
407 fire_ball(GF_NETHER, dir, damage, (plev > 35 ? -3 : -2));
410 if (!get_aim_dir(&dir)) return FALSE;
412 else msg_print("Á®¸÷¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
414 else msg_print("You breathe light.");
417 fire_ball(GF_LITE, dir, damage, (plev > 35 ? -3 : -2));
420 if (!get_aim_dir(&dir)) return FALSE;
422 else msg_print("°Å¹õ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
424 else msg_print("You breathe darkness.");
427 fire_ball(GF_DARK, dir, damage, (plev > 35 ? -3 : -2));
430 if (!get_aim_dir(&dir)) return FALSE;
432 else msg_print("º®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
434 else msg_print("You breathe confusion.");
437 fire_ball(GF_CONFUSION, dir, damage, (plev > 35 ? -3 : -2));
440 if (!get_aim_dir(&dir)) return FALSE;
442 else msg_print("¹ì²»¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
444 else msg_print("You breathe sound.");
447 fire_ball(GF_SOUND, dir, damage, (plev > 35 ? -3 : -2));
450 if (!get_aim_dir(&dir)) return FALSE;
452 else msg_print("¥«¥ª¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
454 else msg_print("You breathe chaos.");
457 fire_ball(GF_CHAOS, dir, damage, (plev > 35 ? -3 : -2));
460 if (!get_aim_dir(&dir)) return FALSE;
462 else msg_print("Îô²½¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
464 else msg_print("You breathe disenchantment.");
467 fire_ball(GF_DISENCHANT, dir, damage, (plev > 35 ? -3 : -2));
470 if (!get_aim_dir(&dir)) return FALSE;
472 else msg_print("°ø²Ìº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
474 else msg_print("You breathe nexus.");
477 fire_ball(GF_NEXUS, dir, damage, (plev > 35 ? -3 : -2));
480 if (!get_aim_dir(&dir)) return FALSE;
482 else msg_print("»þ´ÖµÕž¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
484 else msg_print("You breathe time.");
487 fire_ball(GF_TIME, dir, damage, (plev > 35 ? -3 : -2));
490 if (!get_aim_dir(&dir)) return FALSE;
492 else msg_print("ÃÙÆߤΥ֥쥹¤òÅǤ¤¤¿¡£");
494 else msg_print("You breathe inertia.");
497 fire_ball(GF_INERTIA, dir, damage, (plev > 35 ? -3 : -2));
500 if (!get_aim_dir(&dir)) return FALSE;
502 else msg_print("½ÅÎϤΥ֥쥹¤òÅǤ¤¤¿¡£");
504 else msg_print("You breathe gravity.");
507 fire_ball(GF_GRAVITY, dir, damage, (plev > 35 ? -3 : -2));
510 if (!get_aim_dir(&dir)) return FALSE;
512 else msg_print("ÇËÊҤΥ֥쥹¤òÅǤ¤¤¿¡£");
514 else msg_print("You breathe shards.");
517 fire_ball(GF_SHARDS, dir, damage, (plev > 35 ? -3 : -2));
520 if (!get_aim_dir(&dir)) return FALSE;
522 else msg_print("¥×¥é¥º¥Þ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
524 else msg_print("You breathe plasma.");
527 fire_ball(GF_PLASMA, dir, damage, (plev > 35 ? -3 : -2));
530 if (!get_aim_dir(&dir)) return FALSE;
532 else msg_print("¥Õ¥©¡¼¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
534 else msg_print("You breathe force.");
537 fire_ball(GF_FORCE, dir, damage, (plev > 35 ? -3 : -2));
540 if (!get_aim_dir(&dir)) return FALSE;
542 else msg_print("ËâÎϤΥ֥쥹¤òÅǤ¤¤¿¡£");
544 else msg_print("You breathe mana.");
547 fire_ball(GF_MANA, dir, damage, (plev > 35 ? -3 : -2));
550 if (!get_aim_dir(&dir)) return FALSE;
552 else msg_print("Êü¼Íǽµå¤òÊü¤Ã¤¿¡£");
554 else msg_print("You cast a ball of radiation.");
557 fire_ball(GF_NUKE, dir, damage, 2);
560 if (!get_aim_dir(&dir)) return FALSE;
562 else msg_print("Êü¼ÍÀÇÑ´þʪ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
564 else msg_print("You breathe toxic waste.");
567 fire_ball(GF_NUKE, dir, damage, (plev > 35 ? -3 : -2));
570 if (!get_aim_dir(&dir)) return FALSE;
572 else msg_print("½ã¥í¥°¥ë¥¹¤òÊü¤Ã¤¿¡£");
574 else msg_print("You invoke a raw Logrus.");
577 fire_ball(GF_CHAOS, dir, damage, 4);
580 if (!get_aim_dir(&dir)) return FALSE;
582 else msg_print("ʬ²ò¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
584 else msg_print("You breathe disintegration.");
587 fire_ball(GF_DISINTEGRATE, dir, damage, (plev > 35 ? -3 : -2));
590 if (!get_aim_dir(&dir)) return FALSE;
592 else msg_print("¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
594 else msg_print("You cast an acid ball.");
597 fire_ball(GF_ACID, dir, damage, 2);
600 if (!get_aim_dir(&dir)) return FALSE;
602 else msg_print("¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
604 else msg_print("You cast a lightning ball.");
607 fire_ball(GF_ELEC, dir, damage, 2);
610 if (!get_aim_dir(&dir)) return FALSE;
612 else msg_print("¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
614 else msg_print("You cast a fire ball.");
617 fire_ball(GF_FIRE, dir, damage, 2);
620 if (!get_aim_dir(&dir)) return FALSE;
622 else msg_print("¥¢¥¤¥¹¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
624 else msg_print("You cast a frost ball.");
627 fire_ball(GF_COLD, dir, damage, 2);
630 if (!get_aim_dir(&dir)) return FALSE;
632 else msg_print("°½±À¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
634 else msg_print("You cast a stinking cloud.");
637 fire_ball(GF_POIS, dir, damage, 2);
640 if (!get_aim_dir(&dir)) return FALSE;
642 else msg_print("ÃϹöµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
644 else msg_print("You cast a nether ball.");
647 fire_ball(GF_NETHER, dir, damage, 2);
650 if (!get_aim_dir(&dir)) return FALSE;
652 else msg_print("ή¤ì¤ë¤è¤¦¤Ê¿È¿¶¤ê¤ò¤·¤¿¡£");
654 else msg_print("You gesture fluidly.");
657 fire_ball(GF_WATER, dir, damage, 4);
660 if (!get_aim_dir(&dir)) return FALSE;
662 else msg_print("ËâÎϤÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£");
664 else msg_print("You invoke a mana storm.");
667 fire_ball(GF_MANA, dir, damage, 4);
670 if (!get_aim_dir(&dir)) return FALSE;
672 else msg_print("°Å¹õ¤ÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£");
674 else msg_print("You invoke a darkness storm.");
677 fire_ball(GF_DARK, dir, damage, 4);
680 if (!get_aim_dir(&dir)) return FALSE;
681 fire_ball_hide(GF_DRAIN_MANA, dir, randint1(plev*3)+plev, 0);
684 if (!get_aim_dir(&dir)) return FALSE;
685 fire_ball_hide(GF_MIND_BLAST, dir, damage, 0);
688 if (!get_aim_dir(&dir)) return FALSE;
689 fire_ball_hide(GF_BRAIN_SMASH, dir, damage, 0);
692 if (!get_aim_dir(&dir)) return FALSE;
693 fire_ball_hide(GF_CAUSE_1, dir, damage, 0);
696 if (!get_aim_dir(&dir)) return FALSE;
697 fire_ball_hide(GF_CAUSE_2, dir, damage, 0);
700 if (!get_aim_dir(&dir)) return FALSE;
701 fire_ball_hide(GF_CAUSE_3, dir, damage, 0);
704 if (!get_aim_dir(&dir)) return FALSE;
705 fire_ball_hide(GF_CAUSE_4, dir, damage, 0);
708 if (!get_aim_dir(&dir)) return FALSE;
710 else msg_print("¥¢¥·¥Ã¥É¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
712 else msg_print("You cast an acid bolt.");
715 fire_bolt(GF_ACID, dir, damage);
718 if (!get_aim_dir(&dir)) return FALSE;
720 else msg_print("¥µ¥ó¥À¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
722 else msg_print("You cast a lightning bolt.");
725 fire_bolt(GF_ELEC, dir, damage);
728 if (!get_aim_dir(&dir)) return FALSE;
730 else msg_print("¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
732 else msg_print("You cast a fire bolt.");
735 fire_bolt(GF_FIRE, dir, damage);
738 if (!get_aim_dir(&dir)) return FALSE;
740 else msg_print("¥¢¥¤¥¹¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
742 else msg_print("You cast a frost bolt.");
745 fire_bolt(GF_COLD, dir, damage);
748 if (!get_aim_dir(&dir)) return FALSE;
750 else msg_print("¥¹¥¿¡¼¥Ð¡¼¥¹¥È¤Î¼öʸ¤òÇ°¤¸¤¿¡£");
752 else msg_print("You invoke a starburst.");
755 fire_ball(GF_LITE, dir, damage, 4);
758 if (!get_aim_dir(&dir)) return FALSE;
760 else msg_print("ÃϹö¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
762 else msg_print("You cast a nether bolt.");
765 fire_bolt(GF_NETHER, dir, damage);
768 if (!get_aim_dir(&dir)) return FALSE;
770 else msg_print("¥¦¥©¡¼¥¿¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
772 else msg_print("You cast a water bolt.");
775 fire_bolt(GF_WATER, dir, damage);
778 if (!get_aim_dir(&dir)) return FALSE;
780 else msg_print("ËâÎϤÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
782 else msg_print("You cast a mana bolt.");
785 fire_bolt(GF_MANA, dir, damage);
788 if (!get_aim_dir(&dir)) return FALSE;
790 else msg_print("¥×¥é¥º¥Þ¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
792 else msg_print("You cast a plasma bolt.");
795 fire_bolt(GF_PLASMA, dir, damage);
798 if (!get_aim_dir(&dir)) return FALSE;
800 else msg_print("¶Ë´¨¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
802 else msg_print("You cast a ice bolt.");
805 fire_bolt(GF_ICE, dir, damage);
807 case MS_MAGIC_MISSILE:
808 if (!get_aim_dir(&dir)) return FALSE;
810 else msg_print("¥Þ¥¸¥Ã¥¯¡¦¥ß¥µ¥¤¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
812 else msg_print("You cast a magic missile.");
815 fire_bolt(GF_MISSILE, dir, damage);
818 if (!get_aim_dir(&dir)) return FALSE;
820 else msg_print("¶²¤í¤·¤²¤Ê¸¸³Ð¤òºî¤ê½Ð¤·¤¿¡£");
822 else msg_print("You cast a fearful illusion.");
825 fear_monster(dir, plev+10);
828 if (!get_aim_dir(&dir)) return FALSE;
829 confuse_monster(dir, plev * 2);
832 if (!get_aim_dir(&dir)) return FALSE;
834 else msg_print("ͶÏÇŪ¤Ê¸¸³Ð¤ò¤Ä¤¯¤ê½Ð¤·¤¿¡£");
836 else msg_print("You cast a mesmerizing illusion.");
839 confuse_monster(dir, plev * 2);
842 if (!get_aim_dir(&dir)) return FALSE;
846 if (!get_aim_dir(&dir)) return FALSE;
850 (void)set_fast(randint1(20 + plev) + plev, FALSE);
854 if (!get_aim_dir(&dir)) return FALSE;
856 else msg_print("<ÇËÌǤμê>¤òÊü¤Ã¤¿¡ª");
858 else msg_print("You invoke the Hand of Doom!");
861 fire_ball_hide(GF_HAND_DOOM, dir, 200, 0);
866 msg_print("¼«Ê¬¤Î½ý¤ËÇ°¤ò½¸Ã椷¤¿¡£");
868 msg_print("You concentrate on your wounds!");
870 (void)hp_player(plev*6);
876 msg_print("̵½ý¤Îµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
878 msg_print("You cast a Globe of Invulnerability.");
880 (void)set_invuln(randint1(7) + 7, FALSE);
883 teleport_player(10, 0L);
886 teleport_player(plev * 5, 0L);
890 if (damage == 1 || damage == 2)
892 msg_print("¡Ö¡Ø¥¶¡¦¥ï¡¼¥ë¥É¡Ù¡ª»þ¤Ï»ß¤Þ¤Ã¤¿¡ª¡×");
894 msg_print("You yell 'The World! Time has stopped!'");
896 else if (damage == 3 || damage == 6)
898 msg_print("¡Ö»þ¤è¡ª¡×");
900 msg_print("You yell 'Time!'");
907 p_ptr->energy_need -= 1000 + (100 + randint1(200)+200)*TURNS_PER_TICK/10;
910 p_ptr->redraw |= (PR_MAP);
912 /* Update monsters */
913 p_ptr->update |= (PU_MONSTERS);
916 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
928 if (!target_set(TARGET_KILL)) return FALSE;
929 if (!cave[target_row][target_col].m_idx) break;
930 if (!player_has_los_bold(target_row, target_col)) break;
931 if (!projectable(py, px, target_row, target_col)) break;
932 m_ptr = &m_list[cave[target_row][target_col].m_idx];
933 r_ptr = &r_info[m_ptr->r_idx];
934 monster_desc(m_name, m_ptr, 0);
935 if (r_ptr->flagsr & RFR_RES_TELE)
937 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
939 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
941 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª", m_name);
943 msg_format("%s is unaffected!", m_name);
948 else if (r_ptr->level > randint1(100))
950 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
952 msg_format("%s¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª", m_name);
954 msg_format("%s resists!", m_name);
961 msg_format("%s¤ò°ú¤Ìᤷ¤¿¡£", m_name);
963 msg_format("You command %s to return.", m_name);
966 teleport_monster_to(cave[target_row][target_col].m_idx, py, px, 100, TELEPORT_PASSIVE);
970 if (!get_aim_dir(&dir)) return FALSE;
972 (void)fire_beam(GF_AWAY_ALL, dir, plev);
981 if (!target_set(TARGET_KILL)) return FALSE;
982 target_m_idx = cave[target_row][target_col].m_idx;
983 if (!target_m_idx) break;
984 if (!player_has_los_bold(target_row, target_col)) break;
985 if (!projectable(py, px, target_row, target_col)) break;
986 m_ptr = &m_list[target_m_idx];
987 r_ptr = &r_info[m_ptr->r_idx];
988 monster_desc(m_name, m_ptr, 0);
990 msg_format("%^s¤Î¤ò»Ø¤µ¤·¤¿¡£", m_name);
992 msg_format("You gesture at %^s's feet.", m_name);
995 if ((r_ptr->flagsr & (RFR_EFF_RES_NEXU_MASK | RFR_RES_TELE)) ||
996 (r_ptr->flags1 & RF1_QUESTOR) || (r_ptr->level + randint1(50) > plev + randint1(60)))
999 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
1001 msg_format("%^s is unaffected!", m_name);
1004 else teleport_level(target_m_idx);
1008 if (!get_aim_dir(&dir)) return FALSE;
1011 else msg_print("¸÷¤Î·õ¤òÊü¤Ã¤¿¡£");
1013 else msg_print("You throw a psycho-spear.");
1015 (void)fire_beam(GF_PSY_SPEAR, dir, damage);
1019 msg_print("°Å°Ç¤ÎÃæ¤Ç¼ê¤ò¿¶¤Ã¤¿¡£");
1021 msg_print("You gesture in shadow.");
1023 (void)unlite_area(10, 3);
1026 if (!target_set(TARGET_KILL)) return FALSE;
1028 msg_print("¼öʸ¤ò¾§¤¨¤Æ¼Ù°¤ËÈù¾Ð¤ó¤À¡£");
1030 msg_print("You cast a spell and cackles evilly.");
1032 trap_creation(target_row, target_col);
1036 msg_print("¤·¤«¤·²¿¤âµ¯¤¤Ê¤«¤Ã¤¿¡£");
1038 msg_print("Nothing happen.");
1043 msg_print("»à¼ÔÉü³è¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1045 msg_print("You cast a animate dead.");
1047 (void)animate_dead(0, py, px);
1052 if (!target_set(TARGET_KILL)) return FALSE;
1055 msg_print("±ç·³¤ò¾¤´¤·¤¿¡£");
1057 msg_print("You summon minions.");
1059 for (k = 0;k < 4; k++)
1061 (void)summon_kin_player(plev, target_row, target_col, (PM_FORCE_PET | PM_ALLOW_GROUP));
1068 int max_cyber = (dun_level / 50) + randint1(3);
1069 if (!target_set(TARGET_KILL)) return FALSE;
1071 msg_print("¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ò¾¤´¤·¤¿¡ª");
1073 msg_print("You summon Cyberdemons!");
1075 if (max_cyber > 4) max_cyber = 4;
1076 for (k = 0;k < max_cyber; k++)
1077 summon_specific(-1, target_row, target_col, plev, SUMMON_CYBER, mode);
1083 if (!target_set(TARGET_KILL)) return FALSE;
1085 msg_print("Ãç´Ö¤ò¾¤´¤·¤¿¡£");
1087 msg_print("You summon help.");
1089 for (k = 0;k < 1; k++)
1090 summon_specific(-1, target_row, target_col, plev, 0, (mode | u_mode));
1096 if (!target_set(TARGET_KILL)) return FALSE;
1098 msg_print("¥â¥ó¥¹¥¿¡¼¤ò¾¤´¤·¤¿¡ª");
1100 msg_print("You summon monsters!");
1102 for (k = 0;k < 6; k++)
1103 summon_specific(-1, target_row, target_col, plev, 0, (mode | u_mode));
1109 if (!target_set(TARGET_KILL)) return FALSE;
1111 msg_print("¥¢¥ê¤ò¾¤´¤·¤¿¡£");
1113 msg_print("You summon ants.");
1115 for (k = 0;k < 6; k++)
1116 summon_specific(-1, target_row, target_col, plev, SUMMON_ANT, mode);
1122 if (!target_set(TARGET_KILL)) return FALSE;
1124 msg_print("ÃØéá¤ò¾¤´¤·¤¿¡£");
1126 msg_print("You summon spiders.");
1128 for (k = 0;k < 6; k++)
1129 summon_specific(-1, target_row, target_col, plev, SUMMON_SPIDER, mode);
1135 if (!target_set(TARGET_KILL)) return FALSE;
1137 msg_print("¥Ï¥¦¥ó¥É¤ò¾¤´¤·¤¿¡£");
1139 msg_print("You summon hounds.");
1141 for (k = 0;k < 4; k++)
1142 summon_specific(-1, target_row, target_col, plev, SUMMON_HOUND, mode);
1148 if (!target_set(TARGET_KILL)) return FALSE;
1150 msg_print("¥Ò¥É¥é¤ò¾¤´¤·¤¿¡£");
1152 msg_print("You summon hydras.");
1154 for (k = 0;k < 4; k++)
1155 summon_specific(-1, target_row, target_col, plev, SUMMON_HYDRA, mode);
1161 if (!target_set(TARGET_KILL)) return FALSE;
1163 msg_print("Å·»È¤ò¾¤´¤·¤¿¡ª");
1165 msg_print("You summon angel!");
1167 for (k = 0;k < 1; k++)
1168 summon_specific(-1, target_row, target_col, plev, SUMMON_ANGEL, mode);
1174 if (!target_set(TARGET_KILL)) return FALSE;
1176 msg_print("º®Æ٤εÜÄ¤é°Ëâ¤ò¾¤´¤·¤¿¡ª");
1178 msg_print("You summon a demon from the Courts of Chaos!");
1180 for (k = 0;k < 1; k++)
1181 summon_specific(-1, target_row, target_col, plev, SUMMON_DEMON, (mode | u_mode));
1187 if (!target_set(TARGET_KILL)) return FALSE;
1189 msg_print("¥¢¥ó¥Ç¥Ã¥É¤Î¶¯Å¨¤ò¾¤´¤·¤¿¡ª");
1191 msg_print("You summon an undead adversary!");
1193 for (k = 0;k < 1; k++)
1194 summon_specific(-1, target_row, target_col, plev, SUMMON_UNDEAD, (mode | u_mode));
1200 if (!target_set(TARGET_KILL)) return FALSE;
1202 msg_print("¥É¥é¥´¥ó¤ò¾¤´¤·¤¿¡ª");
1204 msg_print("You summon dragon!");
1206 for (k = 0;k < 1; k++)
1207 summon_specific(-1, target_row, target_col, plev, SUMMON_DRAGON, (mode | u_mode));
1210 case MS_S_HI_UNDEAD:
1213 if (!target_set(TARGET_KILL)) return FALSE;
1215 msg_print("¶¯ÎϤʥ¢¥ó¥Ç¥Ã¥É¤ò¾¤´¤·¤¿¡ª");
1217 msg_print("You summon greater undead!");
1219 for (k = 0;k < 6; k++)
1220 summon_specific(-1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode));
1223 case MS_S_HI_DRAGON:
1226 if (!target_set(TARGET_KILL)) return FALSE;
1228 msg_print("¸ÅÂå¥É¥é¥´¥ó¤ò¾¤´¤·¤¿¡ª");
1230 msg_print("You summon ancient dragons!");
1232 for (k = 0;k < 4; k++)
1233 summon_specific(-1, target_row, target_col, plev, SUMMON_HI_DRAGON, (mode | u_mode));
1239 if (!target_set(TARGET_KILL)) return FALSE;
1241 msg_print("¥¢¥ó¥Ð¡¼¤Î²¦Â²¤ò¾¤´¤·¤¿¡ª");
1243 msg_print("You summon Lords of Amber!");
1245 for (k = 0;k < 4; k++)
1246 summon_specific(-1, target_row, target_col, plev, SUMMON_AMBERITES, (mode | PM_ALLOW_UNIQUE));
1252 if (!target_set(TARGET_KILL)) return FALSE;
1254 msg_print("ÆÃÊ̤ʶ¯Å¨¤ò¾¤´¤·¤¿¡ª");
1256 msg_print("You summon special opponents!");
1258 for (k = 0;k < 4; k++)
1259 if (summon_specific(-1, target_row, target_col, plev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE))) count++;
1260 for (k = count;k < 4; k++)
1261 summon_specific(-1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode));
1273 * do_cmd_cast calls this function if the player's class
1276 bool do_cmd_mane(bool baigaesi)
1281 int plev = p_ptr->lev;
1282 monster_power spell;
1286 /* not if confused */
1287 if (p_ptr->confused)
1290 msg_print("º®Í𤷤Ƥ¤¤Æ½¸Ãæ¤Ç¤¤Ê¤¤¡ª");
1292 msg_print("You are too confused!");
1298 if (!p_ptr->mane_num)
1301 msg_print("¤Þ¤Í¤é¤ì¤ë¤â¤Î¤¬²¿¤â¤Ê¤¤¡ª");
1303 msg_print("You don't remember any action!");
1310 if (!get_mane_power(&n, baigaesi)) return FALSE;
1312 spell = monster_powers[p_ptr->mane_spell[n]];
1314 /* Spell failure chance */
1315 chance = spell.manefail;
1317 /* Reduce failure rate by "effective" level adjustment */
1318 if (plev > spell.level) chance -= 3 * (plev - spell.level);
1320 /* Reduce failure rate by 1 stat and DEX adjustment */
1321 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[spell.use_stat]] + adj_mag_stat[p_ptr->stat_ind[A_DEX]] - 2) / 2;
1323 if (spell.manedam) chance = chance * damage / spell.manedam;
1325 chance += p_ptr->to_m_chance;
1327 /* Extract the minimum failure rate */
1328 minfail = adj_mag_fail[p_ptr->stat_ind[spell.use_stat]];
1330 /* Minimum failure rate */
1331 if (chance < minfail) chance = minfail;
1333 /* Stunning makes spells harder */
1334 if (p_ptr->stun > 50) chance += 25;
1335 else if (p_ptr->stun) chance += 15;
1337 /* Always a 5 percent chance of working */
1338 if (chance > 95) chance = 95;
1341 if (randint0(100) < chance)
1343 if (flush_failure) flush();
1345 msg_print("¤â¤Î¤Þ¤Í¤Ë¼ºÇÔ¤·¤¿¡ª");
1347 msg_print("You failed to concentrate hard enough!");
1356 /* Cast the spell */
1357 cast = use_mane(p_ptr->mane_spell[n]);
1359 if (!cast) return FALSE;
1363 for (j = n; j < p_ptr->mane_num;j++)
1365 p_ptr->mane_spell[j] = p_ptr->mane_spell[j+1];
1366 p_ptr->mane_dam[j] = p_ptr->mane_dam[j+1];
1373 p_ptr->redraw |= (PR_IMITATION);
1374 p_ptr->window |= (PW_PLAYER);
1375 p_ptr->window |= (PW_SPELL);