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')
390 f4 = ((RF4_BOLT_MASK | RF4_BEAM_MASK) & ~(RF4_ROCKET));
391 f5 = RF5_BOLT_MASK | RF5_BEAM_MASK;
392 f6 = RF6_BOLT_MASK | RF6_BEAM_MASK;
396 f4 = (RF4_BALL_MASK & ~(RF4_BREATH_MASK));
397 f5 = (RF5_BALL_MASK & ~(RF5_BREATH_MASK));
398 f6 = (RF6_BALL_MASK & ~(RF6_BREATH_MASK));
402 f4 = RF4_BREATH_MASK;
403 f5 = RF5_BREATH_MASK;
404 f6 = RF6_BREATH_MASK;
408 f4 = RF4_SUMMON_MASK;
409 f5 = RF5_SUMMON_MASK;
410 f6 = RF6_SUMMON_MASK;
414 f4 = ~(RF4_BOLT_MASK | RF4_BEAM_MASK | RF4_BALL_MASK | RF4_SUMMON_MASK | RF4_INDIRECT_MASK | RF4_RIDING_MASK);
415 f5 = ~(RF5_BOLT_MASK | RF5_BEAM_MASK | RF5_BALL_MASK | RF5_SUMMON_MASK | RF5_INDIRECT_MASK | RF5_RIDING_MASK);
416 f6 = (~(RF6_BOLT_MASK | RF6_BEAM_MASK | RF6_BALL_MASK | RF6_SUMMON_MASK | RF6_INDIRECT_MASK | RF6_RIDING_MASK)) | (RF6_TRAPS | RF6_DARKNESS);
419 for (i = 0, num = 0; i < 32; i++)
421 if ((0x00000001 << i) & f4) spellnum[num++] = i;
425 if ((0x00000001 << (i - 32)) & f5) spellnum[num++] = i;
429 if ((0x00000001 << (i - 64)) & f6) spellnum[num++] = i;
431 for (i = 0; i < num; i++)
433 if (p_ptr->magic_num2[spellnum[i]])
435 if (use_menu) menu_line = i+1;
442 msg_print("¤½¤Î¼ïÎà¤ÎËâË¡¤Ï³Ð¤¨¤Æ¤¤¤Ê¤¤¡ª");
444 msg_print("You don't know any spell of this type.");
449 /* Build a prompt (accept all spells) */
451 (void) strnfmt(out_val, 78, "(%c-%c, '*'¤Ç°ìÍ÷, ESC) ¤É¤Î%s¤ò¾§¤¨¤Þ¤¹¤«¡©",
453 (void)strnfmt(out_val, 78, "(%c-%c, *=List, ESC=exit) Use which %s? ",
456 I2A(0), I2A(num - 1), p);
458 if (use_menu) screen_save();
460 /* Get a spell from the user */
462 choice= (always_show_list || use_menu) ? ESCAPE:1 ;
465 if(choice==ESCAPE) choice = ' ';
466 else if( !get_com(out_val, &choice, TRUE) )break;
468 if (use_menu && choice != ' ')
484 menu_line += (num-1);
485 if (menu_line > num) menu_line -= num;
486 } while(!p_ptr->magic_num2[spellnum[menu_line-1]]);
497 if (menu_line > num) menu_line -= num;
498 } while(!p_ptr->magic_num2[spellnum[menu_line-1]]);
507 while(!p_ptr->magic_num2[spellnum[menu_line-1]]) menu_line--;
516 while(!p_ptr->magic_num2[spellnum[menu_line-1]]) menu_line++;
531 if ((choice == ' ') || (choice == '*') || (choice == '?') || (use_menu && ask))
534 if (!redraw || use_menu)
541 /* Save the screen */
542 if (!use_menu) screen_save();
544 /* Display a list of spells */
547 put_str("̾Á°", y, x + 5);
549 put_str("Name", y, x + 5);
553 put_str("MP ¼ºÎ¨ ¸ú²Ì", y, x + 33);
555 put_str("SP Fail Info", y, x + 32);
559 /* Dump the spells */
560 for (i = 0; i < num; i++)
564 prt("", y + i + 1, x);
565 if (!p_ptr->magic_num2[spellnum[i]]) continue;
567 /* Access the spell */
568 spell = monster_powers[spellnum[i]];
572 /* Reduce failure rate by "effective" level adjustment */
573 if (plev > spell.level) chance -= 3 * (plev - spell.level);
574 else chance += (spell.level - plev);
576 chance += p_ptr->to_m_chance;
578 /* Reduce failure rate by INT/WIS adjustment */
579 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[A_INT]] - 1);
581 if (p_ptr->heavy_spell) chance += 20;
582 if(p_ptr->dec_mana && p_ptr->easy_spell) chance-=4;
583 else if (p_ptr->easy_spell) chance-=3;
584 else if (p_ptr->dec_mana) chance-=2;
586 need_mana = mod_need_mana(monster_powers[spellnum[i]].smana, 0, REALM_NONE);
588 /* Not enough mana to cast */
589 if (need_mana > p_ptr->csp)
591 chance += 5 * (need_mana - p_ptr->csp);
594 /* Extract the minimum failure rate */
595 minfail = adj_mag_fail[p_ptr->stat_ind[A_INT]];
597 /* Minimum failure rate */
598 if (chance < minfail) chance = minfail;
600 /* Stunning makes spells harder */
601 if (p_ptr->stun > 50) chance += 25;
602 else if (p_ptr->stun) chance += 15;
604 /* Always a 5 percent chance of working */
605 if (chance > 95) chance = 95;
607 if(p_ptr->dec_mana) chance--;
608 if (p_ptr->heavy_spell) chance += 5;
609 chance = MAX(chance,0);
612 learned_info(comment, spellnum[i]);
617 if (i == (menu_line-1)) strcpy(psi_desc, " ¡Õ");
619 if (i == (menu_line-1)) strcpy(psi_desc, " > ");
621 else strcpy(psi_desc, " ");
623 else sprintf(psi_desc, " %c)", I2A(i));
625 /* Dump the spell --(-- */
626 strcat(psi_desc, format(" %-26s %3d %3d%%%s",
627 spell.name, need_mana,
629 prt(psi_desc, y + i + 1, x);
632 /* Clear the bottom line */
633 if (y < 22) prt("", y + i + 1, x);
642 /* Restore the screen */
653 ask = isupper(choice);
656 if (ask) choice = tolower(choice);
658 /* Extract request */
659 i = (islower(choice) ? A2I(choice) : -1);
662 /* Totally Illegal */
663 if ((i < 0) || (i >= num) || !p_ptr->magic_num2[spellnum[i]])
669 /* Save the spell index */
670 spell = monster_powers[spellnum[i]];
679 (void) strnfmt(tmp_val, 78, "%s¤ÎËâË¡¤ò¾§¤¨¤Þ¤¹¤«¡©", monster_powers[spellnum[i]].name);
681 (void)strnfmt(tmp_val, 78, "Use %s? ", monster_powers[spellnum[i]].name);
685 /* Belay that order */
686 if (!get_check(tmp_val)) continue;
693 /* Restore the screen */
694 if (redraw) screen_load();
700 p_ptr->window |= (PW_SPELL);
706 /* Abort if needed */
707 if (!flag) return (FALSE);
709 /* Save the choice */
712 #ifdef ALLOW_REPEAT /* TNB */
716 #endif /* ALLOW_REPEAT -- TNB */
724 * do_cmd_cast calls this function if the player's class
727 static bool cast_learned_spell(int spell, bool success)
730 int plev = pseudo_plev();
731 int summon_lev = p_ptr->lev * 2 / 3 + randint1(p_ptr->lev/2);
735 bool no_trump = FALSE;
736 u32b p_mode, u_mode = 0L, g_mode;
740 p_mode = PM_FORCE_PET;
746 g_mode = PM_ALLOW_GROUP;
749 if (!success || (randint1(50+plev) < plev/10)) u_mode = PM_ALLOW_UNIQUE;
756 msg_print("¤«¤ó¹â¤¤¶âÀÚ¤êÀ¼¤ò¤¢¤²¤¿¡£");
758 msg_print("You make a high pitched shriek.");
761 aggravate_monsters(0);
770 if (!target_set(TARGET_KILL)) return FALSE;
771 if (!cave[target_row][target_col].m_idx) break;
772 if (!los(py, px, target_row, target_col)) break;
773 m_ptr = &m_list[cave[target_row][target_col].m_idx];
774 monster_desc(m_name, m_ptr, 0);
779 msg_format("%s¤Ï¤â¤¦ÌµÅ¨¤Ç¤Ï¤Ê¤¤¡£", m_name);
781 msg_format("%^s is no longer invulnerable.", m_name);
783 m_ptr->energy_need += ENERGY_NEED();
789 msg_format("%s¤Ï¤â¤¦²Ã®¤µ¤ì¤Æ¤¤¤Ê¤¤¡£", m_name);
791 msg_format("%^s is no longer fast.", m_name);
798 msg_format("%s¤Ï¤â¤¦¸ºÂ®¤µ¤ì¤Æ¤¤¤Ê¤¤¡£", m_name);
800 msg_format("%^s is no longer slow.", m_name);
803 p_ptr->redraw |= (PR_HEALTH);
804 if (p_ptr->riding == cave[target_row][target_col].m_idx) p_ptr->redraw |= (PR_UHEALTH);
809 if (!get_aim_dir(&dir)) return FALSE;
812 msg_print("¥í¥±¥Ã¥È¤òȯ¼Í¤·¤¿¡£");
814 msg_print("You fire a rocket.");
817 fire_rocket(GF_ROCKET, dir, damage, 2);
821 object_type *o_ptr = NULL;
823 if (!get_aim_dir(&dir)) return FALSE;
827 msg_print("Ìð¤òÊü¤Ã¤¿¡£");
829 msg_print("You fire an arrow.");
831 if (buki_motteruka(INVEN_RARM)) o_ptr = &inventory[INVEN_RARM];
832 else if (buki_motteruka(INVEN_LARM)) o_ptr = &inventory[INVEN_LARM];
837 damage = damroll(o_ptr->dd, o_ptr->ds)+ o_ptr->to_d;
838 if (damage < 1) damage = 1;
840 fire_bolt(GF_ARROW, dir, damage);
851 if (!get_aim_dir(&dir)) return FALSE;
853 else msg_print("»À¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
855 else msg_print("You breathe acid.");
858 fire_ball(GF_ACID, dir, damage, (plev > 40 ? -3 : -2));
861 if (!get_aim_dir(&dir)) return FALSE;
863 else msg_print("°ðºÊ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
865 else msg_print("You breathe lightning.");
868 fire_ball(GF_ELEC, dir, damage, (plev > 40 ? -3 : -2));
871 if (!get_aim_dir(&dir)) return FALSE;
873 else msg_print("²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
875 else msg_print("You breathe fire.");
878 fire_ball(GF_FIRE, dir, damage, (plev > 40 ? -3 : -2));
881 if (!get_aim_dir(&dir)) return FALSE;
883 else msg_print("Î䵤¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
885 else msg_print("You breathe frost.");
888 fire_ball(GF_COLD, dir, damage, (plev > 40 ? -3 : -2));
891 if (!get_aim_dir(&dir)) return FALSE;
893 else msg_print("¥¬¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
895 else msg_print("You breathe gas.");
898 fire_ball(GF_POIS, dir, damage, (plev > 40 ? -3 : -2));
901 if (!get_aim_dir(&dir)) return FALSE;
903 else msg_print("ÃϹö¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
905 else msg_print("You breathe nether.");
908 fire_ball(GF_NETHER, dir, damage, (plev > 40 ? -3 : -2));
911 if (!get_aim_dir(&dir)) return FALSE;
913 else msg_print("Á®¸÷¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
915 else msg_print("You breathe light.");
918 fire_ball(GF_LITE, dir, damage, (plev > 40 ? -3 : -2));
921 if (!get_aim_dir(&dir)) return FALSE;
923 else msg_print("°Å¹õ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
925 else msg_print("You breathe darkness.");
928 fire_ball(GF_DARK, dir, damage, (plev > 40 ? -3 : -2));
931 if (!get_aim_dir(&dir)) return FALSE;
933 else msg_print("º®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
935 else msg_print("You breathe confusion.");
938 fire_ball(GF_CONFUSION, dir, damage, (plev > 40 ? -3 : -2));
941 if (!get_aim_dir(&dir)) return FALSE;
943 else msg_print("¹ì²»¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
945 else msg_print("You breathe sound.");
948 fire_ball(GF_SOUND, dir, damage, (plev > 40 ? -3 : -2));
951 if (!get_aim_dir(&dir)) return FALSE;
953 else msg_print("¥«¥ª¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
955 else msg_print("You breathe chaos.");
958 fire_ball(GF_CHAOS, dir, damage, (plev > 40 ? -3 : -2));
961 if (!get_aim_dir(&dir)) return FALSE;
963 else msg_print("Îô²½¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
965 else msg_print("You breathe disenchantment.");
968 fire_ball(GF_DISENCHANT, dir, damage, (plev > 40 ? -3 : -2));
971 if (!get_aim_dir(&dir)) return FALSE;
973 else msg_print("°ø²Ìº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
975 else msg_print("You breathe nexus.");
977 damage = MIN(hp / 3, 250);
978 fire_ball(GF_NEXUS, dir, damage, (plev > 40 ? -3 : -2));
981 if (!get_aim_dir(&dir)) return FALSE;
983 else msg_print("»þ´ÖµÕž¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
985 else msg_print("You breathe time.");
987 damage = MIN(hp / 3, 150);
988 fire_ball(GF_TIME, dir, damage, (plev > 40 ? -3 : -2));
991 if (!get_aim_dir(&dir)) return FALSE;
993 else msg_print("ÃÙÆߤΥ֥쥹¤òÅǤ¤¤¿¡£");
995 else msg_print("You breathe inertia.");
997 damage = MIN(hp / 6, 200);
998 fire_ball(GF_INERTIA, dir, damage, (plev > 40 ? -3 : -2));
1001 if (!get_aim_dir(&dir)) return FALSE;
1003 else msg_print("½ÅÎϤΥ֥쥹¤òÅǤ¤¤¿¡£");
1005 else msg_print("You breathe gravity.");
1007 damage = MIN(hp / 3, 200);
1008 fire_ball(GF_GRAVITY, dir, damage, (plev > 40 ? -3 : -2));
1011 if (!get_aim_dir(&dir)) return FALSE;
1013 else msg_print("ÇËÊҤΥ֥쥹¤òÅǤ¤¤¿¡£");
1015 else msg_print("You breathe shards.");
1018 fire_ball(GF_SHARDS, dir, damage, (plev > 40 ? -3 : -2));
1021 if (!get_aim_dir(&dir)) return FALSE;
1023 else msg_print("¥×¥é¥º¥Þ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
1025 else msg_print("You breathe plasma.");
1027 damage = MIN(hp / 6, 150);
1028 fire_ball(GF_PLASMA, dir, damage, (plev > 40 ? -3 : -2));
1031 if (!get_aim_dir(&dir)) return FALSE;
1033 else msg_print("¥Õ¥©¡¼¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
1035 else msg_print("You breathe force.");
1037 damage = MIN(hp / 6, 200);
1038 fire_ball(GF_FORCE, dir, damage, (plev > 40 ? -3 : -2));
1041 if (!get_aim_dir(&dir)) return FALSE;
1043 else msg_print("ËâÎϤΥ֥쥹¤òÅǤ¤¤¿¡£");
1045 else msg_print("You breathe mana.");
1048 damage = MIN(hp / 3, 250);
1049 fire_ball(GF_MANA, dir, damage, (plev > 40 ? -3 : -2));
1052 if (!get_aim_dir(&dir)) return FALSE;
1054 else msg_print("Êü¼Íǽµå¤òÊü¤Ã¤¿¡£");
1056 else msg_print("You cast a ball of radiation.");
1058 damage = plev * 2 + damroll(10, 6);
1059 fire_ball(GF_NUKE, dir, damage, 2);
1062 if (!get_aim_dir(&dir)) return FALSE;
1064 else msg_print("Êü¼ÍÀÇÑ´þʪ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
1066 else msg_print("You breathe toxic waste.");
1069 fire_ball(GF_NUKE, dir, damage, (plev > 40 ? -3 : -2));
1072 if (!get_aim_dir(&dir)) return FALSE;
1074 else msg_print("½ã¥í¥°¥ë¥¹¤òÊü¤Ã¤¿¡£");
1076 else msg_print("You invoke a raw Logrus.");
1078 damage = plev * 4 + damroll(10, 10);
1079 fire_ball(GF_CHAOS, dir, damage, 4);
1082 if (!get_aim_dir(&dir)) return FALSE;
1084 else msg_print("ʬ²ò¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
1086 else msg_print("You breathe disintegration.");
1088 damage = MIN(hp / 6, 150);
1089 fire_ball(GF_DISINTEGRATE, dir, damage, (plev > 40 ? -3 : -2));
1092 if (!get_aim_dir(&dir)) return FALSE;
1094 else msg_print("¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1096 else msg_print("You cast an acid ball.");
1098 damage = randint1(plev * 6) + 15;
1099 fire_ball(GF_ACID, dir, damage, 2);
1102 if (!get_aim_dir(&dir)) return FALSE;
1104 else msg_print("¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1106 else msg_print("You cast a lightning ball.");
1108 damage = randint1(plev * 3) + 8;
1109 fire_ball(GF_ELEC, dir, damage, 2);
1112 if (!get_aim_dir(&dir)) return FALSE;
1114 else msg_print("¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1116 else msg_print("You cast a fire ball.");
1118 damage = randint1(plev * 7) + 10;
1119 fire_ball(GF_FIRE, dir, damage, 2);
1122 if (!get_aim_dir(&dir)) return FALSE;
1124 else msg_print("¥¢¥¤¥¹¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1126 else msg_print("You cast a frost ball.");
1128 damage = randint1(plev * 3) + 10;
1129 fire_ball(GF_COLD, dir, damage, 2);
1132 if (!get_aim_dir(&dir)) return FALSE;
1134 else msg_print("°½±À¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1136 else msg_print("You cast a stinking cloud.");
1138 damage = damroll(12,2);
1139 fire_ball(GF_POIS, dir, damage, 2);
1141 case MS_BALL_NETHER:
1142 if (!get_aim_dir(&dir)) return FALSE;
1144 else msg_print("ÃϹöµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1146 else msg_print("You cast a nether ball.");
1148 damage = plev * 2 + 50 + damroll(10, 10);
1149 fire_ball(GF_NETHER, dir, damage, 2);
1152 if (!get_aim_dir(&dir)) return FALSE;
1154 else msg_print("ή¤ì¤ë¤è¤¦¤Ê¿È¿¶¤ê¤ò¤·¤¿¡£");
1156 else msg_print("You gesture fluidly.");
1158 damage = randint1(plev * 4) + 50;
1159 fire_ball(GF_WATER, dir, damage, 4);
1162 if (!get_aim_dir(&dir)) return FALSE;
1164 else msg_print("ËâÎϤÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£");
1166 else msg_print("You invoke a mana storm.");
1168 damage = plev * 8 + 50 + damroll(10, 10);
1169 fire_ball(GF_MANA, dir, damage, 4);
1172 if (!get_aim_dir(&dir)) return FALSE;
1174 else msg_print("°Å¹õ¤ÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£");
1176 else msg_print("You invoke a darkness storm.");
1178 damage = plev * 8 + 50 + damroll(10, 10);
1179 fire_ball(GF_DARK, dir, damage, 4);
1182 if (!get_aim_dir(&dir)) return FALSE;
1183 fire_ball_hide(GF_DRAIN_MANA, dir, randint1(plev)+plev, 0);
1186 if (!get_aim_dir(&dir)) return FALSE;
1187 damage = damroll(7, 7);
1188 fire_ball_hide(GF_MIND_BLAST, dir, damage, 0);
1190 case MS_BRAIN_SMASH:
1191 if (!get_aim_dir(&dir)) return FALSE;
1192 damage = damroll(12, 12);
1193 fire_ball_hide(GF_BRAIN_SMASH, dir, damage, 0);
1196 if (!get_aim_dir(&dir)) return FALSE;
1197 damage = damroll(3, 8);
1198 fire_ball_hide(GF_CAUSE_1, dir, damage, 0);
1201 if (!get_aim_dir(&dir)) return FALSE;
1202 damage = damroll(8, 8);
1203 fire_ball_hide(GF_CAUSE_2, dir, damage, 0);
1206 if (!get_aim_dir(&dir)) return FALSE;
1207 damage = damroll(10, 15);
1208 fire_ball_hide(GF_CAUSE_3, dir, damage, 0);
1211 if (!get_aim_dir(&dir)) return FALSE;
1212 damage = damroll(15, 15);
1213 fire_ball_hide(GF_CAUSE_4, dir, damage, 0);
1216 if (!get_aim_dir(&dir)) return FALSE;
1218 else msg_print("¥¢¥·¥Ã¥É¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1220 else msg_print("You cast an acid bolt.");
1222 damage = damroll(7, 8) + plev * 2 / 3;
1223 fire_bolt(GF_ACID, dir, damage);
1226 if (!get_aim_dir(&dir)) return FALSE;
1228 else msg_print("¥µ¥ó¥À¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1230 else msg_print("You cast a lightning bolt.");
1232 damage = damroll(4, 8) + plev * 2 / 3;
1233 fire_bolt(GF_ELEC, dir, damage);
1236 if (!get_aim_dir(&dir)) return FALSE;
1238 else msg_print("¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1240 else msg_print("You cast a fire bolt.");
1242 damage = damroll(9, 8) + plev * 2 / 3;
1243 fire_bolt(GF_FIRE, dir, damage);
1246 if (!get_aim_dir(&dir)) return FALSE;
1248 else msg_print("¥¢¥¤¥¹¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1250 else msg_print("You cast a frost bolt.");
1252 damage = damroll(6, 8) + plev * 2 / 3;
1253 fire_bolt(GF_COLD, dir, damage);
1256 if (!get_aim_dir(&dir)) return FALSE;
1259 msg_print("¥¹¥¿¡¼¥Ð¡¼¥¹¥È¤Î¼öʸ¤òÇ°¤¸¤¿¡£");
1261 msg_print("You invoke a starburst.");
1263 damage = plev * 8 + 50 + damroll(10, 10);
1264 fire_ball(GF_LITE, dir, damage, 4);
1266 case MS_BOLT_NETHER:
1267 if (!get_aim_dir(&dir)) return FALSE;
1269 else msg_print("ÃϹö¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1271 else msg_print("You cast a nether bolt.");
1273 damage = 30 + damroll(5, 5) + plev * 8 / 3;
1274 fire_bolt(GF_NETHER, dir, damage);
1277 if (!get_aim_dir(&dir)) return FALSE;
1279 else msg_print("¥¦¥©¡¼¥¿¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1281 else msg_print("You cast a water bolt.");
1283 damage = damroll(10, 10) + plev * 2;
1284 fire_bolt(GF_WATER, dir, damage);
1287 if (!get_aim_dir(&dir)) return FALSE;
1289 else msg_print("ËâÎϤÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1291 else msg_print("You cast a mana bolt.");
1293 damage = randint1(plev * 7) + 50;
1294 fire_bolt(GF_MANA, dir, damage);
1296 case MS_BOLT_PLASMA:
1297 if (!get_aim_dir(&dir)) return FALSE;
1299 else msg_print("¥×¥é¥º¥Þ¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1301 else msg_print("You cast a plasma bolt.");
1303 damage = 10 + damroll(8, 7) + plev * 2;
1304 fire_bolt(GF_PLASMA, dir, damage);
1307 if (!get_aim_dir(&dir)) return FALSE;
1309 else msg_print("¶Ë´¨¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1311 else msg_print("You cast a ice bolt.");
1313 damage = damroll(6, 6) + plev * 2;
1314 fire_bolt(GF_ICE, dir, damage);
1316 case MS_MAGIC_MISSILE:
1317 if (!get_aim_dir(&dir)) return FALSE;
1319 else msg_print("¥Þ¥¸¥Ã¥¯¡¦¥ß¥µ¥¤¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1321 else msg_print("You cast a magic missile.");
1323 damage = damroll(2, 6) + plev * 2 / 3;
1324 fire_bolt(GF_MISSILE, dir, damage);
1327 if (!get_aim_dir(&dir)) return FALSE;
1329 else msg_print("¶²¤í¤·¤²¤Ê¸¸³Ð¤òºî¤ê½Ð¤·¤¿¡£");
1331 else msg_print("You cast a fearful illusion.");
1333 fear_monster(dir, plev+10);
1336 if (!get_aim_dir(&dir)) return FALSE;
1337 confuse_monster(dir, plev * 2);
1340 if (!get_aim_dir(&dir)) return FALSE;
1342 else msg_print("ͶÏÇŪ¤Ê¸¸³Ð¤ò¤Ä¤¯¤ê½Ð¤·¤¿¡£");
1344 else msg_print("You cast a mesmerizing illusion.");
1346 confuse_monster(dir, plev * 2);
1349 if (!get_aim_dir(&dir)) return FALSE;
1353 if (!get_aim_dir(&dir)) return FALSE;
1357 (void)set_fast(randint1(20 + plev) + plev, FALSE);
1361 if (!get_aim_dir(&dir)) return FALSE;
1363 else msg_print("<ÇËÌǤμê>¤òÊü¤Ã¤¿¡ª");
1365 else msg_print("You invoke the Hand of Doom!");
1368 fire_ball_hide(GF_HAND_DOOM, dir, plev * 3, 0);
1373 msg_print("¼«Ê¬¤Î½ý¤ËÇ°¤ò½¸Ã椷¤¿¡£");
1375 msg_print("You concentrate on your wounds!");
1377 (void)hp_player(plev*4);
1383 msg_print("̵½ý¤Îµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1385 msg_print("You cast a Globe of Invulnerability.");
1387 (void)set_invuln(randint1(4) + 4, FALSE);
1390 teleport_player(10);
1393 teleport_player(plev * 5);
1396 world_player = TRUE;
1398 msg_print("¡Ö»þ¤è¡ª¡×");
1400 msg_print("'Time!'");
1405 p_ptr->energy_need -= 1000 + (100 + randint1(200)+200)*TURNS_PER_TICK/10;
1408 p_ptr->redraw |= (PR_MAP);
1410 /* Update monsters */
1411 p_ptr->update |= (PU_MONSTERS);
1414 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1422 monster_type *m_ptr;
1423 monster_race *r_ptr;
1426 if (!target_set(TARGET_KILL)) return FALSE;
1427 if (!cave[target_row][target_col].m_idx) break;
1428 if (!player_has_los_bold(target_row, target_col)) break;
1429 m_ptr = &m_list[cave[target_row][target_col].m_idx];
1430 r_ptr = &r_info[m_ptr->r_idx];
1431 monster_desc(m_name, m_ptr, 0);
1432 if (r_ptr->flags3 & (RF3_RES_TELE))
1434 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags3 & (RF3_RES_ALL)))
1436 r_ptr->r_flags3 |= RF3_RES_TELE;
1438 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª", m_name);
1440 msg_format("%s is unaffected!", m_name);
1445 else if (r_ptr->level > randint1(100))
1447 r_ptr->r_flags3 |= RF3_RES_TELE;
1449 msg_format("%s¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª", m_name);
1451 msg_format("%s resists!", m_name);
1458 msg_format("%s¤ò°ú¤Ìᤷ¤¿¡£", m_name);
1460 msg_format("You command %s to return.", m_name);
1463 teleport_to_player(cave[target_row][target_col].m_idx, 100);
1467 if (!get_aim_dir(&dir)) return FALSE;
1469 (void)fire_beam(GF_AWAY_ALL, dir, 100);
1473 monster_type *m_ptr;
1474 monster_race *r_ptr;
1477 if (!target_set(TARGET_KILL)) return FALSE;
1478 if (!cave[target_row][target_col].m_idx) break;
1479 if (!los(py, px, target_row, target_col)) break;
1480 m_ptr = &m_list[cave[target_row][target_col].m_idx];
1481 r_ptr = &r_info[m_ptr->r_idx];
1482 monster_desc(m_name, m_ptr, 0);
1484 msg_format("%s¤Î¤ò»Ø¤µ¤·¤¿¡£", m_name);
1486 msg_format("You gesture at %s's feet.", m_name);
1489 if ((r_ptr->flags3 & RF3_RES_NEXU) || (r_ptr->flags3 & RF3_RES_TELE) ||
1490 (r_ptr->flags1 & RF1_QUESTOR) || (r_ptr->level + randint1(50) > plev + randint1(60)))
1493 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
1495 msg_format("%s are unaffected!", m_name);
1498 else if (!dun_level || one_in_(2))
1501 msg_format("%s¤Ï¾²¤òÆͤÇˤäÆÄÀ¤ó¤Ç¤¤¤Ã¤¿¡£", m_name);
1503 msg_format("%s sinks through the floor.", m_name);
1505 delete_monster_idx(cave[target_row][target_col].m_idx);
1510 msg_format("%s¤ÏÅ·°æ¤òÆͤÇˤäÆÃè¤ØÉ⤤¤Æ¤¤¤Ã¤¿¡£",m_name);
1512 msg_format("%s rises up through the ceiling.", m_name);
1514 delete_monster_idx(cave[target_row][target_col].m_idx);
1519 if (!get_aim_dir(&dir)) return FALSE;
1522 else msg_print("¸÷¤Î·õ¤òÊü¤Ã¤¿¡£");
1524 else msg_print("You throw a psycho-spear.");
1526 damage = randint1(plev * 3) + 100;
1527 (void)fire_beam(GF_PSY_SPEAR, dir, damage);
1531 msg_print("°Å°Ç¤ÎÃæ¤Ç¼ê¤ò¿¶¤Ã¤¿¡£");
1533 msg_print("You gesture in shadow.");
1535 (void)unlite_area(10, 3);
1538 if (!target_set(TARGET_KILL)) return FALSE;
1540 msg_print("¼öʸ¤ò¾§¤¨¤Æ¼Ù°¤ËÈù¾Ð¤ó¤À¡£");
1542 msg_print("You cast a spell and cackle evilly.");
1544 trap_creation(target_row, target_col);
1548 msg_print("¤·¤«¤·²¿¤âµ¯¤¤Ê¤«¤Ã¤¿¡£");
1550 msg_print("Nothing happen.");
1555 msg_print("»à¼ÔÉü³è¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1557 msg_print("You cast a animate dead.");
1559 (void)animate_dead(0, py, px);
1565 msg_print("±ç·³¤ò¾¤´¤·¤¿¡£");
1567 msg_print("You summon minions.");
1569 for (k = 0;k < 1; k++)
1571 if (summon_kin_player(summon_lev, py, px, (pet ? PM_FORCE_PET : 0L)))
1575 msg_print("¾¤´¤µ¤ì¤¿Ãç´Ö¤ÏÅܤäƤ¤¤ë¡ª");
1577 msg_print("Summoned fellows are angry!");
1591 msg_print("¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ò¾¤´¤·¤¿¡ª");
1593 msg_print("You summon a Cyberdemon!");
1595 for (k = 0 ;k < 1 ; k++)
1596 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_CYBER, p_mode))
1600 msg_print("¾¤´¤µ¤ì¤¿¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
1602 msg_print("The summoned Cyberdemon are angry!");
1615 msg_print("Ãç´Ö¤ò¾¤´¤·¤¿¡£");
1617 msg_print("You summon help.");
1619 for (k = 0;k < 1; k++)
1620 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, 0, p_mode))
1624 msg_print("¾¤´¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
1626 msg_print("The summoned monster is angry!");
1639 msg_print("¥â¥ó¥¹¥¿¡¼¤ò¾¤´¤·¤¿¡ª");
1641 msg_print("You summon monsters!");
1643 for (k = 0;k < plev / 15 + 2; k++)
1644 if(summon_specific((pet ? -1 : 0), py, px, summon_lev, 0, (p_mode | u_mode)))
1648 msg_print("¾¤´¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
1650 msg_print("Summoned monsters are angry!");
1663 msg_print("¥¢¥ê¤ò¾¤´¤·¤¿¡£");
1665 msg_print("You summon ants.");
1667 for (k = 0;k < 1; k++)
1668 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_ANT, (PM_ALLOW_GROUP | p_mode)))
1672 msg_print("¾¤´¤µ¤ì¤¿¥¢¥ê¤ÏÅܤäƤ¤¤ë¡ª");
1674 msg_print("Summoned ants are angry!");
1687 msg_print("ÃØéá¤ò¾¤´¤·¤¿¡£");
1689 msg_print("You summon spiders.");
1691 for (k = 0;k < 1; k++)
1692 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_SPIDER, (PM_ALLOW_GROUP | p_mode)))
1696 msg_print("¾¤´¤µ¤ì¤¿ÃØéá¤ÏÅܤäƤ¤¤ë¡ª");
1698 msg_print("Summoned spiders are angry!");
1711 msg_print("¥Ï¥¦¥ó¥É¤ò¾¤´¤·¤¿¡£");
1713 msg_print("You summon hounds.");
1715 for (k = 0;k < 1; k++)
1716 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HOUND, (PM_ALLOW_GROUP | p_mode)))
1720 msg_print("¾¤´¤µ¤ì¤¿¥Ï¥¦¥ó¥É¤ÏÅܤäƤ¤¤ë¡ª");
1722 msg_print("Summoned hounds are angry!");
1735 msg_print("¥Ò¥É¥é¤ò¾¤´¤·¤¿¡£");
1737 msg_print("You summon a hydras.");
1739 for (k = 0;k < 1; k++)
1740 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HYDRA, (g_mode | p_mode)))
1744 msg_print("¾¤´¤µ¤ì¤¿¥Ò¥É¥é¤ÏÅܤäƤ¤¤ë¡ª");
1746 msg_print("Summoned hydras are angry!");
1759 msg_print("Å·»È¤ò¾¤´¤·¤¿¡ª");
1761 msg_print("You summon an angel!");
1763 for (k = 0;k < 1; k++)
1764 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_ANGEL, (g_mode | p_mode)))
1768 msg_print("¾¤´¤µ¤ì¤¿Å·»È¤ÏÅܤäƤ¤¤ë¡ª");
1770 msg_print("Summoned angels are angry!");
1783 msg_print("º®Æ٤εÜÄ¤é°Ëâ¤ò¾¤´¤·¤¿¡ª");
1785 msg_print("You summon a demon from the Courts of Chaos!");
1787 for (k = 0;k < 1; k++)
1788 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DEMON, (g_mode | p_mode)))
1792 msg_print("¾¤´¤µ¤ì¤¿¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
1794 msg_print("Summoned demons are angry!");
1807 msg_print("¥¢¥ó¥Ç¥Ã¥É¤Î¶¯Å¨¤ò¾¤´¤·¤¿¡ª");
1809 msg_print("You summon an undead adversary!");
1811 for (k = 0;k < 1; k++)
1812 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_UNDEAD, (g_mode | p_mode)))
1816 msg_print("¾¤´¤µ¤ì¤¿¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
1818 msg_print("Summoned undeads are angry!");
1831 msg_print("¥É¥é¥´¥ó¤ò¾¤´¤·¤¿¡ª");
1833 msg_print("You summon a dragon!");
1835 for (k = 0;k < 1; k++)
1836 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DRAGON, (g_mode | p_mode)))
1840 msg_print("¾¤´¤µ¤ì¤¿¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
1842 msg_print("Summoned dragons are angry!");
1851 case MS_S_HI_UNDEAD:
1855 msg_print("¶¯ÎϤʥ¢¥ó¥Ç¥Ã¥É¤ò¾¤´¤·¤¿¡ª");
1857 msg_print("You summon a greater undead!");
1859 for (k = 0;k < 1; k++)
1860 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HI_UNDEAD, (g_mode | p_mode | u_mode)))
1864 msg_print("¾¤´¤µ¤ì¤¿¾åµé¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
1866 msg_print("Summoned greater undeads are angry!");
1875 case MS_S_HI_DRAGON:
1879 msg_print("¸ÅÂå¥É¥é¥´¥ó¤ò¾¤´¤·¤¿¡ª");
1881 msg_print("You summon an ancient dragon!");
1883 for (k = 0;k < 1; k++)
1884 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HI_DRAGON, (g_mode | p_mode | u_mode)))
1888 msg_print("¾¤´¤µ¤ì¤¿¸ÅÂå¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
1890 msg_print("Summoned ancient dragons are angry!");
1903 msg_print("¥¢¥ó¥Ð¡¼¤Î²¦Â²¤ò¾¤´¤·¤¿¡ª");
1905 msg_print("You summon a Lord of Amber!");
1907 for (k = 0;k < 1; k++)
1908 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_AMBERITES, (g_mode | p_mode | u_mode)))
1912 msg_print("¾¤´¤µ¤ì¤¿¥¢¥ó¥Ð¡¼¤Î²¦Â²¤ÏÅܤäƤ¤¤ë¡ª");
1914 msg_print("Summoned Lords of Amber are angry!");
1927 msg_print("ÆÃÊ̤ʶ¯Å¨¤ò¾¤´¤·¤¿¡ª");
1929 msg_print("You summon a special opponent!");
1931 for (k = 0;k < 1; k++)
1932 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_UNIQUE, (g_mode | p_mode | PM_ALLOW_UNIQUE)))
1937 msg_print("¾¤´¤µ¤ì¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
1939 msg_print("Summoned special opponents are angry!");
1942 for (k = count;k < 1; k++)
1943 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HI_UNDEAD, (g_mode | p_mode | PM_ALLOW_UNIQUE)))
1948 msg_print("¾¤´¤µ¤ì¤¿¾åµé¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
1950 msg_print("Summoned greater undeads are angry!");
1965 msg_print("²¿¤â¸½¤ì¤Ê¤«¤Ã¤¿¡£");
1967 msg_print("No one have appeared.");
1976 * do_cmd_cast calls this function if the player's class
1979 bool do_cmd_cast_learned(void)
1984 int plev = p_ptr->lev;
1985 monster_power spell;
1990 /* not if confused */
1991 if (p_ptr->confused)
1994 msg_print("º®Í𤷤Ƥ¤¤Æ¾§¤¨¤é¤ì¤Ê¤¤¡ª");
1996 msg_print("You are too confused!");
2003 if (!get_learned_power(&n)) return FALSE;
2005 spell = monster_powers[n];
2007 need_mana = mod_need_mana(spell.smana, 0, REALM_NONE);
2009 /* Verify "dangerous" spells */
2010 if (need_mana > p_ptr->csp)
2014 msg_print("£Í£Ð¤¬Â¤ê¤Þ¤»¤ó¡£");
2016 msg_print("You do not have enough mana to use this power.");
2020 if (!over_exert) return FALSE;
2024 if (!get_check("¤½¤ì¤Ç¤âÄ©À路¤Þ¤¹¤«? ")) return FALSE;
2026 if (!get_check("Attempt it anyway? ")) return FALSE;
2031 /* Spell failure chance */
2032 chance = spell.fail;
2034 /* Reduce failure rate by "effective" level adjustment */
2035 if (plev > spell.level) chance -= 3 * (plev - spell.level);
2036 else chance += (spell.level - plev);
2038 chance += p_ptr->to_m_chance;
2040 /* Reduce failure rate by INT/WIS adjustment */
2041 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[A_INT]] - 1);
2043 if (p_ptr->heavy_spell) chance += 20;
2044 if(p_ptr->dec_mana && p_ptr->easy_spell) chance-=4;
2045 else if (p_ptr->easy_spell) chance-=3;
2046 else if (p_ptr->dec_mana) chance-=2;
2048 /* Not enough mana to cast */
2049 if (need_mana > p_ptr->csp)
2051 chance += 5 * (need_mana - p_ptr->csp);
2054 /* Extract the minimum failure rate */
2055 minfail = adj_mag_fail[p_ptr->stat_ind[A_INT]];
2057 /* Minimum failure rate */
2058 if (chance < minfail) chance = minfail;
2060 /* Stunning makes spells harder */
2061 if (p_ptr->stun > 50) chance += 25;
2062 else if (p_ptr->stun) chance += 15;
2064 /* Always a 5 percent chance of working */
2065 if (chance > 95) chance = 95;
2067 if(p_ptr->dec_mana) chance--;
2068 if (p_ptr->heavy_spell) chance += 5;
2069 chance = MAX(chance,0);
2072 if (randint0(100) < chance)
2074 if (flush_failure) flush();
2076 msg_print("ËâË¡¤ò¤¦¤Þ¤¯¾§¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡£");
2078 msg_print("You failed to concentrate hard enough!");
2084 /* Cast the spell */
2085 cast = cast_learned_spell(n, FALSE);
2091 /* Cast the spell */
2092 cast = cast_learned_spell(n, TRUE);
2094 if (!cast) return FALSE;
2097 /* Sufficient mana */
2098 if (need_mana <= p_ptr->csp)
2101 p_ptr->csp -= need_mana;
2105 int oops = need_mana;
2109 p_ptr->csp_frac = 0;
2113 msg_print("Àº¿À¤ò½¸Ã椷¤¹¤®¤Æµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
2115 msg_print("You faint from the effort!");
2119 /* Hack -- Bypass free action */
2120 (void)set_paralyzed(p_ptr->paralyzed + randint1(5 * oops + 1));
2122 chg_virtue(V_KNOWLEDGE, -10);
2124 /* Damage CON (possibly permanently) */
2125 if (randint0(100) < 50)
2127 bool perm = (randint0(100) < 25);
2131 msg_print("ÂΤò°¤¯¤·¤Æ¤·¤Þ¤Ã¤¿¡ª");
2133 msg_print("You have damaged your health!");
2137 /* Reduce constitution */
2138 (void)dec_stat(A_CON, 15 + randint1(10), perm);
2146 p_ptr->redraw |= (PR_MANA);
2147 p_ptr->window |= (PW_PLAYER);
2148 p_ptr->window |= (PW_SPELL);
2153 void learn_spell(int monspell)
2155 if (p_ptr->action != ACTION_LEARN) return;
2156 if (p_ptr->magic_num2[monspell]) return;
2157 if (p_ptr->confused || p_ptr->blind || p_ptr->image || p_ptr->stun || p_ptr->paralyzed) return;
2158 if (randint1(p_ptr->lev + 70) > monster_powers[monspell].level + 40)
2160 p_ptr->magic_num2[monspell] = 1;
2162 msg_format("%s¤ò³Ø½¬¤·¤¿¡ª", monster_powers[monspell].name);
2164 msg_format("You have learned %s!", monster_powers[monspell].name);
2166 gain_exp(monster_powers[monspell].level * monster_powers[monspell].smana);
2172 p_ptr->redraw |= (PR_STATE);