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: Spell/Prayer commands */
15 #include "spellstips.h"
17 cptr spell_category_name(int tval)
22 case TV_HISSATSU_BOOK:
31 case TV_HISSATSU_BOOK:
44 * Allow user to choose a spell/prayer from the given book.
46 * If a valid spell is chosen, saves it in '*sn' and returns TRUE
47 * If the user hits escape, returns FALSE, and set '*sn' to -1
48 * If there are no legal choices, returns FALSE, and sets '*sn' to -2
50 * The "prompt" should be "cast", "recite", or "study"
51 * The "known" should be TRUE for cast/pray, FALSE for study
54 bool select_the_force = FALSE;
56 static int get_spell(int *sn, cptr prompt, int sval, bool learned, int use_realm)
64 bool flag, redraw, okay;
72 int menu_line = (use_menu ? 1 : 0);
74 #ifdef ALLOW_REPEAT /* TNB */
76 /* Get the spell, if available */
79 /* Verify the spell */
80 if (spell_okay(*sn, learned, FALSE, use_realm))
87 #endif /* ALLOW_REPEAT -- TNB */
89 p = spell_category_name(mp_ptr->spell_book);
92 for (spell = 0; spell < 32; spell++)
94 /* Check for this spell */
95 if ((fake_spell_flags[sval] & (1L << spell)))
97 /* Collect this spell */
98 spells[num++] = spell;
102 /* Assume no usable spells */
105 /* Assume no spells available */
108 /* Check for "okay" spells */
109 for (i = 0; i < num; i++)
111 /* Look for "okay" spells */
112 if (spell_okay(spells[i], learned, FALSE, use_realm)) okay = TRUE;
115 /* No "okay" spells */
116 if (!okay) return (FALSE);
117 if (((use_realm) != p_ptr->realm1) && ((use_realm) != p_ptr->realm2) && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE)) return FALSE;
118 if (((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE)) && !is_magic(use_realm)) return FALSE;
119 if ((p_ptr->pclass == CLASS_RED_MAGE) && ((use_realm) != REALM_ARCANE) && (sval > 1)) return FALSE;
121 /* Assume cancelled */
124 /* Nothing chosen yet */
134 p_ptr->window |= (PW_SPELL);
140 /* Build a prompt (accept all spells) */
142 jverb1( prompt, jverb_buf );
143 (void) strnfmt(out_val, 78, "(%^s:%c-%c, '*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤Î%s¤ò%^s¤Þ¤¹¤«? ",
144 p, I2A(0), I2A(num - 1), p, jverb_buf );
146 (void)strnfmt(out_val, 78, "(%^ss %c-%c, *=List, ESC=exit) %^s which %s? ",
147 p, I2A(0), I2A(num - 1), prompt, p);
150 /* Get a spell from the user */
152 choice = (always_show_list || use_menu) ? ESCAPE : 1;
155 if (choice == ESCAPE) choice = ' ';
156 else if (!get_com(out_val, &choice, TRUE))break;
158 if (use_menu && choice != ' ')
172 menu_line += (num - 1);
194 if (menu_line > num) menu_line -= num;
195 /* Display a list of spells */
196 print_spells(menu_line, spells, num, 1, 15, use_realm);
202 if ((choice == ' ') || (choice == '*') || (choice == '?'))
210 /* Save the screen */
213 /* Display a list of spells */
214 print_spells(menu_line, spells, num, 1, 15, use_realm);
220 if (use_menu) continue;
225 /* Restore the screen */
235 ask = (isupper(choice));
238 if (ask) choice = tolower(choice);
240 /* Extract request */
241 i = (islower(choice) ? A2I(choice) : -1);
244 /* Totally Illegal */
245 if ((i < 0) || (i >= num))
251 /* Save the spell index */
254 /* Require "okay" spells */
255 if (!spell_okay(spell, learned, FALSE, use_realm))
259 msg_format("¤½¤Î%s¤ò%s¤³¤È¤Ï¤Ç¤¤Þ¤»¤ó¡£", p, prompt);
261 msg_format("You may not %s that %s.", prompt, p);
272 /* Access the spell */
273 if (!is_magic(use_realm))
275 s_ptr = &technic_info[use_realm - MIN_TECHNIC][spell];
279 s_ptr = &mp_ptr->info[use_realm - 1][spell];
282 /* Extract mana consumption rate */
283 if (use_realm == REALM_HISSATSU)
285 need_mana = s_ptr->smana;
289 need_mana = mod_need_mana(s_ptr->smana, spell, use_realm);
294 jverb1( prompt, jverb_buf );
295 /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½¤ËÂбþ */
296 (void) strnfmt(tmp_val, 78, "%s(MP%d, ¼ºÇÔΨ%d%%)¤ò%s¤Þ¤¹¤«? ",
297 spell_names[technic2magic(use_realm)-1][spell], need_mana,
298 spell_chance(spell, use_realm),jverb_buf);
300 (void)strnfmt(tmp_val, 78, "%^s %s (%d mana, %d%% fail)? ",
301 prompt, spell_names[technic2magic(use_realm)-1][spell], need_mana,
302 spell_chance(spell, use_realm));
306 /* Belay that order */
307 if (!get_check(tmp_val)) continue;
315 /* Restore the screen */
316 if (redraw) screen_load();
323 p_ptr->window |= (PW_SPELL);
330 /* Abort if needed */
331 if (!flag) return FALSE;
333 /* Save the choice */
336 #ifdef ALLOW_REPEAT /* TNB */
340 #endif /* ALLOW_REPEAT -- TNB */
347 static bool item_tester_learn_spell(object_type *o_ptr)
349 s32b choices = realm_choices2[p_ptr->pclass];
351 if (p_ptr->pclass == CLASS_PRIEST)
353 if (is_good_realm(p_ptr->realm1))
355 choices &= ~(CH_DEATH | CH_DAEMON);
359 choices &= ~(CH_LIFE | CH_CRUSADE);
363 if ((o_ptr->tval < TV_LIFE_BOOK) || (o_ptr->tval > (TV_LIFE_BOOK + MAX_REALM - 1))) return (FALSE);
364 if ((o_ptr->tval == TV_MUSIC_BOOK) && (p_ptr->pclass == CLASS_BARD)) return (TRUE);
365 else if (!is_magic(tval2realm(o_ptr->tval))) return FALSE;
366 if ((REALM1_BOOK == o_ptr->tval) || (REALM2_BOOK == o_ptr->tval)) return (TRUE);
367 if (choices & (0x0001 << (tval2realm(o_ptr->tval) - 1))) return (TRUE);
372 static bool player_has_no_spellbooks(void)
377 for (i = 0; i < INVEN_PACK; i++)
379 o_ptr = &inventory[i];
380 if (o_ptr->k_idx && check_book_realm(o_ptr->tval, o_ptr->sval)) return FALSE;
383 for (i = cave[py][px].o_idx; i; i = o_ptr->next_o_idx)
386 if (o_ptr->k_idx && check_book_realm(o_ptr->tval, o_ptr->sval)) return FALSE;
393 static void confirm_use_force(bool browse_only)
400 /* Get the item index */
401 if (repeat_pull(&item) && (item == INVEN_FORCE))
403 browse_only ? do_cmd_mind_browse() : do_cmd_mind();
407 #endif /* ALLOW_REPEAT */
409 /* Show the prompt */
411 prt("('w'Îýµ¤½Ñ, ESC) 'w'¤«ESC¤ò²¡¤·¤Æ¤¯¤À¤µ¤¤¡£ ", 0, 0);
413 prt("(w for the Force, ESC) Hit 'w' or ESC. ", 0, 0);
421 if (which == ESCAPE) break;
422 else if (which == 'w')
427 repeat_push(INVEN_FORCE);
429 #endif /* ALLOW_REPEAT */
435 /* Clear the prompt line */
440 browse_only ? do_cmd_mind_browse() : do_cmd_mind();
446 * Peruse the spells/prayers in a book
448 * Note that *all* spells in the book are listed
450 * Note that browsing is allowed while confused or blind,
451 * and in the dark, primarily to allow browsing in stores.
453 void do_cmd_browse(void)
455 int item, sval, use_realm = 0, j, line;
466 /* Warriors are illiterate */
467 if (!(p_ptr->realm1 || p_ptr->realm2) && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE))
470 msg_print("ËܤòÆɤळ¤È¤¬¤Ç¤¤Ê¤¤¡ª");
472 msg_print("You cannot read books!");
478 if (p_ptr->special_defense & KATA_MUSOU)
480 set_action(ACTION_NONE);
483 if (p_ptr->pclass == CLASS_FORCETRAINER)
485 if (player_has_no_spellbooks())
487 confirm_use_force(TRUE);
490 select_the_force = TRUE;
493 /* Restrict choices to "useful" books */
494 if (p_ptr->realm2 == REALM_NONE) item_tester_tval = mp_ptr->spell_book;
495 else item_tester_hook = item_tester_learn_spell;
499 q = "¤É¤ÎËܤòÆɤߤޤ¹¤«? ";
501 q = "Browse which book? ";
505 s = "Æɤá¤ëËܤ¬¤Ê¤¤¡£";
507 s = "You have no books that you can read.";
510 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR)))
512 select_the_force = FALSE;
515 select_the_force = FALSE;
517 if (item == INVEN_FORCE) /* the_force */
519 do_cmd_mind_browse();
523 /* Get the item (in the pack) */
526 o_ptr = &inventory[item];
529 /* Get the item (on the floor) */
532 o_ptr = &o_list[0 - item];
535 /* Access the item's sval */
538 use_realm = tval2realm(o_ptr->tval);
540 /* Track the object kind */
541 object_kind_track(o_ptr->k_idx);
543 /* Hack -- Handle stuff */
548 for (spell = 0; spell < 32; spell++)
550 /* Check for this spell */
551 if ((fake_spell_flags[sval] & (1L << spell)))
553 /* Collect this spell */
554 spells[num++] = spell;
559 /* Save the screen */
562 /* Clear the top line */
565 /* Keep browsing spells. Exit browsing on cancel. */
568 /* Ask for a spell, allow cancel */
570 if (!get_spell(&spell, "Æɤà", o_ptr->sval, TRUE, use_realm))
572 if (!get_spell(&spell, "browse", o_ptr->sval, TRUE, use_realm))
575 /* If cancelled, leave immediately. */
576 if (spell == -1) break;
578 /* Display a list of spells */
579 print_spells(0, spells, num, 1, 15, use_realm);
581 /* Notify that there's nothing to see, and wait. */
582 if (use_realm == REALM_HISSATSU)
584 prt("Æɤá¤ëµ»¤¬¤Ê¤¤¡£", 0, 0);
586 prt("No techniques to browse.", 0, 0);
590 prt("Æɤá¤ë¼öʸ¤¬¤Ê¤¤¡£", 0, 0);
592 prt("No spells to browse.", 0, 0);
597 /* Restore the screen */
603 /* Clear lines, position cursor (really should use strlen here) */
604 Term_erase(14, 14, 255);
605 Term_erase(14, 13, 255);
606 Term_erase(14, 12, 255);
607 Term_erase(14, 11, 255);
609 roff_to_buf(spell_tips[technic2magic(use_realm) - 1][spell], 62, temp, sizeof(temp));
610 for (j = 0, line = 11; temp[j]; j += 1 + strlen(&temp[j]))
612 prt(&temp[j], line, 15);
617 /* Restore the screen */
622 static void change_realm2(int next_realm)
627 for (i = 0; i < 64; i++)
629 p_ptr->spell_order[j] = p_ptr->spell_order[i];
630 if (p_ptr->spell_order[i] < 32) j++;
633 p_ptr->spell_order[j] = 99;
635 for (i = 32; i < 64; i++)
637 p_ptr->spell_exp[i] = SPELL_EXP_UNSKILLED;
639 p_ptr->spell_learned2 = 0L;
640 p_ptr->spell_worked2 = 0L;
641 p_ptr->spell_forgotten2 = 0L;
644 sprintf(tmp,"ËâË¡¤ÎÎΰè¤ò%s¤«¤é%s¤ËÊѹ¹¤·¤¿¡£", realm_names[p_ptr->realm2], realm_names[next_realm]);
646 sprintf(tmp,"change magic realm from %s to %s.", realm_names[p_ptr->realm2], realm_names[next_realm]);
648 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
649 p_ptr->old_realm |= 1 << (p_ptr->realm2-1);
650 p_ptr->realm2 = next_realm;
652 p_ptr->notice |= (PN_REORDER);
653 p_ptr->update |= (PU_SPELLS);
659 * Study a book to gain a new spell/prayer
661 void do_cmd_study(void)
665 bool learned = FALSE;
667 /* Spells of realm2 will have an increment of +32 */
670 cptr p = spell_category_name(mp_ptr->spell_book);
679 msg_print("ËܤòÆɤळ¤È¤¬¤Ç¤¤Ê¤¤¡ª");
681 msg_print("You cannot read books!");
687 if (p_ptr->blind || no_lite())
690 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡ª");
692 msg_print("You cannot see!");
701 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡ª");
703 msg_print("You are too confused!");
709 if (!(p_ptr->new_spells))
712 msg_format("¿·¤·¤¤%s¤ò³Ð¤¨¤ë¤³¤È¤Ï¤Ç¤¤Ê¤¤¡ª", p);
714 msg_format("You cannot learn any new %ss!", p);
720 if (p_ptr->special_defense & KATA_MUSOU)
722 set_action(ACTION_NONE);
726 if( p_ptr->new_spells < 10 ){
727 msg_format("¤¢¤È %d ¤Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
729 msg_format("¤¢¤È %d ¸Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
732 msg_format("You can learn %d new %s%s.", p_ptr->new_spells, p,
733 (p_ptr->new_spells == 1?"":"s"));
739 /* Restrict choices to "useful" books */
740 if (p_ptr->realm2 == REALM_NONE) item_tester_tval = mp_ptr->spell_book;
741 else item_tester_hook = item_tester_learn_spell;
745 q = "¤É¤ÎËܤ«¤é³Ø¤Ó¤Þ¤¹¤«? ";
747 q = "Study which book? ";
751 s = "Æɤá¤ëËܤ¬¤Ê¤¤¡£";
753 s = "You have no books that you can read.";
756 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
758 /* Get the item (in the pack) */
761 o_ptr = &inventory[item];
764 /* Get the item (on the floor) */
767 o_ptr = &o_list[0 - item];
770 /* Access the item's sval */
773 if (o_ptr->tval == REALM2_BOOK) increment = 32;
774 else if (o_ptr->tval != REALM1_BOOK)
777 if (!get_check("ËÜÅö¤ËËâË¡¤ÎÎΰè¤òÊѹ¹¤·¤Þ¤¹¤«¡©")) return;
779 if (!get_check("Really, change magic realm? ")) return;
781 change_realm2(tval2realm(o_ptr->tval));
785 /* Track the object kind */
786 object_kind_track(o_ptr->k_idx);
788 /* Hack -- Handle stuff */
791 /* Mage -- Learn a selected spell */
792 if (mp_ptr->spell_book != TV_LIFE_BOOK)
794 /* Ask for a spell, allow cancel */
796 if (!get_spell(&spell, "³Ø¤Ö", sval, FALSE, o_ptr->tval - TV_LIFE_BOOK + 1)
797 && (spell == -1)) return;
799 if (!get_spell(&spell, "study", sval, FALSE, o_ptr->tval - TV_LIFE_BOOK + 1)
800 && (spell == -1)) return;
805 /* Priest -- Learn a random prayer */
813 for (spell = 0; spell < 32; spell++)
815 /* Check spells in the book */
816 if ((fake_spell_flags[sval] & (1L << spell)))
818 /* Skip non "okay" prayers */
819 if (!spell_okay(spell, FALSE, TRUE,
820 (increment ? p_ptr->realm2 : p_ptr->realm1))) continue;
822 /* Hack -- Prepare the randomizer */
825 /* Hack -- Apply the randomizer */
826 if (one_in_(k)) gift = spell;
834 /* Nothing to study */
839 msg_format("¤½¤ÎËܤˤϳؤ֤٤%s¤¬¤Ê¤¤¡£", p);
841 msg_format("You cannot learn any %ss in that book.", p);
850 if (increment) spell += increment;
852 /* Learn the spell */
855 if (p_ptr->spell_learned1 & (1L << spell)) learned = TRUE;
856 else p_ptr->spell_learned1 |= (1L << spell);
860 if (p_ptr->spell_learned2 & (1L << (spell - 32))) learned = TRUE;
861 else p_ptr->spell_learned2 |= (1L << (spell - 32));
866 int max_exp = (spell < 32) ? SPELL_EXP_MASTER : SPELL_EXP_EXPERT;
867 int old_exp = p_ptr->spell_exp[spell];
868 int new_rank = EXP_LEVEL_UNSKILLED;
869 cptr name = spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell%32];
871 if (old_exp >= max_exp)
874 msg_format("¤½¤Î%s¤Ï´°Á´¤Ë»È¤¤¤³¤Ê¤»¤ë¤Î¤Ç³Ø¤ÖɬÍפϤʤ¤¡£", p);
876 msg_format("You don't need to study this %s anymore.", p);
881 if (!get_check(format("%s¤Î%s¤ò¤µ¤é¤Ë³Ø¤Ó¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©", name, p)))
883 if (!get_check(format("You will study a %s of %s again. Are you sure? ", p, name)))
888 else if (old_exp >= SPELL_EXP_EXPERT)
890 p_ptr->spell_exp[spell] = SPELL_EXP_MASTER;
891 new_rank = EXP_LEVEL_MASTER;
893 else if (old_exp >= SPELL_EXP_SKILLED)
895 if (spell >= 32) p_ptr->spell_exp[spell] = SPELL_EXP_EXPERT;
896 else p_ptr->spell_exp[spell] += SPELL_EXP_EXPERT - SPELL_EXP_SKILLED;
897 new_rank = EXP_LEVEL_EXPERT;
899 else if (old_exp >= SPELL_EXP_BEGINNER)
901 p_ptr->spell_exp[spell] = SPELL_EXP_SKILLED + (old_exp - SPELL_EXP_BEGINNER) * 2 / 3;
902 new_rank = EXP_LEVEL_SKILLED;
906 p_ptr->spell_exp[spell] = SPELL_EXP_BEGINNER + old_exp / 3;
907 new_rank = EXP_LEVEL_BEGINNER;
910 msg_format("%s¤Î½ÏÎýÅÙ¤¬%s¤Ë¾å¤¬¤Ã¤¿¡£", name, exp_level_str[new_rank]);
912 msg_format("Your proficiency of %s is now %s rank.", name, exp_level_str[new_rank]);
917 /* Find the next open entry in "p_ptr->spell_order[]" */
918 for (i = 0; i < 64; i++)
920 /* Stop at the first empty space */
921 if (p_ptr->spell_order[i] == 99) break;
924 /* Add the spell to the known list */
925 p_ptr->spell_order[i++] = spell;
927 /* Mention the result */
929 /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½¤ËÂбþ */
930 if (mp_ptr->spell_book == TV_MUSIC_BOOK)
932 msg_format("%s¤ò³Ø¤ó¤À¡£",
933 spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32]);
937 msg_format("%s¤Î%s¤ò³Ø¤ó¤À¡£",
938 spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32] ,p);
941 msg_format("You have learned the %s of %s.",
942 p, spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32]);
949 switch (mp_ptr->spell_book)
952 chg_virtue(V_FAITH, 1);
955 chg_virtue(V_UNLIFE, 1);
958 chg_virtue(V_NATURE, 1);
961 chg_virtue(V_KNOWLEDGE, 1);
968 /* One less spell available */
969 p_ptr->learned_spells++;
971 /* Message if needed */
972 if (p_ptr->new_spells)
976 if (p_ptr->new_spells < 10) msg_format("¤¢¤È %d ¤Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
977 else msg_format("¤¢¤È %d ¸Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
979 msg_format("You can learn %d more %s%s.", p_ptr->new_spells, p,
980 (p_ptr->new_spells != 1) ? "s" : "");
986 p_ptr->update |= (PU_SPELLS);
989 /* Redraw object recall */
990 p_ptr->window |= (PW_OBJECT);
994 static void wild_magic(int spell)
997 int type = SUMMON_BIZARRE1 + randint0(6);
999 if (type < SUMMON_BIZARRE1) type = SUMMON_BIZARRE1;
1000 else if (type > SUMMON_BIZARRE6) type = SUMMON_BIZARRE6;
1002 switch (randint1(spell) + randint1(8) + 1)
1007 teleport_player(10);
1012 teleport_player(100);
1016 teleport_player(200);
1026 lite_area(damroll(2, 3), 2);
1029 destroy_doors_touch();
1034 sleep_monsters_touch();
1038 trap_creation(py, px);
1047 aggravate_monsters(0);
1050 earthquake(py, px, 5);
1054 (void)gain_random_mutation(0);
1058 apply_disenchant(1);
1064 fire_ball(GF_CHAOS, 0, spell + 5, 1 + (spell / 10));
1071 while (counter++ < 8)
1073 (void)summon_specific(0, py, px, (dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET));
1078 activate_hi_summon(py, px, FALSE);
1081 (void)summon_cyber(-1, py, px);
1086 (void)activate_ty_curse(FALSE, &count);
1095 static bool cast_life_spell(int spell)
1098 int plev = p_ptr->lev;
1102 case 0: /* Cure Light Wounds */
1103 (void)hp_player(damroll(2, 10));
1104 (void)set_cut(p_ptr->cut - 10);
1107 (void)set_blessed(randint1(12) + 12, FALSE);
1109 case 2: /* Make Light Wounds */
1110 if (!get_aim_dir(&dir)) return FALSE;
1111 fire_ball_hide(GF_WOUNDS, dir, damroll(3 + ((plev - 1) / 5), 4), 0);
1113 case 3: /* Call Light */
1114 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1116 case 4: /* Detect Traps + Secret Doors */
1117 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1118 (void)detect_doors(DETECT_RAD_DEFAULT);
1119 (void)detect_stairs(DETECT_RAD_DEFAULT);
1121 case 5: /* Cure Medium Wounds */
1122 (void)hp_player(damroll(4, 10));
1123 (void)set_cut((p_ptr->cut / 2) - 20);
1125 case 6: /* Cure Poison */
1126 (void)set_poisoned(0);
1128 case 7: /* Satisfy Hunger */
1129 (void)set_food(PY_FOOD_MAX - 1);
1131 case 8: /* Remove Curse */
1135 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1137 msg_print("You feel as if someone is watching over you.");
1141 case 9: /* Make Medium Wounds */
1142 if (!get_aim_dir(&dir)) return FALSE;
1143 fire_ball_hide(GF_WOUNDS, dir, damroll(8 + ((plev - 5) / 4), 8), 0);
1145 case 10: /* Cure Critical Wounds */
1146 (void)hp_player(damroll(8, 10));
1151 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1152 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1155 map_area(DETECT_RAD_MAP);
1158 (void)turn_undead();
1160 case 14: /* Healing */
1161 (void)hp_player(300);
1165 case 15: /* Glyph of Warding */
1168 case 16: /* Dispel Curse */
1169 if (remove_all_curse())
1172 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1174 msg_print("You feel as if someone is watching over you.");
1178 case 17: /* Perception */
1179 return ident_spell(FALSE);
1180 case 18: /* Dispel Undead */
1181 (void)dispel_undead(randint1(plev * 5));
1183 case 19: /* 'Day of the Dove' */
1184 charm_monsters(plev * 2);
1186 case 20: /* Make Critical Wounds */
1187 if (!get_aim_dir(&dir)) return FALSE;
1188 fire_ball_hide(GF_WOUNDS, dir, damroll(5+((plev - 5) / 3), 15), 0);
1190 case 21: /* Word of Recall */
1191 return word_of_recall();
1192 case 22: /* Alter Reality */
1195 case 23: /* Warding True */
1200 num_repro += MAX_REPRO;
1202 case 25: /* Detection True */
1203 (void)detect_all(DETECT_RAD_DEFAULT);
1205 case 26: /* Genocide Undead */
1206 (void)mass_genocide_undead(plev+50,TRUE);
1208 case 27: /* Clairvoyance */
1211 case 28: /* Restoration */
1212 (void)do_res_stat(A_STR);
1213 (void)do_res_stat(A_INT);
1214 (void)do_res_stat(A_WIS);
1215 (void)do_res_stat(A_DEX);
1216 (void)do_res_stat(A_CON);
1217 (void)do_res_stat(A_CHR);
1218 (void)restore_level();
1220 case 29: /* Healing True */
1221 (void)hp_player(2000);
1225 case 30: /* Holy Vision */
1226 return identify_fully(FALSE);
1227 case 31: /* Ultimate resistance */
1229 int v = randint1(plev/2)+plev/2;
1230 (void)set_fast(v, FALSE);
1231 set_oppose_acid(v, FALSE);
1232 set_oppose_elec(v, FALSE);
1233 set_oppose_fire(v, FALSE);
1234 set_oppose_cold(v, FALSE);
1235 set_oppose_pois(v, FALSE);
1236 set_ultimate_res(v, FALSE);
1241 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥é¥¤¥Õ¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1243 msg_format("You cast an unknown Life spell: %d.", spell);
1254 static bool cast_sorcery_spell(int spell)
1257 int plev = p_ptr->lev;
1261 case 0: /* Detect Monsters */
1262 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1264 case 1: /* Phase Door */
1265 teleport_player(10);
1267 case 2: /* Detect Doors and Traps */
1268 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1269 (void)detect_doors(DETECT_RAD_DEFAULT);
1270 (void)detect_stairs(DETECT_RAD_DEFAULT);
1272 case 3: /* Light Area */
1273 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1275 case 4: /* Confuse Monster */
1276 if (!get_aim_dir(&dir)) return FALSE;
1278 (void)confuse_monster(dir, (plev * 3) / 2);
1280 case 5: /* Teleport */
1281 teleport_player(plev * 5);
1283 case 6: /* Sleep Monster */
1284 if (!get_aim_dir(&dir)) return FALSE;
1286 (void)sleep_monster(dir);
1288 case 7: /* Recharging */
1289 return recharge(plev * 4);
1290 case 8: /* Magic Mapping */
1291 map_area(DETECT_RAD_MAP);
1293 case 9: /* Identify */
1294 return ident_spell(FALSE);
1295 case 10: /* Slow Monster */
1296 if (!get_aim_dir(&dir)) return FALSE;
1298 (void)slow_monster(dir);
1300 case 11: /* Mass Sleep */
1301 (void)sleep_monsters();
1303 case 12: /* Teleport Away */
1304 if (!get_aim_dir(&dir)) return FALSE;
1306 (void)fire_beam(GF_AWAY_ALL, dir, plev);
1308 case 13: /* Haste Self */
1309 (void)set_fast(randint1(20 + plev) + plev, FALSE);
1311 case 14: /* Detection True */
1312 (void)detect_all(DETECT_RAD_DEFAULT);
1314 case 15: /* Identify True */
1315 return identify_fully(FALSE);
1316 case 16: /* Detect Objects and Treasure*/
1317 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
1318 (void)detect_treasure(DETECT_RAD_DEFAULT);
1319 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
1321 case 17: /* Charm Monster */
1322 if (!get_aim_dir(&dir)) return FALSE;
1324 (void)charm_monster(dir, plev);
1326 case 18: /* Sense Minds */
1327 (void)set_tim_esp(randint1(30) + 25, FALSE);
1329 case 19: /* Teleport to town */
1331 case 20: /* Self knowledge */
1332 (void)self_knowledge();
1334 case 21: /* Teleport Level */
1336 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
1338 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
1340 (void)teleport_level(0);
1342 case 22: /* Word of Recall */
1343 return word_of_recall();
1344 case 23: /* Dimension Door */
1346 msg_print("¼¡¸µ¤ÎÈ⤬³«¤¤¤¿¡£ÌÜŪÃϤòÁª¤ó¤Ç²¼¤µ¤¤¡£");
1348 msg_print("You open a dimensional gate. Choose a destination.");
1351 return dimension_door();
1352 case 24: /* Probing */
1355 case 25: /* Explosive Rune */
1358 case 26: /* Telekinesis */
1359 if (!get_aim_dir(&dir)) return FALSE;
1361 fetch(dir, plev * 15, FALSE);
1363 case 27: /* Clairvoyance */
1364 chg_virtue(V_KNOWLEDGE, 1);
1365 chg_virtue(V_ENLIGHTEN, 1);
1368 if (!(p_ptr->telepathy))
1370 (void)set_tim_esp(randint1(30) + 25, FALSE);
1373 case 28: /* Charm Monsters */
1374 charm_monsters(plev * 2);
1376 case 29: /* Alchemy */
1378 case 30: /* Banish */
1379 banish_monsters(plev * 4);
1381 case 31: /* Globe of Invulnerability */
1382 (void)set_invuln(randint1(4) + 4, FALSE);
1386 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥½¡¼¥µ¥ê¡¼¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1388 msg_format("You cast an unknown Sorcery spell: %d.", spell);
1398 static bool cast_nature_spell(int spell)
1402 int plev = p_ptr->lev;
1404 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1405 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1406 else beam = plev / 2;
1410 case 0: /* Detect Creatures */
1411 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1413 case 1: /* Lightning Bolt */
1414 project_length = plev / 6 + 2;
1415 if (!get_aim_dir(&dir)) return FALSE;
1417 fire_beam(GF_ELEC, dir,
1418 damroll(3 + ((plev - 1) / 5), 4));
1420 case 2: /* Detect Doors & Traps */
1421 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1422 (void)detect_doors(DETECT_RAD_DEFAULT);
1423 (void)detect_stairs(DETECT_RAD_DEFAULT);
1425 case 3: /* Produce Food */
1427 object_type forge, *q_ptr = &forge;
1430 msg_print("¿©ÎÁ¤òÀ¸À®¤·¤¿¡£");
1432 msg_print("A food ration is produced.");
1435 /* Create the food ration */
1436 object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_RATION));
1438 /* Drop the object from heaven */
1439 (void)drop_near(q_ptr, -1, py, px);
1443 case 4: /* Daylight */
1444 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1445 if ((prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
1448 msg_print("Æü¤Î¸÷¤¬¤¢¤Ê¤¿¤ÎÆùÂΤò¾Ç¤¬¤·¤¿¡ª");
1450 msg_print("The daylight scorches your flesh!");
1454 take_hit(DAMAGE_NOESCAPE, damroll(2, 2), "Æü¤Î¸÷", -1);
1456 take_hit(DAMAGE_NOESCAPE, damroll(2, 2), "daylight", -1);
1461 case 5: /* Animal Taming */
1462 if (!get_aim_dir(&dir)) return FALSE;
1464 (void)charm_animal(dir, plev);
1466 case 6: /* Resist Environment */
1467 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1468 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1469 (void)set_oppose_elec(randint1(20) + 20, FALSE);
1471 case 7: /* Cure Wounds & Poison */
1472 (void)hp_player(damroll(2, 8));
1474 (void)set_poisoned(0);
1476 case 8: /* Stone to Mud */
1477 if (!get_aim_dir(&dir)) return FALSE;
1479 (void)wall_to_mud(dir);
1481 case 9: /* Frost Bolt */
1482 if (!get_aim_dir(&dir)) return FALSE;
1483 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
1484 damroll(3 + ((plev - 5) / 4), 8));
1486 case 10: /* Nature Awareness -- downgraded */
1487 map_area(DETECT_RAD_MAP);
1488 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1489 (void)detect_doors(DETECT_RAD_DEFAULT);
1490 (void)detect_stairs(DETECT_RAD_DEFAULT);
1491 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1493 case 11: /* Fire Bolt */
1494 if (!get_aim_dir(&dir)) return FALSE;
1495 fire_bolt_or_beam(beam - 10, GF_FIRE, dir,
1496 damroll(5 + ((plev - 5) / 4), 8));
1498 case 12: /* Ray of Sunlight */
1499 if (!get_aim_dir(&dir)) return FALSE;
1501 msg_print("ÂÀÍÛ¸÷Àþ¤¬¸½¤ì¤¿¡£");
1503 msg_print("A line of sunlight appears.");
1506 (void)lite_line(dir);
1508 case 13: /* Entangle */
1511 case 14: /* Summon Animals */
1512 if (!(summon_specific(-1, py, px, plev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET))))
1515 msg_print("ưʪ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
1517 msg_print("No animals arrive.");
1521 case 15: /* Herbal Healing */
1522 (void)hp_player(500);
1525 (void)set_poisoned(0);
1527 case 16: /* Stair Building */
1528 (void)stair_creation();
1530 case 17: /* Stone Skin */
1531 (void)set_shield(randint1(20) + 30, FALSE);
1533 case 18: /* Resistance True */
1534 (void)set_oppose_acid(randint1(20) + 20, FALSE);
1535 (void)set_oppose_elec(randint1(20) + 20, FALSE);
1536 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1537 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1538 (void)set_oppose_pois(randint1(20) + 20, FALSE);
1540 case 19: /* Tree Creation */
1541 (void)tree_creation();
1543 case 20: /* Animal Friendship */
1544 (void)charm_animals(plev * 2);
1546 case 21: /* Stone Tell */
1547 return identify_fully(FALSE);
1548 case 22: /* Wall of Stone */
1551 case 23: /* Protection from Corrosion */
1553 case 24: /* Earthquake */
1554 earthquake(py, px, 10);
1556 case 25: /* Whirlwind Attack */
1560 monster_type *m_ptr;
1562 for (dir = 0; dir < 8; dir++)
1564 y = py + ddy_ddd[dir];
1565 x = px + ddx_ddd[dir];
1566 c_ptr = &cave[y][x];
1568 /* Get the monster */
1569 m_ptr = &m_list[c_ptr->m_idx];
1571 /* Hack -- attack monsters */
1572 if (c_ptr->m_idx && (m_ptr->ml || cave_floor_bold(y, x)))
1577 case 26: /* Blizzard */
1578 if (!get_aim_dir(&dir)) return FALSE;
1580 fire_ball(GF_COLD, dir, 70 + plev * 3 / 2, (plev / 12) + 1);
1582 case 27: /* Lightning Storm */
1583 if (!get_aim_dir(&dir)) return FALSE;
1584 fire_ball(GF_ELEC, dir, 90 + plev * 3 / 2, (plev / 12) + 1);
1586 case 28: /* Whirlpool */
1587 if (!get_aim_dir(&dir)) return FALSE;
1588 fire_ball(GF_WATER, dir, 100 + plev * 3 / 2, (plev / 12) + 1);
1590 case 29: /* Call Sunlight */
1591 fire_ball(GF_LITE, 0, 150, 8);
1592 chg_virtue(V_KNOWLEDGE, 1);
1593 chg_virtue(V_ENLIGHTEN, 1);
1595 if ((prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
1598 msg_print("Æü¸÷¤¬¤¢¤Ê¤¿¤ÎÆùÂΤò¾Ç¤¬¤·¤¿¡ª");
1600 msg_print("The sunlight scorches your flesh!");
1604 take_hit(DAMAGE_NOESCAPE, 50, "Æü¸÷", -1);
1606 take_hit(DAMAGE_NOESCAPE, 50, "sunlight", -1);
1611 case 30: /* Elemental Branding */
1612 brand_weapon(randint0(2));
1614 case 31: /* Nature's Wrath */
1615 (void)dispel_monsters(plev * 4);
1616 earthquake(py, px, 20 + (plev / 2));
1617 project(0, 1 + plev / 12, py, px,
1618 (100 + plev) * 2, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM, -1);
1622 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥Í¥¤¥Á¥ã¡¼¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1624 msg_format("You cast an unknown Nature spell: %d.", spell);
1634 static bool cast_chaos_spell(int spell)
1637 int plev = p_ptr->lev;
1639 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1640 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1641 else beam = plev / 2;
1645 case 0: /* Magic Missile */
1646 if (!get_aim_dir(&dir)) return FALSE;
1648 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
1649 damroll(3 + ((plev - 1) / 5), 4));
1651 case 1: /* Trap / Door destruction */
1652 (void)destroy_doors_touch();
1654 case 2: /* Flash of Light == Light Area */
1655 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1657 case 3: /* Touch of Confusion */
1658 if (!(p_ptr->special_attack & ATTACK_CONFUSE))
1661 msg_print("¤¢¤Ê¤¿¤Î¼ê¤Ï¸÷¤ê»Ï¤á¤¿¡£");
1663 msg_print("Your hands start glowing.");
1666 p_ptr->special_attack |= ATTACK_CONFUSE;
1667 p_ptr->redraw |= (PR_STATUS);
1670 case 4: /* Mana Burst */
1671 if (!get_aim_dir(&dir)) return FALSE;
1673 fire_ball(GF_MISSILE, dir,
1674 (damroll(3, 5) + plev +
1675 (plev / (((p_ptr->pclass == CLASS_MAGE)
1676 || (p_ptr->pclass == CLASS_HIGH_MAGE)
1677 || (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
1678 ((plev < 30) ? 2 : 3));
1679 /* Shouldn't actually use GF_MANA, as it will destroy all
1680 * items on the floor */
1682 case 5: /* Fire Bolt */
1683 if (!get_aim_dir(&dir)) return FALSE;
1685 fire_bolt_or_beam(beam, GF_FIRE, dir,
1686 damroll(8 + ((plev - 5) / 4), 8));
1688 case 6: /* Fist of Force ("Fist of Fun") */
1689 if (!get_aim_dir(&dir)) return FALSE;
1691 fire_ball(GF_DISINTEGRATE, dir,
1692 damroll(8 + ((plev - 5) / 4), 8), 0);
1694 case 7: /* Teleport Self */
1695 teleport_player(plev * 5);
1697 case 8: /* Wonder */
1699 /* This spell should become more useful (more
1700 controlled) as the player gains experience levels.
1701 Thus, add 1/5 of the player's level to the die roll.
1702 This eliminates the worst effects later on, while
1703 keeping the results quite random. It also allows
1704 some potent effects only at high level. */
1706 int die = randint1(100) + plev / 5;
1707 int vir = virtue_number(V_CHANCE);
1710 if (p_ptr->virtues[vir - 1] > 0)
1712 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
1716 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
1721 chg_virtue(V_CHANCE, 1);
1723 if (!get_aim_dir(&dir)) return FALSE;
1726 msg_print("¤¢¤Ê¤¿¤ÏÎϤ¬¤ß¤Ê¤®¤ë¤Î¤ò´¶¤¸¤¿¡ª");
1728 msg_print("You feel a surge of power!");
1731 if (die < 8) clone_monster(dir);
1732 else if (die < 14) speed_monster(dir);
1733 else if (die < 26) heal_monster(dir, damroll(4, 6));
1734 else if (die < 31) poly_monster(dir);
1736 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
1737 damroll(3 + ((plev - 1) / 5), 4));
1738 else if (die < 41) confuse_monster(dir, plev);
1739 else if (die < 46) fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
1740 else if (die < 51) (void)lite_line(dir);
1742 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
1743 damroll(3 + ((plev - 5) / 4), 8));
1745 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
1746 damroll(5 + ((plev - 5) / 4), 8));
1748 fire_bolt_or_beam(beam, GF_ACID, dir,
1749 damroll(6 + ((plev - 5) / 4), 8));
1751 fire_bolt_or_beam(beam, GF_FIRE, dir,
1752 damroll(8 + ((plev - 5) / 4), 8));
1753 else if (die < 76) drain_life(dir, 75);
1754 else if (die < 81) fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
1755 else if (die < 86) fire_ball(GF_ACID, dir, 40 + plev, 2);
1756 else if (die < 91) fire_ball(GF_ICE, dir, 70 + plev, 3);
1757 else if (die < 96) fire_ball(GF_FIRE, dir, 80 + plev, 3);
1758 else if (die < 101) drain_life(dir, 100 + plev);
1761 earthquake(py, px, 12);
1765 (void)destroy_area(py, px, 13 + randint0(5), FALSE);
1769 symbol_genocide(plev+50, TRUE);
1771 else if (die < 110) dispel_monsters(120);
1774 dispel_monsters(150);
1781 case 9: /* Chaos Bolt */
1782 if (!get_aim_dir(&dir)) return FALSE;
1784 fire_bolt_or_beam(beam, GF_CHAOS, dir,
1785 damroll(10 + ((plev - 5) / 4), 8));
1787 case 10: /* Sonic Boom */
1789 msg_print("¥É¡¼¥ó¡ªÉô²°¤¬Íɤ줿¡ª");
1791 msg_print("BOOM! Shake the room!");
1794 project(0, plev / 10 + 2, py, px,
1795 (60 + plev), GF_SOUND, PROJECT_KILL | PROJECT_ITEM, -1);
1797 case 11: /* Doom Bolt -- always beam in 2.0.7 or later */
1798 if (!get_aim_dir(&dir)) return FALSE;
1800 fire_beam(GF_MANA, dir, damroll(11 + ((plev - 5) / 4), 8));
1802 case 12: /* Fire Ball */
1803 if (!get_aim_dir(&dir)) return FALSE;
1805 fire_ball(GF_FIRE, dir, plev + 55, 2);
1807 case 13: /* Teleport Other */
1808 if (!get_aim_dir(&dir)) return FALSE;
1810 (void)fire_beam(GF_AWAY_ALL, dir, plev);
1812 case 14: /* Word of Destruction */
1813 (void)destroy_area(py, px, 13 + randint0(5), FALSE);
1815 case 15: /* Invoke Logrus */
1816 if (!get_aim_dir(&dir)) return FALSE;
1818 fire_ball(GF_CHAOS, dir, plev*2 + 99, plev / 5);
1820 case 16: /* Polymorph Other */
1821 if (!get_aim_dir(&dir)) return FALSE;
1823 (void)poly_monster(dir);
1825 case 17: /* Chain Lightning */
1826 for (dir = 0; dir <= 9; dir++)
1827 fire_beam(GF_ELEC, dir, damroll(5 + (plev / 10), 8));
1829 case 18: /* Arcane Binding == Charging */
1830 return recharge(90);
1831 case 19: /* Disintegration */
1832 if (!get_aim_dir(&dir)) return FALSE;
1834 fire_ball(GF_DISINTEGRATE, dir, plev + 70, 3 + plev / 40);
1836 case 20: /* Alter Reality */
1839 case 21: /* Magic Rocket */
1840 if (!get_aim_dir(&dir)) return FALSE;
1843 msg_print("¥í¥±¥Ã¥Èȯ¼Í¡ª");
1845 msg_print("You launch a rocket!");
1848 fire_rocket(GF_ROCKET, dir, 120 + plev*2, 2);
1850 case 22: /* Chaos Branding */
1853 case 23: /* Summon monster, demon */
1856 bool pet = !one_in_(3);
1858 if (pet) mode |= PM_FORCE_PET;
1859 else mode |= PM_NO_PET;
1860 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
1862 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, SUMMON_DEMON, mode))
1865 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
1867 msg_print("The area fills with a stench of sulphur and brimstone.");
1873 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
1875 msg_print("'What is thy bidding... Master?'");
1880 msg_print("¡ÖÈܤ·¤¼Ô¤è¡¢²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª ¤ªÁ°¤Îº²¤òĺ¤¯¤¾¡ª¡×");
1882 msg_print("'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'");
1888 case 24: /* Beam of Gravity */
1889 if (!get_aim_dir(&dir)) return FALSE;
1891 fire_beam(GF_GRAVITY, dir, damroll(9 + ((plev - 5) / 4), 8));
1893 case 25: /* Meteor Swarm */
1896 int b = 10 + randint1(10);
1897 for (i = 0; i < b; i++)
1899 int count = 0, d = 0;
1904 if (count > 20) break;
1905 x = px - 8 + randint0(17);
1906 y = py - 8 + randint0(17);
1908 if (!in_bounds(y,x) || (!cave_floor_bold(y,x) && (cave[y][x].feat != FEAT_TREES)) || !player_has_los_bold(y, x)) continue;
1910 dx = (px > x) ? (px - x) : (x - px);
1911 dy = (py > y) ? (py - y) : (y - py);
1913 /* Approximate distance */
1914 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
1918 if (count > 20) continue;
1920 project(0, 2, y, x, plev * 2, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
1924 case 26: /* Flame Strike */
1925 fire_ball(GF_FIRE, 0, 300 + (3 * plev), 8);
1927 case 27: /* Call Chaos */
1930 case 28: /* Polymorph Self */
1932 if (!get_check("ÊѿȤ·¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©")) return FALSE;
1934 if (!get_check("You will polymorph yourself. Are you sure? ")) return FALSE;
1938 case 29: /* Mana Storm */
1939 if (!get_aim_dir(&dir)) return FALSE;
1941 fire_ball(GF_MANA, dir, 300 + (plev * 4), 4);
1943 case 30: /* Breathe Logrus */
1944 if (!get_aim_dir(&dir)) return FALSE;
1946 fire_ball(GF_CHAOS, dir, p_ptr->chp, 2);
1948 case 31: /* Call the Void */
1953 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥«¥ª¥¹¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1955 msg_format("You cast an unknown Chaos spell: %d.", spell);
1965 static bool cast_death_spell(int spell)
1969 int plev = p_ptr->lev;
1972 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1973 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1974 else beam = plev / 2;
1978 case 0: /* Detect Undead & Demons -> Unlife */
1979 (void)detect_monsters_nonliving(DETECT_RAD_DEFAULT);
1981 case 1: /* Malediction */
1982 if (!get_aim_dir(&dir)) return FALSE;
1983 /* A radius-0 ball may (1) be aimed at objects etc.,
1984 * and will affect them; (2) may be aimed at ANY
1985 * visible monster, unlike a 'bolt' which must travel
1986 * to the monster. */
1988 fire_ball(GF_HELL_FIRE, dir,
1989 damroll(3 + ((plev - 1) / 5), 4), 0);
1992 { /* Special effect first */
1993 dummy = randint1(1000);
1995 fire_ball_hide(GF_DEATH_RAY, dir, plev * 200, 0);
1996 else if (dummy < 500)
1997 fire_ball_hide(GF_TURN_ALL, dir, plev, 0);
1998 else if (dummy < 800)
1999 fire_ball_hide(GF_OLD_CONF, dir, plev, 0);
2001 fire_ball_hide(GF_STUN, dir, plev, 0);
2004 case 2: /* Detect Evil */
2005 (void)detect_monsters_evil(DETECT_RAD_DEFAULT);
2007 case 3: /* Stinking Cloud */
2008 if (!get_aim_dir(&dir)) return FALSE;
2010 fire_ball(GF_POIS, dir, 10 + (plev / 2), 2);
2012 case 4: /* Black Sleep */
2013 if (!get_aim_dir(&dir)) return FALSE;
2015 (void)sleep_monster(dir);
2017 case 5: /* Resist Poison */
2018 (void)set_oppose_pois(randint1(20) + 20, FALSE);
2020 case 6: /* Horrify */
2021 if (!get_aim_dir(&dir)) return FALSE;
2023 (void)fear_monster(dir, plev);
2024 (void)stun_monster(dir, plev);
2026 case 7: /* Enslave Undead */
2027 if (!get_aim_dir(&dir)) return FALSE;
2029 (void)control_one_undead(dir, plev);
2031 case 8: /* Orb of Entropy */
2032 if (!get_aim_dir(&dir)) return FALSE;
2034 fire_ball(GF_OLD_DRAIN, dir,
2035 (damroll(3, 6) + plev +
2036 (plev / (((p_ptr->pclass == CLASS_MAGE) ||
2037 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
2038 (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
2039 ((plev < 30) ? 2 : 3));
2041 case 9: /* Nether Bolt */
2042 if (!get_aim_dir(&dir)) return FALSE;
2044 fire_bolt_or_beam(beam, GF_NETHER, dir,
2045 damroll(8 + ((plev - 5) / 4), 8));
2047 case 10: /* Cloud kill */
2048 project(0, plev / 10 + 2, py, px,
2049 (30 + plev) * 2, GF_POIS, PROJECT_KILL | PROJECT_ITEM, -1);
2051 case 11: /* Genocide One */
2052 if (!get_aim_dir(&dir)) return FALSE;
2054 fire_ball_hide(GF_GENOCIDE, dir, plev + 50, 0);
2056 case 12: /* Poison Branding */
2059 case 13: /* Vampiric Drain */
2060 if (!get_aim_dir(&dir)) return FALSE;
2062 dummy = plev * 2 + randint1(plev * 2); /* Dmg */
2063 if (drain_life(dir, dummy))
2065 chg_virtue(V_SACRIFICE, -1);
2066 chg_virtue(V_VITALITY, -1);
2068 (void)hp_player(dummy);
2069 /* Gain nutritional sustenance: 150/hp drained */
2070 /* A Food ration gives 5000 food points (by contrast) */
2071 /* Don't ever get more than "Full" this way */
2072 /* But if we ARE Gorged, it won't cure us */
2073 dummy = p_ptr->food + MIN(5000, 100 * dummy);
2074 if (p_ptr->food < PY_FOOD_MAX) /* Not gorged already */
2075 (void)set_food(dummy >= PY_FOOD_MAX ? PY_FOOD_MAX - 1 : dummy);
2078 case 14: /* Animate Dead */
2079 animate_dead(0, py, px);
2081 case 15: /* Genocide */
2082 (void)symbol_genocide(plev+50, TRUE);
2084 case 16: /* Berserk */
2085 (void)set_shero(randint1(25) + 25, FALSE);
2086 (void)hp_player(30);
2087 (void)set_afraid(0);
2089 case 17: /* Invoke Spirits */
2091 int die = randint1(100) + plev / 5;
2092 int vir = virtue_number(V_CHANCE);
2095 if (p_ptr->virtues[vir - 1] > 0)
2097 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
2101 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
2105 if (!get_aim_dir(&dir)) return FALSE;
2108 msg_print("¤¢¤Ê¤¿¤Ï»à¼Ô¤¿¤Á¤ÎÎϤò¾·½¸¤·¤¿...");
2110 msg_print("You call on the power of the dead...");
2113 chg_virtue(V_CHANCE, 1);
2117 msg_print("¤¢¤Ê¤¿¤Ï¤ª¤É¤í¤ª¤É¤í¤·¤¤ÎϤΤ¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
2119 msg_print("You feel a surge of eldritch force!");
2126 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¤¢¤Ê¤¿¤Î¼þ¤ê¤ÎÃÏÌ̤«¤éµà¤Á¤¿¿Í±Æ¤¬Î©¤Á¾å¤¬¤Ã¤Æ¤¤¿¡ª");
2128 msg_print("Oh no! Mouldering forms rise from the earth around you!");
2131 (void)summon_specific(0, py, px, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
2132 chg_virtue(V_UNLIFE, 1);
2137 msg_print("̾¾õ¤·Æñ¤¤¼Ù°¤Ê¸ºß¤¬¤¢¤Ê¤¿¤Î¿´¤òÄ̤ê²á¤®¤Æ¹Ô¤Ã¤¿...");
2139 msg_print("An unnamable evil brushes against your mind...");
2142 set_afraid(p_ptr->afraid + randint1(4) + 4);
2147 msg_print("¤¢¤Ê¤¿¤ÎƬ¤ËÂçÎ̤ÎÍ©Î¤Á¤ÎÁû¡¹¤·¤¤À¼¤¬²¡¤·´ó¤»¤Æ¤¤¿...");
2149 msg_print("Your head is invaded by a horde of gibbering spectral voices...");
2152 set_confused(p_ptr->confused + randint1(4) + 4);
2160 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
2161 damroll(3 + ((plev - 1) / 5), 4));
2165 confuse_monster (dir, plev);
2169 fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
2173 (void)lite_line(dir);
2177 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
2178 damroll(3+((plev-5)/4),8));
2182 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
2183 damroll(5+((plev-5)/4),8));
2187 fire_bolt_or_beam(beam, GF_ACID, dir,
2188 damroll(6+((plev-5)/4),8));
2192 fire_bolt_or_beam(beam, GF_FIRE, dir,
2193 damroll(8+((plev-5)/4),8));
2197 drain_life(dir, 75);
2201 fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
2205 fire_ball(GF_ACID, dir, 40 + plev, 2);
2209 fire_ball(GF_ICE, dir, 70 + plev, 3);
2213 fire_ball(GF_FIRE, dir, 80 + plev, 3);
2217 drain_life(dir, 100 + plev);
2221 earthquake(py, px, 12);
2225 (void)destroy_area(py, px, 13 + randint0(5), FALSE);
2229 symbol_genocide(plev+50, TRUE);
2233 dispel_monsters(120);
2237 dispel_monsters(150);
2245 msg_print("±¢±µ¤ÊÀ¼¤¬¥¯¥¹¥¯¥¹¾Ð¤¦¡£¡Ö¤â¤¦¤¹¤°¤ª¤Þ¤¨¤Ï²æ¡¹¤ÎÃç´Ö¤Ë¤Ê¤ë¤À¤í¤¦¡£¼å¤¼Ô¤è¡£¡×");
2247 msg_print("Sepulchral voices chuckle. 'Soon you will join us, mortal.'");
2252 case 18: /* Dark Bolt */
2253 if (!get_aim_dir(&dir)) return FALSE;
2255 fire_bolt_or_beam(beam, GF_DARK, dir,
2256 damroll(4 + ((plev - 5) / 4), 8));
2258 case 19: /* Battle Frenzy */
2259 (void)set_shero(randint1(25) + 25, FALSE);
2260 (void)hp_player(30);
2261 (void)set_afraid(0);
2262 (void)set_fast(randint1(20 + (plev / 2)) + (plev / 2), FALSE);
2264 case 20: /* Vampiric Branding */
2267 case 21: /* Vampirism True */
2268 if (!get_aim_dir(&dir)) return FALSE;
2270 chg_virtue(V_SACRIFICE, -1);
2271 chg_virtue(V_VITALITY, -1);
2273 for (dummy = 0; dummy < 3; dummy++)
2275 if (drain_life(dir, 100))
2279 case 22: /* Word of Death */
2280 (void)dispel_living(randint1(plev * 3));
2282 case 23: /* Darkness Storm */
2283 if (!get_aim_dir(&dir)) return FALSE;
2285 fire_ball(GF_DARK, dir, 100+plev*2, 4);
2287 case 24: /* Death Ray */
2288 if (!get_aim_dir(&dir)) return FALSE;
2290 (void)death_ray(dir, plev);
2292 case 25: /* Raise the Dead */
2295 bool pet = one_in_(3);
2298 type = (plev > 47 ? SUMMON_HI_UNDEAD : SUMMON_UNDEAD);
2300 if (!pet || (pet && (plev > 24) && one_in_(3)))
2301 mode |= PM_ALLOW_GROUP;
2303 if (pet) mode |= PM_FORCE_PET;
2304 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
2306 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, type, mode))
2309 msg_print("Î䤿¤¤É÷¤¬¤¢¤Ê¤¿¤Î¼þ¤ê¤Ë¿á¤»Ï¤á¤¿¡£¤½¤ì¤ÏÉåÇÔ½¤ò±¿¤ó¤Ç¤¤¤ë...");
2311 msg_print("Cold winds begin to blow around you, carrying with them the stench of decay...");
2317 msg_print("¸Å¤¨¤Î»à¤»¤ë¼Ô¶¦¤¬¤¢¤Ê¤¿¤Ë»Å¤¨¤ë¤¿¤áÅÚ¤«¤éᴤä¿¡ª");
2319 msg_print("Ancient, long-dead forms arise from the ground to serve you!");
2324 msg_print("»à¼Ô¤¬á´¤Ã¤¿¡£Ì²¤ê¤ò˸¤²¤ë¤¢¤Ê¤¿¤òȳ¤¹¤ë¤¿¤á¤Ë¡ª");
2326 msg_print("'The dead arise... to punish you for disturbing them!'");
2329 chg_virtue(V_UNLIFE, 1);
2334 case 26: /* Esoteria */
2335 if (randint1(50) > plev)
2336 return ident_spell(FALSE);
2338 return identify_fully(FALSE);
2339 case 27: /* Mimic vampire */
2340 (void)set_mimic(10+plev/2 + randint1(10+plev/2), MIMIC_VAMPIRE, FALSE);
2342 case 28: /* Restore Life */
2343 (void)restore_level();
2345 case 29: /* Mass Genocide */
2346 (void)mass_genocide(plev+50, TRUE);
2348 case 30: /* Hellfire */
2349 if (!get_aim_dir(&dir)) return FALSE;
2351 fire_ball(GF_HELL_FIRE, dir, 666, 3);
2353 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "ÃϹö¤Î¹å²Ð¤Î¼öʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
2355 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "the strain of casting Hellfire", -1);
2359 case 31: /* Wraithform */
2360 set_wraith_form(randint1(plev / 2) + (plev / 2), FALSE);
2363 msg_format("You cast an unknown Death spell: %d.", spell);
2371 static bool cast_trump_spell(int spell, bool success)
2374 int plev = p_ptr->lev;
2375 int summon_lev = plev * 2 / 3 + randint1(plev/2);
2377 bool no_trump = FALSE;
2378 bool unique_okay = FALSE;
2380 if (summon_lev < 1) summon_lev = 1;
2381 if (!success || (randint1(50+plev) < plev/10)) unique_okay = TRUE;
2384 case 0: /* Phase Door */
2387 teleport_player(10);
2390 case 1: /* Trump Spiders */
2392 bool pet = success; /* (randint1(5) > 2) */
2393 u32b mode = PM_ALLOW_GROUP;
2395 if (pet) mode |= PM_FORCE_PET;
2396 else mode |= PM_NO_PET;
2399 msg_print("¤¢¤Ê¤¿¤ÏÃØéá¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2401 msg_print("You concentrate on the trump of an spider...");
2404 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_SPIDER, mode))
2408 msg_print("¾¤´¤µ¤ì¤¿ÃØéá¤ÏÅܤäƤ¤¤ë¡ª");
2410 msg_print("The summoned spiders get angry!");
2420 case 2: /* Shuffle */
2423 /* A limited power 'wonder' spell */
2424 int die = randint1(120);
2425 int vir = virtue_number(V_CHANCE);
2427 if ((p_ptr->pclass == CLASS_ROGUE) ||
2428 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
2429 (p_ptr->pclass == CLASS_SORCERER))
2430 die = (randint1(110)) + plev / 5;
2431 /* Card sharks and high mages get a level bonus */
2435 if (p_ptr->virtues[vir - 1] > 0)
2437 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
2441 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
2446 msg_print("¤¢¤Ê¤¿¤Ï¥«¡¼¥É¤òÀڤäưìËç°ú¤¤¤¿...");
2448 msg_print("You shuffle the deck and draw a card...");
2452 chg_virtue(V_CHANCE, 1);
2457 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡Ô»à¡Õ¤À¡ª");
2459 msg_print("Oh no! It's Death!");
2462 for (dummy = 0; dummy < randint1(3); dummy++)
2463 (void)activate_hi_summon(py, px, FALSE);
2468 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡Ô°Ëâ¡Õ¤À¡ª");
2470 msg_print("Oh no! It's the Devil!");
2473 (void)summon_specific(0, py, px, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
2479 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡ÔÄߤé¤ì¤¿ÃË¡Õ¤À¡ª");
2481 msg_print("Oh no! It's the Hanged Man.");
2484 (void)activate_ty_curse(FALSE, &count);
2489 msg_print("¡ÔÉÔĴϤηõ¡Õ¤À¡£");
2491 msg_print("It's the swords of discord.");
2494 aggravate_monsters(0);
2499 msg_print("¡Ô¶ò¼Ô¡Õ¤À¡£");
2501 msg_print("It's the Fool.");
2504 (void)do_dec_stat(A_INT);
2505 (void)do_dec_stat(A_WIS);
2510 msg_print("´ñ̯¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2512 msg_print("It's the picture of a strange monster.");
2515 if (!(summon_specific(0, py, px, (dun_level * 3) / 2, 32 + randint1(6), (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET))))
2521 msg_print("¡Ô·î¡Õ¤À¡£");
2523 msg_print("It's the Moon.");
2531 msg_print("¡Ô±¿Ì¿¤ÎÎØ¡Õ¤À¡£");
2533 msg_print("It's the Wheel of Fortune.");
2536 wild_magic(randint0(32));
2541 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2543 msg_print("It's a teleport trump card.");
2546 teleport_player(10);
2551 msg_print("¡ÔÀµµÁ¡Õ¤À¡£");
2553 msg_print("It's Justice.");
2556 set_blessed(p_ptr->lev, FALSE);
2561 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2563 msg_print("It's a teleport trump card.");
2566 teleport_player(100);
2571 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2573 msg_print("It's a teleport trump card.");
2576 teleport_player(200);
2581 msg_print("¡ÔÅã¡Õ¤À¡£");
2583 msg_print("It's the Tower.");
2591 msg_print("¡ÔÀáÀ©¡Õ¤À¡£");
2593 msg_print("It's Temperance.");
2596 sleep_monsters_touch();
2601 msg_print("¡ÔÅã¡Õ¤À¡£");
2603 msg_print("It's the Tower.");
2606 earthquake(py, px, 5);
2611 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2613 msg_print("It's the picture of a friendly monster.");
2616 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE1, PM_FORCE_PET)))
2622 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2624 msg_print("It's the picture of a friendly monster.");
2627 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE2, PM_FORCE_PET)))
2633 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2635 msg_print("It's the picture of a friendly monster.");
2638 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE4, PM_FORCE_PET)))
2644 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2646 msg_print("It's the picture of a friendly monster.");
2649 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE5, PM_FORCE_PET)))
2655 msg_print("¡ÔÎø¿Í¡Õ¤À¡£");
2657 msg_print("It's the Lovers.");
2660 if (get_aim_dir(&dir))
2661 (void)charm_monster(dir, MIN(p_ptr->lev, 20));
2666 msg_print("¡Ô±£¼Ô¡Õ¤À¡£");
2668 msg_print("It's the Hermit.");
2676 msg_print("¡Ô¿³È½¡Õ¤À¡£");
2678 msg_print("It's the Judgement.");
2681 do_cmd_rerate(FALSE);
2682 if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3)
2685 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
2687 msg_print("You are cured of all mutations.");
2690 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
2691 p_ptr->update |= PU_BONUS;
2698 msg_print("¡ÔÂÀÍÛ¡Õ¤À¡£");
2700 msg_print("It's the Sun.");
2703 chg_virtue(V_KNOWLEDGE, 1);
2704 chg_virtue(V_ENLIGHTEN, 1);
2710 msg_print("¡ÔÀ¤³¦¡Õ¤À¡£");
2712 msg_print("It's the World.");
2715 if (p_ptr->exp < PY_MAX_EXP)
2717 s32b ee = (p_ptr->exp / 25) + 1;
2718 if (ee > 5000) ee = 5000;
2720 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
2722 msg_print("You feel more experienced.");
2730 case 3: /* Reset Recall */
2733 if (!reset_recall()) return FALSE;
2736 case 4: /* Teleport Self */
2739 teleport_player(plev * 4);
2742 case 5: /* Trump Spying */
2745 (void)set_tim_esp(randint1(30) + 25, FALSE);
2748 case 6: /* Teleport Away */
2751 if (!get_aim_dir(&dir)) return FALSE;
2752 (void)fire_beam(GF_AWAY_ALL, dir, plev);
2755 case 7: /* Trump Animals */
2757 bool pet = success; /* was (randint1(5) > 2) */
2758 int type = (pet ? SUMMON_ANIMAL_RANGER : SUMMON_ANIMAL);
2761 if (pet) mode |= PM_FORCE_PET;
2762 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2765 msg_print("¤¢¤Ê¤¿¤Ïưʪ¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2767 msg_print("You concentrate on the trump of an animal...");
2771 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
2775 msg_print("¾¤´¤µ¤ì¤¿Æ°Êª¤ÏÅܤäƤ¤¤ë¡ª");
2777 msg_print("The summoned animal gets angry!");
2788 case 8: /* Trump Reach */
2791 if (!get_aim_dir(&dir)) return FALSE;
2792 fetch(dir, plev * 15, TRUE);
2795 case 9: /* Trump Kamikaze */
2800 if (!target_set(TARGET_KILL)) return FALSE;
2807 msg_print("¤¢¤Ê¤¿¤Ï¥«¥ß¥«¥¼¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2809 msg_print("You concentrate on several trumps at once...");
2813 for (dummy = 2 + randint0(plev / 7); dummy > 0; dummy--)
2815 bool pet = success; /* was (randint1(10) > 3) */
2819 if (pet) mode |= PM_FORCE_PET;
2820 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2822 if (p_ptr->pclass == CLASS_BEASTMASTER)
2824 type = SUMMON_KAMIKAZE_LIVING;
2828 type = SUMMON_KAMIKAZE;
2831 if (summon_specific((pet ? -1 : 0), y, x, summon_lev, type, mode))
2835 msg_print("¾¤´¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
2837 msg_print("The summoned creatures get angry!");
2845 case 10: /* Phantasmal Servant */
2848 if (summon_specific(-1, py, px, (summon_lev * 3) / 2, SUMMON_PHANTOM, PM_FORCE_PET))
2851 msg_print("¸æÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¸æ¼ç¿ÍÍÍ¡©");
2853 msg_print("'Your wish, master?'");
2863 case 11: /* Speed Monster */
2866 bool old_target_pet = target_pet;
2868 if (!get_aim_dir(&dir))
2870 target_pet = old_target_pet;
2873 target_pet = old_target_pet;
2874 (void)speed_monster(dir);
2877 case 12: /* Teleport Level */
2881 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
2883 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
2885 (void)teleport_level(0);
2888 case 13: /* Dimension Door */
2892 msg_print("¼¡¸µ¤ÎÈ⤬³«¤¤¤¿¡£ÌÜŪÃϤòÁª¤ó¤Ç²¼¤µ¤¤¡£");
2894 msg_print("You open a dimensional gate. Choose a destination.");
2897 return dimension_door();
2900 case 14: /* Word of Recall */
2903 return word_of_recall();
2906 case 15: /* Banish */
2909 banish_monsters(plev * 4);
2912 case 16: /* Swap Position */
2916 project_length = -1;
2917 if (!get_aim_dir(&dir))
2924 (void)teleport_swap(dir);
2928 case 17: /* Trump Undead */
2930 bool pet = success; /* (randint1(10) > 3) */
2933 if (pet) mode |= PM_FORCE_PET;
2934 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2937 msg_print("¤¢¤Ê¤¿¤Ï¥¢¥ó¥Ç¥Ã¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2939 msg_print("You concentrate on the trump of an undead creature...");
2943 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_UNDEAD, mode))
2947 msg_print("¾¤´¤µ¤ì¤¿¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
2949 msg_print("The summoned undead creature gets angry!");
2960 case 18: /* Trump Reptiles */
2962 bool pet = success; /* was (randint1(5) > 2) */
2965 if (pet) mode |= PM_FORCE_PET;
2966 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2969 msg_print("¤¢¤Ê¤¿¤Ïà¨ÃîÎà¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2971 msg_print("You concentrate on the trump of a reptile...");
2975 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HYDRA, mode))
2979 msg_print("¾¤´¤µ¤ì¤¿à¨ÃîÎà¤ÏÅܤäƤ¤¤ë¡ª");
2981 msg_print("The summoned reptile gets angry!");
2992 case 19: /* Trump Monsters */
2997 msg_print("¤¢¤Ê¤¿¤Ï¥â¥ó¥¹¥¿¡¼¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2999 msg_print("You concentrate on several trumps at once...");
3003 for (dummy = 0; dummy < 1 + ((plev - 15)/ 10); dummy++)
3005 bool pet = success; /* was (randint1(10) > 3) */
3009 if (pet) mode |= PM_FORCE_PET;
3010 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3012 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
3014 if (p_ptr->pclass == CLASS_BEASTMASTER)
3016 type = SUMMON_LIVING;
3023 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
3027 msg_print("¾¤´¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
3029 msg_print("The summoned creatures get angry!");
3037 case 20: /* Trump Hounds */
3039 bool pet = success; /* was (randint1(5) > 2) */
3040 u32b mode = PM_ALLOW_GROUP;
3042 if (pet) mode |= PM_FORCE_PET;
3043 else mode |= PM_NO_PET;
3046 msg_print("¤¢¤Ê¤¿¤Ï¥Ï¥¦¥ó¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3048 msg_print("You concentrate on the trump of a hound...");
3052 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HOUND, mode))
3056 msg_print("¾¤´¤µ¤ì¤¿¥Ï¥¦¥ó¥É¤ÏÅܤäƤ¤¤ë¡ª");
3058 msg_print("The summoned hounds get angry!");
3069 case 21: /* Trump Branding */
3075 case 22: /* Living Trump */
3079 /* Teleport control */
3082 /* Random teleportation (uncontrolled) */
3084 /* Gain the mutation */
3085 if (gain_random_mutation(dummy))
3087 msg_print("¤¢¤Ê¤¿¤ÏÀ¸¤¤Æ¤¤¤ë¥«¡¼¥É¤ËÊѤï¤Ã¤¿¡£");
3089 msg_print("You have turned into a Living Trump.");
3094 case 23: /* Trump Cyberdemon */
3096 bool pet = success; /* was (randint1(10) > 3) */
3099 if (pet) mode |= PM_FORCE_PET;
3100 else mode |= PM_NO_PET;
3103 msg_print("¤¢¤Ê¤¿¤Ï¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3105 msg_print("You concentrate on the trump of a Cyberdemon...");
3109 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_CYBER, mode))
3113 msg_print("¾¤´¤µ¤ì¤¿¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3115 msg_print("The summoned Cyberdemon gets angry!");
3126 case 24: /* Trump Divination */
3129 (void)detect_all(DETECT_RAD_DEFAULT);
3132 case 25: /* Trump Lore */
3135 return identify_fully(FALSE);
3138 case 26: /* Heal Monster */
3141 bool old_target_pet = target_pet;
3143 if (!get_aim_dir(&dir))
3145 target_pet = old_target_pet;
3148 target_pet = old_target_pet;
3150 (void)heal_monster(dir, p_ptr->lev * 10 + 200);
3153 case 27: /* Trump Dragon */
3155 bool pet = success; /* was (randint1(10) > 3) */
3158 if (pet) mode |= PM_FORCE_PET;
3159 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3162 msg_print("¤¢¤Ê¤¿¤Ï¥É¥é¥´¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3164 msg_print("You concentrate on the trump of a dragon...");
3168 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DRAGON, mode))
3172 msg_print("¾¤´¤µ¤ì¤¿¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3174 msg_print("The summoned dragon gets angry!");
3185 case 28: /* Trump Meteor */
3188 int x, y, dx, dy, i;
3189 int b = 10 + randint1(10);
3190 for (i = 0; i < b; i++)
3192 int count = 0, d = 0;
3197 if (count > 20) break;
3198 x = px - 8 + randint0(17);
3199 y = py - 8 + randint0(17);
3201 if (!in_bounds(y,x) || (!cave_floor_bold(y,x) && (cave[y][x].feat != FEAT_TREES)) || !player_has_los_bold(y, x)) continue;
3203 dx = (px > x) ? (px - x) : (x - px);
3204 dy = (py > y) ? (py - y) : (y - py);
3206 /* Approximate distance */
3207 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
3211 if (count > 20) continue;
3213 project(0, 2, y, x, plev * 2, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
3217 case 29: /* Trump Demon */
3219 bool pet = success; /* was (randint1(10) > 3) */
3222 if (pet) mode |= PM_FORCE_PET;
3223 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3226 msg_print("¤¢¤Ê¤¿¤Ï¥Ç¡¼¥â¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3228 msg_print("You concentrate on the trump of a demon...");
3232 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DEMON, mode))
3236 msg_print("¾¤´¤µ¤ì¤¿¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3238 msg_print("The summoned demon gets angry!");
3249 case 30: /* Trump Greater Undead */
3251 bool pet = success; /* was (randint1(10) > 3) */
3254 if (pet) mode |= PM_FORCE_PET;
3255 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3257 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
3260 msg_print("¤¢¤Ê¤¿¤Ï¶¯ÎϤʥ¢¥ó¥Ç¥Ã¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3262 msg_print("You concentrate on the trump of a greater undead being...");
3266 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HI_UNDEAD, mode))
3270 msg_print("¾¤´¤µ¤ì¤¿¾åµé¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
3272 msg_print("The summoned greater undead creature gets angry!");
3283 case 31: /* Trump Ancient Dragon */
3285 bool pet = success; /* was (randint1(10) > 3) */
3289 if (pet) mode |= PM_FORCE_PET;
3290 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3292 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
3294 if (p_ptr->pclass == CLASS_BEASTMASTER)
3296 type = SUMMON_HI_DRAGON_LIVING;
3300 type = SUMMON_HI_DRAGON;
3304 msg_print("¤¢¤Ê¤¿¤Ï¸ÅÂå¥É¥é¥´¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3306 msg_print("You concentrate on the trump of an ancient dragon...");
3310 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
3314 msg_print("¾¤´¤µ¤ì¤¿¸ÅÂå¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3316 msg_print("The summoned ancient dragon gets angry!");
3329 msg_format("̤ÃΤΥ«¡¼¥É¤Î¼öʸ¤Ç¤¹: %d", spell);
3331 msg_format("You cast an unknown Trump spell: %d.", spell);
3340 msg_print("ï¤â¤¢¤Ê¤¿¤Î¥«¡¼¥É¤Î¸Æ¤ÓÀ¼¤ËÅú¤¨¤Ê¤¤¡£");
3342 msg_print("Nobody answers to your Trump call.");
3351 static bool cast_arcane_spell(int spell)
3355 int plev = p_ptr->lev;
3358 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3359 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3360 else beam = plev / 2;
3365 if (!get_aim_dir(&dir)) return FALSE;
3367 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
3368 damroll(3 + ((plev - 1) / 5), 3));
3370 case 1: /* Wizard Lock */
3371 if (!get_aim_dir(&dir)) return FALSE;
3373 (void)wizard_lock(dir);
3375 case 2: /* Detect Invisibility */
3376 (void)detect_monsters_invis(DETECT_RAD_DEFAULT);
3378 case 3: /* Detect Monsters */
3379 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
3382 teleport_player(10);
3384 case 5: /* Light Area */
3385 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
3387 case 6: /* Trap & Door Destruction */
3388 if (!get_aim_dir(&dir)) return FALSE;
3390 (void)destroy_door(dir);
3392 case 7: /* Cure Light Wounds */
3393 (void)hp_player(damroll(2, 8));
3394 (void)set_cut(p_ptr->cut - 10);
3396 case 8: /* Detect Doors & Traps */
3397 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
3398 (void)detect_doors(DETECT_RAD_DEFAULT);
3399 (void)detect_stairs(DETECT_RAD_DEFAULT);
3401 case 9: /* Phlogiston */
3404 case 10: /* Detect Treasure */
3405 (void)detect_treasure(DETECT_RAD_DEFAULT);
3406 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
3408 case 11: /* Detect Enchantment */
3409 (void)detect_objects_magic(DETECT_RAD_DEFAULT);
3411 case 12: /* Detect Objects */
3412 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
3414 case 13: /* Cure Poison */
3415 (void)set_poisoned(0);
3417 case 14: /* Resist Cold */
3418 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3420 case 15: /* Resist Fire */
3421 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3423 case 16: /* Resist Lightning */
3424 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3426 case 17: /* Resist Acid */
3427 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3429 case 18: /* Cure Medium Wounds */
3430 (void)hp_player(damroll(4, 8));
3431 (void)set_cut((p_ptr->cut / 2) - 50);
3433 case 19: /* Teleport */
3434 teleport_player(plev * 5);
3436 case 20: /* Identify */
3437 return ident_spell(FALSE);
3438 case 21: /* Stone to Mud */
3439 if (!get_aim_dir(&dir)) return FALSE;
3441 (void)wall_to_mud(dir);
3443 case 22: /* Ray of Light */
3444 if (!get_aim_dir(&dir)) return FALSE;
3447 msg_print("¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
3449 msg_print("A line of light appears.");
3452 (void)lite_line(dir);
3454 case 23: /* Satisfy Hunger */
3455 (void)set_food(PY_FOOD_MAX - 1);
3457 case 24: /* See Invisible */
3458 (void)set_tim_invis(randint1(24) + 24, FALSE);
3460 case 25: /* Conjure Elemental */
3461 if (!summon_specific(-1, py, px, plev, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3464 msg_print("¥¨¥ì¥á¥ó¥¿¥ë¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3466 msg_print("No Elementals arrive.");
3470 case 26: /* Teleport Level */
3472 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
3474 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
3476 (void)teleport_level(0);
3478 case 27: /* Teleport Away */
3479 if (!get_aim_dir(&dir)) return FALSE;
3481 (void)fire_beam(GF_AWAY_ALL, dir, plev);
3483 case 28: /* Elemental Ball */
3484 if (!get_aim_dir(&dir)) return FALSE;
3486 switch (randint1(4))
3488 case 1: dummy = GF_FIRE;break;
3489 case 2: dummy = GF_ELEC;break;
3490 case 3: dummy = GF_COLD;break;
3491 default: dummy = GF_ACID;break;
3493 fire_ball(dummy, dir, 75 + (plev), 2);
3495 case 29: /* Detection */
3496 (void)detect_all(DETECT_RAD_DEFAULT);
3498 case 30: /* Word of Recall */
3499 return word_of_recall();
3500 case 31: /* Clairvoyance */
3501 chg_virtue(V_KNOWLEDGE, 1);
3502 chg_virtue(V_ENLIGHTEN, 1);
3504 if (!p_ptr->telepathy)
3506 (void)set_tim_esp(randint1(30) + 25, FALSE);
3510 msg_format("You cast an unknown Arcane spell: %d.", spell);
3518 static bool cast_enchant_spell(int spell)
3520 int plev = p_ptr->lev;
3525 case 0: /* Infravision */
3526 set_tim_infra(100 + randint1(100), FALSE);
3528 case 1: /* Regeneration */
3529 set_tim_regen(80 + randint1(80), FALSE);
3531 case 2: /* Satisfy Hunger */
3532 (void)set_food(PY_FOOD_MAX - 1);
3534 case 3: /* Resist Cold */
3535 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3537 case 4: /* Resist Fire */
3538 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3540 case 5: /* Heroism */
3541 (void)set_hero(randint1(25) + 25, FALSE);
3542 (void)hp_player(10);
3543 (void)set_afraid(0);
3545 case 6: /* Resist Lightning */
3546 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3548 case 7: /* Resist Acid */
3549 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3551 case 8: /* See Invisibility */
3552 (void)set_tim_invis(randint1(24) + 24, FALSE);
3554 case 9: /* Remove Curse */
3558 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
3560 msg_print("You feel as if someone is watching over you.");
3564 case 10: /* Resist Poison */
3565 (void)set_oppose_pois(randint1(20) + 20, FALSE);
3567 case 11: /* Berserk */
3568 (void)set_shero(randint1(25) + 25, FALSE);
3569 (void)hp_player(30);
3570 (void)set_afraid(0);
3572 case 12: /* Self Knowledge */
3573 (void)self_knowledge();
3575 case 13: /* Protection from Evil */
3576 (void)set_protevil(randint1(25) + 3 * p_ptr->lev, FALSE);
3578 case 14: /* Healing */
3584 case 15: /* Mana Branding */
3585 return choose_ele_attack();
3586 case 16: /* Telepathy */
3587 (void)set_tim_esp(randint1(30) + 25, FALSE);
3589 case 17: /* Stone Skin */
3590 (void)set_shield(randint1(20) + 30, FALSE);
3592 case 18: /* Resistance */
3593 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3594 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3595 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3596 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3597 (void)set_oppose_pois(randint1(20) + 20, FALSE);
3599 case 19: /* Haste */
3600 (void)set_fast(randint1(20 + plev) + plev, FALSE);
3602 case 20: /* Walk through Wall */
3603 (void)set_kabenuke(randint1(plev/2) + plev/2, FALSE);
3605 case 21: /* Pulish Shield */
3606 (void)pulish_shield();
3608 case 22: /* Create Golem */
3609 if (summon_specific(-1, py, px, plev, SUMMON_GOLEM, PM_FORCE_PET))
3612 msg_print("¥´¡¼¥ì¥à¤òºî¤Ã¤¿¡£");
3614 msg_print("You make a golem.");
3620 msg_print("¤¦¤Þ¤¯¥´¡¼¥ì¥à¤òºî¤ì¤Ê¤«¤Ã¤¿¡£");
3622 msg_print("No Golems arrive.");
3626 case 23: /* Magic armor */
3627 (void)set_magicdef(randint1(20) + 20, FALSE);
3629 case 24: /* Remove Enchantment */
3630 if (!mundane_spell(TRUE)) return FALSE;
3632 case 25: /* Remove All Curse */
3633 if (remove_all_curse())
3636 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
3638 msg_print("You feel as if someone is watching over you.");
3642 case 26: /* Total Knowledge */
3643 return identify_fully(FALSE);
3644 case 27: /* Enchant Weapon */
3645 return enchant_spell(randint0(4) + 1, randint0(4) + 1, 0);
3646 case 28: /* Enchant Armor */
3647 return enchant_spell(0, 0, randint0(3) + 2);
3648 case 29: /* Brand Weapon */
3649 brand_weapon(randint0(18));
3651 case 30: /* Living Trump */
3653 /* Teleport control */
3656 /* Random teleportation (uncontrolled) */
3658 /* Gain the mutation */
3659 if (gain_random_mutation(dummy))
3661 msg_print("¤¢¤Ê¤¿¤ÏÀ¸¤¤Æ¤¤¤ë¥«¡¼¥É¤ËÊѤï¤Ã¤¿¡£");
3663 msg_print("You have turned into a Living Trump.");
3666 case 31: /* Immune */
3667 return choose_ele_immune(13 + randint1(13));
3669 msg_format("You cast an unknown Craft spell: %d.", spell);
3678 * An "item_tester_hook" for offer
3680 static bool item_tester_offer(object_type *o_ptr)
3682 /* Flasks of oil are okay */
3683 if (o_ptr->tval != TV_CORPSE) return (FALSE);
3685 if (o_ptr->sval != SV_CORPSE) return (FALSE);
3687 if (strchr("pht", r_info[o_ptr->pval].d_char)) return (TRUE);
3689 /* Assume not okay */
3694 static bool cast_daemon_spell(int spell)
3697 int plev = p_ptr->lev;
3699 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3700 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3701 else beam = plev / 2;
3705 case 0: /* Magic Missile */
3706 if (!get_aim_dir(&dir)) return FALSE;
3708 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
3709 damroll(3 + ((plev - 1) / 5), 4));
3711 case 1: /* Detect Undead & Demons -> Unlife */
3712 (void)detect_monsters_nonliving(DETECT_RAD_DEFAULT);
3715 (void)set_blessed(randint1(12) + 12, FALSE);
3717 case 3: /* Resist Fire */
3718 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3720 case 4: /* Horrify */
3721 if (!get_aim_dir(&dir)) return FALSE;
3723 (void)fear_monster(dir, plev);
3724 (void)stun_monster(dir, plev);
3726 case 5: /* Nether Bolt */
3727 if (!get_aim_dir(&dir)) return FALSE;
3729 fire_bolt_or_beam(beam, GF_NETHER, dir,
3730 damroll(6 + ((plev - 5) / 4), 8));
3732 case 6: /* Summon monster, demon */
3733 if (!summon_specific(-1, py, px, (plev * 3) / 2, SUMMON_MANES, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3736 msg_print("¸ÅÂå¤Î»àÎî¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3738 msg_print("No Manes arrive.");
3742 case 7: /* Mini Hellfire */
3743 if (!get_aim_dir(&dir)) return FALSE;
3745 fire_ball(GF_HELL_FIRE, dir,
3746 (damroll(3, 6) + plev +
3747 (plev / (((p_ptr->pclass == CLASS_MAGE) ||
3748 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
3749 (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
3750 ((plev < 30) ? 2 : 3));
3752 case 8: /* Enslave Demon */
3753 if (!get_aim_dir(&dir)) return FALSE;
3755 (void)control_one_demon(dir, plev);
3757 case 9: /* Vision */
3758 map_area(DETECT_RAD_MAP);
3760 case 10: /* Resist Nether */
3761 (void)set_tim_res_nether(randint1(20) + 20, FALSE);
3763 case 11: /* Plasma Bolt */
3764 if (!get_aim_dir(&dir)) return FALSE;
3766 fire_bolt_or_beam(beam, GF_PLASMA, dir,
3767 damroll(11 + ((plev - 5) / 4), 8));
3769 case 12: /* Fire Ball */
3770 if (!get_aim_dir(&dir)) return FALSE;
3772 fire_ball(GF_FIRE, dir, plev + 55, 2);
3774 case 13: /* Fire Branding */
3777 case 14: /* Nether Ball */
3778 if (!get_aim_dir(&dir)) return FALSE;
3780 fire_ball(GF_NETHER, dir, plev*3/2 + 100, plev / 20+2);
3782 case 15: /* Summon monster, demon */
3784 bool pet = !one_in_(3);
3787 if (pet) mode |= PM_FORCE_PET;
3788 else mode |= PM_NO_PET;
3789 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
3791 if (summon_specific((pet ? -1 : 0), py, px, plev*2/3+randint1(plev/2), SUMMON_DEMON, mode))
3794 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
3796 msg_print("The area fills with a stench of sulphur and brimstone.");
3802 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
3804 msg_print("'What is thy bidding... Master?'");
3809 msg_print("¡ÖÈܤ·¤¼Ô¤è¡¢²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª ¤ªÁ°¤Îº²¤òĺ¤¯¤¾¡ª¡×");
3811 msg_print("'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'");
3818 msg_print("°Ëâ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3820 msg_print("No demons arrive.");
3825 case 16: /* Telepathy */
3826 (void)set_tim_esp(randint1(30) + 25, FALSE);
3828 case 17: /* Demoncloak */
3830 int dur=randint1(20) + 20;
3832 set_oppose_fire(dur, FALSE);
3833 set_oppose_cold(dur, FALSE);
3834 set_tim_sh_fire(dur, FALSE);
3838 case 18: /* Rain of Lava */
3839 fire_ball(GF_FIRE, 0, (55 + plev)*2, 3);
3840 fire_ball_hide(GF_LAVA_FLOW, 0, 2+randint1(2), 3);
3842 case 19: /* Plasma ball */
3843 if (!get_aim_dir(&dir)) return FALSE;
3845 fire_ball(GF_PLASMA, dir, plev*3/2 + 80, 2 + plev/40);
3847 case 20: /* Mimic demon */
3848 (void)set_mimic(10+plev/2 + randint1(10+plev/2), MIMIC_DEMON, FALSE);
3850 case 21: /* Nether Wave == Dispel Good */
3851 (void)dispel_monsters(randint1(plev * 2));
3852 (void)dispel_good(randint1(plev * 2));
3855 if (!get_aim_dir(&dir)) return FALSE;
3856 fire_ball(GF_NEXUS, dir, 100 + plev*2, 4);
3858 case 23: /* Hand Doom */
3859 if (!get_aim_dir(&dir)) return FALSE;
3861 else msg_print("<ÇËÌǤμê>¤òÊü¤Ã¤¿¡ª");
3863 else msg_print("You invoke the Hand of Doom!");
3866 fire_ball_hide(GF_HAND_DOOM, dir, plev * 2, 0);
3868 case 24: /* Heroism */
3869 (void)set_hero(randint1(25) + 25, FALSE);
3870 (void)hp_player(10);
3871 (void)set_afraid(0);
3873 case 25: /* Tim resist time */
3874 (void)set_tim_res_time(randint1(20)+20, FALSE);
3876 case 26: /* Circle of Madness */
3877 fire_ball(GF_CHAOS, 0, 50+plev, 3+plev/20);
3878 fire_ball(GF_CONFUSION, 0, 50+plev, 3+plev/20);
3879 fire_ball(GF_CHARM, 0, 20+plev, 3+plev/20);
3881 case 27: /* True Discharge Minion */
3884 case 28: /* Summon Greater Demon */
3891 item_tester_hook = item_tester_offer;
3893 q = "¤É¤Î»àÂΤòÊû¤²¤Þ¤¹¤«? ";
3894 s = "Êû¤²¤é¤ì¤ë»àÂΤò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
3896 q = "Sacrifice which corpse? ";
3897 s = "You have nothing to scrifice.";
3899 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return FALSE;
3901 /* Get the item (in the pack) */
3904 o_ptr = &inventory[item];
3907 /* Get the item (on the floor) */
3910 o_ptr = &o_list[0 - item];
3913 summon_lev = p_ptr->lev * 2 / 3 + r_info[o_ptr->pval].level;
3914 if (summon_specific(-1, py, px, summon_lev, SUMMON_HI_DEMON, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3917 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
3919 msg_print("The area fills with a stench of sulphur and brimstone.");
3924 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
3926 msg_print("'What is thy bidding... Master?'");
3929 /* Decrease the item (from the pack) */
3932 inven_item_increase(item, -1);
3933 inven_item_describe(item);
3934 inven_item_optimize(item);
3937 /* Decrease the item (from the floor) */
3940 floor_item_increase(0 - item, -1);
3941 floor_item_describe(0 - item);
3942 floor_item_optimize(0 - item);
3948 msg_print("°Ëâ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3950 msg_print("No Greater Demon arrive.");
3955 case 29: /* Nether Storm */
3956 if (!get_aim_dir(&dir)) return FALSE;
3958 fire_ball(GF_NETHER, dir, plev*15, plev / 5);
3960 case 30: /* Blood curse */
3962 if (!get_aim_dir(&dir)) return FALSE;
3964 fire_ball_hide(GF_BLOOD_CURSE, dir, 600, 0);
3966 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "·ì¤Î¼ö¤¤", -1);
3968 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "Blood curse", -1);
3972 case 31: /* Mimic Demon lord */
3973 (void)set_mimic(15 + randint1(15), MIMIC_DEMON_LORD, FALSE);
3976 msg_format("You cast an unknown Daemon spell: %d.", spell);
3984 static bool cast_crusade_spell(int spell)
3988 int plev = p_ptr->lev;
3990 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3991 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3992 else beam = plev / 2;
3997 if (!get_aim_dir(&dir)) return FALSE;
3999 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
4000 damroll(3 + ((plev - 1) / 5), 4));
4003 (void)detect_monsters_evil(DETECT_RAD_DEFAULT);
4005 case 2: /* Remove Fear */
4006 (void)set_afraid(0);
4009 if (!get_aim_dir(&dir)) return FALSE;
4011 (void)fear_monster(dir, plev);
4014 (void)sleep_monsters_touch();
4017 teleport_player(25+plev/2);
4020 if (!get_aim_dir(&dir)) return FALSE;
4021 fire_blast(GF_LITE, dir, 3+((plev-1)/9), 2, 10, 3);
4025 (void)set_poisoned(0);
4029 if (!get_aim_dir(&dir)) return FALSE;
4030 (void)fire_ball(GF_AWAY_EVIL, dir, MAX_SIGHT*5, 0);
4032 case 9: /* Holy Orb */
4033 if (!get_aim_dir(&dir)) return FALSE;
4035 fire_ball(GF_HOLY_FIRE, dir,
4036 (damroll(3, 6) + plev +
4037 (plev / ((p_ptr->pclass == CLASS_PRIEST ||
4038 p_ptr->pclass == CLASS_HIGH_MAGE ||
4039 p_ptr->pclass == CLASS_SORCERER) ? 2 : 4))),
4040 ((plev < 30) ? 2 : 3));
4043 case 10: /* Exorcism */
4044 (void)dispel_undead(randint1(plev));
4045 (void)dispel_demons(randint1(plev));
4046 (void)turn_evil(plev);
4048 case 11: /* Remove Curse */
4052 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
4054 msg_print("You feel as if someone is watching over you.");
4058 case 12: /* Sense Unseen */
4059 (void)set_tim_invis(randint1(24) + 24, FALSE);
4061 case 13: /* Protection from Evil */
4062 (void)set_protevil(randint1(25) + 3 * p_ptr->lev, FALSE);
4065 if (!get_aim_dir(&dir)) return FALSE;
4066 (void)fire_bolt(GF_ELEC, dir, plev*5);
4068 case 15: /* Holy Word */
4069 (void)dispel_evil(randint1(plev * 6));
4070 (void)hp_player(100);
4071 (void)set_afraid(0);
4072 (void)set_poisoned(0);
4077 if (!get_aim_dir(&dir)) return FALSE;
4079 (void)destroy_door(dir);
4082 if (!get_aim_dir(&dir)) return FALSE;
4083 (void)stasis_evil(dir);
4086 set_tim_sh_holy(randint1(20)+20, FALSE);
4088 case 19: /* Dispel Undead + Demons */
4089 (void)dispel_undead(randint1(plev * 4));
4090 (void)dispel_demons(randint1(plev * 4));
4092 case 20: /* Dispel Evil */
4093 (void)dispel_evil(randint1(plev * 4));
4098 case 22: /* Star Burst */
4099 if (!get_aim_dir(&dir)) return FALSE;
4101 fire_ball(GF_LITE, dir, 100+plev*2, 4);
4103 case 23: /* Summon monster, angel */
4105 bool pet = !one_in_(3);
4108 if (pet) mode |= PM_FORCE_PET;
4109 else mode |= PM_NO_PET;
4110 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
4112 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, SUMMON_ANGEL, mode))
4116 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
4118 msg_print("'What is thy bidding... Master?'");
4123 msg_print("¡Ö²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª °¹Ô¼Ô¤è¡¢²ù¤¤²þ¤á¤è¡ª¡×");
4125 msg_print("Mortal! Repent of thy impiousness.");
4131 case 24: /* Heroism */
4132 (void)set_hero(randint1(25) + 25, FALSE);
4133 (void)hp_player(10);
4134 (void)set_afraid(0);
4136 case 25: /* Remove All Curse */
4137 if (remove_all_curse())
4140 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
4142 msg_print("You feel as if someone is watching over you.");
4146 case 26: /* Banishment */
4147 if (banish_evil(100))
4150 msg_print("¿ÀÀ»¤ÊÎϤ¬¼Ù°¤òÂǤÁʧ¤Ã¤¿¡ª");
4152 msg_print("The holy power banishes evil!");
4157 case 27: /* Word of Destruction */
4158 (void)destroy_area(py, px, 13 + randint0(5), FALSE);
4160 case 28: /* Eye for an Eye */
4161 set_tim_eyeeye(randint1(10)+10, FALSE);
4168 int b = 10 + randint1(10);
4170 if (!get_aim_dir(&dir)) return FALSE;
4172 /* Use the given direction */
4173 tx = px + 99 * ddx[dir];
4174 ty = py + 99 * ddy[dir];
4176 /* Hack -- Use an actual "target" */
4177 if ((dir == 5) && target_okay())
4188 /* Hack -- Stop at the target */
4189 if ((y == ty) && (x == tx)) break;
4193 mmove2(&ny, &nx, py, px, ty, tx);
4195 /* Stop at maximum range */
4196 if (MAX_RANGE <= distance(py, px, ny, nx)) break;
4198 /* Stopped by walls/doors */
4199 if (!cave_floor_bold(ny, nx)) break;
4201 /* Stopped by monsters */
4202 if ((dir != 5) && cave[ny][nx].m_idx != 0) break;
4204 /* Save the new location */
4211 for (i = 0; i < b; i++)
4213 int count = 20, d = 0;
4219 x = tx - 5 + randint0(11);
4220 y = ty - 5 + randint0(11);
4222 dx = (tx > x) ? (tx - x) : (x - tx);
4223 dy = (ty > y) ? (ty - y) : (y - ty);
4225 /* Approximate distance */
4226 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
4227 /* Within the radius */
4231 if (count < 0) continue;
4233 /* Cannot penetrate perm walls */
4234 if (!in_bounds(y,x) ||
4235 cave_stop_disintegration(y,x) ||
4236 !in_disintegration_range(ty, tx, y, x))
4239 project(0, 2, y, x, plev * 3+25, GF_DISINTEGRATE, PROJECT_JUMP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1);
4243 case 30: /* Divine Intervention */
4244 project(0, 1, py, px, plev*11, GF_HOLY_FIRE, PROJECT_KILL, -1);
4245 dispel_monsters(plev * 4);
4247 stun_monsters(plev * 4);
4248 confuse_monsters(plev * 4);
4249 turn_monsters(plev * 4);
4250 stasis_monsters(plev * 4);
4251 (void)hp_player(100);
4257 for (i = 0; i < 12; i++)
4264 scatter(&my, &mx, py, px, 4, 0);
4266 /* Require empty grids */
4267 if (cave_empty_bold2(my, mx)) break;
4269 if (attempt < 0) continue;
4270 summon_specific(-1, my, mx, plev, SUMMON_KNIGHTS, (PM_ALLOW_GROUP | PM_FORCE_PET | PM_HASTE));
4272 (void)set_hero(randint1(25) + 25, FALSE);
4273 (void)set_blessed(randint1(25) + 25, FALSE);
4274 (void)set_fast(randint1(20 + plev) + plev, FALSE);
4275 (void)set_protevil(randint1(25) + 25, FALSE);
4276 (void)set_afraid(0);
4281 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤ÊÇ˼٤μöʸ %d ¤ò¾§¤¨¤¿¡£", spell);
4283 msg_format("You cast an unknown crusade spell: %d.", spell);
4294 void stop_singing(void)
4296 if (p_ptr->pclass != CLASS_BARD) return;
4298 if (p_ptr->magic_num1[1])
4300 p_ptr->magic_num1[1] = 0;
4303 if (!p_ptr->magic_num1[0]) return;
4305 /* Hack -- if called from set_action(), avoid recursive loop */
4306 if (p_ptr->action == ACTION_SING) set_action(ACTION_NONE);
4308 switch(p_ptr->magic_num1[0])
4311 if (!p_ptr->blessed)
4313 msg_print("¹â·é¤Êµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4315 msg_print("The prayer has expired.");
4322 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4324 msg_print("The heroism wears off.");
4326 /* Recalculate hitpoints */
4327 p_ptr->update |= (PU_HP);
4331 if (!p_ptr->tim_esp)
4334 msg_print("°Õ¼±¤Ï¸µ¤ËÌá¤Ã¤¿¡£");
4336 msg_print("Your consciousness contracts again.");
4338 /* Update the monsters */
4339 p_ptr->update |= (PU_MONSTERS);
4343 if (!p_ptr->tim_stealth)
4345 msg_print("»Ñ¤¬¤Ï¤Ã¤¤ê¤È¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
4347 msg_print("You are no longer hided.");
4351 if (!p_ptr->oppose_acid)
4353 msg_print("»À¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4355 msg_print("You feel less resistant to acid.");
4357 if (!p_ptr->oppose_elec)
4359 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4361 msg_print("You feel less resistant to elec.");
4363 if (!p_ptr->oppose_fire)
4365 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4367 msg_print("You feel less resistant to fire.");
4369 if (!p_ptr->oppose_cold)
4371 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4373 msg_print("You feel less resistant to cold.");
4375 if (!p_ptr->oppose_pois)
4377 msg_print("ÆǤؤÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4379 msg_print("You feel less resistant to pois.");
4385 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
4387 msg_print("You feel yourself slow down.");
4394 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4396 msg_print("The heroism wears off.");
4398 /* Recalculate hitpoints */
4399 p_ptr->update |= (PU_HP);
4404 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
4406 msg_print("You feel yourself slow down.");
4413 msg_print("̵Ũ¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£");
4415 msg_print("The invulnerability wears off.");
4418 p_ptr->redraw |= (PR_MAP);
4420 /* Update monsters */
4421 p_ptr->update |= (PU_MONSTERS);
4424 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4428 p_ptr->magic_num1[0] = MUSIC_NONE;
4429 p_ptr->magic_num2[0] = 0;
4431 /* Recalculate bonuses */
4432 p_ptr->update |= (PU_BONUS | PU_HP);
4434 /* Redraw status bar */
4435 p_ptr->redraw |= (PR_STATUS);
4439 static bool cast_music_spell(int spell)
4441 int plev = p_ptr->lev;
4444 if(p_ptr->magic_num1[0])
4449 p_ptr->magic_num2[0] = spell;
4453 case 0: /* Song of Holding ÃÙÆߤβΠ*/
4455 msg_print("¤æ¤Ã¤¯¤ê¤È¤·¤¿¥á¥í¥Ç¥£¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4457 msg_print("You start humming a slow, steady melody...");
4459 p_ptr->magic_num1[0] = MUSIC_SLOW;
4461 case 1: /* Song of Blessing ½ËÊ¡¤Î²Î */
4463 msg_print("¸·¤«¤Ê¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4465 msg_print("The holy power of the Music of the Ainur enters you...");
4467 p_ptr->magic_num1[0] = MUSIC_BLESS;
4470 case 2: /* Wrecking Note Êø²õ¤Î²»¿§ */
4471 if (!get_aim_dir(&dir)) return FALSE;
4472 fire_bolt(GF_SOUND, dir,
4473 damroll(4 + ((plev - 1) / 5), 4));
4475 case 3: /* Stun Pattern Û¯Û°¤ÎÀûΧ */
4477 msg_print("âÁÏǤµ¤»¤ë¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4479 msg_print("You weave a pattern of sounds to bewilder and daze...");
4481 p_ptr->magic_num1[0] = MUSIC_STUN;
4483 case 4: /* Flow of life À¸Ì¿¤Îή¤ì */
4485 msg_print("²Î¤òÄ̤·¤ÆÂΤ˳赤¤¬Ìá¤Ã¤Æ¤¤¿¡¥¡¥¡¥");
4487 msg_print("Life flows through you as you sing a song of healing...");
4489 p_ptr->magic_num1[0] = MUSIC_L_LIFE;
4491 case 5: /* Song of the Sun ÂÀÍۤβΠ*/
4493 msg_print("¸÷¤êµ±¤¯²Î¤¬ÊÕ¤ê¤ò¾È¤é¤·¤¿¡£");
4495 msg_print("Your uplifting song brings brightness to dark places...");
4497 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
4499 case 6: /* Song of fear ¶²ÉݤβΠ*/
4501 msg_print("¤ª¤É¤í¤ª¤É¤í¤·¤¤¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4503 msg_print("You start weaving a fearful pattern...");
4505 p_ptr->magic_num1[0] = MUSIC_FEAR;
4507 case 7: /* Heroic Ballad À襤¤Î²Î */
4509 msg_print("·ã¤·¤¤À襤¤Î²Î¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4511 msg_print("You start singing a song of intense fighting...");
4513 p_ptr->magic_num1[0] = MUSIC_HERO;
4515 case 8: /* Clairaudience ÎîŪÃγР*/
4517 msg_print("ÀŤ«¤Ê²»³Ú¤¬´¶³Ð¤ò¸¦¤®À¡¤Þ¤µ¤»¤¿¡¥¡¥¡¥");
4519 msg_print("Your quiet music sharpens your sense of hearing...");
4521 p_ptr->magic_num1[0] = MUSIC_DETECT;
4523 case 9: /* º²¤Î²Î */
4525 msg_print("Àº¿À¤òDZ¤¸¶Ê¤²¤ë²Î¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4527 msg_print("You start singing a song of soul in pain...");
4529 p_ptr->magic_num1[0] = MUSIC_PSI;
4531 case 10: /* Song of Lore Ãμ±¤Î²Î */
4533 msg_print("¤³¤ÎÀ¤³¦¤ÎÃ챤¬Î®¤ì¹þ¤ó¤Ç¤¤¿¡¥¡¥¡¥");
4535 msg_print("You recall the rich lore of the world...");
4537 p_ptr->magic_num1[0] = MUSIC_ID;
4539 case 11: /* hidding song ±£ÆۤβΠ*/
4541 msg_print("¤¢¤Ê¤¿¤Î»Ñ¤¬·Ê¿§¤Ë¤È¤±¤³¤ó¤Ç¤¤¤Ã¤¿¡¥¡¥¡¥");
4543 msg_print("Your song carries you beyond the sight of mortal eyes...");
4545 p_ptr->magic_num1[0] = MUSIC_STEALTH;
4547 case 12: /* Illusion Pattern ¸¸±Æ¤ÎÀûΧ */
4549 msg_print("ÊÕ¤ê°ìÌ̤˸¸±Æ¤¬¸½¤ì¤¿¡¥¡¥¡¥");
4551 msg_print("You weave a pattern of sounds to beguile and confuse...");
4553 p_ptr->magic_num1[0] = MUSIC_CONF;
4555 case 13: /* Doomcall (vibration song) ÇËÌǤζ«¤Ó */
4557 msg_print("¹ì²»¤¬¶Á¤¤¤¿¡¥¡¥¡¥");
4559 msg_print("The fury of the Downfall of Numenor lashes out...");
4561 p_ptr->magic_num1[0] = MUSIC_SOUND;
4563 case 14: /* Firiel's Song (song of the Undeads) ¥Õ¥£¥ê¥¨¥ë¤Î²Î */
4565 msg_print("À¸Ì¿¤ÈÉü³è¤Î¥Æ¡¼¥Þ¤òÁդǻϤ᤿¡¥¡¥¡¥");
4567 msg_print("The themes of life and revival are woven into your song...");
4569 animate_dead(0, py, px);
4571 case 15: /* Fellowship Chant (charming song) ι¤ÎÃç´Ö */
4573 msg_print("°Â¤é¤«¤Ê¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4575 msg_print("You weave a slow, soothing melody of imploration...");
4577 p_ptr->magic_num1[0] = MUSIC_CHARM;
4579 case 16: /* (wall breaking song) ʬ²ò²»ÇÈ */
4581 msg_print("Ê´ºÕ¤¹¤ë¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4583 msg_print("You weave a violent pattern of sounds to break wall.");
4585 p_ptr->magic_num1[0] = MUSIC_WALL;
4586 project(0, 0, py, px,
4587 0, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM | PROJECT_HIDE, -1);
4589 case 17: /* Finrod's Resistance (song of resistance) ¸µÁÇÂÑÀ */
4591 msg_print("¸µÁǤÎÎϤËÂФ¹¤ëǦÂѤβΤò²Î¤Ã¤¿¡£");
4593 msg_print("You sing a song of perseverance against powers...");
4595 p_ptr->magic_num1[0] = MUSIC_RESIST;
4597 case 18: /* Hobbit Melodies (song of time) ¥Û¥Ó¥Ã¥È¤Î¥á¥í¥Ç¥£ */
4599 msg_print("·Ú²÷¤Ê²Î¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4601 msg_print("You start singing joyful pop song...");
4603 p_ptr->magic_num1[0] = MUSIC_SPEED;
4605 case 19: /* World Contortion ÏĤó¤ÀÀ¤³¦ */
4607 msg_print("²Î¤¬¶õ´Ö¤òÏĤ᤿¡¥¡¥¡¥");
4609 msg_print("Reality whirls wildly as you sing a dizzying melody...");
4611 project(0, plev/15 + 1, py, px, plev * 3 + 1, GF_AWAY_ALL , PROJECT_KILL, -1);
4613 case 20: /* Â໶¤Î²Î */
4615 msg_print("ÂѤ¨¤é¤ì¤Ê¤¤ÉÔ¶¨Ï²»¤¬Å¨¤òÀÕ¤áΩ¤Æ¤¿¡¥¡¥¡¥");
4617 msg_print("You cry out in an ear-wracking voice...");
4619 p_ptr->magic_num1[0] = MUSIC_DISPEL;
4621 case 21: /* The Voice of Saruman ¥µ¥ë¥Þ¥ó¤Î´Å¸À */
4623 msg_print("Í¥¤·¤¯¡¢Ì¥ÎÏŪ¤Ê²Î¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4625 msg_print("You start humming a gentle and attractive song...");
4627 p_ptr->magic_num1[0] = MUSIC_SARUMAN;
4629 case 22: /* Song of Tempest (song of death) Íò¤Î²»¿§ */
4630 if (!get_aim_dir(&dir)) return FALSE;
4631 fire_beam(GF_SOUND, dir,
4632 damroll(15 + ((plev - 1) / 2), 10));
4634 case 23: /* (song of disruption) ¤â¤¦°ì¤Ä¤ÎÀ¤³¦ */
4636 msg_print("¼þ°Ï¤¬ÊѲ½¤·»Ï¤á¤¿¡¥¡¥¡¥");
4638 msg_print("You sing of the primeval shaping of Middle-earth...");
4642 case 24: /* Wrecking Pattern (destruction shriek) Ç˲õ¤ÎÀûΧ */
4644 msg_print("Ç˲õŪ¤Ê²Î¤¬¶Á¤¤ï¤¿¤Ã¤¿¡¥¡¥¡¥");
4646 msg_print("You weave a pattern of sounds to contort and shatter...");
4648 p_ptr->magic_num1[0] = MUSIC_QUAKE;
4650 case 25: /* ÄäÂڤβΠ*/
4652 msg_print("¤æ¤Ã¤¯¤ê¤È¤·¤¿¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4654 msg_print("You weave a very slow pattern which is almost likely to stop...");
4656 p_ptr->magic_num1[0] = MUSIC_STASIS;
4658 case 26: /* ¼é¤ê¤Î²Î */
4660 msg_print("²Î¤¬¿ÀÀ»¤Ê¾ì¤òºî¤ê½Ð¤·¤¿¡¥¡¥¡¥");
4662 msg_print("The holy power of the Music is creating sacred field...");
4666 case 27: /* ±Ñͺ¤Î»í */
4668 msg_print("±Ñͺ¤Î²Î¤ò¸ý¤º¤µ¤ó¤À¡¥¡¥¡¥");
4670 msg_print("You chant a powerful, heroic call to arms...");
4672 p_ptr->magic_num1[0] = MUSIC_SHERO;
4673 (void)hp_player(10);
4674 (void)set_afraid(0);
4676 case 28: /* ¥ä¥ô¥¡¥ó¥Ê¤Î½õ¤± */
4678 msg_print("²Î¤òÄ̤·¤ÆÂΤ˳赤¤¬Ìá¤Ã¤Æ¤¤¿¡¥¡¥¡¥");
4680 msg_print("Life flows through you as you sing the song...");
4682 p_ptr->magic_num1[0] = MUSIC_H_LIFE;
4684 case 29: /* ºÆÀ¸¤Î²Î */
4686 msg_print("°Å¹õ¤ÎÃæ¤Ë¸÷¤ÈÈþ¤ò¤Õ¤ê¤Þ¤¤¤¿¡£ÂΤ¬¸µ¤Î³èÎϤò¼è¤êÌᤷ¤¿¡£");
4688 msg_print("You strewed light and beauty in the dark as you sing. You feel refreshed.");
4690 (void)do_res_stat(A_STR);
4691 (void)do_res_stat(A_INT);
4692 (void)do_res_stat(A_WIS);
4693 (void)do_res_stat(A_DEX);
4694 (void)do_res_stat(A_CON);
4695 (void)do_res_stat(A_CHR);
4696 (void)restore_level();
4698 case 30: /* shriek of death ¥µ¥¦¥í¥ó¤ÎËâ½Ñ */
4699 if (!get_aim_dir(&dir)) return FALSE;
4700 fire_ball(GF_SOUND, dir, damroll(50 + plev, 10), 0);
4702 case 31: /* song of liberty ¥Õ¥£¥ó¥´¥ë¥Õ¥£¥ó¤ÎÄ©Àï */
4704 msg_print("¥Õ¥£¥ó¥´¥ë¥Õ¥£¥ó¤Î̽²¦¤Ø¤ÎÄ©Àï¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4706 msg_print("You recall the valor of Fingolfin's challenge to the Dark Lord...");
4708 p_ptr->magic_num1[0] = MUSIC_INVULN;
4711 p_ptr->redraw |= (PR_MAP);
4713 /* Update monsters */
4714 p_ptr->update |= (PU_MONSTERS);
4717 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4721 msg_format("̤ÃΤβÎ(%d)¤ò²Î¤Ã¤¿¡£", spell);
4723 msg_format("You sing an unknown song: %d.", spell);
4728 if (p_ptr->magic_num1[0]) set_action(ACTION_SING);
4730 /* Recalculate bonuses */
4731 p_ptr->update |= (PU_BONUS | PU_HP);
4733 /* Redraw status bar */
4734 p_ptr->redraw |= (PR_STATUS);
4742 void do_cmd_cast(void)
4744 int item, sval, spell, realm;
4759 /* Require spell ability */
4760 if (!p_ptr->realm1 && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE))
4763 msg_print("¼öʸ¤ò¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4765 msg_print("You cannot cast spells!");
4772 if (p_ptr->blind || no_lite())
4774 if (p_ptr->pclass == CLASS_FORCETRAINER) confirm_use_force(FALSE);
4778 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡ª");
4780 msg_print("You cannot see!");
4787 /* Not when confused */
4788 if (p_ptr->confused)
4791 msg_print("º®Í𤷤Ƥ¤¤Æ¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4793 msg_print("You are too confused!");
4799 if (p_ptr->pclass == CLASS_FORCETRAINER)
4801 if (player_has_no_spellbooks())
4803 confirm_use_force(FALSE);
4806 select_the_force = TRUE;
4809 prayer = spell_category_name(mp_ptr->spell_book);
4811 /* Restrict choices to spell books */
4812 item_tester_tval = mp_ptr->spell_book;
4816 q = "¤É¤Î¼öʸ½ñ¤ò»È¤¤¤Þ¤¹¤«? ";
4818 q = "Use which book? ";
4822 s = "¼öʸ½ñ¤¬¤Ê¤¤¡ª";
4824 s = "You have no spell books!";
4827 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR)))
4829 select_the_force = FALSE;
4832 select_the_force = FALSE;
4834 if (item == INVEN_FORCE) /* the_force */
4840 /* Get the item (in the pack) */
4843 o_ptr = &inventory[item];
4846 /* Get the item (on the floor) */
4849 o_ptr = &o_list[0 - item];
4852 /* Access the item's sval */
4855 if ((p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE) && (o_ptr->tval == REALM2_BOOK)) increment = 32;
4858 /* Track the object kind */
4859 object_kind_track(o_ptr->k_idx);
4861 /* Hack -- Handle stuff */
4864 if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
4865 realm = o_ptr->tval - TV_LIFE_BOOK + 1;
4866 else if (increment) realm = p_ptr->realm2;
4867 else realm = p_ptr->realm1;
4869 /* Ask for a spell */
4871 if (!get_spell(&spell,
4872 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "±Ó¾§¤¹¤ë" : (mp_ptr->spell_book == TV_MUSIC_BOOK) ? "²Î¤¦" : "¾§¤¨¤ë"),
4875 if (spell == -2) msg_format("¤½¤ÎËܤˤÏÃΤäƤ¤¤ë%s¤¬¤Ê¤¤¡£", prayer);
4879 if (!get_spell(&spell, ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "recite" : "cast"),
4883 msg_format("You don't know any %ss in that book.", prayer);
4889 use_realm = tval2realm(o_ptr->tval);
4891 if (!is_magic(use_realm))
4893 s_ptr = &technic_info[use_realm - MIN_TECHNIC][spell];
4897 s_ptr = &mp_ptr->info[realm - 1][spell];
4900 /* Extract mana consumption rate */
4901 need_mana = mod_need_mana(s_ptr->smana, spell, realm);
4903 /* Verify "dangerous" spells */
4904 if (need_mana > p_ptr->csp)
4906 if (flush_failure) flush();
4910 msg_format("¤½¤Î%s¤ò%s¤Î¤Ë½½Ê¬¤Ê¥Þ¥¸¥Ã¥¯¥Ý¥¤¥ó¥È¤¬¤Ê¤¤¡£",prayer,
4911 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "±Ó¾§¤¹¤ë" : (mp_ptr->spell_book == TV_LIFE_BOOK) ? "²Î¤¦" : "¾§¤¨¤ë"));
4913 msg_format("You do not have enough mana to %s this %s.",
4914 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "recite" : "cast"),
4919 if (!over_exert) return;
4923 if (!get_check_strict("¤½¤ì¤Ç¤âÄ©À路¤Þ¤¹¤«? ", CHECK_OKAY_CANCEL)) return;
4925 if (!get_check_strict("Attempt it anyway? ", CHECK_OKAY_CANCEL)) return;
4931 /* Spell failure chance */
4932 chance = spell_chance(spell, use_realm);
4935 if (randint0(100) < chance)
4937 if (flush_failure) flush();
4940 msg_format("%s¤ò¤¦¤Þ¤¯¾§¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡ª", prayer);
4942 msg_format("You failed to get the %s off!", prayer);
4950 if (randint1(100) < chance) chg_virtue(V_VITALITY, -1);
4953 if (randint1(100) < chance) chg_virtue(V_UNLIFE, -1);
4956 if (randint1(100) < chance) chg_virtue(V_NATURE, -1);
4959 if (randint1(100) < chance) chg_virtue(V_JUSTICE, 1);
4962 if (randint1(100) < chance) chg_virtue(V_JUSTICE, -1);
4965 if (randint1(100) < chance) chg_virtue(V_KNOWLEDGE, -1);
4969 if (realm == REALM_TRUMP)
4971 cast_trump_spell(spell, FALSE);
4973 else if ((o_ptr->tval == TV_CHAOS_BOOK) && (randint1(100) < spell))
4976 msg_print("¥«¥ª¥¹Åª¤Ê¸ú²Ì¤òȯÀ¸¤·¤¿¡ª");
4978 msg_print("You produce a chaotic effect!");
4983 else if ((o_ptr->tval == TV_DEATH_BOOK) && (randint1(100) < spell))
4985 if ((sval == 3) && one_in_(2))
4987 sanity_blast(0, TRUE);
4992 msg_print("Äˤ¤¡ª");
4994 msg_print("It hurts!");
4998 take_hit(DAMAGE_LOSELIFE, damroll(o_ptr->sval + 1, 6), "°Å¹õËâË¡¤ÎµÕή", -1);
5000 take_hit(DAMAGE_LOSELIFE, damroll(o_ptr->sval + 1, 6), "a miscast Death spell", -1);
5003 if ((spell > 15) && one_in_(6) && !p_ptr->hold_life)
5004 lose_exp(spell * 250);
5007 else if ((o_ptr->tval == TV_MUSIC_BOOK) && (randint1(200) < spell))
5010 msg_print("¤¤¤ä¤Ê²»¤¬¶Á¤¤¤¿");
5012 msg_print("An infernal sound echoed.");
5015 aggravate_monsters(0);
5017 if (randint1(100) >= chance)
5018 chg_virtue(V_CHANCE,-1);
5027 case REALM_LIFE: /* * LIFE * */
5028 cast = cast_life_spell(spell);
5030 case REALM_SORCERY: /* * SORCERY * */
5031 cast = cast_sorcery_spell(spell);
5033 case REALM_NATURE: /* * NATURE * */
5034 cast = cast_nature_spell(spell);
5036 case REALM_CHAOS: /* * CHAOS * */
5037 cast = cast_chaos_spell(spell);
5039 case REALM_DEATH: /* * DEATH * */
5040 cast = cast_death_spell(spell);
5042 case REALM_TRUMP: /* TRUMP */
5043 cast = cast_trump_spell(spell, TRUE);
5045 case REALM_ARCANE: /* ARCANE */
5046 cast = cast_arcane_spell(spell);
5048 case REALM_ENCHANT: /* ENCHANT */
5049 cast = cast_enchant_spell(spell);
5051 case REALM_DAEMON: /* DAEMON */
5052 cast = cast_daemon_spell(spell);
5054 case REALM_CRUSADE: /* CRUSADE */
5055 cast = cast_crusade_spell(spell);
5057 case REALM_MUSIC: /* MUSIC */
5058 cast = cast_music_spell(spell);
5062 msg_format("You cast a spell from an unknown realm: realm %d, spell %d.", realm, spell);
5066 /* Canceled spells cost neither a turn nor mana */
5069 if (randint1(100) < chance)
5070 chg_virtue(V_CHANCE,1);
5072 /* A spell was cast */
5074 (p_ptr->spell_worked2 & (1L << spell)) :
5075 (p_ptr->spell_worked1 & (1L << spell)))
5076 && (p_ptr->pclass != CLASS_SORCERER)
5077 && (p_ptr->pclass != CLASS_RED_MAGE))
5079 int e = s_ptr->sexp;
5081 /* The spell worked */
5082 if (realm == p_ptr->realm1)
5084 p_ptr->spell_worked1 |= (1L << spell);
5088 p_ptr->spell_worked2 |= (1L << spell);
5091 /* Gain experience */
5092 gain_exp(e * s_ptr->slevel);
5094 /* Redraw object recall */
5095 p_ptr->window |= (PW_OBJECT);
5100 chg_virtue(V_TEMPERANCE, 1);
5101 chg_virtue(V_COMPASSION, 1);
5102 chg_virtue(V_VITALITY, 1);
5103 chg_virtue(V_DILIGENCE, 1);
5106 chg_virtue(V_UNLIFE, 1);
5107 chg_virtue(V_JUSTICE, -1);
5108 chg_virtue(V_FAITH, -1);
5109 chg_virtue(V_VITALITY, -1);
5112 chg_virtue(V_JUSTICE, -1);
5113 chg_virtue(V_FAITH, -1);
5114 chg_virtue(V_HONOUR, -1);
5115 chg_virtue(V_TEMPERANCE, -1);
5118 chg_virtue(V_FAITH, 1);
5119 chg_virtue(V_JUSTICE, 1);
5120 chg_virtue(V_SACRIFICE, 1);
5121 chg_virtue(V_HONOUR, 1);
5124 chg_virtue(V_NATURE, 1);
5125 chg_virtue(V_HARMONY, 1);
5128 chg_virtue(V_KNOWLEDGE, 1);
5135 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_TEMPERANCE, 1);
5136 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_COMPASSION, 1);
5137 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_VITALITY, 1);
5138 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_DILIGENCE, 1);
5141 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_UNLIFE, 1);
5142 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_JUSTICE, -1);
5143 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_FAITH, -1);
5144 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_VITALITY, -1);
5147 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_JUSTICE, -1);
5148 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_FAITH, -1);
5149 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_HONOUR, -1);
5150 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_TEMPERANCE, -1);
5153 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_FAITH, 1);
5154 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_JUSTICE, 1);
5155 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_SACRIFICE, 1);
5156 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_HONOUR, 1);
5159 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_NATURE, 1);
5160 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_HARMONY, 1);
5163 if (mp_ptr->spell_xtra & MAGIC_GAIN_EXP)
5165 s16b cur_exp = p_ptr->spell_exp[(increment ? 32 : 0)+spell];
5168 if (cur_exp < SPELL_EXP_BEGINNER)
5170 else if (cur_exp < SPELL_EXP_SKILLED)
5172 if ((dun_level > 4) && ((dun_level + 10) > p_ptr->lev))
5175 else if (cur_exp < SPELL_EXP_EXPERT)
5177 if (((dun_level + 5) > p_ptr->lev) && ((dun_level + 5) > s_ptr->slevel))
5180 else if ((cur_exp < SPELL_EXP_MASTER) && !increment)
5182 if (((dun_level + 5) > p_ptr->lev) && (dun_level > s_ptr->slevel))
5185 p_ptr->spell_exp[(increment ? 32 : 0) + spell] += exp_gain;
5192 /* Sufficient mana */
5193 if (need_mana <= p_ptr->csp)
5196 p_ptr->csp -= need_mana;
5199 /* Over-exert the player */
5202 int oops = need_mana;
5206 p_ptr->csp_frac = 0;
5210 msg_print("Àº¿À¤ò½¸Ã椷¤¹¤®¤Æµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
5212 msg_print("You faint from the effort!");
5216 /* Hack -- Bypass free action */
5217 (void)set_paralyzed(p_ptr->paralyzed + randint1(5 * oops + 1));
5222 chg_virtue(V_VITALITY, -10);
5225 chg_virtue(V_UNLIFE, -10);
5228 chg_virtue(V_JUSTICE, 10);
5231 chg_virtue(V_NATURE, -10);
5234 chg_virtue(V_JUSTICE, -10);
5237 chg_virtue(V_KNOWLEDGE, -10);
5241 /* Damage CON (possibly permanently) */
5242 if (randint0(100) < 50)
5244 bool perm = (randint0(100) < 25);
5248 msg_print("ÂΤò°¤¯¤·¤Æ¤·¤Þ¤Ã¤¿¡ª");
5250 msg_print("You have damaged your health!");
5254 /* Reduce constitution */
5255 (void)dec_stat(A_CON, 15 + randint1(10), perm);
5260 p_ptr->redraw |= (PR_MANA);
5263 p_ptr->window |= (PW_PLAYER);
5264 p_ptr->window |= (PW_SPELL);
5269 * Pray a prayer -- Unused in Hengband
5271 void do_cmd_pray(void)
5273 msg_print("Praying is not used in Hengband. Use magic spell casting instead.");
5276 static bool ang_sort_comp_pet_dismiss(vptr u, vptr v, int a, int b)
5278 u16b *who = (u16b*)(u);
5283 monster_type *m_ptr1 = &m_list[w1];
5284 monster_type *m_ptr2 = &m_list[w2];
5285 monster_race *r_ptr1 = &r_info[m_ptr1->r_idx];
5286 monster_race *r_ptr2 = &r_info[m_ptr2->r_idx];
5291 if (w1 == p_ptr->riding) return TRUE;
5292 if (w2 == p_ptr->riding) return FALSE;
5294 if (m_ptr1->nickname && !m_ptr2->nickname) return TRUE;
5295 if (m_ptr2->nickname && !m_ptr1->nickname) return FALSE;
5297 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return TRUE;
5298 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return FALSE;
5300 if (r_ptr1->level > r_ptr2->level) return TRUE;
5301 if (r_ptr2->level > r_ptr1->level) return FALSE;
5303 if (m_ptr1->hp > m_ptr2->hp) return TRUE;
5304 if (m_ptr2->hp > m_ptr1->hp) return FALSE;
5309 int calculate_upkeep(void)
5311 s32b old_friend_align = friend_align;
5313 bool have_a_unique = FALSE;
5316 total_friend_levels = 0;
5319 for (m_idx = m_max - 1; m_idx >=1; m_idx--)
5321 monster_type *m_ptr;
5322 monster_race *r_ptr;
5324 m_ptr = &m_list[m_idx];
5325 if (!m_ptr->r_idx) continue;
5326 r_ptr = &r_info[m_ptr->r_idx];
5331 if (r_ptr->flags1 & RF1_UNIQUE)
5333 if (p_ptr->pclass == CLASS_CAVALRY)
5335 if (p_ptr->riding == m_idx)
5336 total_friend_levels += (r_ptr->level+5)*2;
5337 else if (!have_a_unique && (r_info[m_ptr->r_idx].flags7 & RF7_RIDING))
5338 total_friend_levels += (r_ptr->level+5)*7/2;
5340 total_friend_levels += (r_ptr->level+5)*10;
5341 have_a_unique = TRUE;
5344 total_friend_levels += (r_ptr->level+5)*10;
5347 total_friend_levels += r_ptr->level;
5349 /* Determine pet alignment */
5350 if (r_ptr->flags3 & RF3_GOOD) friend_align += r_ptr->level;
5351 if (r_ptr->flags3 & RF3_EVIL) friend_align -= r_ptr->level;
5354 if (old_friend_align != friend_align) p_ptr->update |= (PU_BONUS);
5358 upkeep_factor = (total_friend_levels - (p_ptr->lev * 80 / (cp_ptr->pet_upkeep_div)));
5359 if (upkeep_factor < 0) upkeep_factor = 0;
5360 if (upkeep_factor > 1000) upkeep_factor = 1000;
5361 return upkeep_factor;
5367 void do_cmd_pet_dismiss(void)
5369 monster_type *m_ptr;
5370 bool all_pets = FALSE;
5384 /* Allocate the "who" array */
5385 C_MAKE(who, max_m_idx, u16b);
5387 /* Process the monsters (backwards) */
5388 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
5390 if (is_pet(&m_list[pet_ctr]))
5391 who[max_pet++] = pet_ctr;
5394 /* Select the sort method */
5395 ang_sort_comp = ang_sort_comp_pet_dismiss;
5396 ang_sort_swap = ang_sort_swap_hook;
5398 ang_sort(who, &dummy_why, max_pet);
5400 /* Process the monsters (backwards) */
5401 for (i = 0; i < max_pet; i++)
5404 char friend_name[80];
5408 /* Access the monster */
5410 m_ptr = &m_list[pet_ctr];
5412 delete_this = FALSE;
5413 kakunin = ((pet_ctr == p_ptr->riding) || (m_ptr->nickname));
5414 monster_desc(friend_name, m_ptr, MD_ASSUME_VISIBLE);
5418 /* Hack -- health bar for this monster */
5419 health_track(pet_ctr);
5421 /* Hack -- handle stuff */
5425 sprintf(buf, "%s¤òÊü¤·¤Þ¤¹¤«¡© [Yes/No/Unnamed (%dÂÎ)]", friend_name, max_pet - i);
5427 sprintf(buf, "Dismiss %s? [Yes/No/Unnamed (%d remain)]", friend_name, max_pet - i);
5432 move_cursor_relative(m_ptr->fy, m_ptr->fx);
5438 if (ch == 'Y' || ch == 'y')
5445 sprintf(buf, "ËÜÅö¤Ë¤è¤í¤·¤¤¤Ç¤¹¤«¡© (%s) ", friend_name);
5447 sprintf(buf, "Are you sure? (%s) ", friend_name);
5449 if (!get_check(buf))
5450 delete_this = FALSE;
5455 if (ch == 'U' || ch == 'u')
5461 if (ch == ESCAPE || ch == 'N' || ch == 'n')
5468 if ((all_pets && !kakunin) || (!all_pets && delete_this))
5470 if (record_named_pet && m_ptr->nickname)
5474 monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
5475 do_cmd_write_nikki(NIKKI_NAMED_PET, 2, m_name);
5478 if (pet_ctr == p_ptr->riding)
5481 msg_format("%s¤«¤é¹ß¤ê¤¿¡£", friend_name);
5483 msg_format("You have got off %s. ", friend_name);
5488 /* Update the monsters */
5489 p_ptr->update |= (PU_BONUS | PU_MONSTERS);
5490 p_ptr->redraw |= (PR_EXTRA | PR_UHEALTH);
5493 /* HACK : Add the line to message buffer */
5495 sprintf(buf, "%s ¤òÊü¤·¤¿¡£", friend_name);
5497 sprintf(buf, "Dismissed %s.", friend_name);
5500 p_ptr->window |= (PW_MESSAGE);
5503 delete_monster_idx(pet_ctr);
5512 C_KILL(who, max_m_idx, u16b);
5515 msg_format("%d ÂΤΥڥåȤòÊü¤·¤Þ¤·¤¿¡£", Dismissed);
5517 msg_format("You have dismissed %d pet%s.", Dismissed,
5518 (Dismissed == 1 ? "" : "s"));
5520 if (Dismissed == 0 && all_pets)
5522 msg_print("'U'nnamed ¤Ï¡¢¾èÇϰʳ°¤Î̾Á°¤Î¤Ê¤¤¥Ú¥Ã¥È¤À¤±¤òÁ´¤Æ²òÊü¤·¤Þ¤¹¡£");
5524 msg_print("'U'nnamed means all your pets except named pets and your mount.");
5527 p_ptr->update |= (PU_MON_LITE);
5530 bool rakuba(int dam, bool force)
5532 int i, y, x, oy, ox;
5533 int sn = 0, sy = 0, sx = 0;
5535 monster_type *m_ptr = &m_list[p_ptr->riding];
5536 monster_race *r_ptr = &r_info[m_ptr->r_idx];
5538 if (!p_ptr->riding) return FALSE;
5539 if (p_ptr->wild_mode) return FALSE;
5541 if (dam >= 0 || force)
5545 int cur = p_ptr->skill_exp[GINOU_RIDING];
5546 int max = s_info[p_ptr->pclass].s_max[GINOU_RIDING];
5547 int ridinglevel = r_ptr->level;
5549 /* ÍîÇϤΤ·¤ä¤¹¤µ */
5550 int rakubalevel = r_ptr->level;
5551 if (p_ptr->riding_ryoute) rakubalevel += 20;
5553 if ((cur < max) && (max > 1000) &&
5554 (dam / 2 + ridinglevel) > (cur / 30 + 10))
5558 if (ridinglevel > (cur / 100 + 15))
5559 inc += 1 + (ridinglevel - cur / 100 - 15);
5563 p_ptr->skill_exp[GINOU_RIDING] = MIN(max, cur + inc);
5566 /* ¥ì¥Ù¥ë¤ÎÄ㤤¾èÇϤ«¤é¤ÏÍîÇϤ·¤Ë¤¯¤¤ */
5567 if (randint0(dam / 2 + rakubalevel * 2) < cur / 30 + 10)
5569 if ((((p_ptr->pclass == CLASS_BEASTMASTER) || (p_ptr->pclass == CLASS_CAVALRY)) && !p_ptr->riding_ryoute) || !one_in_(p_ptr->lev*(p_ptr->riding_ryoute ? 2 : 3) + 30))
5576 /* Check around the player */
5577 for (i = 0; i < 8; i++)
5581 /* Access the location */
5582 y = py + ddy_ddd[i];
5583 x = px + ddx_ddd[i];
5585 c_ptr = &cave[y][x];
5587 /* Skip non-empty grids */
5588 if (cave_perma_grid(c_ptr)) continue;
5589 if (!cave_empty_grid2(c_ptr)) continue;
5591 if (c_ptr->m_idx) continue;
5593 /* Count "safe" grids */
5596 /* Randomize choice */
5597 if (randint0(sn) > 0) continue;
5599 /* Save the safe location */
5604 monster_desc(m_name, m_ptr, 0);
5606 msg_format("%s¤«¤é¿¶¤êÍî¤È¤µ¤ì¤½¤¦¤Ë¤Ê¤Ã¤Æ¡¢Êɤˤ֤Ĥ«¤Ã¤¿¡£",m_name);
5607 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "Êɤؤξ×ÆÍ", -1);
5609 msg_format("You have nearly fallen from %s, but bumped into wall.",m_name);
5610 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "bumping into wall", -1);
5621 /* Redraw the old spot */
5624 /* Redraw the new spot */
5627 /* Check for new panel */
5632 p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5633 p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE;
5637 p_ptr->update |= (PU_BONUS);
5640 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
5642 /* Update the monsters */
5643 p_ptr->update |= (PU_DISTANCE);
5646 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5648 p_ptr->redraw |= (PR_EXTRA);
5650 /* Update health track of mount */
5651 p_ptr->redraw |= (PR_UHEALTH);
5653 if (p_ptr->ffall && !force)
5655 monster_desc(m_name, m_ptr, 0);
5657 msg_format("%s¤«¤éÍî¤Á¤¿¤¬¡¢¶õÃæ¤Ç¤¦¤Þ¤¯ÂÎÀª¤òΩ¤Æľ¤·¤ÆÃåÃϤ·¤¿¡£",m_name);
5659 msg_format("You are thrown from %s, but make a good landing.",m_name);
5664 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "ÍîÇÏ", -1);
5666 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "Falling from riding", -1);
5672 bool do_riding(bool force)
5674 int oy, ox, x, y, dir = 0;
5676 monster_type *m_ptr;
5678 if (!get_rep_dir2(&dir)) return FALSE;
5681 c_ptr = &cave[y][x];
5683 if (p_ptr->special_defense & KATA_MUSOU) set_action(ACTION_NONE);
5687 /* Skip non-empty grids */
5688 if (!cave_empty_bold2(y, x) || c_ptr->m_idx)
5691 msg_print("¤½¤Á¤é¤Ë¤Ï¹ß¤ê¤é¤ì¤Þ¤»¤ó¡£");
5693 msg_print("You cannot go to that direction.");
5698 if (!pattern_seq(py, px, y, x)) return FALSE;
5701 p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5702 p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE;
5706 if (p_ptr->confused)
5709 msg_print("º®Í𤷤Ƥ¤¤Æ¾è¤ì¤Ê¤¤¡ª");
5711 msg_print("You are too confused!");
5716 m_ptr = &m_list[c_ptr->m_idx];
5718 if (!c_ptr->m_idx || !m_ptr->ml)
5721 msg_print("¤½¤Î¾ì½ê¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
5723 msg_print("Here is no monster.");
5729 if (!is_pet(m_ptr) && !force)
5732 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï¥Ú¥Ã¥È¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£");
5734 msg_print("That monster is not a pet.");
5739 if (!(r_info[m_ptr->r_idx].flags7 & RF7_RIDING))
5742 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ë¤Ï¾è¤ì¤Ê¤µ¤½¤¦¤À¡£");
5744 msg_print("This monster doesn't seem suitable for riding.");
5749 if (!(p_ptr->pass_wall) && (c_ptr->feat >= FEAT_RUBBLE) && (c_ptr->feat <= FEAT_PERM_SOLID))
5752 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤ÏÊɤÎÃæ¤Ë¤¤¤ë¡£");
5754 msg_print("This monster is in the wall.");
5759 if (!pattern_seq(py, px, y, x)) return FALSE;
5760 if (r_info[m_ptr->r_idx].level > randint1((p_ptr->skill_exp[GINOU_RIDING] / 50 + p_ptr->lev / 2 + 20)))
5763 msg_print("¤¦¤Þ¤¯¾è¤ì¤Ê¤«¤Ã¤¿¡£");
5765 msg_print("You failed to ride.");
5775 monster_desc(m_name, m_ptr, 0);
5778 msg_format("%s¤òµ¯¤³¤·¤¿¡£", m_name);
5780 msg_format("You have waked %s up.", m_name);
5784 p_ptr->riding = c_ptr->m_idx;
5786 /* Hack -- remove tracked monster */
5787 if (p_ptr->riding == p_ptr->health_who) health_track(0);
5790 /* Save the old location */
5794 /* Move the player to the safe location */
5798 /* Redraw the old spot */
5801 /* Redraw the new spot */
5804 /* Check for new panel */
5809 /* Mega-Hack -- Forget the view and lite */
5810 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
5813 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
5815 /* Update the monsters */
5816 p_ptr->update |= (PU_DISTANCE);
5818 /* Update the monsters */
5819 p_ptr->update |= (PU_BONUS);
5822 p_ptr->redraw |= (PR_MAP | PR_EXTRA);
5825 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5827 p_ptr->redraw |= (PR_UHEALTH);
5833 static void do_name_pet(void)
5835 monster_type *m_ptr;
5838 bool old_name = FALSE;
5839 bool old_target_pet = target_pet;
5842 if (!target_set(TARGET_KILL))
5844 target_pet = old_target_pet;
5847 target_pet = old_target_pet;
5849 if (cave[target_row][target_col].m_idx)
5851 m_ptr = &m_list[cave[target_row][target_col].m_idx];
5857 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï¥Ú¥Ã¥È¤Ç¤Ï¤Ê¤¤¡£");
5859 msg_format("This monster is not a pet.");
5863 if (r_info[m_ptr->r_idx].flags1 & RF1_UNIQUE)
5866 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Î̾Á°¤ÏÊѤ¨¤é¤ì¤Ê¤¤¡ª");
5868 msg_format("You cannot change name of this monster!");
5872 monster_desc(m_name, m_ptr, 0);
5876 msg_format("%s¤Ë̾Á°¤ò¤Ä¤±¤ë¡£", m_name);
5878 msg_format("Name %s.", m_name);
5883 /* Start with nothing */
5884 strcpy(out_val, "");
5886 /* Use old inscription */
5887 if (m_ptr->nickname)
5889 /* Start with the old inscription */
5890 strcpy(out_val, quark_str(m_ptr->nickname));
5894 /* Get a new inscription (possibly empty) */
5896 if (get_string("̾Á°: ", out_val, 15))
5898 if (get_string("Name: ", out_val, 15))
5904 /* Save the inscription */
5905 m_ptr->nickname = quark_add(out_val);
5906 if (record_named_pet)
5910 monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
5911 do_cmd_write_nikki(NIKKI_NAMED_PET, 0, m_name);
5916 if (record_named_pet && old_name)
5920 monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
5921 do_cmd_write_nikki(NIKKI_NAMED_PET, 1, m_name);
5923 m_ptr->nickname = 0;
5930 * Issue a pet command
5932 void do_cmd_pet(void)
5937 cptr power_desc[36];
5943 monster_type *m_ptr;
5950 char target_buf[160];
5955 power_desc[num] = "¥Ú¥Ã¥È¤òÊü¤¹";
5957 power_desc[num] = "dismiss pets";
5960 powers[num++] = PET_DISMISS;
5963 sprintf(target_buf,"¥Ú¥Ã¥È¤Î¥¿¡¼¥²¥Ã¥È¤ò»ØÄê (¸½ºß¡§%s)",
5964 (pet_t_m_idx ? r_name + r_info[m_list[pet_t_m_idx].r_idx].name : "»ØÄê¤Ê¤·"));
5966 sprintf(target_buf,"specify a target of pet (now:%s)",
5967 (pet_t_m_idx ? r_name + r_info[m_list[pet_t_m_idx].r_idx].name : "nothing"));
5969 power_desc[num] = target_buf;
5971 powers[num++] = PET_TARGET;
5974 power_desc[num] = "¶á¤¯¤Ë¤¤¤í";
5976 power_desc[num] = "stay close";
5979 if (p_ptr->pet_follow_distance == PET_CLOSE_DIST) mode = num;
5980 powers[num++] = PET_STAY_CLOSE;
5983 power_desc[num] = "¤Ä¤¤¤ÆÍ褤";
5985 power_desc[num] = "follow me";
5988 if (p_ptr->pet_follow_distance == PET_FOLLOW_DIST) mode = num;
5989 powers[num++] = PET_FOLLOW_ME;
5992 power_desc[num] = "Ũ¤ò¸«¤Ä¤±¤ÆÅݤ»";
5994 power_desc[num] = "seek and destroy";
5997 if (p_ptr->pet_follow_distance == PET_DESTROY_DIST) mode = num;
5998 powers[num++] = PET_SEEK_AND_DESTROY;
6001 power_desc[num] = "¾¯¤·Î¥¤ì¤Æ¤¤¤í";
6003 power_desc[num] = "give me space";
6006 if (p_ptr->pet_follow_distance == PET_SPACE_DIST) mode = num;
6007 powers[num++] = PET_ALLOW_SPACE;
6010 power_desc[num] = "Î¥¤ì¤Æ¤¤¤í";
6012 power_desc[num] = "stay away";
6015 if (p_ptr->pet_follow_distance == PET_AWAY_DIST) mode = num;
6016 powers[num++] = PET_STAY_AWAY;
6018 if (p_ptr->pet_extra_flags & PF_OPEN_DOORS)
6021 power_desc[num] = "¥É¥¢¤ò³«¤±¤ë (¸½ºß:ON)";
6023 power_desc[num] = "pets open doors (now On)";
6030 power_desc[num] = "¥É¥¢¤ò³«¤±¤ë (¸½ºß:OFF)";
6032 power_desc[num] = "pets open doors (now Off)";
6036 powers[num++] = PET_OPEN_DOORS;
6038 if (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS)
6041 power_desc[num] = "¥¢¥¤¥Æ¥à¤ò½¦¤¦ (¸½ºß:ON)";
6043 power_desc[num] = "pets pick up items (now On)";
6050 power_desc[num] = "¥¢¥¤¥Æ¥à¤ò½¦¤¦ (¸½ºß:OFF)";
6052 power_desc[num] = "pets pick up items (now Off)";
6056 powers[num++] = PET_TAKE_ITEMS;
6058 if (p_ptr->pet_extra_flags & PF_TELEPORT)
6061 power_desc[num] = "¥Æ¥ì¥Ý¡¼¥È·ÏËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6063 power_desc[num] = "allow teleport (now On)";
6070 power_desc[num] = "¥Æ¥ì¥Ý¡¼¥È·ÏËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6072 power_desc[num] = "allow teleport (now Off)";
6076 powers[num++] = PET_TELEPORT;
6078 if (p_ptr->pet_extra_flags & PF_ATTACK_SPELL)
6081 power_desc[num] = "¹¶·âËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6083 power_desc[num] = "allow cast attack spell (now On)";
6090 power_desc[num] = "¹¶·âËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6092 power_desc[num] = "allow cast attack spell (now Off)";
6096 powers[num++] = PET_ATTACK_SPELL;
6098 if (p_ptr->pet_extra_flags & PF_SUMMON_SPELL)
6101 power_desc[num] = "¾¤´ËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6103 power_desc[num] = "allow cast summon spell (now On)";
6110 power_desc[num] = "¾¤´ËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6112 power_desc[num] = "allow cast summon spell (now Off)";
6116 powers[num++] = PET_SUMMON_SPELL;
6118 if (p_ptr->pet_extra_flags & PF_BALL_SPELL)
6121 power_desc[num] = "¥×¥ì¥¤¥ä¡¼¤ò´¬¤¹þ¤àÈÏ°ÏËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6123 power_desc[num] = "allow involve player in area spell (now On)";
6130 power_desc[num] = "¥×¥ì¥¤¥ä¡¼¤ò´¬¤¹þ¤àÈÏ°ÏËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6132 power_desc[num] = "allow involve player in area spell (now Off)";
6136 powers[num++] = PET_BALL_SPELL;
6141 power_desc[num] = "¥Ú¥Ã¥È¤«¤é¹ß¤ê¤ë";
6143 power_desc[num] = "get off a pet";
6150 power_desc[num] = "¥Ú¥Ã¥È¤Ë¾è¤ë";
6152 power_desc[num] = "ride a pet";
6156 powers[num++] = PET_RIDING;
6159 power_desc[num] = "¥Ú¥Ã¥È¤Ë̾Á°¤ò¤Ä¤±¤ë";
6161 power_desc[num] = "name pets";
6164 powers[num++] = PET_NAME;
6166 if (p_ptr->riding && buki_motteruka(INVEN_RARM) && (empty_hands(FALSE) & 0x00000001) && ((inventory[INVEN_RARM].weight > 99) || (inventory[INVEN_RARM].tval == TV_POLEARM)))
6168 if (p_ptr->pet_extra_flags & PF_RYOUTE)
6171 power_desc[num] = "Éð´ï¤òÊÒ¼ê¤Ç»ý¤Ä";
6173 power_desc[num] = "use one hand to control a riding pet";
6180 power_desc[num] = "Éð´ï¤òξ¼ê¤Ç»ý¤Ä";
6182 power_desc[num] = "use both hands for a weapon.";
6187 powers[num++] = PET_RYOUTE;
6190 /* Nothing chosen yet */
6193 /* Build a prompt (accept all spells) */
6196 /* Build a prompt (accept all spells) */
6198 strnfmt(out_val, 78, "(¥³¥Þ¥ó¥É %c-%c¡¢'*'=°ìÍ÷¡¢ESC=½ªÎ») ¥³¥Þ¥ó¥É¤òÁª¤ó¤Ç¤¯¤À¤µ¤¤:",
6200 strnfmt(out_val, 78, "(Command %c-%c, *=List, ESC=exit) Select a command: ",
6203 I2A(0), I2A(num - 1));
6208 strnfmt(out_val, 78, "(¥³¥Þ¥ó¥É %c-%c¡¢'*'=°ìÍ÷¡¢ESC=½ªÎ») ¥³¥Þ¥ó¥É¤òÁª¤ó¤Ç¤¯¤À¤µ¤¤:",
6210 strnfmt(out_val, 78, "(Command %c-%c, *=List, ESC=exit) Select a command: ",
6213 I2A(0), '0' + num - 27);
6219 /* Save the screen */
6226 prt(format("%s%c) %s", (ctr == mode) ? "*" : " ", I2A(ctr), power_desc[ctr]), y + ctr, x);
6232 prt("", y + ctr, x);
6239 /* Get a command from the user */
6240 while (!flag && get_com(out_val, &choice, TRUE))
6242 /* Request redraw */
6243 if ((choice == ' ') || (choice == '*') || (choice == '?'))
6255 /* Save the screen */
6262 sprintf(buf, "%s%c) %s", (ctr == mode) ? "*" : " ", I2A(ctr), power_desc[ctr]);
6263 prt(buf, y + ctr, x);
6269 prt("", y + ctr, x);
6283 /* Restore the screen */
6291 if (isalpha(choice))
6294 ask = (isupper(choice));
6297 if (ask) choice = tolower(choice);
6299 /* Extract request */
6300 i = (islower(choice) ? A2I(choice) : -1);
6304 ask = FALSE; /* Can't uppercase digits */
6306 i = choice - '0' + 26;
6309 /* Totally Illegal */
6310 if ((i < 0) || (i >= num))
6321 strnfmt(buf, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡© ", power_desc[i]);
6323 strnfmt(buf, 78, "Use %s? ", power_desc[i]);
6327 /* Belay that order */
6328 if (!get_check(buf)) continue;
6335 /* Restore the screen */
6336 if (redraw) Term_load();
6338 /* Abort if needed */
6347 case PET_DISMISS: /* Dismiss pets */
6349 /* Check pets (backwards) */
6350 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
6352 /* Player has pet */
6353 if (is_pet(&m_list[pet_ctr])) break;
6359 msg_print("¥Ú¥Ã¥È¤¬¤¤¤Ê¤¤¡ª");
6361 msg_print("You have no pets!");
6365 do_cmd_pet_dismiss();
6366 (void)calculate_upkeep();
6371 project_length = -1;
6372 if (!target_set(TARGET_KILL)) pet_t_m_idx = 0;
6375 cave_type *c_ptr = &cave[target_row][target_col];
6376 if (c_ptr->m_idx && (m_list[c_ptr->m_idx].ml))
6378 pet_t_m_idx = cave[target_row][target_col].m_idx;
6379 p_ptr->pet_follow_distance = PET_DESTROY_DIST;
6381 else pet_t_m_idx = 0;
6388 case PET_STAY_CLOSE:
6390 p_ptr->pet_follow_distance = PET_CLOSE_DIST;
6397 p_ptr->pet_follow_distance = PET_FOLLOW_DIST;
6401 /* "Seek and destoy" */
6402 case PET_SEEK_AND_DESTROY:
6404 p_ptr->pet_follow_distance = PET_DESTROY_DIST;
6407 /* "Give me space" */
6408 case PET_ALLOW_SPACE:
6410 p_ptr->pet_follow_distance = PET_SPACE_DIST;
6416 p_ptr->pet_follow_distance = PET_AWAY_DIST;
6419 /* flag - allow pets to open doors */
6420 case PET_OPEN_DOORS:
6422 if (p_ptr->pet_extra_flags & PF_OPEN_DOORS) p_ptr->pet_extra_flags &= ~(PF_OPEN_DOORS);
6423 else p_ptr->pet_extra_flags |= (PF_OPEN_DOORS);
6426 /* flag - allow pets to pickup items */
6427 case PET_TAKE_ITEMS:
6429 if (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS)
6431 p_ptr->pet_extra_flags &= ~(PF_PICKUP_ITEMS);
6432 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
6434 /* Access the monster */
6435 m_ptr = &m_list[pet_ctr];
6439 monster_drop_carried_objects(m_ptr);
6443 else p_ptr->pet_extra_flags |= (PF_PICKUP_ITEMS);
6447 /* flag - allow pets to teleport */
6450 if (p_ptr->pet_extra_flags & PF_TELEPORT) p_ptr->pet_extra_flags &= ~(PF_TELEPORT);
6451 else p_ptr->pet_extra_flags |= (PF_TELEPORT);
6454 /* flag - allow pets to cast attack spell */
6455 case PET_ATTACK_SPELL:
6457 if (p_ptr->pet_extra_flags & PF_ATTACK_SPELL) p_ptr->pet_extra_flags &= ~(PF_ATTACK_SPELL);
6458 else p_ptr->pet_extra_flags |= (PF_ATTACK_SPELL);
6461 /* flag - allow pets to cast attack spell */
6462 case PET_SUMMON_SPELL:
6464 if (p_ptr->pet_extra_flags & PF_SUMMON_SPELL) p_ptr->pet_extra_flags &= ~(PF_SUMMON_SPELL);
6465 else p_ptr->pet_extra_flags |= (PF_SUMMON_SPELL);
6468 /* flag - allow pets to cast attack spell */
6469 case PET_BALL_SPELL:
6471 if (p_ptr->pet_extra_flags & PF_BALL_SPELL) p_ptr->pet_extra_flags &= ~(PF_BALL_SPELL);
6472 else p_ptr->pet_extra_flags |= (PF_BALL_SPELL);
6490 if (p_ptr->pet_extra_flags & PF_RYOUTE) p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
6491 else p_ptr->pet_extra_flags |= (PF_RYOUTE);
6492 p_ptr->update |= (PU_BONUS);