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: Mane code */
15 #define pseudo_plev() (((p_ptr->lev + 40) * (p_ptr->lev + 40) - 1550) / 130)
17 static void learned_info(char *p, int power)
19 int plev = pseudo_plev();
25 cptr s_range = "ÈÏ°Ï:";
26 cptr s_heal = "²óÉü:";
30 cptr s_range = "range ";
31 cptr s_heal = "heal ";
77 sprintf(p, " %s%d+10d10", s_dam, plev * 8 + 50);
82 sprintf(p, " %s%d", s_dam, hp/4);
86 object_type *o_ptr = NULL;
87 if (buki_motteruka(INVEN_RARM)) o_ptr = &inventory[INVEN_RARM];
88 else if (buki_motteruka(INVEN_LARM)) o_ptr = &inventory[INVEN_LARM];
90 sprintf(p, " %s1", s_dam);
92 sprintf(p, " %s%dd%d+%d", s_dam, o_ptr->dd, o_ptr->ds, o_ptr->to_d);
101 sprintf(p, " %s%d", s_dam, hp/3);
104 sprintf(p, " %s%d", s_dam, MIN(hp/3, 250));
107 sprintf(p, " %s%d", s_dam, MIN(hp/3, 150));
110 sprintf(p, " %s%d", s_dam, MIN(hp/3, 200));
113 sprintf(p, " %s%d", s_dam, MIN(hp/3, 250));
124 sprintf(p, " %s%d", s_dam, hp/6);
128 sprintf(p, " %s%d", s_dam, MIN(hp/6, 200));
131 sprintf(p, " %s%d", s_dam, MIN(hp/6, 150));
134 sprintf(p, " %s%d+10d6", s_dam, plev * 2);
137 sprintf(p, " %s%d+10d10", s_dam, plev * 4);
140 sprintf(p, " %s15+d%d", s_dam, plev * 6);
143 sprintf(p, " %s8+d%d", s_dam, plev * 3);
146 sprintf(p, " %s10+d%d", s_dam, plev * 7);
149 sprintf(p, " %s10+d%d", s_dam, plev * 3);
152 sprintf(p, " %s12d2", s_dam);
155 sprintf(p, " %s%d+10d10", s_dam, plev * 2 + 50);
158 sprintf(p, " %s50+d%d", s_dam, plev * 4);
161 sprintf(p, " %sd%d+%d", s_heal, plev, plev);
164 sprintf(p, " %s8d8", s_dam);
167 sprintf(p, " %s12d15", s_dam);
170 sprintf(p, " %s3d8", s_dam);
173 sprintf(p, " %s8d8", s_dam);
176 sprintf(p, " %s10d15", s_dam);
179 sprintf(p, " %s15d15", s_dam);
182 sprintf(p, " %s%d+7d8", s_dam, plev * 2 / 3);
185 sprintf(p, " %s%d+4d8", s_dam, plev * 2 / 3);
188 sprintf(p, " %s%d+9d8", s_dam, plev * 2 / 3);
191 sprintf(p, " %s%d+6d8", s_dam, plev * 2 / 3);
194 sprintf(p, " %s%d+5d5", s_dam, 30 + plev * 8 / 3);
197 sprintf(p, " %s%d+10d10", s_dam, plev * 2);
200 sprintf(p, " %s50+d%d", s_dam, plev * 7);
203 sprintf(p, " %s%d+8d7", s_dam, plev * 2 + 10);
206 sprintf(p, " %s%d+6d6", s_dam, plev * 2);
208 case MS_MAGIC_MISSILE:
209 sprintf(p, " %s%d+2d6", s_dam, plev * 2 / 3);
212 sprintf(p, " %sd%d+%d", s_dur, 20+plev, plev);
215 sprintf(p, " %s%d", s_heal, plev*4);
218 sprintf(p, " %sd7+7", s_dur);
221 sprintf(p, " %s10", s_range);
224 sprintf(p, " %s%d", s_range, plev * 5);
227 sprintf(p, " %s100+d%d", s_dam, plev * 3);
230 sprintf(p, " %s5", s_range);
239 * Allow user to choose a imitation.
241 * If a valid spell is chosen, saves it in '*sn' and returns TRUE
242 * If the user hits escape, returns FALSE, and set '*sn' to -1
243 * If there are no legal choices, returns FALSE, and sets '*sn' to -2
245 * The "prompt" should be "cast", "recite", or "study"
246 * The "known" should be TRUE for cast/pray, FALSE for study
248 * nb: This function has a (trivial) display bug which will be obvious
249 * when you run it. It's probably easy to fix but I haven't tried,
252 static int get_learned_power(int *sn)
259 int plev = p_ptr->lev;
261 int ask = TRUE, mode = 0;
262 int spellnum[MAX_MONSPELLS];
267 s32b f4 = 0, f5 = 0, f6 = 0;
276 int menu_line = (use_menu ? 1 : 0);
278 /* Assume cancelled */
281 /* Nothing chosen yet */
287 #ifdef ALLOW_REPEAT /* TNB */
289 /* Get the spell, if available */
296 #endif /* ALLOW_REPEAT -- TNB */
305 prt(format(" %s ¥Ü¥ë¥È", (menu_line == 1) ? "¡Õ" : " "), 2, 14);
306 prt(format(" %s ¥Ü¡¼¥ë", (menu_line == 2) ? "¡Õ" : " "), 3, 14);
307 prt(format(" %s ¥Ö¥ì¥¹", (menu_line == 3) ? "¡Õ" : " "), 4, 14);
308 prt(format(" %s ¾¤´", (menu_line == 4) ? "¡Õ" : " "), 5, 14);
309 prt(format(" %s ¤½¤Î¾", (menu_line == 5) ? "¡Õ" : " "), 6, 14);
310 prt("¤É¤Î¼ïÎà¤ÎËâË¡¤ò»È¤¤¤Þ¤¹¤«¡©", 0, 0);
312 prt(format(" %s bolt", (menu_line == 1) ? "> " : " "), 2, 14);
313 prt(format(" %s ball", (menu_line == 2) ? "> " : " "), 3, 14);
314 prt(format(" %s breath", (menu_line == 3) ? "> " : " "), 4, 14);
315 prt(format(" %s sommoning", (menu_line == 4) ? "> " : " "), 5, 14);
316 prt(format(" %s others", (menu_line == 5) ? "> " : " "), 6, 14);
317 prt("use which type of magic? ", 0, 0);
343 if (menu_line > 5) menu_line -= 5;
350 sprintf(comment, "[A]¥Ü¥ë¥È, [B]¥Ü¡¼¥ë, [C]¥Ö¥ì¥¹, [D]¾¤´, [E]¤½¤Î¾:");
352 sprintf(comment, "[A] bolt, [B] ball, [C] breath, [D] summoning, [E] others:");
356 if (!get_com(comment, &ch, TRUE))
360 if (ch == 'A' || ch == 'a')
365 if (ch == 'B' || ch == 'b')
370 if (ch == 'C' || ch == 'c')
375 if (ch == 'D' || ch == 'd')
380 if (ch == 'E' || ch == 'e')
388 set_rf_masks(&f4, &f5, &f6, mode);
390 for (i = 0, num = 0; i < 32; i++)
392 if ((0x00000001 << i) & f4) spellnum[num++] = i;
396 if ((0x00000001 << (i - 32)) & f5) spellnum[num++] = i;
400 if ((0x00000001 << (i - 64)) & f6) spellnum[num++] = i;
402 for (i = 0; i < num; i++)
404 if (p_ptr->magic_num2[spellnum[i]])
406 if (use_menu) menu_line = i+1;
413 msg_print("¤½¤Î¼ïÎà¤ÎËâË¡¤Ï³Ð¤¨¤Æ¤¤¤Ê¤¤¡ª");
415 msg_print("You don't know any spell of this type.");
420 /* Build a prompt (accept all spells) */
422 (void) strnfmt(out_val, 78, "(%c-%c, '*'¤Ç°ìÍ÷, ESC) ¤É¤Î%s¤ò¾§¤¨¤Þ¤¹¤«¡©",
424 (void)strnfmt(out_val, 78, "(%c-%c, *=List, ESC=exit) Use which %s? ",
427 I2A(0), I2A(num - 1), p);
429 if (use_menu) screen_save();
431 /* Get a spell from the user */
433 choice= (always_show_list || use_menu) ? ESCAPE:1 ;
436 if(choice==ESCAPE) choice = ' ';
437 else if( !get_com(out_val, &choice, TRUE) )break;
439 if (use_menu && choice != ' ')
455 menu_line += (num-1);
456 if (menu_line > num) menu_line -= num;
457 } while(!p_ptr->magic_num2[spellnum[menu_line-1]]);
468 if (menu_line > num) menu_line -= num;
469 } while(!p_ptr->magic_num2[spellnum[menu_line-1]]);
478 while(!p_ptr->magic_num2[spellnum[menu_line-1]]) menu_line--;
487 while(!p_ptr->magic_num2[spellnum[menu_line-1]]) menu_line++;
502 if ((choice == ' ') || (choice == '*') || (choice == '?') || (use_menu && ask))
505 if (!redraw || use_menu)
512 /* Save the screen */
513 if (!use_menu) screen_save();
515 /* Display a list of spells */
518 put_str("̾Á°", y, x + 5);
520 put_str("Name", y, x + 5);
524 put_str("MP ¼ºÎ¨ ¸ú²Ì", y, x + 33);
526 put_str("SP Fail Info", y, x + 32);
530 /* Dump the spells */
531 for (i = 0; i < num; i++)
535 prt("", y + i + 1, x);
536 if (!p_ptr->magic_num2[spellnum[i]]) continue;
538 /* Access the spell */
539 spell = monster_powers[spellnum[i]];
543 /* Reduce failure rate by "effective" level adjustment */
544 if (plev > spell.level) chance -= 3 * (plev - spell.level);
545 else chance += (spell.level - plev);
547 chance += p_ptr->to_m_chance;
549 /* Reduce failure rate by INT/WIS adjustment */
550 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[A_INT]] - 1);
552 if (p_ptr->heavy_spell) chance += 20;
553 if(p_ptr->dec_mana && p_ptr->easy_spell) chance-=4;
554 else if (p_ptr->easy_spell) chance-=3;
555 else if (p_ptr->dec_mana) chance-=2;
557 need_mana = mod_need_mana(monster_powers[spellnum[i]].smana, 0, REALM_NONE);
559 /* Not enough mana to cast */
560 if (need_mana > p_ptr->csp)
562 chance += 5 * (need_mana - p_ptr->csp);
565 /* Extract the minimum failure rate */
566 minfail = adj_mag_fail[p_ptr->stat_ind[A_INT]];
568 /* Minimum failure rate */
569 if (chance < minfail) chance = minfail;
571 /* Stunning makes spells harder */
572 if (p_ptr->stun > 50) chance += 25;
573 else if (p_ptr->stun) chance += 15;
575 /* Always a 5 percent chance of working */
576 if (chance > 95) chance = 95;
578 if(p_ptr->dec_mana) chance--;
579 if (p_ptr->heavy_spell) chance += 5;
580 chance = MAX(chance,0);
583 learned_info(comment, spellnum[i]);
588 if (i == (menu_line-1)) strcpy(psi_desc, " ¡Õ");
590 if (i == (menu_line-1)) strcpy(psi_desc, " > ");
592 else strcpy(psi_desc, " ");
594 else sprintf(psi_desc, " %c)", I2A(i));
596 /* Dump the spell --(-- */
597 strcat(psi_desc, format(" %-26s %3d %3d%%%s",
598 spell.name, need_mana,
600 prt(psi_desc, y + i + 1, x);
603 /* Clear the bottom line */
604 if (y < 22) prt("", y + i + 1, x);
613 /* Restore the screen */
624 ask = isupper(choice);
627 if (ask) choice = tolower(choice);
629 /* Extract request */
630 i = (islower(choice) ? A2I(choice) : -1);
633 /* Totally Illegal */
634 if ((i < 0) || (i >= num) || !p_ptr->magic_num2[spellnum[i]])
640 /* Save the spell index */
641 spell = monster_powers[spellnum[i]];
650 (void) strnfmt(tmp_val, 78, "%s¤ÎËâË¡¤ò¾§¤¨¤Þ¤¹¤«¡©", monster_powers[spellnum[i]].name);
652 (void)strnfmt(tmp_val, 78, "Use %s? ", monster_powers[spellnum[i]].name);
656 /* Belay that order */
657 if (!get_check(tmp_val)) continue;
664 /* Restore the screen */
665 if (redraw) screen_load();
671 p_ptr->window |= (PW_SPELL);
677 /* Abort if needed */
678 if (!flag) return (FALSE);
680 /* Save the choice */
683 #ifdef ALLOW_REPEAT /* TNB */
687 #endif /* ALLOW_REPEAT -- TNB */
695 * do_cmd_cast calls this function if the player's class
698 static bool cast_learned_spell(int spell, bool success)
701 int plev = pseudo_plev();
702 int summon_lev = p_ptr->lev * 2 / 3 + randint1(p_ptr->lev/2);
706 bool no_trump = FALSE;
707 u32b p_mode, u_mode = 0L, g_mode;
711 p_mode = PM_FORCE_PET;
717 g_mode = PM_ALLOW_GROUP;
720 if (!success || (randint1(50+plev) < plev/10)) u_mode = PM_ALLOW_UNIQUE;
727 msg_print("¤«¤ó¹â¤¤¶âÀÚ¤êÀ¼¤ò¤¢¤²¤¿¡£");
729 msg_print("You make a high pitched shriek.");
732 aggravate_monsters(0);
741 if (!target_set(TARGET_KILL)) return FALSE;
742 if (!cave[target_row][target_col].m_idx) break;
743 if (!los(py, px, target_row, target_col)) break;
744 m_ptr = &m_list[cave[target_row][target_col].m_idx];
745 monster_desc(m_name, m_ptr, 0);
750 msg_format("%s¤Ï¤â¤¦ÌµÅ¨¤Ç¤Ï¤Ê¤¤¡£", m_name);
752 msg_format("%^s is no longer invulnerable.", m_name);
754 m_ptr->energy_need += ENERGY_NEED();
760 msg_format("%s¤Ï¤â¤¦²Ã®¤µ¤ì¤Æ¤¤¤Ê¤¤¡£", m_name);
762 msg_format("%^s is no longer fast.", m_name);
769 msg_format("%s¤Ï¤â¤¦¸ºÂ®¤µ¤ì¤Æ¤¤¤Ê¤¤¡£", m_name);
771 msg_format("%^s is no longer slow.", m_name);
774 p_ptr->redraw |= (PR_HEALTH);
775 if (p_ptr->riding == cave[target_row][target_col].m_idx) p_ptr->redraw |= (PR_UHEALTH);
780 if (!get_aim_dir(&dir)) return FALSE;
783 msg_print("¥í¥±¥Ã¥È¤òȯ¼Í¤·¤¿¡£");
785 msg_print("You fire a rocket.");
788 fire_rocket(GF_ROCKET, dir, damage, 2);
792 object_type *o_ptr = NULL;
794 if (!get_aim_dir(&dir)) return FALSE;
798 msg_print("Ìð¤òÊü¤Ã¤¿¡£");
800 msg_print("You fire an arrow.");
802 if (buki_motteruka(INVEN_RARM)) o_ptr = &inventory[INVEN_RARM];
803 else if (buki_motteruka(INVEN_LARM)) o_ptr = &inventory[INVEN_LARM];
808 damage = damroll(o_ptr->dd, o_ptr->ds)+ o_ptr->to_d;
809 if (damage < 1) damage = 1;
811 fire_bolt(GF_ARROW, dir, damage);
822 if (!get_aim_dir(&dir)) return FALSE;
824 else msg_print("»À¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
826 else msg_print("You breathe acid.");
829 fire_ball(GF_ACID, dir, damage, (plev > 40 ? -3 : -2));
832 if (!get_aim_dir(&dir)) return FALSE;
834 else msg_print("°ðºÊ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
836 else msg_print("You breathe lightning.");
839 fire_ball(GF_ELEC, dir, damage, (plev > 40 ? -3 : -2));
842 if (!get_aim_dir(&dir)) return FALSE;
844 else msg_print("²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
846 else msg_print("You breathe fire.");
849 fire_ball(GF_FIRE, dir, damage, (plev > 40 ? -3 : -2));
852 if (!get_aim_dir(&dir)) return FALSE;
854 else msg_print("Î䵤¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
856 else msg_print("You breathe frost.");
859 fire_ball(GF_COLD, dir, damage, (plev > 40 ? -3 : -2));
862 if (!get_aim_dir(&dir)) return FALSE;
864 else msg_print("¥¬¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
866 else msg_print("You breathe gas.");
869 fire_ball(GF_POIS, dir, damage, (plev > 40 ? -3 : -2));
872 if (!get_aim_dir(&dir)) return FALSE;
874 else msg_print("ÃϹö¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
876 else msg_print("You breathe nether.");
879 fire_ball(GF_NETHER, dir, damage, (plev > 40 ? -3 : -2));
882 if (!get_aim_dir(&dir)) return FALSE;
884 else msg_print("Á®¸÷¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
886 else msg_print("You breathe light.");
889 fire_ball(GF_LITE, dir, damage, (plev > 40 ? -3 : -2));
892 if (!get_aim_dir(&dir)) return FALSE;
894 else msg_print("°Å¹õ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
896 else msg_print("You breathe darkness.");
899 fire_ball(GF_DARK, dir, damage, (plev > 40 ? -3 : -2));
902 if (!get_aim_dir(&dir)) return FALSE;
904 else msg_print("º®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
906 else msg_print("You breathe confusion.");
909 fire_ball(GF_CONFUSION, dir, damage, (plev > 40 ? -3 : -2));
912 if (!get_aim_dir(&dir)) return FALSE;
914 else msg_print("¹ì²»¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
916 else msg_print("You breathe sound.");
919 fire_ball(GF_SOUND, dir, damage, (plev > 40 ? -3 : -2));
922 if (!get_aim_dir(&dir)) return FALSE;
924 else msg_print("¥«¥ª¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
926 else msg_print("You breathe chaos.");
929 fire_ball(GF_CHAOS, dir, damage, (plev > 40 ? -3 : -2));
932 if (!get_aim_dir(&dir)) return FALSE;
934 else msg_print("Îô²½¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
936 else msg_print("You breathe disenchantment.");
939 fire_ball(GF_DISENCHANT, dir, damage, (plev > 40 ? -3 : -2));
942 if (!get_aim_dir(&dir)) return FALSE;
944 else msg_print("°ø²Ìº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
946 else msg_print("You breathe nexus.");
948 damage = MIN(hp / 3, 250);
949 fire_ball(GF_NEXUS, dir, damage, (plev > 40 ? -3 : -2));
952 if (!get_aim_dir(&dir)) return FALSE;
954 else msg_print("»þ´ÖµÕž¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
956 else msg_print("You breathe time.");
958 damage = MIN(hp / 3, 150);
959 fire_ball(GF_TIME, dir, damage, (plev > 40 ? -3 : -2));
962 if (!get_aim_dir(&dir)) return FALSE;
964 else msg_print("ÃÙÆߤΥ֥쥹¤òÅǤ¤¤¿¡£");
966 else msg_print("You breathe inertia.");
968 damage = MIN(hp / 6, 200);
969 fire_ball(GF_INERTIA, dir, damage, (plev > 40 ? -3 : -2));
972 if (!get_aim_dir(&dir)) return FALSE;
974 else msg_print("½ÅÎϤΥ֥쥹¤òÅǤ¤¤¿¡£");
976 else msg_print("You breathe gravity.");
978 damage = MIN(hp / 3, 200);
979 fire_ball(GF_GRAVITY, dir, damage, (plev > 40 ? -3 : -2));
982 if (!get_aim_dir(&dir)) return FALSE;
984 else msg_print("ÇËÊҤΥ֥쥹¤òÅǤ¤¤¿¡£");
986 else msg_print("You breathe shards.");
989 fire_ball(GF_SHARDS, dir, damage, (plev > 40 ? -3 : -2));
992 if (!get_aim_dir(&dir)) return FALSE;
994 else msg_print("¥×¥é¥º¥Þ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
996 else msg_print("You breathe plasma.");
998 damage = MIN(hp / 6, 150);
999 fire_ball(GF_PLASMA, dir, damage, (plev > 40 ? -3 : -2));
1002 if (!get_aim_dir(&dir)) return FALSE;
1004 else msg_print("¥Õ¥©¡¼¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
1006 else msg_print("You breathe force.");
1008 damage = MIN(hp / 6, 200);
1009 fire_ball(GF_FORCE, dir, damage, (plev > 40 ? -3 : -2));
1012 if (!get_aim_dir(&dir)) return FALSE;
1014 else msg_print("ËâÎϤΥ֥쥹¤òÅǤ¤¤¿¡£");
1016 else msg_print("You breathe mana.");
1019 damage = MIN(hp / 3, 250);
1020 fire_ball(GF_MANA, dir, damage, (plev > 40 ? -3 : -2));
1023 if (!get_aim_dir(&dir)) return FALSE;
1025 else msg_print("Êü¼Íǽµå¤òÊü¤Ã¤¿¡£");
1027 else msg_print("You cast a ball of radiation.");
1029 damage = plev * 2 + damroll(10, 6);
1030 fire_ball(GF_NUKE, dir, damage, 2);
1033 if (!get_aim_dir(&dir)) return FALSE;
1035 else msg_print("Êü¼ÍÀÇÑ´þʪ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
1037 else msg_print("You breathe toxic waste.");
1040 fire_ball(GF_NUKE, dir, damage, (plev > 40 ? -3 : -2));
1043 if (!get_aim_dir(&dir)) return FALSE;
1045 else msg_print("½ã¥í¥°¥ë¥¹¤òÊü¤Ã¤¿¡£");
1047 else msg_print("You invoke a raw Logrus.");
1049 damage = plev * 4 + damroll(10, 10);
1050 fire_ball(GF_CHAOS, dir, damage, 4);
1053 if (!get_aim_dir(&dir)) return FALSE;
1055 else msg_print("ʬ²ò¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
1057 else msg_print("You breathe disintegration.");
1059 damage = MIN(hp / 6, 150);
1060 fire_ball(GF_DISINTEGRATE, dir, damage, (plev > 40 ? -3 : -2));
1063 if (!get_aim_dir(&dir)) return FALSE;
1065 else msg_print("¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1067 else msg_print("You cast an acid ball.");
1069 damage = randint1(plev * 6) + 15;
1070 fire_ball(GF_ACID, dir, damage, 2);
1073 if (!get_aim_dir(&dir)) return FALSE;
1075 else msg_print("¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1077 else msg_print("You cast a lightning ball.");
1079 damage = randint1(plev * 3) + 8;
1080 fire_ball(GF_ELEC, dir, damage, 2);
1083 if (!get_aim_dir(&dir)) return FALSE;
1085 else msg_print("¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1087 else msg_print("You cast a fire ball.");
1089 damage = randint1(plev * 7) + 10;
1090 fire_ball(GF_FIRE, dir, damage, 2);
1093 if (!get_aim_dir(&dir)) return FALSE;
1095 else msg_print("¥¢¥¤¥¹¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1097 else msg_print("You cast a frost ball.");
1099 damage = randint1(plev * 3) + 10;
1100 fire_ball(GF_COLD, dir, damage, 2);
1103 if (!get_aim_dir(&dir)) return FALSE;
1105 else msg_print("°½±À¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1107 else msg_print("You cast a stinking cloud.");
1109 damage = damroll(12,2);
1110 fire_ball(GF_POIS, dir, damage, 2);
1112 case MS_BALL_NETHER:
1113 if (!get_aim_dir(&dir)) return FALSE;
1115 else msg_print("ÃϹöµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1117 else msg_print("You cast a nether ball.");
1119 damage = plev * 2 + 50 + damroll(10, 10);
1120 fire_ball(GF_NETHER, dir, damage, 2);
1123 if (!get_aim_dir(&dir)) return FALSE;
1125 else msg_print("ή¤ì¤ë¤è¤¦¤Ê¿È¿¶¤ê¤ò¤·¤¿¡£");
1127 else msg_print("You gesture fluidly.");
1129 damage = randint1(plev * 4) + 50;
1130 fire_ball(GF_WATER, dir, damage, 4);
1133 if (!get_aim_dir(&dir)) return FALSE;
1135 else msg_print("ËâÎϤÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£");
1137 else msg_print("You invoke a mana storm.");
1139 damage = plev * 8 + 50 + damroll(10, 10);
1140 fire_ball(GF_MANA, dir, damage, 4);
1143 if (!get_aim_dir(&dir)) return FALSE;
1145 else msg_print("°Å¹õ¤ÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£");
1147 else msg_print("You invoke a darkness storm.");
1149 damage = plev * 8 + 50 + damroll(10, 10);
1150 fire_ball(GF_DARK, dir, damage, 4);
1153 if (!get_aim_dir(&dir)) return FALSE;
1154 fire_ball_hide(GF_DRAIN_MANA, dir, randint1(plev)+plev, 0);
1157 if (!get_aim_dir(&dir)) return FALSE;
1158 damage = damroll(7, 7);
1159 fire_ball_hide(GF_MIND_BLAST, dir, damage, 0);
1161 case MS_BRAIN_SMASH:
1162 if (!get_aim_dir(&dir)) return FALSE;
1163 damage = damroll(12, 12);
1164 fire_ball_hide(GF_BRAIN_SMASH, dir, damage, 0);
1167 if (!get_aim_dir(&dir)) return FALSE;
1168 damage = damroll(3, 8);
1169 fire_ball_hide(GF_CAUSE_1, dir, damage, 0);
1172 if (!get_aim_dir(&dir)) return FALSE;
1173 damage = damroll(8, 8);
1174 fire_ball_hide(GF_CAUSE_2, dir, damage, 0);
1177 if (!get_aim_dir(&dir)) return FALSE;
1178 damage = damroll(10, 15);
1179 fire_ball_hide(GF_CAUSE_3, dir, damage, 0);
1182 if (!get_aim_dir(&dir)) return FALSE;
1183 damage = damroll(15, 15);
1184 fire_ball_hide(GF_CAUSE_4, dir, damage, 0);
1187 if (!get_aim_dir(&dir)) return FALSE;
1189 else msg_print("¥¢¥·¥Ã¥É¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1191 else msg_print("You cast an acid bolt.");
1193 damage = damroll(7, 8) + plev * 2 / 3;
1194 fire_bolt(GF_ACID, dir, damage);
1197 if (!get_aim_dir(&dir)) return FALSE;
1199 else msg_print("¥µ¥ó¥À¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1201 else msg_print("You cast a lightning bolt.");
1203 damage = damroll(4, 8) + plev * 2 / 3;
1204 fire_bolt(GF_ELEC, dir, damage);
1207 if (!get_aim_dir(&dir)) return FALSE;
1209 else msg_print("¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1211 else msg_print("You cast a fire bolt.");
1213 damage = damroll(9, 8) + plev * 2 / 3;
1214 fire_bolt(GF_FIRE, dir, damage);
1217 if (!get_aim_dir(&dir)) return FALSE;
1219 else msg_print("¥¢¥¤¥¹¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1221 else msg_print("You cast a frost bolt.");
1223 damage = damroll(6, 8) + plev * 2 / 3;
1224 fire_bolt(GF_COLD, dir, damage);
1227 if (!get_aim_dir(&dir)) return FALSE;
1230 msg_print("¥¹¥¿¡¼¥Ð¡¼¥¹¥È¤Î¼öʸ¤òÇ°¤¸¤¿¡£");
1232 msg_print("You invoke a starburst.");
1234 damage = plev * 8 + 50 + damroll(10, 10);
1235 fire_ball(GF_LITE, dir, damage, 4);
1237 case MS_BOLT_NETHER:
1238 if (!get_aim_dir(&dir)) return FALSE;
1240 else msg_print("ÃϹö¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1242 else msg_print("You cast a nether bolt.");
1244 damage = 30 + damroll(5, 5) + plev * 8 / 3;
1245 fire_bolt(GF_NETHER, dir, damage);
1248 if (!get_aim_dir(&dir)) return FALSE;
1250 else msg_print("¥¦¥©¡¼¥¿¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1252 else msg_print("You cast a water bolt.");
1254 damage = damroll(10, 10) + plev * 2;
1255 fire_bolt(GF_WATER, dir, damage);
1258 if (!get_aim_dir(&dir)) return FALSE;
1260 else msg_print("ËâÎϤÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1262 else msg_print("You cast a mana bolt.");
1264 damage = randint1(plev * 7) + 50;
1265 fire_bolt(GF_MANA, dir, damage);
1267 case MS_BOLT_PLASMA:
1268 if (!get_aim_dir(&dir)) return FALSE;
1270 else msg_print("¥×¥é¥º¥Þ¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1272 else msg_print("You cast a plasma bolt.");
1274 damage = 10 + damroll(8, 7) + plev * 2;
1275 fire_bolt(GF_PLASMA, dir, damage);
1278 if (!get_aim_dir(&dir)) return FALSE;
1280 else msg_print("¶Ë´¨¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1282 else msg_print("You cast a ice bolt.");
1284 damage = damroll(6, 6) + plev * 2;
1285 fire_bolt(GF_ICE, dir, damage);
1287 case MS_MAGIC_MISSILE:
1288 if (!get_aim_dir(&dir)) return FALSE;
1290 else msg_print("¥Þ¥¸¥Ã¥¯¡¦¥ß¥µ¥¤¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1292 else msg_print("You cast a magic missile.");
1294 damage = damroll(2, 6) + plev * 2 / 3;
1295 fire_bolt(GF_MISSILE, dir, damage);
1298 if (!get_aim_dir(&dir)) return FALSE;
1300 else msg_print("¶²¤í¤·¤²¤Ê¸¸³Ð¤òºî¤ê½Ð¤·¤¿¡£");
1302 else msg_print("You cast a fearful illusion.");
1304 fear_monster(dir, plev+10);
1307 if (!get_aim_dir(&dir)) return FALSE;
1308 confuse_monster(dir, plev * 2);
1311 if (!get_aim_dir(&dir)) return FALSE;
1313 else msg_print("ͶÏÇŪ¤Ê¸¸³Ð¤ò¤Ä¤¯¤ê½Ð¤·¤¿¡£");
1315 else msg_print("You cast a mesmerizing illusion.");
1317 confuse_monster(dir, plev * 2);
1320 if (!get_aim_dir(&dir)) return FALSE;
1324 if (!get_aim_dir(&dir)) return FALSE;
1328 (void)set_fast(randint1(20 + plev) + plev, FALSE);
1332 if (!get_aim_dir(&dir)) return FALSE;
1334 else msg_print("<ÇËÌǤμê>¤òÊü¤Ã¤¿¡ª");
1336 else msg_print("You invoke the Hand of Doom!");
1339 fire_ball_hide(GF_HAND_DOOM, dir, plev * 3, 0);
1344 msg_print("¼«Ê¬¤Î½ý¤ËÇ°¤ò½¸Ã椷¤¿¡£");
1346 msg_print("You concentrate on your wounds!");
1348 (void)hp_player(plev*4);
1354 msg_print("̵½ý¤Îµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1356 msg_print("You cast a Globe of Invulnerability.");
1358 (void)set_invuln(randint1(4) + 4, FALSE);
1361 teleport_player(10);
1364 teleport_player(plev * 5);
1367 world_player = TRUE;
1369 msg_print("¡Ö»þ¤è¡ª¡×");
1371 msg_print("'Time!'");
1376 p_ptr->energy_need -= 1000 + (100 + randint1(200)+200)*TURNS_PER_TICK/10;
1379 p_ptr->redraw |= (PR_MAP);
1381 /* Update monsters */
1382 p_ptr->update |= (PU_MONSTERS);
1385 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1393 monster_type *m_ptr;
1394 monster_race *r_ptr;
1397 if (!target_set(TARGET_KILL)) return FALSE;
1398 if (!cave[target_row][target_col].m_idx) break;
1399 if (!player_has_los_bold(target_row, target_col)) break;
1400 m_ptr = &m_list[cave[target_row][target_col].m_idx];
1401 r_ptr = &r_info[m_ptr->r_idx];
1402 monster_desc(m_name, m_ptr, 0);
1403 if (r_ptr->flags3 & (RF3_RES_TELE))
1405 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags3 & (RF3_RES_ALL)))
1407 r_ptr->r_flags3 |= RF3_RES_TELE;
1409 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª", m_name);
1411 msg_format("%s is unaffected!", m_name);
1416 else if (r_ptr->level > randint1(100))
1418 r_ptr->r_flags3 |= RF3_RES_TELE;
1420 msg_format("%s¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª", m_name);
1422 msg_format("%s resists!", m_name);
1429 msg_format("%s¤ò°ú¤Ìᤷ¤¿¡£", m_name);
1431 msg_format("You command %s to return.", m_name);
1434 teleport_to_player(cave[target_row][target_col].m_idx, 100);
1438 if (!get_aim_dir(&dir)) return FALSE;
1440 (void)fire_beam(GF_AWAY_ALL, dir, 100);
1444 monster_type *m_ptr;
1445 monster_race *r_ptr;
1448 if (!target_set(TARGET_KILL)) return FALSE;
1449 if (!cave[target_row][target_col].m_idx) break;
1450 if (!los(py, px, target_row, target_col)) break;
1451 m_ptr = &m_list[cave[target_row][target_col].m_idx];
1452 r_ptr = &r_info[m_ptr->r_idx];
1453 monster_desc(m_name, m_ptr, 0);
1455 msg_format("%s¤Î¤ò»Ø¤µ¤·¤¿¡£", m_name);
1457 msg_format("You gesture at %s's feet.", m_name);
1460 if ((r_ptr->flags3 & RF3_RES_NEXU) || (r_ptr->flags3 & RF3_RES_TELE) ||
1461 (r_ptr->flags1 & RF1_QUESTOR) || (r_ptr->level + randint1(50) > plev + randint1(60)))
1464 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
1466 msg_format("%s are unaffected!", m_name);
1469 else if (!dun_level || one_in_(2))
1472 msg_format("%s¤Ï¾²¤òÆͤÇˤäÆÄÀ¤ó¤Ç¤¤¤Ã¤¿¡£", m_name);
1474 msg_format("%s sinks through the floor.", m_name);
1476 delete_monster_idx(cave[target_row][target_col].m_idx);
1481 msg_format("%s¤ÏÅ·°æ¤òÆͤÇˤäÆÃè¤ØÉ⤤¤Æ¤¤¤Ã¤¿¡£",m_name);
1483 msg_format("%s rises up through the ceiling.", m_name);
1485 delete_monster_idx(cave[target_row][target_col].m_idx);
1490 if (!get_aim_dir(&dir)) return FALSE;
1493 else msg_print("¸÷¤Î·õ¤òÊü¤Ã¤¿¡£");
1495 else msg_print("You throw a psycho-spear.");
1497 damage = randint1(plev * 3) + 100;
1498 (void)fire_beam(GF_PSY_SPEAR, dir, damage);
1502 msg_print("°Å°Ç¤ÎÃæ¤Ç¼ê¤ò¿¶¤Ã¤¿¡£");
1504 msg_print("You gesture in shadow.");
1506 (void)unlite_area(10, 3);
1509 if (!target_set(TARGET_KILL)) return FALSE;
1511 msg_print("¼öʸ¤ò¾§¤¨¤Æ¼Ù°¤ËÈù¾Ð¤ó¤À¡£");
1513 msg_print("You cast a spell and cackle evilly.");
1515 trap_creation(target_row, target_col);
1519 msg_print("¤·¤«¤·²¿¤âµ¯¤¤Ê¤«¤Ã¤¿¡£");
1521 msg_print("Nothing happen.");
1526 msg_print("»à¼ÔÉü³è¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1528 msg_print("You cast a animate dead.");
1530 (void)animate_dead(0, py, px);
1536 msg_print("±ç·³¤ò¾¤´¤·¤¿¡£");
1538 msg_print("You summon minions.");
1540 for (k = 0;k < 1; k++)
1542 if (summon_kin_player(summon_lev, py, px, (pet ? PM_FORCE_PET : 0L)))
1546 msg_print("¾¤´¤µ¤ì¤¿Ãç´Ö¤ÏÅܤäƤ¤¤ë¡ª");
1548 msg_print("Summoned fellows are angry!");
1562 msg_print("¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ò¾¤´¤·¤¿¡ª");
1564 msg_print("You summon a Cyberdemon!");
1566 for (k = 0 ;k < 1 ; k++)
1567 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_CYBER, p_mode))
1571 msg_print("¾¤´¤µ¤ì¤¿¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
1573 msg_print("The summoned Cyberdemon are angry!");
1586 msg_print("Ãç´Ö¤ò¾¤´¤·¤¿¡£");
1588 msg_print("You summon help.");
1590 for (k = 0;k < 1; k++)
1591 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, 0, p_mode))
1595 msg_print("¾¤´¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
1597 msg_print("The summoned monster is angry!");
1610 msg_print("¥â¥ó¥¹¥¿¡¼¤ò¾¤´¤·¤¿¡ª");
1612 msg_print("You summon monsters!");
1614 for (k = 0;k < plev / 15 + 2; k++)
1615 if(summon_specific((pet ? -1 : 0), py, px, summon_lev, 0, (p_mode | u_mode)))
1619 msg_print("¾¤´¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
1621 msg_print("Summoned monsters are angry!");
1634 msg_print("¥¢¥ê¤ò¾¤´¤·¤¿¡£");
1636 msg_print("You summon ants.");
1638 for (k = 0;k < 1; k++)
1639 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_ANT, (PM_ALLOW_GROUP | p_mode)))
1643 msg_print("¾¤´¤µ¤ì¤¿¥¢¥ê¤ÏÅܤäƤ¤¤ë¡ª");
1645 msg_print("Summoned ants are angry!");
1658 msg_print("ÃØéá¤ò¾¤´¤·¤¿¡£");
1660 msg_print("You summon spiders.");
1662 for (k = 0;k < 1; k++)
1663 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_SPIDER, (PM_ALLOW_GROUP | p_mode)))
1667 msg_print("¾¤´¤µ¤ì¤¿ÃØéá¤ÏÅܤäƤ¤¤ë¡ª");
1669 msg_print("Summoned spiders are angry!");
1682 msg_print("¥Ï¥¦¥ó¥É¤ò¾¤´¤·¤¿¡£");
1684 msg_print("You summon hounds.");
1686 for (k = 0;k < 1; k++)
1687 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HOUND, (PM_ALLOW_GROUP | p_mode)))
1691 msg_print("¾¤´¤µ¤ì¤¿¥Ï¥¦¥ó¥É¤ÏÅܤäƤ¤¤ë¡ª");
1693 msg_print("Summoned hounds are angry!");
1706 msg_print("¥Ò¥É¥é¤ò¾¤´¤·¤¿¡£");
1708 msg_print("You summon a hydras.");
1710 for (k = 0;k < 1; k++)
1711 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HYDRA, (g_mode | p_mode)))
1715 msg_print("¾¤´¤µ¤ì¤¿¥Ò¥É¥é¤ÏÅܤäƤ¤¤ë¡ª");
1717 msg_print("Summoned hydras are angry!");
1730 msg_print("Å·»È¤ò¾¤´¤·¤¿¡ª");
1732 msg_print("You summon an angel!");
1734 for (k = 0;k < 1; k++)
1735 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_ANGEL, (g_mode | p_mode)))
1739 msg_print("¾¤´¤µ¤ì¤¿Å·»È¤ÏÅܤäƤ¤¤ë¡ª");
1741 msg_print("Summoned angels are angry!");
1754 msg_print("º®Æ٤εÜÄ¤é°Ëâ¤ò¾¤´¤·¤¿¡ª");
1756 msg_print("You summon a demon from the Courts of Chaos!");
1758 for (k = 0;k < 1; k++)
1759 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DEMON, (g_mode | p_mode)))
1763 msg_print("¾¤´¤µ¤ì¤¿¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
1765 msg_print("Summoned demons are angry!");
1778 msg_print("¥¢¥ó¥Ç¥Ã¥É¤Î¶¯Å¨¤ò¾¤´¤·¤¿¡ª");
1780 msg_print("You summon an undead adversary!");
1782 for (k = 0;k < 1; k++)
1783 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_UNDEAD, (g_mode | p_mode)))
1787 msg_print("¾¤´¤µ¤ì¤¿¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
1789 msg_print("Summoned undeads are angry!");
1802 msg_print("¥É¥é¥´¥ó¤ò¾¤´¤·¤¿¡ª");
1804 msg_print("You summon a dragon!");
1806 for (k = 0;k < 1; k++)
1807 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DRAGON, (g_mode | p_mode)))
1811 msg_print("¾¤´¤µ¤ì¤¿¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
1813 msg_print("Summoned dragons are angry!");
1822 case MS_S_HI_UNDEAD:
1826 msg_print("¶¯ÎϤʥ¢¥ó¥Ç¥Ã¥É¤ò¾¤´¤·¤¿¡ª");
1828 msg_print("You summon a greater undead!");
1830 for (k = 0;k < 1; k++)
1831 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HI_UNDEAD, (g_mode | p_mode | u_mode)))
1835 msg_print("¾¤´¤µ¤ì¤¿¾åµé¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
1837 msg_print("Summoned greater undeads are angry!");
1846 case MS_S_HI_DRAGON:
1850 msg_print("¸ÅÂå¥É¥é¥´¥ó¤ò¾¤´¤·¤¿¡ª");
1852 msg_print("You summon an ancient dragon!");
1854 for (k = 0;k < 1; k++)
1855 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HI_DRAGON, (g_mode | p_mode | u_mode)))
1859 msg_print("¾¤´¤µ¤ì¤¿¸ÅÂå¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
1861 msg_print("Summoned ancient dragons are angry!");
1874 msg_print("¥¢¥ó¥Ð¡¼¤Î²¦Â²¤ò¾¤´¤·¤¿¡ª");
1876 msg_print("You summon a Lord of Amber!");
1878 for (k = 0;k < 1; k++)
1879 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_AMBERITES, (g_mode | p_mode | u_mode)))
1883 msg_print("¾¤´¤µ¤ì¤¿¥¢¥ó¥Ð¡¼¤Î²¦Â²¤ÏÅܤäƤ¤¤ë¡ª");
1885 msg_print("Summoned Lords of Amber are angry!");
1898 msg_print("ÆÃÊ̤ʶ¯Å¨¤ò¾¤´¤·¤¿¡ª");
1900 msg_print("You summon a special opponent!");
1902 for (k = 0;k < 1; k++)
1903 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_UNIQUE, (g_mode | p_mode | PM_ALLOW_UNIQUE)))
1908 msg_print("¾¤´¤µ¤ì¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
1910 msg_print("Summoned special opponents are angry!");
1913 for (k = count;k < 1; k++)
1914 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HI_UNDEAD, (g_mode | p_mode | PM_ALLOW_UNIQUE)))
1919 msg_print("¾¤´¤µ¤ì¤¿¾åµé¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
1921 msg_print("Summoned greater undeads are angry!");
1936 msg_print("²¿¤â¸½¤ì¤Ê¤«¤Ã¤¿¡£");
1938 msg_print("No one have appeared.");
1947 * do_cmd_cast calls this function if the player's class
1950 bool do_cmd_cast_learned(void)
1955 int plev = p_ptr->lev;
1956 monster_power spell;
1961 /* not if confused */
1962 if (p_ptr->confused)
1965 msg_print("º®Í𤷤Ƥ¤¤Æ¾§¤¨¤é¤ì¤Ê¤¤¡ª");
1967 msg_print("You are too confused!");
1974 if (!get_learned_power(&n)) return FALSE;
1976 spell = monster_powers[n];
1978 need_mana = mod_need_mana(spell.smana, 0, REALM_NONE);
1980 /* Verify "dangerous" spells */
1981 if (need_mana > p_ptr->csp)
1985 msg_print("£Í£Ð¤¬Â¤ê¤Þ¤»¤ó¡£");
1987 msg_print("You do not have enough mana to use this power.");
1991 if (!over_exert) return FALSE;
1995 if (!get_check("¤½¤ì¤Ç¤âÄ©À路¤Þ¤¹¤«? ")) return FALSE;
1997 if (!get_check("Attempt it anyway? ")) return FALSE;
2002 /* Spell failure chance */
2003 chance = spell.fail;
2005 /* Reduce failure rate by "effective" level adjustment */
2006 if (plev > spell.level) chance -= 3 * (plev - spell.level);
2007 else chance += (spell.level - plev);
2009 chance += p_ptr->to_m_chance;
2011 /* Reduce failure rate by INT/WIS adjustment */
2012 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[A_INT]] - 1);
2014 if (p_ptr->heavy_spell) chance += 20;
2015 if(p_ptr->dec_mana && p_ptr->easy_spell) chance-=4;
2016 else if (p_ptr->easy_spell) chance-=3;
2017 else if (p_ptr->dec_mana) chance-=2;
2019 /* Not enough mana to cast */
2020 if (need_mana > p_ptr->csp)
2022 chance += 5 * (need_mana - p_ptr->csp);
2025 /* Extract the minimum failure rate */
2026 minfail = adj_mag_fail[p_ptr->stat_ind[A_INT]];
2028 /* Minimum failure rate */
2029 if (chance < minfail) chance = minfail;
2031 /* Stunning makes spells harder */
2032 if (p_ptr->stun > 50) chance += 25;
2033 else if (p_ptr->stun) chance += 15;
2035 /* Always a 5 percent chance of working */
2036 if (chance > 95) chance = 95;
2038 if(p_ptr->dec_mana) chance--;
2039 if (p_ptr->heavy_spell) chance += 5;
2040 chance = MAX(chance,0);
2043 if (randint0(100) < chance)
2045 if (flush_failure) flush();
2047 msg_print("ËâË¡¤ò¤¦¤Þ¤¯¾§¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡£");
2049 msg_print("You failed to concentrate hard enough!");
2055 /* Cast the spell */
2056 cast = cast_learned_spell(n, FALSE);
2062 /* Cast the spell */
2063 cast = cast_learned_spell(n, TRUE);
2065 if (!cast) return FALSE;
2068 /* Sufficient mana */
2069 if (need_mana <= p_ptr->csp)
2072 p_ptr->csp -= need_mana;
2076 int oops = need_mana;
2080 p_ptr->csp_frac = 0;
2084 msg_print("Àº¿À¤ò½¸Ã椷¤¹¤®¤Æµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
2086 msg_print("You faint from the effort!");
2090 /* Hack -- Bypass free action */
2091 (void)set_paralyzed(p_ptr->paralyzed + randint1(5 * oops + 1));
2093 chg_virtue(V_KNOWLEDGE, -10);
2095 /* Damage CON (possibly permanently) */
2096 if (randint0(100) < 50)
2098 bool perm = (randint0(100) < 25);
2102 msg_print("ÂΤò°¤¯¤·¤Æ¤·¤Þ¤Ã¤¿¡ª");
2104 msg_print("You have damaged your health!");
2108 /* Reduce constitution */
2109 (void)dec_stat(A_CON, 15 + randint1(10), perm);
2117 p_ptr->redraw |= (PR_MANA);
2118 p_ptr->window |= (PW_PLAYER);
2119 p_ptr->window |= (PW_SPELL);
2124 void learn_spell(int monspell)
2126 if (p_ptr->action != ACTION_LEARN) return;
2127 if (p_ptr->magic_num2[monspell]) return;
2128 if (p_ptr->confused || p_ptr->blind || p_ptr->image || p_ptr->stun || p_ptr->paralyzed) return;
2129 if (randint1(p_ptr->lev + 70) > monster_powers[monspell].level + 40)
2131 p_ptr->magic_num2[monspell] = 1;
2133 msg_format("%s¤ò³Ø½¬¤·¤¿¡ª", monster_powers[monspell].name);
2135 msg_format("You have learned %s!", monster_powers[monspell].name);
2137 gain_exp(monster_powers[monspell].level * monster_powers[monspell].smana);
2143 p_ptr->redraw |= (PR_STATE);
2149 * Extract monster spells mask for the given mode
2151 void set_rf_masks(s32b *f4, s32b *f5, s32b *f6, int mode)
2155 case MONSPELL_TYPE_BOLT:
2156 *f4 = ((RF4_BOLT_MASK | RF4_BEAM_MASK) & ~(RF4_ROCKET));
2157 *f5 = RF5_BOLT_MASK | RF5_BEAM_MASK;
2158 *f6 = RF6_BOLT_MASK | RF6_BEAM_MASK;
2161 case MONSPELL_TYPE_BALL:
2162 *f4 = (RF4_BALL_MASK & ~(RF4_BREATH_MASK));
2163 *f5 = (RF5_BALL_MASK & ~(RF5_BREATH_MASK));
2164 *f6 = (RF6_BALL_MASK & ~(RF6_BREATH_MASK));
2167 case MONSPELL_TYPE_BREATH:
2168 *f4 = RF4_BREATH_MASK;
2169 *f5 = RF5_BREATH_MASK;
2170 *f6 = RF6_BREATH_MASK;
2173 case MONSPELL_TYPE_SUMMON:
2174 *f4 = RF4_SUMMON_MASK;
2175 *f5 = RF5_SUMMON_MASK;
2176 *f6 = RF6_SUMMON_MASK;
2179 case MONSPELL_TYPE_OTHER:
2180 *f4 = RF4_ATTACK_MASK & ~(RF4_BOLT_MASK | RF4_BEAM_MASK | RF4_BALL_MASK | RF4_INDIRECT_MASK);
2181 *f5 = RF5_ATTACK_MASK & ~(RF5_BOLT_MASK | RF5_BEAM_MASK | RF5_BALL_MASK | RF5_INDIRECT_MASK);
2182 *f6 = RF6_ATTACK_MASK & ~(RF6_BOLT_MASK | RF6_BEAM_MASK | RF6_BALL_MASK | RF6_INDIRECT_MASK);