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) */
421 (void)strnfmt(out_val, 78,
423 "(%c-%c, '*'¤Ç°ìÍ÷, ESC) ¤É¤Î%s¤ò¾§¤¨¤Þ¤¹¤«¡©",
425 "(%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 /* Reduce failure rate by INT/WIS adjustment */
548 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[A_INT]] - 1);
550 chance = mod_spell_chance_1(chance);
552 need_mana = mod_need_mana(monster_powers[spellnum[i]].smana, 0, REALM_NONE);
554 /* Not enough mana to cast */
555 if (need_mana > p_ptr->csp)
557 chance += 5 * (need_mana - p_ptr->csp);
560 /* Extract the minimum failure rate */
561 minfail = adj_mag_fail[p_ptr->stat_ind[A_INT]];
563 /* Minimum failure rate */
564 if (chance < minfail) chance = minfail;
566 /* Stunning makes spells harder */
567 if (p_ptr->stun > 50) chance += 25;
568 else if (p_ptr->stun) chance += 15;
570 /* Always a 5 percent chance of working */
571 if (chance > 95) chance = 95;
573 chance = mod_spell_chance_2(chance);
576 learned_info(comment, spellnum[i]);
581 if (i == (menu_line-1)) strcpy(psi_desc, " ¡Õ");
583 if (i == (menu_line-1)) strcpy(psi_desc, " > ");
585 else strcpy(psi_desc, " ");
587 else sprintf(psi_desc, " %c)", I2A(i));
589 /* Dump the spell --(-- */
590 strcat(psi_desc, format(" %-26s %3d %3d%%%s",
591 spell.name, need_mana,
593 prt(psi_desc, y + i + 1, x);
596 /* Clear the bottom line */
597 if (y < 22) prt("", y + i + 1, x);
606 /* Restore the screen */
617 ask = isupper(choice);
620 if (ask) choice = tolower(choice);
622 /* Extract request */
623 i = (islower(choice) ? A2I(choice) : -1);
626 /* Totally Illegal */
627 if ((i < 0) || (i >= num) || !p_ptr->magic_num2[spellnum[i]])
633 /* Save the spell index */
634 spell = monster_powers[spellnum[i]];
643 (void) strnfmt(tmp_val, 78, "%s¤ÎËâË¡¤ò¾§¤¨¤Þ¤¹¤«¡©", monster_powers[spellnum[i]].name);
645 (void)strnfmt(tmp_val, 78, "Use %s? ", monster_powers[spellnum[i]].name);
649 /* Belay that order */
650 if (!get_check(tmp_val)) continue;
657 /* Restore the screen */
658 if (redraw) screen_load();
661 p_ptr->window |= (PW_SPELL);
666 /* Abort if needed */
667 if (!flag) return (FALSE);
669 /* Save the choice */
672 #ifdef ALLOW_REPEAT /* TNB */
676 #endif /* ALLOW_REPEAT -- TNB */
684 * do_cmd_cast calls this function if the player's class
687 static bool cast_learned_spell(int spell, bool success)
690 int plev = pseudo_plev();
691 int summon_lev = p_ptr->lev * 2 / 3 + randint1(p_ptr->lev/2);
695 bool no_trump = FALSE;
696 u32b p_mode, u_mode = 0L, g_mode;
700 p_mode = PM_FORCE_PET;
706 g_mode = PM_ALLOW_GROUP;
709 if (!success || (randint1(50+plev) < plev/10)) u_mode = PM_ALLOW_UNIQUE;
716 msg_print("¤«¤ó¹â¤¤¶âÀÚ¤êÀ¼¤ò¤¢¤²¤¿¡£");
718 msg_print("You make a high pitched shriek.");
721 aggravate_monsters(0);
730 if (!target_set(TARGET_KILL)) return FALSE;
731 if (!cave[target_row][target_col].m_idx) break;
732 if (!los(py, px, target_row, target_col)) break;
733 if (!projectable(py, px, target_row, target_col)) break;
734 m_ptr = &m_list[cave[target_row][target_col].m_idx];
735 monster_desc(m_name, m_ptr, 0);
742 msg_format("%s¤Ï¤â¤¦ÌµÅ¨¤Ç¤Ï¤Ê¤¤¡£", m_name);
744 msg_format("%^s is no longer invulnerable.", m_name);
746 p_ptr->redraw |= (PR_HEALTH);
747 if (p_ptr->riding == cave[target_row][target_col].m_idx) p_ptr->redraw |= (PR_UHEALTH);
749 m_ptr->energy_need += ENERGY_NEED();
755 if (m_ptr->ml) msg_format("%s¤Ï¤â¤¦²Ã®¤µ¤ì¤Æ¤¤¤Ê¤¤¡£", m_name);
757 if (m_ptr->ml) msg_format("%^s is no longer fast.", m_name);
764 if (m_ptr->ml) msg_format("%s¤Ï¤â¤¦¸ºÂ®¤µ¤ì¤Æ¤¤¤Ê¤¤¡£", m_name);
766 if (m_ptr->ml) msg_format("%^s is no longer slow.", m_name);
773 if (!get_aim_dir(&dir)) return FALSE;
776 msg_print("¥í¥±¥Ã¥È¤òȯ¼Í¤·¤¿¡£");
778 msg_print("You fire a rocket.");
781 fire_rocket(GF_ROCKET, dir, damage, 2);
785 object_type *o_ptr = NULL;
787 if (!get_aim_dir(&dir)) return FALSE;
791 msg_print("Ìð¤òÊü¤Ã¤¿¡£");
793 msg_print("You fire an arrow.");
795 if (buki_motteruka(INVEN_RARM)) o_ptr = &inventory[INVEN_RARM];
796 else if (buki_motteruka(INVEN_LARM)) o_ptr = &inventory[INVEN_LARM];
801 damage = damroll(o_ptr->dd, o_ptr->ds)+ o_ptr->to_d;
802 if (damage < 1) damage = 1;
804 fire_bolt(GF_ARROW, dir, damage);
815 if (!get_aim_dir(&dir)) return FALSE;
817 else msg_print("»À¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
819 else msg_print("You breathe acid.");
822 fire_ball(GF_ACID, dir, damage, (plev > 40 ? -3 : -2));
825 if (!get_aim_dir(&dir)) return FALSE;
827 else msg_print("°ðºÊ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
829 else msg_print("You breathe lightning.");
832 fire_ball(GF_ELEC, dir, damage, (plev > 40 ? -3 : -2));
835 if (!get_aim_dir(&dir)) return FALSE;
837 else msg_print("²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
839 else msg_print("You breathe fire.");
842 fire_ball(GF_FIRE, dir, damage, (plev > 40 ? -3 : -2));
845 if (!get_aim_dir(&dir)) return FALSE;
847 else msg_print("Î䵤¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
849 else msg_print("You breathe frost.");
852 fire_ball(GF_COLD, dir, damage, (plev > 40 ? -3 : -2));
855 if (!get_aim_dir(&dir)) return FALSE;
857 else msg_print("¥¬¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
859 else msg_print("You breathe gas.");
862 fire_ball(GF_POIS, dir, damage, (plev > 40 ? -3 : -2));
865 if (!get_aim_dir(&dir)) return FALSE;
867 else msg_print("ÃϹö¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
869 else msg_print("You breathe nether.");
872 fire_ball(GF_NETHER, dir, damage, (plev > 40 ? -3 : -2));
875 if (!get_aim_dir(&dir)) return FALSE;
877 else msg_print("Á®¸÷¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
879 else msg_print("You breathe light.");
882 fire_ball(GF_LITE, dir, damage, (plev > 40 ? -3 : -2));
885 if (!get_aim_dir(&dir)) return FALSE;
887 else msg_print("°Å¹õ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
889 else msg_print("You breathe darkness.");
892 fire_ball(GF_DARK, dir, damage, (plev > 40 ? -3 : -2));
895 if (!get_aim_dir(&dir)) return FALSE;
897 else msg_print("º®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
899 else msg_print("You breathe confusion.");
902 fire_ball(GF_CONFUSION, dir, damage, (plev > 40 ? -3 : -2));
905 if (!get_aim_dir(&dir)) return FALSE;
907 else msg_print("¹ì²»¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
909 else msg_print("You breathe sound.");
912 fire_ball(GF_SOUND, dir, damage, (plev > 40 ? -3 : -2));
915 if (!get_aim_dir(&dir)) return FALSE;
917 else msg_print("¥«¥ª¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
919 else msg_print("You breathe chaos.");
922 fire_ball(GF_CHAOS, dir, damage, (plev > 40 ? -3 : -2));
925 if (!get_aim_dir(&dir)) return FALSE;
927 else msg_print("Îô²½¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
929 else msg_print("You breathe disenchantment.");
932 fire_ball(GF_DISENCHANT, dir, damage, (plev > 40 ? -3 : -2));
935 if (!get_aim_dir(&dir)) return FALSE;
937 else msg_print("°ø²Ìº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
939 else msg_print("You breathe nexus.");
941 damage = MIN(hp / 3, 250);
942 fire_ball(GF_NEXUS, dir, damage, (plev > 40 ? -3 : -2));
945 if (!get_aim_dir(&dir)) return FALSE;
947 else msg_print("»þ´ÖµÕž¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
949 else msg_print("You breathe time.");
951 damage = MIN(hp / 3, 150);
952 fire_ball(GF_TIME, dir, damage, (plev > 40 ? -3 : -2));
955 if (!get_aim_dir(&dir)) return FALSE;
957 else msg_print("ÃÙÆߤΥ֥쥹¤òÅǤ¤¤¿¡£");
959 else msg_print("You breathe inertia.");
961 damage = MIN(hp / 6, 200);
962 fire_ball(GF_INERTIA, dir, damage, (plev > 40 ? -3 : -2));
965 if (!get_aim_dir(&dir)) return FALSE;
967 else msg_print("½ÅÎϤΥ֥쥹¤òÅǤ¤¤¿¡£");
969 else msg_print("You breathe gravity.");
971 damage = MIN(hp / 3, 200);
972 fire_ball(GF_GRAVITY, dir, damage, (plev > 40 ? -3 : -2));
975 if (!get_aim_dir(&dir)) return FALSE;
977 else msg_print("ÇËÊҤΥ֥쥹¤òÅǤ¤¤¿¡£");
979 else msg_print("You breathe shards.");
982 fire_ball(GF_SHARDS, dir, damage, (plev > 40 ? -3 : -2));
985 if (!get_aim_dir(&dir)) return FALSE;
987 else msg_print("¥×¥é¥º¥Þ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
989 else msg_print("You breathe plasma.");
991 damage = MIN(hp / 6, 150);
992 fire_ball(GF_PLASMA, dir, damage, (plev > 40 ? -3 : -2));
995 if (!get_aim_dir(&dir)) return FALSE;
997 else msg_print("¥Õ¥©¡¼¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
999 else msg_print("You breathe force.");
1001 damage = MIN(hp / 6, 200);
1002 fire_ball(GF_FORCE, dir, damage, (plev > 40 ? -3 : -2));
1005 if (!get_aim_dir(&dir)) return FALSE;
1007 else msg_print("ËâÎϤΥ֥쥹¤òÅǤ¤¤¿¡£");
1009 else msg_print("You breathe mana.");
1012 damage = MIN(hp / 3, 250);
1013 fire_ball(GF_MANA, dir, damage, (plev > 40 ? -3 : -2));
1016 if (!get_aim_dir(&dir)) return FALSE;
1018 else msg_print("Êü¼Íǽµå¤òÊü¤Ã¤¿¡£");
1020 else msg_print("You cast a ball of radiation.");
1022 damage = plev * 2 + damroll(10, 6);
1023 fire_ball(GF_NUKE, dir, damage, 2);
1026 if (!get_aim_dir(&dir)) return FALSE;
1028 else msg_print("Êü¼ÍÀÇÑ´þʪ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
1030 else msg_print("You breathe toxic waste.");
1033 fire_ball(GF_NUKE, dir, damage, (plev > 40 ? -3 : -2));
1036 if (!get_aim_dir(&dir)) return FALSE;
1038 else msg_print("½ã¥í¥°¥ë¥¹¤òÊü¤Ã¤¿¡£");
1040 else msg_print("You invoke a raw Logrus.");
1042 damage = plev * 4 + damroll(10, 10);
1043 fire_ball(GF_CHAOS, dir, damage, 4);
1046 if (!get_aim_dir(&dir)) return FALSE;
1048 else msg_print("ʬ²ò¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
1050 else msg_print("You breathe disintegration.");
1052 damage = MIN(hp / 6, 150);
1053 fire_ball(GF_DISINTEGRATE, dir, damage, (plev > 40 ? -3 : -2));
1056 if (!get_aim_dir(&dir)) return FALSE;
1058 else msg_print("¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1060 else msg_print("You cast an acid ball.");
1062 damage = randint1(plev * 6) + 15;
1063 fire_ball(GF_ACID, dir, damage, 2);
1066 if (!get_aim_dir(&dir)) return FALSE;
1068 else msg_print("¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1070 else msg_print("You cast a lightning ball.");
1072 damage = randint1(plev * 3) + 8;
1073 fire_ball(GF_ELEC, dir, damage, 2);
1076 if (!get_aim_dir(&dir)) return FALSE;
1078 else msg_print("¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1080 else msg_print("You cast a fire ball.");
1082 damage = randint1(plev * 7) + 10;
1083 fire_ball(GF_FIRE, dir, damage, 2);
1086 if (!get_aim_dir(&dir)) return FALSE;
1088 else msg_print("¥¢¥¤¥¹¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1090 else msg_print("You cast a frost ball.");
1092 damage = randint1(plev * 3) + 10;
1093 fire_ball(GF_COLD, dir, damage, 2);
1096 if (!get_aim_dir(&dir)) return FALSE;
1098 else msg_print("°½±À¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1100 else msg_print("You cast a stinking cloud.");
1102 damage = damroll(12,2);
1103 fire_ball(GF_POIS, dir, damage, 2);
1105 case MS_BALL_NETHER:
1106 if (!get_aim_dir(&dir)) return FALSE;
1108 else msg_print("ÃϹöµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1110 else msg_print("You cast a nether ball.");
1112 damage = plev * 2 + 50 + damroll(10, 10);
1113 fire_ball(GF_NETHER, dir, damage, 2);
1116 if (!get_aim_dir(&dir)) return FALSE;
1118 else msg_print("ή¤ì¤ë¤è¤¦¤Ê¿È¿¶¤ê¤ò¤·¤¿¡£");
1120 else msg_print("You gesture fluidly.");
1122 damage = randint1(plev * 4) + 50;
1123 fire_ball(GF_WATER, dir, damage, 4);
1126 if (!get_aim_dir(&dir)) return FALSE;
1128 else msg_print("ËâÎϤÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£");
1130 else msg_print("You invoke a mana storm.");
1132 damage = plev * 8 + 50 + damroll(10, 10);
1133 fire_ball(GF_MANA, dir, damage, 4);
1136 if (!get_aim_dir(&dir)) return FALSE;
1138 else msg_print("°Å¹õ¤ÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£");
1140 else msg_print("You invoke a darkness storm.");
1142 damage = plev * 8 + 50 + damroll(10, 10);
1143 fire_ball(GF_DARK, dir, damage, 4);
1146 if (!get_aim_dir(&dir)) return FALSE;
1147 fire_ball_hide(GF_DRAIN_MANA, dir, randint1(plev)+plev, 0);
1150 if (!get_aim_dir(&dir)) return FALSE;
1151 damage = damroll(7, 7);
1152 fire_ball_hide(GF_MIND_BLAST, dir, damage, 0);
1154 case MS_BRAIN_SMASH:
1155 if (!get_aim_dir(&dir)) return FALSE;
1156 damage = damroll(12, 12);
1157 fire_ball_hide(GF_BRAIN_SMASH, dir, damage, 0);
1160 if (!get_aim_dir(&dir)) return FALSE;
1161 damage = damroll(3, 8);
1162 fire_ball_hide(GF_CAUSE_1, dir, damage, 0);
1165 if (!get_aim_dir(&dir)) return FALSE;
1166 damage = damroll(8, 8);
1167 fire_ball_hide(GF_CAUSE_2, dir, damage, 0);
1170 if (!get_aim_dir(&dir)) return FALSE;
1171 damage = damroll(10, 15);
1172 fire_ball_hide(GF_CAUSE_3, dir, damage, 0);
1175 if (!get_aim_dir(&dir)) return FALSE;
1176 damage = damroll(15, 15);
1177 fire_ball_hide(GF_CAUSE_4, dir, damage, 0);
1180 if (!get_aim_dir(&dir)) return FALSE;
1182 else msg_print("¥¢¥·¥Ã¥É¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1184 else msg_print("You cast an acid bolt.");
1186 damage = damroll(7, 8) + plev * 2 / 3;
1187 fire_bolt(GF_ACID, dir, damage);
1190 if (!get_aim_dir(&dir)) return FALSE;
1192 else msg_print("¥µ¥ó¥À¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1194 else msg_print("You cast a lightning bolt.");
1196 damage = damroll(4, 8) + plev * 2 / 3;
1197 fire_bolt(GF_ELEC, dir, damage);
1200 if (!get_aim_dir(&dir)) return FALSE;
1202 else msg_print("¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1204 else msg_print("You cast a fire bolt.");
1206 damage = damroll(9, 8) + plev * 2 / 3;
1207 fire_bolt(GF_FIRE, dir, damage);
1210 if (!get_aim_dir(&dir)) return FALSE;
1212 else msg_print("¥¢¥¤¥¹¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1214 else msg_print("You cast a frost bolt.");
1216 damage = damroll(6, 8) + plev * 2 / 3;
1217 fire_bolt(GF_COLD, dir, damage);
1220 if (!get_aim_dir(&dir)) return FALSE;
1223 msg_print("¥¹¥¿¡¼¥Ð¡¼¥¹¥È¤Î¼öʸ¤òÇ°¤¸¤¿¡£");
1225 msg_print("You invoke a starburst.");
1227 damage = plev * 8 + 50 + damroll(10, 10);
1228 fire_ball(GF_LITE, dir, damage, 4);
1230 case MS_BOLT_NETHER:
1231 if (!get_aim_dir(&dir)) return FALSE;
1233 else msg_print("ÃϹö¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1235 else msg_print("You cast a nether bolt.");
1237 damage = 30 + damroll(5, 5) + plev * 8 / 3;
1238 fire_bolt(GF_NETHER, dir, damage);
1241 if (!get_aim_dir(&dir)) return FALSE;
1243 else msg_print("¥¦¥©¡¼¥¿¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1245 else msg_print("You cast a water bolt.");
1247 damage = damroll(10, 10) + plev * 2;
1248 fire_bolt(GF_WATER, dir, damage);
1251 if (!get_aim_dir(&dir)) return FALSE;
1253 else msg_print("ËâÎϤÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1255 else msg_print("You cast a mana bolt.");
1257 damage = randint1(plev * 7) + 50;
1258 fire_bolt(GF_MANA, dir, damage);
1260 case MS_BOLT_PLASMA:
1261 if (!get_aim_dir(&dir)) return FALSE;
1263 else msg_print("¥×¥é¥º¥Þ¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1265 else msg_print("You cast a plasma bolt.");
1267 damage = 10 + damroll(8, 7) + plev * 2;
1268 fire_bolt(GF_PLASMA, dir, damage);
1271 if (!get_aim_dir(&dir)) return FALSE;
1273 else msg_print("¶Ë´¨¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1275 else msg_print("You cast a ice bolt.");
1277 damage = damroll(6, 6) + plev * 2;
1278 fire_bolt(GF_ICE, dir, damage);
1280 case MS_MAGIC_MISSILE:
1281 if (!get_aim_dir(&dir)) return FALSE;
1283 else msg_print("¥Þ¥¸¥Ã¥¯¡¦¥ß¥µ¥¤¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1285 else msg_print("You cast a magic missile.");
1287 damage = damroll(2, 6) + plev * 2 / 3;
1288 fire_bolt(GF_MISSILE, dir, damage);
1291 if (!get_aim_dir(&dir)) return FALSE;
1293 else msg_print("¶²¤í¤·¤²¤Ê¸¸³Ð¤òºî¤ê½Ð¤·¤¿¡£");
1295 else msg_print("You cast a fearful illusion.");
1297 fear_monster(dir, plev+10);
1300 if (!get_aim_dir(&dir)) return FALSE;
1301 confuse_monster(dir, plev * 2);
1304 if (!get_aim_dir(&dir)) return FALSE;
1306 else msg_print("ͶÏÇŪ¤Ê¸¸³Ð¤ò¤Ä¤¯¤ê½Ð¤·¤¿¡£");
1308 else msg_print("You cast a mesmerizing illusion.");
1310 confuse_monster(dir, plev * 2);
1313 if (!get_aim_dir(&dir)) return FALSE;
1317 if (!get_aim_dir(&dir)) return FALSE;
1321 (void)set_fast(randint1(20 + plev) + plev, FALSE);
1325 if (!get_aim_dir(&dir)) return FALSE;
1327 else msg_print("<ÇËÌǤμê>¤òÊü¤Ã¤¿¡ª");
1329 else msg_print("You invoke the Hand of Doom!");
1332 fire_ball_hide(GF_HAND_DOOM, dir, plev * 3, 0);
1337 msg_print("¼«Ê¬¤Î½ý¤ËÇ°¤ò½¸Ã椷¤¿¡£");
1339 msg_print("You concentrate on your wounds!");
1341 (void)hp_player(plev*4);
1347 msg_print("̵½ý¤Îµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1349 msg_print("You cast a Globe of Invulnerability.");
1351 (void)set_invuln(randint1(4) + 4, FALSE);
1354 teleport_player(10);
1357 teleport_player(plev * 5);
1360 world_player = TRUE;
1362 msg_print("¡Ö»þ¤è¡ª¡×");
1364 msg_print("'Time!'");
1369 p_ptr->energy_need -= 1000 + (100 + randint1(200)+200)*TURNS_PER_TICK/10;
1372 p_ptr->redraw |= (PR_MAP);
1374 /* Update monsters */
1375 p_ptr->update |= (PU_MONSTERS);
1378 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1386 monster_type *m_ptr;
1387 monster_race *r_ptr;
1390 if (!target_set(TARGET_KILL)) return FALSE;
1391 if (!cave[target_row][target_col].m_idx) break;
1392 if (!player_has_los_bold(target_row, target_col)) break;
1393 if (!projectable(py, px, target_row, target_col)) break;
1394 m_ptr = &m_list[cave[target_row][target_col].m_idx];
1395 r_ptr = &r_info[m_ptr->r_idx];
1396 monster_desc(m_name, m_ptr, 0);
1397 if (r_ptr->flagsr & RFR_RES_TELE)
1399 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
1401 if (is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1403 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª", m_name);
1405 msg_format("%s is unaffected!", m_name);
1410 else if (r_ptr->level > randint1(100))
1412 if (is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1414 msg_format("%s¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª", m_name);
1416 msg_format("%s resists!", m_name);
1423 msg_format("%s¤ò°ú¤Ìᤷ¤¿¡£", m_name);
1425 msg_format("You command %s to return.", m_name);
1428 teleport_monster_to(cave[target_row][target_col].m_idx, py, px, 100);
1432 if (!get_aim_dir(&dir)) return FALSE;
1434 (void)fire_beam(GF_AWAY_ALL, dir, 100);
1439 monster_type *m_ptr;
1440 monster_race *r_ptr;
1443 if (!target_set(TARGET_KILL)) return FALSE;
1444 target_m_idx = cave[target_row][target_col].m_idx;
1445 if (!target_m_idx) break;
1446 if (!los(py, px, target_row, target_col)) break;
1447 if (!projectable(py, px, target_row, target_col)) break;
1448 m_ptr = &m_list[target_m_idx];
1449 r_ptr = &r_info[m_ptr->r_idx];
1450 monster_desc(m_name, m_ptr, 0);
1452 msg_format("%^s¤Î¤ò»Ø¤µ¤·¤¿¡£", m_name);
1454 msg_format("You gesture at %^s's feet.", m_name);
1457 if ((r_ptr->flagsr & (RFR_EFF_RES_NEXU_MASK | RFR_RES_TELE)) ||
1458 (r_ptr->flags1 & RF1_QUESTOR) || (r_ptr->level + randint1(50) > plev + randint1(60)))
1461 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
1463 msg_format("%^s is unaffected!", m_name);
1466 else teleport_level(target_m_idx);
1470 if (!get_aim_dir(&dir)) return FALSE;
1473 else msg_print("¸÷¤Î·õ¤òÊü¤Ã¤¿¡£");
1475 else msg_print("You throw a psycho-spear.");
1477 damage = randint1(plev * 3) + 100;
1478 (void)fire_beam(GF_PSY_SPEAR, dir, damage);
1482 msg_print("°Å°Ç¤ÎÃæ¤Ç¼ê¤ò¿¶¤Ã¤¿¡£");
1484 msg_print("You gesture in shadow.");
1486 (void)unlite_area(10, 3);
1489 if (!target_set(TARGET_KILL)) return FALSE;
1491 msg_print("¼öʸ¤ò¾§¤¨¤Æ¼Ù°¤ËÈù¾Ð¤ó¤À¡£");
1493 msg_print("You cast a spell and cackle evilly.");
1495 trap_creation(target_row, target_col);
1499 msg_print("¤·¤«¤·²¿¤âµ¯¤¤Ê¤«¤Ã¤¿¡£");
1501 msg_print("Nothing happen.");
1506 msg_print("»à¼ÔÉü³è¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1508 msg_print("You cast a animate dead.");
1510 (void)animate_dead(0, py, px);
1516 msg_print("±ç·³¤ò¾¤´¤·¤¿¡£");
1518 msg_print("You summon minions.");
1520 for (k = 0;k < 1; k++)
1522 if (summon_kin_player(summon_lev, py, px, (pet ? PM_FORCE_PET : 0L)))
1526 msg_print("¾¤´¤µ¤ì¤¿Ãç´Ö¤ÏÅܤäƤ¤¤ë¡ª");
1528 msg_print("Summoned fellows are angry!");
1542 msg_print("¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ò¾¤´¤·¤¿¡ª");
1544 msg_print("You summon a Cyberdemon!");
1546 for (k = 0 ;k < 1 ; k++)
1547 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_CYBER, p_mode))
1551 msg_print("¾¤´¤µ¤ì¤¿¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
1553 msg_print("The summoned Cyberdemon are angry!");
1566 msg_print("Ãç´Ö¤ò¾¤´¤·¤¿¡£");
1568 msg_print("You summon help.");
1570 for (k = 0;k < 1; k++)
1571 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, 0, p_mode))
1575 msg_print("¾¤´¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
1577 msg_print("The summoned monster is angry!");
1590 msg_print("¥â¥ó¥¹¥¿¡¼¤ò¾¤´¤·¤¿¡ª");
1592 msg_print("You summon monsters!");
1594 for (k = 0;k < plev / 15 + 2; k++)
1595 if(summon_specific((pet ? -1 : 0), py, px, summon_lev, 0, (p_mode | u_mode)))
1599 msg_print("¾¤´¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
1601 msg_print("Summoned monsters are angry!");
1614 msg_print("¥¢¥ê¤ò¾¤´¤·¤¿¡£");
1616 msg_print("You summon ants.");
1618 for (k = 0;k < 1; k++)
1619 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_ANT, (PM_ALLOW_GROUP | p_mode)))
1623 msg_print("¾¤´¤µ¤ì¤¿¥¢¥ê¤ÏÅܤäƤ¤¤ë¡ª");
1625 msg_print("Summoned ants are angry!");
1638 msg_print("ÃØéá¤ò¾¤´¤·¤¿¡£");
1640 msg_print("You summon spiders.");
1642 for (k = 0;k < 1; k++)
1643 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_SPIDER, (PM_ALLOW_GROUP | p_mode)))
1647 msg_print("¾¤´¤µ¤ì¤¿ÃØéá¤ÏÅܤäƤ¤¤ë¡ª");
1649 msg_print("Summoned spiders are angry!");
1662 msg_print("¥Ï¥¦¥ó¥É¤ò¾¤´¤·¤¿¡£");
1664 msg_print("You summon hounds.");
1666 for (k = 0;k < 1; k++)
1667 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HOUND, (PM_ALLOW_GROUP | p_mode)))
1671 msg_print("¾¤´¤µ¤ì¤¿¥Ï¥¦¥ó¥É¤ÏÅܤäƤ¤¤ë¡ª");
1673 msg_print("Summoned hounds are angry!");
1686 msg_print("¥Ò¥É¥é¤ò¾¤´¤·¤¿¡£");
1688 msg_print("You summon a hydras.");
1690 for (k = 0;k < 1; k++)
1691 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HYDRA, (g_mode | p_mode)))
1695 msg_print("¾¤´¤µ¤ì¤¿¥Ò¥É¥é¤ÏÅܤäƤ¤¤ë¡ª");
1697 msg_print("Summoned hydras are angry!");
1710 msg_print("Å·»È¤ò¾¤´¤·¤¿¡ª");
1712 msg_print("You summon an angel!");
1714 for (k = 0;k < 1; k++)
1715 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_ANGEL, (g_mode | p_mode)))
1719 msg_print("¾¤´¤µ¤ì¤¿Å·»È¤ÏÅܤäƤ¤¤ë¡ª");
1721 msg_print("Summoned angels are angry!");
1734 msg_print("º®Æ٤εÜÄ¤é°Ëâ¤ò¾¤´¤·¤¿¡ª");
1736 msg_print("You summon a demon from the Courts of Chaos!");
1738 for (k = 0;k < 1; k++)
1739 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DEMON, (g_mode | p_mode)))
1743 msg_print("¾¤´¤µ¤ì¤¿¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
1745 msg_print("Summoned demons are angry!");
1758 msg_print("¥¢¥ó¥Ç¥Ã¥É¤Î¶¯Å¨¤ò¾¤´¤·¤¿¡ª");
1760 msg_print("You summon an undead adversary!");
1762 for (k = 0;k < 1; k++)
1763 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_UNDEAD, (g_mode | p_mode)))
1767 msg_print("¾¤´¤µ¤ì¤¿¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
1769 msg_print("Summoned undeads are angry!");
1782 msg_print("¥É¥é¥´¥ó¤ò¾¤´¤·¤¿¡ª");
1784 msg_print("You summon a dragon!");
1786 for (k = 0;k < 1; k++)
1787 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DRAGON, (g_mode | p_mode)))
1791 msg_print("¾¤´¤µ¤ì¤¿¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
1793 msg_print("Summoned dragons are angry!");
1802 case MS_S_HI_UNDEAD:
1806 msg_print("¶¯ÎϤʥ¢¥ó¥Ç¥Ã¥É¤ò¾¤´¤·¤¿¡ª");
1808 msg_print("You summon a greater undead!");
1810 for (k = 0;k < 1; k++)
1811 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HI_UNDEAD, (g_mode | p_mode | u_mode)))
1815 msg_print("¾¤´¤µ¤ì¤¿¾åµé¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
1817 msg_print("Summoned greater undeads are angry!");
1826 case MS_S_HI_DRAGON:
1830 msg_print("¸ÅÂå¥É¥é¥´¥ó¤ò¾¤´¤·¤¿¡ª");
1832 msg_print("You summon an ancient dragon!");
1834 for (k = 0;k < 1; k++)
1835 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HI_DRAGON, (g_mode | p_mode | u_mode)))
1839 msg_print("¾¤´¤µ¤ì¤¿¸ÅÂå¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
1841 msg_print("Summoned ancient dragons are angry!");
1854 msg_print("¥¢¥ó¥Ð¡¼¤Î²¦Â²¤ò¾¤´¤·¤¿¡ª");
1856 msg_print("You summon a Lord of Amber!");
1858 for (k = 0;k < 1; k++)
1859 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_AMBERITES, (g_mode | p_mode | u_mode)))
1863 msg_print("¾¤´¤µ¤ì¤¿¥¢¥ó¥Ð¡¼¤Î²¦Â²¤ÏÅܤäƤ¤¤ë¡ª");
1865 msg_print("Summoned Lords of Amber are angry!");
1878 msg_print("ÆÃÊ̤ʶ¯Å¨¤ò¾¤´¤·¤¿¡ª");
1880 msg_print("You summon a special opponent!");
1882 for (k = 0;k < 1; k++)
1883 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_UNIQUE, (g_mode | p_mode | PM_ALLOW_UNIQUE)))
1888 msg_print("¾¤´¤µ¤ì¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
1890 msg_print("Summoned special opponents are angry!");
1893 for (k = count;k < 1; k++)
1894 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HI_UNDEAD, (g_mode | p_mode | PM_ALLOW_UNIQUE)))
1899 msg_print("¾¤´¤µ¤ì¤¿¾åµé¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
1901 msg_print("Summoned greater undeads are angry!");
1916 msg_print("²¿¤â¸½¤ì¤Ê¤«¤Ã¤¿¡£");
1918 msg_print("No one have appeared.");
1927 * do_cmd_cast calls this function if the player's class
1930 bool do_cmd_cast_learned(void)
1935 int plev = p_ptr->lev;
1936 monster_power spell;
1941 /* not if confused */
1942 if (p_ptr->confused)
1945 msg_print("º®Í𤷤Ƥ¤¤Æ¾§¤¨¤é¤ì¤Ê¤¤¡ª");
1947 msg_print("You are too confused!");
1954 if (!get_learned_power(&n)) return FALSE;
1956 spell = monster_powers[n];
1958 need_mana = mod_need_mana(spell.smana, 0, REALM_NONE);
1960 /* Verify "dangerous" spells */
1961 if (need_mana > p_ptr->csp)
1965 msg_print("£Í£Ð¤¬Â¤ê¤Þ¤»¤ó¡£");
1967 msg_print("You do not have enough mana to use this power.");
1971 if (!over_exert) return FALSE;
1975 if (!get_check("¤½¤ì¤Ç¤âÄ©À路¤Þ¤¹¤«? ")) return FALSE;
1977 if (!get_check("Attempt it anyway? ")) return FALSE;
1982 /* Spell failure chance */
1983 chance = spell.fail;
1985 /* Reduce failure rate by "effective" level adjustment */
1986 if (plev > spell.level) chance -= 3 * (plev - spell.level);
1987 else chance += (spell.level - plev);
1989 /* Reduce failure rate by INT/WIS adjustment */
1990 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[A_INT]] - 1);
1992 chance = mod_spell_chance_1(chance);
1994 /* Not enough mana to cast */
1995 if (need_mana > p_ptr->csp)
1997 chance += 5 * (need_mana - p_ptr->csp);
2000 /* Extract the minimum failure rate */
2001 minfail = adj_mag_fail[p_ptr->stat_ind[A_INT]];
2003 /* Minimum failure rate */
2004 if (chance < minfail) chance = minfail;
2006 /* Stunning makes spells harder */
2007 if (p_ptr->stun > 50) chance += 25;
2008 else if (p_ptr->stun) chance += 15;
2010 /* Always a 5 percent chance of working */
2011 if (chance > 95) chance = 95;
2013 chance = mod_spell_chance_2(chance);
2016 if (randint0(100) < chance)
2018 if (flush_failure) flush();
2020 msg_print("ËâË¡¤ò¤¦¤Þ¤¯¾§¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡£");
2022 msg_print("You failed to concentrate hard enough!");
2028 /* Cast the spell */
2029 cast = cast_learned_spell(n, FALSE);
2035 /* Cast the spell */
2036 cast = cast_learned_spell(n, TRUE);
2038 if (!cast) return FALSE;
2041 /* Sufficient mana */
2042 if (need_mana <= p_ptr->csp)
2045 p_ptr->csp -= need_mana;
2049 int oops = need_mana;
2053 p_ptr->csp_frac = 0;
2057 msg_print("Àº¿À¤ò½¸Ã椷¤¹¤®¤Æµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
2059 msg_print("You faint from the effort!");
2063 /* Hack -- Bypass free action */
2064 (void)set_paralyzed(p_ptr->paralyzed + randint1(5 * oops + 1));
2066 chg_virtue(V_KNOWLEDGE, -10);
2068 /* Damage CON (possibly permanently) */
2069 if (randint0(100) < 50)
2071 bool perm = (randint0(100) < 25);
2075 msg_print("ÂΤò°¤¯¤·¤Æ¤·¤Þ¤Ã¤¿¡ª");
2077 msg_print("You have damaged your health!");
2081 /* Reduce constitution */
2082 (void)dec_stat(A_CON, 15 + randint1(10), perm);
2090 p_ptr->redraw |= (PR_MANA);
2091 p_ptr->window |= (PW_PLAYER);
2092 p_ptr->window |= (PW_SPELL);
2097 void learn_spell(int monspell)
2099 if (p_ptr->action != ACTION_LEARN) return;
2100 if (monspell < 0) return; /* Paranoia */
2101 if (p_ptr->magic_num2[monspell]) return;
2102 if (p_ptr->confused || p_ptr->blind || p_ptr->image || p_ptr->stun || p_ptr->paralyzed) return;
2103 if (randint1(p_ptr->lev + 70) > monster_powers[monspell].level + 40)
2105 p_ptr->magic_num2[monspell] = 1;
2107 msg_format("%s¤ò³Ø½¬¤·¤¿¡ª", monster_powers[monspell].name);
2109 msg_format("You have learned %s!", monster_powers[monspell].name);
2111 gain_exp(monster_powers[monspell].level * monster_powers[monspell].smana);
2117 p_ptr->redraw |= (PR_STATE);
2123 * Extract monster spells mask for the given mode
2125 void set_rf_masks(s32b *f4, s32b *f5, s32b *f6, int mode)
2129 case MONSPELL_TYPE_BOLT:
2130 *f4 = ((RF4_BOLT_MASK | RF4_BEAM_MASK) & ~(RF4_ROCKET));
2131 *f5 = RF5_BOLT_MASK | RF5_BEAM_MASK;
2132 *f6 = RF6_BOLT_MASK | RF6_BEAM_MASK;
2135 case MONSPELL_TYPE_BALL:
2136 *f4 = (RF4_BALL_MASK & ~(RF4_BREATH_MASK));
2137 *f5 = (RF5_BALL_MASK & ~(RF5_BREATH_MASK));
2138 *f6 = (RF6_BALL_MASK & ~(RF6_BREATH_MASK));
2141 case MONSPELL_TYPE_BREATH:
2142 *f4 = RF4_BREATH_MASK;
2143 *f5 = RF5_BREATH_MASK;
2144 *f6 = RF6_BREATH_MASK;
2147 case MONSPELL_TYPE_SUMMON:
2148 *f4 = RF4_SUMMON_MASK;
2149 *f5 = RF5_SUMMON_MASK;
2150 *f6 = RF6_SUMMON_MASK;
2153 case MONSPELL_TYPE_OTHER:
2154 *f4 = RF4_ATTACK_MASK & ~(RF4_BOLT_MASK | RF4_BEAM_MASK | RF4_BALL_MASK | RF4_INDIRECT_MASK);
2155 *f5 = RF5_ATTACK_MASK & ~(RF5_BOLT_MASK | RF5_BEAM_MASK | RF5_BALL_MASK | RF5_INDIRECT_MASK);
2156 *f6 = RF6_ATTACK_MASK & ~(RF6_BOLT_MASK | RF6_BEAM_MASK | RF6_BALL_MASK | RF6_INDIRECT_MASK);