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 */
131 p_ptr->window |= (PW_SPELL);
136 /* Build a prompt (accept all spells) */
138 jverb1( prompt, jverb_buf );
139 (void) strnfmt(out_val, 78, "(%^s:%c-%c, '*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤Î%s¤ò%^s¤Þ¤¹¤«? ",
140 p, I2A(0), I2A(num - 1), p, jverb_buf );
142 (void)strnfmt(out_val, 78, "(%^ss %c-%c, *=List, ESC=exit) %^s which %s? ",
143 p, I2A(0), I2A(num - 1), prompt, p);
146 /* Get a spell from the user */
148 choice = (always_show_list || use_menu) ? ESCAPE : 1;
151 if (choice == ESCAPE) choice = ' ';
152 else if (!get_com(out_val, &choice, TRUE))break;
154 if (use_menu && choice != ' ')
168 menu_line += (num - 1);
190 if (menu_line > num) menu_line -= num;
191 /* Display a list of spells */
192 print_spells(menu_line, spells, num, 1, 15, use_realm);
198 if ((choice == ' ') || (choice == '*') || (choice == '?'))
206 /* Save the screen */
209 /* Display a list of spells */
210 print_spells(menu_line, spells, num, 1, 15, use_realm);
216 if (use_menu) continue;
221 /* Restore the screen */
231 ask = (isupper(choice));
234 if (ask) choice = tolower(choice);
236 /* Extract request */
237 i = (islower(choice) ? A2I(choice) : -1);
240 /* Totally Illegal */
241 if ((i < 0) || (i >= num))
247 /* Save the spell index */
250 /* Require "okay" spells */
251 if (!spell_okay(spell, learned, FALSE, use_realm))
255 msg_format("¤½¤Î%s¤ò%s¤³¤È¤Ï¤Ç¤¤Þ¤»¤ó¡£", p, prompt);
257 msg_format("You may not %s that %s.", prompt, p);
268 /* Access the spell */
269 if (!is_magic(use_realm))
271 s_ptr = &technic_info[use_realm - MIN_TECHNIC][spell];
275 s_ptr = &mp_ptr->info[use_realm - 1][spell];
278 /* Extract mana consumption rate */
279 if (use_realm == REALM_HISSATSU)
281 need_mana = s_ptr->smana;
285 need_mana = mod_need_mana(s_ptr->smana, spell, use_realm);
290 jverb1( prompt, jverb_buf );
291 /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½¤ËÂбþ */
292 (void) strnfmt(tmp_val, 78, "%s(MP%d, ¼ºÇÔΨ%d%%)¤ò%s¤Þ¤¹¤«? ",
293 spell_names[technic2magic(use_realm)-1][spell], need_mana,
294 spell_chance(spell, use_realm),jverb_buf);
296 (void)strnfmt(tmp_val, 78, "%^s %s (%d mana, %d%% fail)? ",
297 prompt, spell_names[technic2magic(use_realm)-1][spell], need_mana,
298 spell_chance(spell, use_realm));
302 /* Belay that order */
303 if (!get_check(tmp_val)) continue;
311 /* Restore the screen */
312 if (redraw) screen_load();
316 p_ptr->window |= (PW_SPELL);
322 /* Abort if needed */
323 if (!flag) return FALSE;
325 /* Save the choice */
328 #ifdef ALLOW_REPEAT /* TNB */
332 #endif /* ALLOW_REPEAT -- TNB */
339 static bool item_tester_learn_spell(object_type *o_ptr)
341 s32b choices = realm_choices2[p_ptr->pclass];
343 if (p_ptr->pclass == CLASS_PRIEST)
345 if (is_good_realm(p_ptr->realm1))
347 choices &= ~(CH_DEATH | CH_DAEMON);
351 choices &= ~(CH_LIFE | CH_CRUSADE);
355 if ((o_ptr->tval < TV_LIFE_BOOK) || (o_ptr->tval > (TV_LIFE_BOOK + MAX_REALM - 1))) return (FALSE);
356 if ((o_ptr->tval == TV_MUSIC_BOOK) && (p_ptr->pclass == CLASS_BARD)) return (TRUE);
357 else if (!is_magic(tval2realm(o_ptr->tval))) return FALSE;
358 if ((REALM1_BOOK == o_ptr->tval) || (REALM2_BOOK == o_ptr->tval)) return (TRUE);
359 if (choices & (0x0001 << (tval2realm(o_ptr->tval) - 1))) return (TRUE);
364 static bool player_has_no_spellbooks(void)
369 for (i = 0; i < INVEN_PACK; i++)
371 o_ptr = &inventory[i];
372 if (o_ptr->k_idx && check_book_realm(o_ptr->tval, o_ptr->sval)) return FALSE;
375 for (i = cave[py][px].o_idx; i; i = o_ptr->next_o_idx)
378 if (o_ptr->k_idx && check_book_realm(o_ptr->tval, o_ptr->sval)) return FALSE;
385 static void confirm_use_force(bool browse_only)
392 /* Get the item index */
393 if (repeat_pull(&item) && (item == INVEN_FORCE))
395 browse_only ? do_cmd_mind_browse() : do_cmd_mind();
399 #endif /* ALLOW_REPEAT */
401 /* Show the prompt */
403 prt("('w'Îýµ¤½Ñ, ESC) 'w'¤«ESC¤ò²¡¤·¤Æ¤¯¤À¤µ¤¤¡£ ", 0, 0);
405 prt("(w for the Force, ESC) Hit 'w' or ESC. ", 0, 0);
413 if (which == ESCAPE) break;
414 else if (which == 'w')
419 repeat_push(INVEN_FORCE);
421 #endif /* ALLOW_REPEAT */
427 /* Clear the prompt line */
432 browse_only ? do_cmd_mind_browse() : do_cmd_mind();
438 * Peruse the spells/prayers in a book
440 * Note that *all* spells in the book are listed
442 * Note that browsing is allowed while confused or blind,
443 * and in the dark, primarily to allow browsing in stores.
445 void do_cmd_browse(void)
447 int item, sval, use_realm = 0, j, line;
458 /* Warriors are illiterate */
459 if (!(p_ptr->realm1 || p_ptr->realm2) && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE))
462 msg_print("ËܤòÆɤळ¤È¤¬¤Ç¤¤Ê¤¤¡ª");
464 msg_print("You cannot read books!");
470 if (p_ptr->special_defense & KATA_MUSOU)
472 set_action(ACTION_NONE);
475 if (p_ptr->pclass == CLASS_FORCETRAINER)
477 if (player_has_no_spellbooks())
479 confirm_use_force(TRUE);
482 select_the_force = TRUE;
485 /* Restrict choices to "useful" books */
486 if (p_ptr->realm2 == REALM_NONE) item_tester_tval = mp_ptr->spell_book;
487 else item_tester_hook = item_tester_learn_spell;
491 q = "¤É¤ÎËܤòÆɤߤޤ¹¤«? ";
493 q = "Browse which book? ";
497 s = "Æɤá¤ëËܤ¬¤Ê¤¤¡£";
499 s = "You have no books that you can read.";
502 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR)))
504 select_the_force = FALSE;
507 select_the_force = FALSE;
509 if (item == INVEN_FORCE) /* the_force */
511 do_cmd_mind_browse();
515 /* Get the item (in the pack) */
518 o_ptr = &inventory[item];
521 /* Get the item (on the floor) */
524 o_ptr = &o_list[0 - item];
527 /* Access the item's sval */
530 use_realm = tval2realm(o_ptr->tval);
532 /* Track the object kind */
533 object_kind_track(o_ptr->k_idx);
535 /* Hack -- Handle stuff */
540 for (spell = 0; spell < 32; spell++)
542 /* Check for this spell */
543 if ((fake_spell_flags[sval] & (1L << spell)))
545 /* Collect this spell */
546 spells[num++] = spell;
551 /* Save the screen */
554 /* Clear the top line */
557 /* Keep browsing spells. Exit browsing on cancel. */
560 /* Ask for a spell, allow cancel */
562 if (!get_spell(&spell, "Æɤà", o_ptr->sval, TRUE, use_realm))
564 if (!get_spell(&spell, "browse", o_ptr->sval, TRUE, use_realm))
567 /* If cancelled, leave immediately. */
568 if (spell == -1) break;
570 /* Display a list of spells */
571 print_spells(0, spells, num, 1, 15, use_realm);
573 /* Notify that there's nothing to see, and wait. */
574 if (use_realm == REALM_HISSATSU)
576 prt("Æɤá¤ëµ»¤¬¤Ê¤¤¡£", 0, 0);
578 prt("No techniques to browse.", 0, 0);
582 prt("Æɤá¤ë¼öʸ¤¬¤Ê¤¤¡£", 0, 0);
584 prt("No spells to browse.", 0, 0);
589 /* Restore the screen */
595 /* Clear lines, position cursor (really should use strlen here) */
596 Term_erase(14, 14, 255);
597 Term_erase(14, 13, 255);
598 Term_erase(14, 12, 255);
599 Term_erase(14, 11, 255);
601 roff_to_buf(spell_tips[technic2magic(use_realm) - 1][spell], 62, temp, sizeof(temp));
602 for (j = 0, line = 11; temp[j]; j += 1 + strlen(&temp[j]))
604 prt(&temp[j], line, 15);
609 /* Restore the screen */
614 static void change_realm2(int next_realm)
619 for (i = 0; i < 64; i++)
621 p_ptr->spell_order[j] = p_ptr->spell_order[i];
622 if (p_ptr->spell_order[i] < 32) j++;
625 p_ptr->spell_order[j] = 99;
627 for (i = 32; i < 64; i++)
629 p_ptr->spell_exp[i] = SPELL_EXP_UNSKILLED;
631 p_ptr->spell_learned2 = 0L;
632 p_ptr->spell_worked2 = 0L;
633 p_ptr->spell_forgotten2 = 0L;
636 sprintf(tmp,"ËâË¡¤ÎÎΰè¤ò%s¤«¤é%s¤ËÊѹ¹¤·¤¿¡£", realm_names[p_ptr->realm2], realm_names[next_realm]);
638 sprintf(tmp,"change magic realm from %s to %s.", realm_names[p_ptr->realm2], realm_names[next_realm]);
640 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
641 p_ptr->old_realm |= 1 << (p_ptr->realm2-1);
642 p_ptr->realm2 = next_realm;
644 p_ptr->notice |= (PN_REORDER);
645 p_ptr->update |= (PU_SPELLS);
648 /* Load an autopick preference file */
649 autopick_load_pref(FALSE);
654 * Study a book to gain a new spell/prayer
656 void do_cmd_study(void)
660 bool learned = FALSE;
662 /* Spells of realm2 will have an increment of +32 */
665 cptr p = spell_category_name(mp_ptr->spell_book);
674 msg_print("ËܤòÆɤळ¤È¤¬¤Ç¤¤Ê¤¤¡ª");
676 msg_print("You cannot read books!");
682 if (p_ptr->blind || no_lite())
685 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡ª");
687 msg_print("You cannot see!");
696 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡ª");
698 msg_print("You are too confused!");
704 if (!(p_ptr->new_spells))
707 msg_format("¿·¤·¤¤%s¤ò³Ð¤¨¤ë¤³¤È¤Ï¤Ç¤¤Ê¤¤¡ª", p);
709 msg_format("You cannot learn any new %ss!", p);
715 if (p_ptr->special_defense & KATA_MUSOU)
717 set_action(ACTION_NONE);
721 if( p_ptr->new_spells < 10 ){
722 msg_format("¤¢¤È %d ¤Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
724 msg_format("¤¢¤È %d ¸Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
727 msg_format("You can learn %d new %s%s.", p_ptr->new_spells, p,
728 (p_ptr->new_spells == 1?"":"s"));
734 /* Restrict choices to "useful" books */
735 if (p_ptr->realm2 == REALM_NONE) item_tester_tval = mp_ptr->spell_book;
736 else item_tester_hook = item_tester_learn_spell;
740 q = "¤É¤ÎËܤ«¤é³Ø¤Ó¤Þ¤¹¤«? ";
742 q = "Study which book? ";
746 s = "Æɤá¤ëËܤ¬¤Ê¤¤¡£";
748 s = "You have no books that you can read.";
751 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
753 /* Get the item (in the pack) */
756 o_ptr = &inventory[item];
759 /* Get the item (on the floor) */
762 o_ptr = &o_list[0 - item];
765 /* Access the item's sval */
768 if (o_ptr->tval == REALM2_BOOK) increment = 32;
769 else if (o_ptr->tval != REALM1_BOOK)
772 if (!get_check("ËÜÅö¤ËËâË¡¤ÎÎΰè¤òÊѹ¹¤·¤Þ¤¹¤«¡©")) return;
774 if (!get_check("Really, change magic realm? ")) return;
776 change_realm2(tval2realm(o_ptr->tval));
780 /* Track the object kind */
781 object_kind_track(o_ptr->k_idx);
783 /* Hack -- Handle stuff */
786 /* Mage -- Learn a selected spell */
787 if (mp_ptr->spell_book != TV_LIFE_BOOK)
789 /* Ask for a spell, allow cancel */
791 if (!get_spell(&spell, "³Ø¤Ö", sval, FALSE, o_ptr->tval - TV_LIFE_BOOK + 1)
792 && (spell == -1)) return;
794 if (!get_spell(&spell, "study", sval, FALSE, o_ptr->tval - TV_LIFE_BOOK + 1)
795 && (spell == -1)) return;
800 /* Priest -- Learn a random prayer */
808 for (spell = 0; spell < 32; spell++)
810 /* Check spells in the book */
811 if ((fake_spell_flags[sval] & (1L << spell)))
813 /* Skip non "okay" prayers */
814 if (!spell_okay(spell, FALSE, TRUE,
815 (increment ? p_ptr->realm2 : p_ptr->realm1))) continue;
817 /* Hack -- Prepare the randomizer */
820 /* Hack -- Apply the randomizer */
821 if (one_in_(k)) gift = spell;
829 /* Nothing to study */
834 msg_format("¤½¤ÎËܤˤϳؤ֤٤%s¤¬¤Ê¤¤¡£", p);
836 msg_format("You cannot learn any %ss in that book.", p);
845 if (increment) spell += increment;
847 /* Learn the spell */
850 if (p_ptr->spell_learned1 & (1L << spell)) learned = TRUE;
851 else p_ptr->spell_learned1 |= (1L << spell);
855 if (p_ptr->spell_learned2 & (1L << (spell - 32))) learned = TRUE;
856 else p_ptr->spell_learned2 |= (1L << (spell - 32));
861 int max_exp = (spell < 32) ? SPELL_EXP_MASTER : SPELL_EXP_EXPERT;
862 int old_exp = p_ptr->spell_exp[spell];
863 int new_rank = EXP_LEVEL_UNSKILLED;
864 cptr name = spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell%32];
866 if (old_exp >= max_exp)
869 msg_format("¤½¤Î%s¤Ï´°Á´¤Ë»È¤¤¤³¤Ê¤»¤ë¤Î¤Ç³Ø¤ÖɬÍפϤʤ¤¡£", p);
871 msg_format("You don't need to study this %s anymore.", p);
876 if (!get_check(format("%s¤Î%s¤ò¤µ¤é¤Ë³Ø¤Ó¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©", name, p)))
878 if (!get_check(format("You will study a %s of %s again. Are you sure? ", p, name)))
883 else if (old_exp >= SPELL_EXP_EXPERT)
885 p_ptr->spell_exp[spell] = SPELL_EXP_MASTER;
886 new_rank = EXP_LEVEL_MASTER;
888 else if (old_exp >= SPELL_EXP_SKILLED)
890 if (spell >= 32) p_ptr->spell_exp[spell] = SPELL_EXP_EXPERT;
891 else p_ptr->spell_exp[spell] += SPELL_EXP_EXPERT - SPELL_EXP_SKILLED;
892 new_rank = EXP_LEVEL_EXPERT;
894 else if (old_exp >= SPELL_EXP_BEGINNER)
896 p_ptr->spell_exp[spell] = SPELL_EXP_SKILLED + (old_exp - SPELL_EXP_BEGINNER) * 2 / 3;
897 new_rank = EXP_LEVEL_SKILLED;
901 p_ptr->spell_exp[spell] = SPELL_EXP_BEGINNER + old_exp / 3;
902 new_rank = EXP_LEVEL_BEGINNER;
905 msg_format("%s¤Î½ÏÎýÅÙ¤¬%s¤Ë¾å¤¬¤Ã¤¿¡£", name, exp_level_str[new_rank]);
907 msg_format("Your proficiency of %s is now %s rank.", name, exp_level_str[new_rank]);
912 /* Find the next open entry in "p_ptr->spell_order[]" */
913 for (i = 0; i < 64; i++)
915 /* Stop at the first empty space */
916 if (p_ptr->spell_order[i] == 99) break;
919 /* Add the spell to the known list */
920 p_ptr->spell_order[i++] = spell;
922 /* Mention the result */
924 /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½¤ËÂбþ */
925 if (mp_ptr->spell_book == TV_MUSIC_BOOK)
927 msg_format("%s¤ò³Ø¤ó¤À¡£",
928 spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32]);
932 msg_format("%s¤Î%s¤ò³Ø¤ó¤À¡£",
933 spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32] ,p);
936 msg_format("You have learned the %s of %s.",
937 p, spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32]);
944 switch (mp_ptr->spell_book)
947 chg_virtue(V_FAITH, 1);
950 chg_virtue(V_UNLIFE, 1);
953 chg_virtue(V_NATURE, 1);
956 chg_virtue(V_KNOWLEDGE, 1);
963 /* One less spell available */
964 p_ptr->learned_spells++;
966 /* Message if needed */
967 if (p_ptr->new_spells)
971 if (p_ptr->new_spells < 10) msg_format("¤¢¤È %d ¤Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
972 else msg_format("¤¢¤È %d ¸Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
974 msg_format("You can learn %d more %s%s.", p_ptr->new_spells, p,
975 (p_ptr->new_spells != 1) ? "s" : "");
981 p_ptr->update |= (PU_SPELLS);
984 /* Redraw object recall */
985 p_ptr->window |= (PW_OBJECT);
989 static void wild_magic(int spell)
992 int type = SUMMON_BIZARRE1 + randint0(6);
994 if (type < SUMMON_BIZARRE1) type = SUMMON_BIZARRE1;
995 else if (type > SUMMON_BIZARRE6) type = SUMMON_BIZARRE6;
997 switch (randint1(spell) + randint1(8) + 1)
1002 teleport_player(10, TRUE);
1007 teleport_player(100, TRUE);
1011 teleport_player(200, TRUE);
1021 lite_area(damroll(2, 3), 2);
1024 destroy_doors_touch();
1029 sleep_monsters_touch();
1033 trap_creation(py, px);
1042 aggravate_monsters(0);
1045 earthquake(py, px, 5);
1049 (void)gain_random_mutation(0);
1053 apply_disenchant(1);
1059 fire_ball(GF_CHAOS, 0, spell + 5, 1 + (spell / 10));
1066 while (counter++ < 8)
1068 (void)summon_specific(0, py, px, (dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET));
1073 activate_hi_summon(py, px, FALSE);
1076 (void)summon_cyber(-1, py, px);
1081 (void)activate_ty_curse(FALSE, &count);
1090 static bool cast_life_spell(int spell)
1093 int plev = p_ptr->lev;
1097 case 0: /* Cure Light Wounds */
1098 (void)hp_player(damroll(2, 10));
1099 (void)set_cut(p_ptr->cut - 10);
1102 (void)set_blessed(randint1(12) + 12, FALSE);
1104 case 2: /* Make Light Wounds */
1105 if (!get_aim_dir(&dir)) return FALSE;
1106 fire_ball_hide(GF_WOUNDS, dir, damroll(3 + ((plev - 1) / 5), 4), 0);
1108 case 3: /* Call Light */
1109 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1111 case 4: /* Detect Traps + Secret Doors */
1112 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1113 (void)detect_doors(DETECT_RAD_DEFAULT);
1114 (void)detect_stairs(DETECT_RAD_DEFAULT);
1116 case 5: /* Cure Medium Wounds */
1117 (void)hp_player(damroll(4, 10));
1118 (void)set_cut((p_ptr->cut / 2) - 20);
1120 case 6: /* Cure Poison */
1121 (void)set_poisoned(0);
1123 case 7: /* Satisfy Hunger */
1124 (void)set_food(PY_FOOD_MAX - 1);
1126 case 8: /* Remove Curse */
1130 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1132 msg_print("You feel as if someone is watching over you.");
1136 case 9: /* Make Medium Wounds */
1137 if (!get_aim_dir(&dir)) return FALSE;
1138 fire_ball_hide(GF_WOUNDS, dir, damroll(8 + ((plev - 5) / 4), 8), 0);
1140 case 10: /* Cure Critical Wounds */
1141 (void)hp_player(damroll(8, 10));
1146 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1147 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1150 map_area(DETECT_RAD_MAP);
1153 (void)turn_undead();
1155 case 14: /* Healing */
1156 (void)hp_player(300);
1160 case 15: /* Glyph of Warding */
1163 case 16: /* Dispel Curse */
1164 if (remove_all_curse())
1167 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1169 msg_print("You feel as if someone is watching over you.");
1173 case 17: /* Perception */
1174 return ident_spell(FALSE);
1175 case 18: /* Dispel Undead */
1176 (void)dispel_undead(randint1(plev * 5));
1178 case 19: /* 'Day of the Dove' */
1179 charm_monsters(plev * 2);
1181 case 20: /* Make Critical Wounds */
1182 if (!get_aim_dir(&dir)) return FALSE;
1183 fire_ball_hide(GF_WOUNDS, dir, damroll(5+((plev - 5) / 3), 15), 0);
1185 case 21: /* Word of Recall */
1186 return word_of_recall();
1187 case 22: /* Alter Reality */
1190 case 23: /* Warding True */
1195 num_repro += MAX_REPRO;
1197 case 25: /* Detection True */
1198 (void)detect_all(DETECT_RAD_DEFAULT);
1200 case 26: /* Genocide Undead */
1201 (void)mass_genocide_undead(plev+50,TRUE);
1203 case 27: /* Clairvoyance */
1206 case 28: /* Restoration */
1207 (void)do_res_stat(A_STR);
1208 (void)do_res_stat(A_INT);
1209 (void)do_res_stat(A_WIS);
1210 (void)do_res_stat(A_DEX);
1211 (void)do_res_stat(A_CON);
1212 (void)do_res_stat(A_CHR);
1213 (void)restore_level();
1215 case 29: /* Healing True */
1216 (void)hp_player(2000);
1220 case 30: /* Holy Vision */
1221 return identify_fully(FALSE);
1222 case 31: /* Ultimate resistance */
1224 int v = randint1(plev/2)+plev/2;
1225 (void)set_fast(v, FALSE);
1226 set_oppose_acid(v, FALSE);
1227 set_oppose_elec(v, FALSE);
1228 set_oppose_fire(v, FALSE);
1229 set_oppose_cold(v, FALSE);
1230 set_oppose_pois(v, FALSE);
1231 set_ultimate_res(v, FALSE);
1236 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥é¥¤¥Õ¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1238 msg_format("You cast an unknown Life spell: %d.", spell);
1249 static bool cast_sorcery_spell(int spell)
1252 int plev = p_ptr->lev;
1256 case 0: /* Detect Monsters */
1257 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1259 case 1: /* Phase Door */
1260 teleport_player(10, FALSE);
1262 case 2: /* Detect Doors and Traps */
1263 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1264 (void)detect_doors(DETECT_RAD_DEFAULT);
1265 (void)detect_stairs(DETECT_RAD_DEFAULT);
1267 case 3: /* Light Area */
1268 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1270 case 4: /* Confuse Monster */
1271 if (!get_aim_dir(&dir)) return FALSE;
1273 (void)confuse_monster(dir, (plev * 3) / 2);
1275 case 5: /* Teleport */
1276 teleport_player(plev * 5, FALSE);
1278 case 6: /* Sleep Monster */
1279 if (!get_aim_dir(&dir)) return FALSE;
1281 (void)sleep_monster(dir);
1283 case 7: /* Recharging */
1284 return recharge(plev * 4);
1285 case 8: /* Magic Mapping */
1286 map_area(DETECT_RAD_MAP);
1288 case 9: /* Identify */
1289 return ident_spell(FALSE);
1290 case 10: /* Slow Monster */
1291 if (!get_aim_dir(&dir)) return FALSE;
1293 (void)slow_monster(dir);
1295 case 11: /* Mass Sleep */
1296 (void)sleep_monsters();
1298 case 12: /* Teleport Away */
1299 if (!get_aim_dir(&dir)) return FALSE;
1301 (void)fire_beam(GF_AWAY_ALL, dir, plev);
1303 case 13: /* Haste Self */
1304 (void)set_fast(randint1(20 + plev) + plev, FALSE);
1306 case 14: /* Detection True */
1307 (void)detect_all(DETECT_RAD_DEFAULT);
1309 case 15: /* Identify True */
1310 return identify_fully(FALSE);
1311 case 16: /* Detect Objects and Treasure*/
1312 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
1313 (void)detect_treasure(DETECT_RAD_DEFAULT);
1314 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
1316 case 17: /* Charm Monster */
1317 if (!get_aim_dir(&dir)) return FALSE;
1319 (void)charm_monster(dir, plev);
1321 case 18: /* Sense Minds */
1322 (void)set_tim_esp(randint1(30) + 25, FALSE);
1324 case 19: /* Teleport to town */
1326 case 20: /* Self knowledge */
1327 (void)self_knowledge();
1329 case 21: /* Teleport Level */
1331 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
1333 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
1335 (void)teleport_level(0);
1337 case 22: /* Word of Recall */
1338 return word_of_recall();
1339 case 23: /* Dimension Door */
1341 msg_print("¼¡¸µ¤ÎÈ⤬³«¤¤¤¿¡£ÌÜŪÃϤòÁª¤ó¤Ç²¼¤µ¤¤¡£");
1343 msg_print("You open a dimensional gate. Choose a destination.");
1346 return dimension_door();
1347 case 24: /* Probing */
1350 case 25: /* Explosive Rune */
1353 case 26: /* Telekinesis */
1354 if (!get_aim_dir(&dir)) return FALSE;
1356 fetch(dir, plev * 15, FALSE);
1358 case 27: /* Clairvoyance */
1359 chg_virtue(V_KNOWLEDGE, 1);
1360 chg_virtue(V_ENLIGHTEN, 1);
1363 if (!(p_ptr->telepathy))
1365 (void)set_tim_esp(randint1(30) + 25, FALSE);
1368 case 28: /* Charm Monsters */
1369 charm_monsters(plev * 2);
1371 case 29: /* Alchemy */
1373 case 30: /* Banish */
1374 banish_monsters(plev * 4);
1376 case 31: /* Globe of Invulnerability */
1377 (void)set_invuln(randint1(4) + 4, FALSE);
1381 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥½¡¼¥µ¥ê¡¼¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1383 msg_format("You cast an unknown Sorcery spell: %d.", spell);
1393 static bool cast_nature_spell(int spell)
1397 int plev = p_ptr->lev;
1399 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1400 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1401 else beam = plev / 2;
1405 case 0: /* Detect Creatures */
1406 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1408 case 1: /* Lightning Bolt */
1409 project_length = plev / 6 + 2;
1410 if (!get_aim_dir(&dir)) return FALSE;
1412 fire_beam(GF_ELEC, dir,
1413 damroll(3 + ((plev - 1) / 5), 4));
1415 case 2: /* Detect Doors & Traps */
1416 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1417 (void)detect_doors(DETECT_RAD_DEFAULT);
1418 (void)detect_stairs(DETECT_RAD_DEFAULT);
1420 case 3: /* Produce Food */
1422 object_type forge, *q_ptr = &forge;
1425 msg_print("¿©ÎÁ¤òÀ¸À®¤·¤¿¡£");
1427 msg_print("A food ration is produced.");
1430 /* Create the food ration */
1431 object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_RATION));
1433 /* Drop the object from heaven */
1434 (void)drop_near(q_ptr, -1, py, px);
1438 case 4: /* Daylight */
1439 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1440 if ((prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
1443 msg_print("Æü¤Î¸÷¤¬¤¢¤Ê¤¿¤ÎÆùÂΤò¾Ç¤¬¤·¤¿¡ª");
1445 msg_print("The daylight scorches your flesh!");
1449 take_hit(DAMAGE_NOESCAPE, damroll(2, 2), "Æü¤Î¸÷", -1);
1451 take_hit(DAMAGE_NOESCAPE, damroll(2, 2), "daylight", -1);
1456 case 5: /* Animal Taming */
1457 if (!get_aim_dir(&dir)) return FALSE;
1459 (void)charm_animal(dir, plev);
1461 case 6: /* Resist Environment */
1462 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1463 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1464 (void)set_oppose_elec(randint1(20) + 20, FALSE);
1466 case 7: /* Cure Wounds & Poison */
1467 (void)hp_player(damroll(2, 8));
1469 (void)set_poisoned(0);
1471 case 8: /* Stone to Mud */
1472 if (!get_aim_dir(&dir)) return FALSE;
1474 (void)wall_to_mud(dir);
1476 case 9: /* Frost Bolt */
1477 if (!get_aim_dir(&dir)) return FALSE;
1478 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
1479 damroll(3 + ((plev - 5) / 4), 8));
1481 case 10: /* Nature Awareness -- downgraded */
1482 map_area(DETECT_RAD_MAP);
1483 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1484 (void)detect_doors(DETECT_RAD_DEFAULT);
1485 (void)detect_stairs(DETECT_RAD_DEFAULT);
1486 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1488 case 11: /* Fire Bolt */
1489 if (!get_aim_dir(&dir)) return FALSE;
1490 fire_bolt_or_beam(beam - 10, GF_FIRE, dir,
1491 damroll(5 + ((plev - 5) / 4), 8));
1493 case 12: /* Ray of Sunlight */
1494 if (!get_aim_dir(&dir)) return FALSE;
1496 msg_print("ÂÀÍÛ¸÷Àþ¤¬¸½¤ì¤¿¡£");
1498 msg_print("A line of sunlight appears.");
1501 (void)lite_line(dir);
1503 case 13: /* Entangle */
1506 case 14: /* Summon Animals */
1507 if (!(summon_specific(-1, py, px, plev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET))))
1510 msg_print("ưʪ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
1512 msg_print("No animals arrive.");
1516 case 15: /* Herbal Healing */
1517 (void)hp_player(500);
1520 (void)set_poisoned(0);
1522 case 16: /* Stair Building */
1523 (void)stair_creation();
1525 case 17: /* Stone Skin */
1526 (void)set_shield(randint1(20) + 30, FALSE);
1528 case 18: /* Resistance True */
1529 (void)set_oppose_acid(randint1(20) + 20, FALSE);
1530 (void)set_oppose_elec(randint1(20) + 20, FALSE);
1531 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1532 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1533 (void)set_oppose_pois(randint1(20) + 20, FALSE);
1535 case 19: /* Tree Creation */
1536 (void)tree_creation();
1538 case 20: /* Animal Friendship */
1539 (void)charm_animals(plev * 2);
1541 case 21: /* Stone Tell */
1542 return identify_fully(FALSE);
1543 case 22: /* Wall of Stone */
1546 case 23: /* Protection from Corrosion */
1548 case 24: /* Earthquake */
1549 earthquake(py, px, 10);
1551 case 25: /* Whirlwind Attack */
1555 monster_type *m_ptr;
1557 for (dir = 0; dir < 8; dir++)
1559 y = py + ddy_ddd[dir];
1560 x = px + ddx_ddd[dir];
1561 c_ptr = &cave[y][x];
1563 /* Get the monster */
1564 m_ptr = &m_list[c_ptr->m_idx];
1566 /* Hack -- attack monsters */
1567 if (c_ptr->m_idx && (m_ptr->ml || cave_have_flag_bold(y, x, FF_PROJECT)))
1572 case 26: /* Blizzard */
1573 if (!get_aim_dir(&dir)) return FALSE;
1575 fire_ball(GF_COLD, dir, 70 + plev * 3 / 2, (plev / 12) + 1);
1577 case 27: /* Lightning Storm */
1578 if (!get_aim_dir(&dir)) return FALSE;
1579 fire_ball(GF_ELEC, dir, 90 + plev * 3 / 2, (plev / 12) + 1);
1581 case 28: /* Whirlpool */
1582 if (!get_aim_dir(&dir)) return FALSE;
1583 fire_ball(GF_WATER, dir, 100 + plev * 3 / 2, (plev / 12) + 1);
1585 case 29: /* Call Sunlight */
1586 fire_ball(GF_LITE, 0, 150, 8);
1587 chg_virtue(V_KNOWLEDGE, 1);
1588 chg_virtue(V_ENLIGHTEN, 1);
1590 if ((prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
1593 msg_print("Æü¸÷¤¬¤¢¤Ê¤¿¤ÎÆùÂΤò¾Ç¤¬¤·¤¿¡ª");
1595 msg_print("The sunlight scorches your flesh!");
1599 take_hit(DAMAGE_NOESCAPE, 50, "Æü¸÷", -1);
1601 take_hit(DAMAGE_NOESCAPE, 50, "sunlight", -1);
1606 case 30: /* Elemental Branding */
1607 brand_weapon(randint0(2));
1609 case 31: /* Nature's Wrath */
1610 (void)dispel_monsters(plev * 4);
1611 earthquake(py, px, 20 + (plev / 2));
1612 project(0, 1 + plev / 12, py, px,
1613 (100 + plev) * 2, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM, -1);
1617 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥Í¥¤¥Á¥ã¡¼¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1619 msg_format("You cast an unknown Nature spell: %d.", spell);
1629 static bool cast_chaos_spell(int spell)
1632 int plev = p_ptr->lev;
1634 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1635 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1636 else beam = plev / 2;
1640 case 0: /* Magic Missile */
1641 if (!get_aim_dir(&dir)) return FALSE;
1643 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
1644 damroll(3 + ((plev - 1) / 5), 4));
1646 case 1: /* Trap / Door destruction */
1647 (void)destroy_doors_touch();
1649 case 2: /* Flash of Light == Light Area */
1650 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1652 case 3: /* Touch of Confusion */
1653 if (!(p_ptr->special_attack & ATTACK_CONFUSE))
1656 msg_print("¤¢¤Ê¤¿¤Î¼ê¤Ï¸÷¤ê»Ï¤á¤¿¡£");
1658 msg_print("Your hands start glowing.");
1661 p_ptr->special_attack |= ATTACK_CONFUSE;
1662 p_ptr->redraw |= (PR_STATUS);
1665 case 4: /* Mana Burst */
1666 if (!get_aim_dir(&dir)) return FALSE;
1668 fire_ball(GF_MISSILE, dir,
1669 (damroll(3, 5) + plev +
1670 (plev / (((p_ptr->pclass == CLASS_MAGE)
1671 || (p_ptr->pclass == CLASS_HIGH_MAGE)
1672 || (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
1673 ((plev < 30) ? 2 : 3));
1674 /* Shouldn't actually use GF_MANA, as it will destroy all
1675 * items on the floor */
1677 case 5: /* Fire Bolt */
1678 if (!get_aim_dir(&dir)) return FALSE;
1680 fire_bolt_or_beam(beam, GF_FIRE, dir,
1681 damroll(8 + ((plev - 5) / 4), 8));
1683 case 6: /* Fist of Force ("Fist of Fun") */
1684 if (!get_aim_dir(&dir)) return FALSE;
1686 fire_ball(GF_DISINTEGRATE, dir,
1687 damroll(8 + ((plev - 5) / 4), 8), 0);
1689 case 7: /* Teleport Self */
1690 teleport_player(plev * 5, FALSE);
1692 case 8: /* Wonder */
1694 /* This spell should become more useful (more
1695 controlled) as the player gains experience levels.
1696 Thus, add 1/5 of the player's level to the die roll.
1697 This eliminates the worst effects later on, while
1698 keeping the results quite random. It also allows
1699 some potent effects only at high level. */
1701 int die = randint1(100) + plev / 5;
1702 int vir = virtue_number(V_CHANCE);
1705 if (p_ptr->virtues[vir - 1] > 0)
1707 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
1711 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
1716 chg_virtue(V_CHANCE, 1);
1718 if (!get_aim_dir(&dir)) return FALSE;
1721 msg_print("¤¢¤Ê¤¿¤ÏÎϤ¬¤ß¤Ê¤®¤ë¤Î¤ò´¶¤¸¤¿¡ª");
1723 msg_print("You feel a surge of power!");
1726 if (die < 8) clone_monster(dir);
1727 else if (die < 14) speed_monster(dir);
1728 else if (die < 26) heal_monster(dir, damroll(4, 6));
1729 else if (die < 31) poly_monster(dir);
1731 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
1732 damroll(3 + ((plev - 1) / 5), 4));
1733 else if (die < 41) confuse_monster(dir, plev);
1734 else if (die < 46) fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
1735 else if (die < 51) (void)lite_line(dir);
1737 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
1738 damroll(3 + ((plev - 5) / 4), 8));
1740 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
1741 damroll(5 + ((plev - 5) / 4), 8));
1743 fire_bolt_or_beam(beam, GF_ACID, dir,
1744 damroll(6 + ((plev - 5) / 4), 8));
1746 fire_bolt_or_beam(beam, GF_FIRE, dir,
1747 damroll(8 + ((plev - 5) / 4), 8));
1748 else if (die < 76) drain_life(dir, 75);
1749 else if (die < 81) fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
1750 else if (die < 86) fire_ball(GF_ACID, dir, 40 + plev, 2);
1751 else if (die < 91) fire_ball(GF_ICE, dir, 70 + plev, 3);
1752 else if (die < 96) fire_ball(GF_FIRE, dir, 80 + plev, 3);
1753 else if (die < 101) drain_life(dir, 100 + plev);
1756 earthquake(py, px, 12);
1760 (void)destroy_area(py, px, 13 + randint0(5), FALSE);
1764 symbol_genocide(plev+50, TRUE);
1766 else if (die < 110) dispel_monsters(120);
1769 dispel_monsters(150);
1776 case 9: /* Chaos Bolt */
1777 if (!get_aim_dir(&dir)) return FALSE;
1779 fire_bolt_or_beam(beam, GF_CHAOS, dir,
1780 damroll(10 + ((plev - 5) / 4), 8));
1782 case 10: /* Sonic Boom */
1784 msg_print("¥É¡¼¥ó¡ªÉô²°¤¬Íɤ줿¡ª");
1786 msg_print("BOOM! Shake the room!");
1789 project(0, plev / 10 + 2, py, px,
1790 (60 + plev), GF_SOUND, PROJECT_KILL | PROJECT_ITEM, -1);
1792 case 11: /* Doom Bolt -- always beam in 2.0.7 or later */
1793 if (!get_aim_dir(&dir)) return FALSE;
1795 fire_beam(GF_MANA, dir, damroll(11 + ((plev - 5) / 4), 8));
1797 case 12: /* Fire Ball */
1798 if (!get_aim_dir(&dir)) return FALSE;
1800 fire_ball(GF_FIRE, dir, plev + 55, 2);
1802 case 13: /* Teleport Other */
1803 if (!get_aim_dir(&dir)) return FALSE;
1805 (void)fire_beam(GF_AWAY_ALL, dir, plev);
1807 case 14: /* Word of Destruction */
1808 (void)destroy_area(py, px, 13 + randint0(5), FALSE);
1810 case 15: /* Invoke Logrus */
1811 if (!get_aim_dir(&dir)) return FALSE;
1813 fire_ball(GF_CHAOS, dir, plev*2 + 99, plev / 5);
1815 case 16: /* Polymorph Other */
1816 if (!get_aim_dir(&dir)) return FALSE;
1818 (void)poly_monster(dir);
1820 case 17: /* Chain Lightning */
1821 for (dir = 0; dir <= 9; dir++)
1822 fire_beam(GF_ELEC, dir, damroll(5 + (plev / 10), 8));
1824 case 18: /* Arcane Binding == Charging */
1825 return recharge(90);
1826 case 19: /* Disintegration */
1827 if (!get_aim_dir(&dir)) return FALSE;
1829 fire_ball(GF_DISINTEGRATE, dir, plev + 70, 3 + plev / 40);
1831 case 20: /* Alter Reality */
1834 case 21: /* Magic Rocket */
1835 if (!get_aim_dir(&dir)) return FALSE;
1838 msg_print("¥í¥±¥Ã¥Èȯ¼Í¡ª");
1840 msg_print("You launch a rocket!");
1843 fire_rocket(GF_ROCKET, dir, 120 + plev*2, 2);
1845 case 22: /* Chaos Branding */
1848 case 23: /* Summon monster, demon */
1851 bool pet = !one_in_(3);
1853 if (pet) mode |= PM_FORCE_PET;
1854 else mode |= PM_NO_PET;
1855 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
1857 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, SUMMON_DEMON, mode))
1860 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
1862 msg_print("The area fills with a stench of sulphur and brimstone.");
1868 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
1870 msg_print("'What is thy bidding... Master?'");
1875 msg_print("¡ÖÈܤ·¤¼Ô¤è¡¢²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª ¤ªÁ°¤Îº²¤òĺ¤¯¤¾¡ª¡×");
1877 msg_print("'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'");
1883 case 24: /* Beam of Gravity */
1884 if (!get_aim_dir(&dir)) return FALSE;
1886 fire_beam(GF_GRAVITY, dir, damroll(9 + ((plev - 5) / 4), 8));
1888 case 25: /* Meteor Swarm */
1891 int b = 10 + randint1(10);
1892 for (i = 0; i < b; i++)
1894 int count = 0, d = 0;
1899 if (count > 20) break;
1900 x = px - 8 + randint0(17);
1901 y = py - 8 + randint0(17);
1903 if (!in_bounds(y, x) || !projectable(py, px, y, x)) continue;
1905 dx = (px > x) ? (px - x) : (x - px);
1906 dy = (py > y) ? (py - y) : (y - py);
1908 /* Approximate distance */
1909 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
1913 if (count > 20) continue;
1915 project(0, 2, y, x, plev * 2, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
1919 case 26: /* Flame Strike */
1920 fire_ball(GF_FIRE, 0, 300 + (3 * plev), 8);
1922 case 27: /* Call Chaos */
1925 case 28: /* Polymorph Self */
1927 if (!get_check("ÊѿȤ·¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©")) return FALSE;
1929 if (!get_check("You will polymorph yourself. Are you sure? ")) return FALSE;
1933 case 29: /* Mana Storm */
1934 if (!get_aim_dir(&dir)) return FALSE;
1936 fire_ball(GF_MANA, dir, 300 + (plev * 4), 4);
1938 case 30: /* Breathe Logrus */
1939 if (!get_aim_dir(&dir)) return FALSE;
1941 fire_ball(GF_CHAOS, dir, p_ptr->chp, 2);
1943 case 31: /* Call the Void */
1948 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥«¥ª¥¹¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1950 msg_format("You cast an unknown Chaos spell: %d.", spell);
1960 static bool cast_death_spell(int spell)
1964 int plev = p_ptr->lev;
1967 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1968 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1969 else beam = plev / 2;
1973 case 0: /* Detect Undead & Demons -> Unlife */
1974 (void)detect_monsters_nonliving(DETECT_RAD_DEFAULT);
1976 case 1: /* Malediction */
1977 if (!get_aim_dir(&dir)) return FALSE;
1978 /* A radius-0 ball may (1) be aimed at objects etc.,
1979 * and will affect them; (2) may be aimed at ANY
1980 * visible monster, unlike a 'bolt' which must travel
1981 * to the monster. */
1983 fire_ball(GF_HELL_FIRE, dir,
1984 damroll(3 + ((plev - 1) / 5), 4), 0);
1987 { /* Special effect first */
1988 dummy = randint1(1000);
1990 fire_ball_hide(GF_DEATH_RAY, dir, plev * 200, 0);
1991 else if (dummy < 500)
1992 fire_ball_hide(GF_TURN_ALL, dir, plev, 0);
1993 else if (dummy < 800)
1994 fire_ball_hide(GF_OLD_CONF, dir, plev, 0);
1996 fire_ball_hide(GF_STUN, dir, plev, 0);
1999 case 2: /* Detect Evil */
2000 (void)detect_monsters_evil(DETECT_RAD_DEFAULT);
2002 case 3: /* Stinking Cloud */
2003 if (!get_aim_dir(&dir)) return FALSE;
2005 fire_ball(GF_POIS, dir, 10 + (plev / 2), 2);
2007 case 4: /* Black Sleep */
2008 if (!get_aim_dir(&dir)) return FALSE;
2010 (void)sleep_monster(dir);
2012 case 5: /* Resist Poison */
2013 (void)set_oppose_pois(randint1(20) + 20, FALSE);
2015 case 6: /* Horrify */
2016 if (!get_aim_dir(&dir)) return FALSE;
2018 (void)fear_monster(dir, plev);
2019 (void)stun_monster(dir, plev);
2021 case 7: /* Enslave Undead */
2022 if (!get_aim_dir(&dir)) return FALSE;
2024 (void)control_one_undead(dir, plev);
2026 case 8: /* Orb of Entropy */
2027 if (!get_aim_dir(&dir)) return FALSE;
2029 fire_ball(GF_OLD_DRAIN, dir,
2030 (damroll(3, 6) + plev +
2031 (plev / (((p_ptr->pclass == CLASS_MAGE) ||
2032 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
2033 (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
2034 ((plev < 30) ? 2 : 3));
2036 case 9: /* Nether Bolt */
2037 if (!get_aim_dir(&dir)) return FALSE;
2039 fire_bolt_or_beam(beam, GF_NETHER, dir,
2040 damroll(8 + ((plev - 5) / 4), 8));
2042 case 10: /* Cloud kill */
2043 project(0, plev / 10 + 2, py, px,
2044 (30 + plev) * 2, GF_POIS, PROJECT_KILL | PROJECT_ITEM, -1);
2046 case 11: /* Genocide One */
2047 if (!get_aim_dir(&dir)) return FALSE;
2049 fire_ball_hide(GF_GENOCIDE, dir, plev + 50, 0);
2051 case 12: /* Poison Branding */
2054 case 13: /* Vampiric Drain */
2055 if (!get_aim_dir(&dir)) return FALSE;
2057 dummy = plev * 2 + randint1(plev * 2); /* Dmg */
2058 if (drain_life(dir, dummy))
2060 chg_virtue(V_SACRIFICE, -1);
2061 chg_virtue(V_VITALITY, -1);
2063 (void)hp_player(dummy);
2064 /* Gain nutritional sustenance: 150/hp drained */
2065 /* A Food ration gives 5000 food points (by contrast) */
2066 /* Don't ever get more than "Full" this way */
2067 /* But if we ARE Gorged, it won't cure us */
2068 dummy = p_ptr->food + MIN(5000, 100 * dummy);
2069 if (p_ptr->food < PY_FOOD_MAX) /* Not gorged already */
2070 (void)set_food(dummy >= PY_FOOD_MAX ? PY_FOOD_MAX - 1 : dummy);
2073 case 14: /* Animate Dead */
2074 animate_dead(0, py, px);
2076 case 15: /* Genocide */
2077 (void)symbol_genocide(plev+50, TRUE);
2079 case 16: /* Berserk */
2080 (void)set_shero(randint1(25) + 25, FALSE);
2081 (void)hp_player(30);
2082 (void)set_afraid(0);
2084 case 17: /* Invoke Spirits */
2086 int die = randint1(100) + plev / 5;
2087 int vir = virtue_number(V_CHANCE);
2090 if (p_ptr->virtues[vir - 1] > 0)
2092 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
2096 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
2100 if (!get_aim_dir(&dir)) return FALSE;
2103 msg_print("¤¢¤Ê¤¿¤Ï»à¼Ô¤¿¤Á¤ÎÎϤò¾·½¸¤·¤¿...");
2105 msg_print("You call on the power of the dead...");
2108 chg_virtue(V_CHANCE, 1);
2112 msg_print("¤¢¤Ê¤¿¤Ï¤ª¤É¤í¤ª¤É¤í¤·¤¤ÎϤΤ¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
2114 msg_print("You feel a surge of eldritch force!");
2121 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¤¢¤Ê¤¿¤Î¼þ¤ê¤ÎÃÏÌ̤«¤éµà¤Á¤¿¿Í±Æ¤¬Î©¤Á¾å¤¬¤Ã¤Æ¤¤¿¡ª");
2123 msg_print("Oh no! Mouldering forms rise from the earth around you!");
2126 (void)summon_specific(0, py, px, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
2127 chg_virtue(V_UNLIFE, 1);
2132 msg_print("̾¾õ¤·Æñ¤¤¼Ù°¤Ê¸ºß¤¬¤¢¤Ê¤¿¤Î¿´¤òÄ̤ê²á¤®¤Æ¹Ô¤Ã¤¿...");
2134 msg_print("An unnamable evil brushes against your mind...");
2137 set_afraid(p_ptr->afraid + randint1(4) + 4);
2142 msg_print("¤¢¤Ê¤¿¤ÎƬ¤ËÂçÎ̤ÎÍ©Î¤Á¤ÎÁû¡¹¤·¤¤À¼¤¬²¡¤·´ó¤»¤Æ¤¤¿...");
2144 msg_print("Your head is invaded by a horde of gibbering spectral voices...");
2147 set_confused(p_ptr->confused + randint1(4) + 4);
2155 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
2156 damroll(3 + ((plev - 1) / 5), 4));
2160 confuse_monster (dir, plev);
2164 fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
2168 (void)lite_line(dir);
2172 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
2173 damroll(3+((plev-5)/4),8));
2177 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
2178 damroll(5+((plev-5)/4),8));
2182 fire_bolt_or_beam(beam, GF_ACID, dir,
2183 damroll(6+((plev-5)/4),8));
2187 fire_bolt_or_beam(beam, GF_FIRE, dir,
2188 damroll(8+((plev-5)/4),8));
2192 drain_life(dir, 75);
2196 fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
2200 fire_ball(GF_ACID, dir, 40 + plev, 2);
2204 fire_ball(GF_ICE, dir, 70 + plev, 3);
2208 fire_ball(GF_FIRE, dir, 80 + plev, 3);
2212 drain_life(dir, 100 + plev);
2216 earthquake(py, px, 12);
2220 (void)destroy_area(py, px, 13 + randint0(5), FALSE);
2224 symbol_genocide(plev+50, TRUE);
2228 dispel_monsters(120);
2232 dispel_monsters(150);
2240 msg_print("±¢±µ¤ÊÀ¼¤¬¥¯¥¹¥¯¥¹¾Ð¤¦¡£¡Ö¤â¤¦¤¹¤°¤ª¤Þ¤¨¤Ï²æ¡¹¤ÎÃç´Ö¤Ë¤Ê¤ë¤À¤í¤¦¡£¼å¤¼Ô¤è¡£¡×");
2242 msg_print("Sepulchral voices chuckle. 'Soon you will join us, mortal.'");
2247 case 18: /* Dark Bolt */
2248 if (!get_aim_dir(&dir)) return FALSE;
2250 fire_bolt_or_beam(beam, GF_DARK, dir,
2251 damroll(4 + ((plev - 5) / 4), 8));
2253 case 19: /* Battle Frenzy */
2254 (void)set_shero(randint1(25) + 25, FALSE);
2255 (void)hp_player(30);
2256 (void)set_afraid(0);
2257 (void)set_fast(randint1(20 + (plev / 2)) + (plev / 2), FALSE);
2259 case 20: /* Vampiric Branding */
2262 case 21: /* Vampirism True */
2263 if (!get_aim_dir(&dir)) return FALSE;
2265 chg_virtue(V_SACRIFICE, -1);
2266 chg_virtue(V_VITALITY, -1);
2268 for (dummy = 0; dummy < 3; dummy++)
2270 if (drain_life(dir, 100))
2274 case 22: /* Word of Death */
2275 (void)dispel_living(randint1(plev * 3));
2277 case 23: /* Darkness Storm */
2278 if (!get_aim_dir(&dir)) return FALSE;
2280 fire_ball(GF_DARK, dir, 100+plev*2, 4);
2282 case 24: /* Death Ray */
2283 if (!get_aim_dir(&dir)) return FALSE;
2285 (void)death_ray(dir, plev);
2287 case 25: /* Raise the Dead */
2290 bool pet = one_in_(3);
2293 type = (plev > 47 ? SUMMON_HI_UNDEAD : SUMMON_UNDEAD);
2295 if (!pet || (pet && (plev > 24) && one_in_(3)))
2296 mode |= PM_ALLOW_GROUP;
2298 if (pet) mode |= PM_FORCE_PET;
2299 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
2301 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, type, mode))
2304 msg_print("Î䤿¤¤É÷¤¬¤¢¤Ê¤¿¤Î¼þ¤ê¤Ë¿á¤»Ï¤á¤¿¡£¤½¤ì¤ÏÉåÇÔ½¤ò±¿¤ó¤Ç¤¤¤ë...");
2306 msg_print("Cold winds begin to blow around you, carrying with them the stench of decay...");
2312 msg_print("¸Å¤¨¤Î»à¤»¤ë¼Ô¶¦¤¬¤¢¤Ê¤¿¤Ë»Å¤¨¤ë¤¿¤áÅÚ¤«¤éᴤä¿¡ª");
2314 msg_print("Ancient, long-dead forms arise from the ground to serve you!");
2319 msg_print("»à¼Ô¤¬á´¤Ã¤¿¡£Ì²¤ê¤ò˸¤²¤ë¤¢¤Ê¤¿¤òȳ¤¹¤ë¤¿¤á¤Ë¡ª");
2321 msg_print("'The dead arise... to punish you for disturbing them!'");
2324 chg_virtue(V_UNLIFE, 1);
2329 case 26: /* Esoteria */
2330 if (randint1(50) > plev)
2331 return ident_spell(FALSE);
2333 return identify_fully(FALSE);
2334 case 27: /* Mimic vampire */
2335 (void)set_mimic(10+plev/2 + randint1(10+plev/2), MIMIC_VAMPIRE, FALSE);
2337 case 28: /* Restore Life */
2338 (void)restore_level();
2340 case 29: /* Mass Genocide */
2341 (void)mass_genocide(plev+50, TRUE);
2343 case 30: /* Hellfire */
2344 if (!get_aim_dir(&dir)) return FALSE;
2346 fire_ball(GF_HELL_FIRE, dir, 666, 3);
2348 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "ÃϹö¤Î¹å²Ð¤Î¼öʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
2350 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "the strain of casting Hellfire", -1);
2354 case 31: /* Wraithform */
2355 set_wraith_form(randint1(plev / 2) + (plev / 2), FALSE);
2358 msg_format("You cast an unknown Death spell: %d.", spell);
2366 static bool cast_trump_spell(int spell, bool success)
2369 int plev = p_ptr->lev;
2370 int summon_lev = plev * 2 / 3 + randint1(plev/2);
2372 bool no_trump = FALSE;
2373 bool unique_okay = FALSE;
2375 if (summon_lev < 1) summon_lev = 1;
2376 if (!success || (randint1(50+plev) < plev/10)) unique_okay = TRUE;
2379 case 0: /* Phase Door */
2382 teleport_player(10, FALSE);
2385 case 1: /* Trump Spiders */
2387 bool pet = success; /* (randint1(5) > 2) */
2388 u32b mode = PM_ALLOW_GROUP;
2390 if (pet) mode |= PM_FORCE_PET;
2391 else mode |= PM_NO_PET;
2394 msg_print("¤¢¤Ê¤¿¤ÏÃØéá¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2396 msg_print("You concentrate on the trump of an spider...");
2399 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_SPIDER, mode))
2403 msg_print("¾¤´¤µ¤ì¤¿ÃØéá¤ÏÅܤäƤ¤¤ë¡ª");
2405 msg_print("The summoned spiders get angry!");
2415 case 2: /* Shuffle */
2418 /* A limited power 'wonder' spell */
2419 int die = randint1(120);
2420 int vir = virtue_number(V_CHANCE);
2422 if ((p_ptr->pclass == CLASS_ROGUE) ||
2423 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
2424 (p_ptr->pclass == CLASS_SORCERER))
2425 die = (randint1(110)) + plev / 5;
2426 /* Card sharks and high mages get a level bonus */
2430 if (p_ptr->virtues[vir - 1] > 0)
2432 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
2436 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
2441 msg_print("¤¢¤Ê¤¿¤Ï¥«¡¼¥É¤òÀڤäưìËç°ú¤¤¤¿...");
2443 msg_print("You shuffle the deck and draw a card...");
2447 chg_virtue(V_CHANCE, 1);
2452 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡Ô»à¡Õ¤À¡ª");
2454 msg_print("Oh no! It's Death!");
2457 for (dummy = 0; dummy < randint1(3); dummy++)
2458 (void)activate_hi_summon(py, px, FALSE);
2463 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡Ô°Ëâ¡Õ¤À¡ª");
2465 msg_print("Oh no! It's the Devil!");
2468 (void)summon_specific(0, py, px, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
2474 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡ÔÄߤé¤ì¤¿ÃË¡Õ¤À¡ª");
2476 msg_print("Oh no! It's the Hanged Man.");
2479 (void)activate_ty_curse(FALSE, &count);
2484 msg_print("¡ÔÉÔĴϤηõ¡Õ¤À¡£");
2486 msg_print("It's the swords of discord.");
2489 aggravate_monsters(0);
2494 msg_print("¡Ô¶ò¼Ô¡Õ¤À¡£");
2496 msg_print("It's the Fool.");
2499 (void)do_dec_stat(A_INT);
2500 (void)do_dec_stat(A_WIS);
2505 msg_print("´ñ̯¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2507 msg_print("It's the picture of a strange monster.");
2510 if (!(summon_specific(0, py, px, (dun_level * 3) / 2, 32 + randint1(6), (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET))))
2516 msg_print("¡Ô·î¡Õ¤À¡£");
2518 msg_print("It's the Moon.");
2526 msg_print("¡Ô±¿Ì¿¤ÎÎØ¡Õ¤À¡£");
2528 msg_print("It's the Wheel of Fortune.");
2531 wild_magic(randint0(32));
2536 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2538 msg_print("It's a teleport trump card.");
2541 teleport_player(10, TRUE);
2546 msg_print("¡ÔÀµµÁ¡Õ¤À¡£");
2548 msg_print("It's Justice.");
2551 set_blessed(p_ptr->lev, FALSE);
2556 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2558 msg_print("It's a teleport trump card.");
2561 teleport_player(100, TRUE);
2566 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2568 msg_print("It's a teleport trump card.");
2571 teleport_player(200, TRUE);
2576 msg_print("¡ÔÅã¡Õ¤À¡£");
2578 msg_print("It's the Tower.");
2586 msg_print("¡ÔÀáÀ©¡Õ¤À¡£");
2588 msg_print("It's Temperance.");
2591 sleep_monsters_touch();
2596 msg_print("¡ÔÅã¡Õ¤À¡£");
2598 msg_print("It's the Tower.");
2601 earthquake(py, px, 5);
2606 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2608 msg_print("It's the picture of a friendly monster.");
2611 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE1, PM_FORCE_PET)))
2617 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2619 msg_print("It's the picture of a friendly monster.");
2622 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE2, PM_FORCE_PET)))
2628 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2630 msg_print("It's the picture of a friendly monster.");
2633 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE4, PM_FORCE_PET)))
2639 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2641 msg_print("It's the picture of a friendly monster.");
2644 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE5, PM_FORCE_PET)))
2650 msg_print("¡ÔÎø¿Í¡Õ¤À¡£");
2652 msg_print("It's the Lovers.");
2655 if (get_aim_dir(&dir))
2656 (void)charm_monster(dir, MIN(p_ptr->lev, 20));
2661 msg_print("¡Ô±£¼Ô¡Õ¤À¡£");
2663 msg_print("It's the Hermit.");
2671 msg_print("¡Ô¿³È½¡Õ¤À¡£");
2673 msg_print("It's the Judgement.");
2676 do_cmd_rerate(FALSE);
2677 if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3)
2680 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
2682 msg_print("You are cured of all mutations.");
2685 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
2686 p_ptr->update |= PU_BONUS;
2693 msg_print("¡ÔÂÀÍÛ¡Õ¤À¡£");
2695 msg_print("It's the Sun.");
2698 chg_virtue(V_KNOWLEDGE, 1);
2699 chg_virtue(V_ENLIGHTEN, 1);
2705 msg_print("¡ÔÀ¤³¦¡Õ¤À¡£");
2707 msg_print("It's the World.");
2710 if (p_ptr->exp < PY_MAX_EXP)
2712 s32b ee = (p_ptr->exp / 25) + 1;
2713 if (ee > 5000) ee = 5000;
2715 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
2717 msg_print("You feel more experienced.");
2725 case 3: /* Reset Recall */
2728 if (!reset_recall()) return FALSE;
2731 case 4: /* Teleport Self */
2734 teleport_player(plev * 4, FALSE);
2737 case 5: /* Trump Spying */
2740 (void)set_tim_esp(randint1(30) + 25, FALSE);
2743 case 6: /* Teleport Away */
2746 if (!get_aim_dir(&dir)) return FALSE;
2747 (void)fire_beam(GF_AWAY_ALL, dir, plev);
2750 case 7: /* Trump Animals */
2752 bool pet = success; /* was (randint1(5) > 2) */
2753 int type = (pet ? SUMMON_ANIMAL_RANGER : SUMMON_ANIMAL);
2756 if (pet) mode |= PM_FORCE_PET;
2757 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2760 msg_print("¤¢¤Ê¤¿¤Ïưʪ¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2762 msg_print("You concentrate on the trump of an animal...");
2766 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
2770 msg_print("¾¤´¤µ¤ì¤¿Æ°Êª¤ÏÅܤäƤ¤¤ë¡ª");
2772 msg_print("The summoned animal gets angry!");
2783 case 8: /* Trump Reach */
2786 if (!get_aim_dir(&dir)) return FALSE;
2787 fetch(dir, plev * 15, TRUE);
2790 case 9: /* Trump Kamikaze */
2795 if (!target_set(TARGET_KILL)) return FALSE;
2802 msg_print("¤¢¤Ê¤¿¤Ï¥«¥ß¥«¥¼¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2804 msg_print("You concentrate on several trumps at once...");
2808 for (dummy = 2 + randint0(plev / 7); dummy > 0; dummy--)
2810 bool pet = success; /* was (randint1(10) > 3) */
2814 if (pet) mode |= PM_FORCE_PET;
2815 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2817 if (p_ptr->pclass == CLASS_BEASTMASTER)
2819 type = SUMMON_KAMIKAZE_LIVING;
2823 type = SUMMON_KAMIKAZE;
2826 if (summon_specific((pet ? -1 : 0), y, x, summon_lev, type, mode))
2830 msg_print("¾¤´¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
2832 msg_print("The summoned creatures get angry!");
2840 case 10: /* Phantasmal Servant */
2843 if (summon_specific(-1, py, px, (summon_lev * 3) / 2, SUMMON_PHANTOM, PM_FORCE_PET))
2846 msg_print("¸æÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¸æ¼ç¿ÍÍÍ¡©");
2848 msg_print("'Your wish, master?'");
2858 case 11: /* Speed Monster */
2861 bool old_target_pet = target_pet;
2863 if (!get_aim_dir(&dir))
2865 target_pet = old_target_pet;
2868 target_pet = old_target_pet;
2869 (void)speed_monster(dir);
2872 case 12: /* Teleport Level */
2876 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
2878 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
2880 (void)teleport_level(0);
2883 case 13: /* Dimension Door */
2887 msg_print("¼¡¸µ¤ÎÈ⤬³«¤¤¤¿¡£ÌÜŪÃϤòÁª¤ó¤Ç²¼¤µ¤¤¡£");
2889 msg_print("You open a dimensional gate. Choose a destination.");
2892 return dimension_door();
2895 case 14: /* Word of Recall */
2898 return word_of_recall();
2901 case 15: /* Banish */
2904 banish_monsters(plev * 4);
2907 case 16: /* Swap Position */
2911 project_length = -1;
2912 if (!get_aim_dir(&dir))
2919 (void)teleport_swap(dir);
2923 case 17: /* Trump Undead */
2925 bool pet = success; /* (randint1(10) > 3) */
2928 if (pet) mode |= PM_FORCE_PET;
2929 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2932 msg_print("¤¢¤Ê¤¿¤Ï¥¢¥ó¥Ç¥Ã¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2934 msg_print("You concentrate on the trump of an undead creature...");
2938 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_UNDEAD, mode))
2942 msg_print("¾¤´¤µ¤ì¤¿¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
2944 msg_print("The summoned undead creature gets angry!");
2955 case 18: /* Trump Reptiles */
2957 bool pet = success; /* was (randint1(5) > 2) */
2960 if (pet) mode |= PM_FORCE_PET;
2961 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2964 msg_print("¤¢¤Ê¤¿¤Ïà¨ÃîÎà¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2966 msg_print("You concentrate on the trump of a reptile...");
2970 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HYDRA, mode))
2974 msg_print("¾¤´¤µ¤ì¤¿à¨ÃîÎà¤ÏÅܤäƤ¤¤ë¡ª");
2976 msg_print("The summoned reptile gets angry!");
2987 case 19: /* Trump Monsters */
2992 msg_print("¤¢¤Ê¤¿¤Ï¥â¥ó¥¹¥¿¡¼¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2994 msg_print("You concentrate on several trumps at once...");
2998 for (dummy = 0; dummy < 1 + ((plev - 15)/ 10); dummy++)
3000 bool pet = success; /* was (randint1(10) > 3) */
3004 if (pet) mode |= PM_FORCE_PET;
3005 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3007 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
3009 if (p_ptr->pclass == CLASS_BEASTMASTER)
3011 type = SUMMON_LIVING;
3018 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
3022 msg_print("¾¤´¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
3024 msg_print("The summoned creatures get angry!");
3032 case 20: /* Trump Hounds */
3034 bool pet = success; /* was (randint1(5) > 2) */
3035 u32b mode = PM_ALLOW_GROUP;
3037 if (pet) mode |= PM_FORCE_PET;
3038 else mode |= PM_NO_PET;
3041 msg_print("¤¢¤Ê¤¿¤Ï¥Ï¥¦¥ó¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3043 msg_print("You concentrate on the trump of a hound...");
3047 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HOUND, mode))
3051 msg_print("¾¤´¤µ¤ì¤¿¥Ï¥¦¥ó¥É¤ÏÅܤäƤ¤¤ë¡ª");
3053 msg_print("The summoned hounds get angry!");
3064 case 21: /* Trump Branding */
3070 case 22: /* Living Trump */
3074 /* Teleport control */
3077 /* Random teleportation (uncontrolled) */
3079 /* Gain the mutation */
3080 if (gain_random_mutation(dummy))
3082 msg_print("¤¢¤Ê¤¿¤ÏÀ¸¤¤Æ¤¤¤ë¥«¡¼¥É¤ËÊѤï¤Ã¤¿¡£");
3084 msg_print("You have turned into a Living Trump.");
3089 case 23: /* Trump Cyberdemon */
3091 bool pet = success; /* was (randint1(10) > 3) */
3094 if (pet) mode |= PM_FORCE_PET;
3095 else mode |= PM_NO_PET;
3098 msg_print("¤¢¤Ê¤¿¤Ï¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3100 msg_print("You concentrate on the trump of a Cyberdemon...");
3104 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_CYBER, mode))
3108 msg_print("¾¤´¤µ¤ì¤¿¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3110 msg_print("The summoned Cyberdemon gets angry!");
3121 case 24: /* Trump Divination */
3124 (void)detect_all(DETECT_RAD_DEFAULT);
3127 case 25: /* Trump Lore */
3130 return identify_fully(FALSE);
3133 case 26: /* Heal Monster */
3136 bool old_target_pet = target_pet;
3138 if (!get_aim_dir(&dir))
3140 target_pet = old_target_pet;
3143 target_pet = old_target_pet;
3145 (void)heal_monster(dir, p_ptr->lev * 10 + 200);
3148 case 27: /* Trump Dragon */
3150 bool pet = success; /* was (randint1(10) > 3) */
3153 if (pet) mode |= PM_FORCE_PET;
3154 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3157 msg_print("¤¢¤Ê¤¿¤Ï¥É¥é¥´¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3159 msg_print("You concentrate on the trump of a dragon...");
3163 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DRAGON, mode))
3167 msg_print("¾¤´¤µ¤ì¤¿¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3169 msg_print("The summoned dragon gets angry!");
3180 case 28: /* Trump Meteor */
3183 int x, y, dx, dy, i;
3184 int b = 10 + randint1(10);
3185 for (i = 0; i < b; i++)
3187 int count = 0, d = 0;
3192 if (count > 20) break;
3193 x = px - 8 + randint0(17);
3194 y = py - 8 + randint0(17);
3196 if (!in_bounds(y, x) || !projectable(py, px, y, x)) continue;
3198 dx = (px > x) ? (px - x) : (x - px);
3199 dy = (py > y) ? (py - y) : (y - py);
3201 /* Approximate distance */
3202 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
3206 if (count > 20) continue;
3208 project(0, 2, y, x, plev * 2, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
3212 case 29: /* Trump Demon */
3214 bool pet = success; /* was (randint1(10) > 3) */
3217 if (pet) mode |= PM_FORCE_PET;
3218 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3221 msg_print("¤¢¤Ê¤¿¤Ï¥Ç¡¼¥â¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3223 msg_print("You concentrate on the trump of a demon...");
3227 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DEMON, mode))
3231 msg_print("¾¤´¤µ¤ì¤¿¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3233 msg_print("The summoned demon gets angry!");
3244 case 30: /* Trump Greater Undead */
3246 bool pet = success; /* was (randint1(10) > 3) */
3249 if (pet) mode |= PM_FORCE_PET;
3250 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3252 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
3255 msg_print("¤¢¤Ê¤¿¤Ï¶¯ÎϤʥ¢¥ó¥Ç¥Ã¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3257 msg_print("You concentrate on the trump of a greater undead being...");
3261 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HI_UNDEAD, mode))
3265 msg_print("¾¤´¤µ¤ì¤¿¾åµé¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
3267 msg_print("The summoned greater undead creature gets angry!");
3278 case 31: /* Trump Ancient Dragon */
3280 bool pet = success; /* was (randint1(10) > 3) */
3284 if (pet) mode |= PM_FORCE_PET;
3285 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3287 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
3289 if (p_ptr->pclass == CLASS_BEASTMASTER)
3291 type = SUMMON_HI_DRAGON_LIVING;
3295 type = SUMMON_HI_DRAGON;
3299 msg_print("¤¢¤Ê¤¿¤Ï¸ÅÂå¥É¥é¥´¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3301 msg_print("You concentrate on the trump of an ancient dragon...");
3305 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
3309 msg_print("¾¤´¤µ¤ì¤¿¸ÅÂå¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3311 msg_print("The summoned ancient dragon gets angry!");
3324 msg_format("̤ÃΤΥ«¡¼¥É¤Î¼öʸ¤Ç¤¹: %d", spell);
3326 msg_format("You cast an unknown Trump spell: %d.", spell);
3335 msg_print("ï¤â¤¢¤Ê¤¿¤Î¥«¡¼¥É¤Î¸Æ¤ÓÀ¼¤ËÅú¤¨¤Ê¤¤¡£");
3337 msg_print("Nobody answers to your Trump call.");
3346 static bool cast_arcane_spell(int spell)
3350 int plev = p_ptr->lev;
3353 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3354 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3355 else beam = plev / 2;
3360 if (!get_aim_dir(&dir)) return FALSE;
3362 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
3363 damroll(3 + ((plev - 1) / 5), 3));
3365 case 1: /* Wizard Lock */
3366 if (!get_aim_dir(&dir)) return FALSE;
3368 (void)wizard_lock(dir);
3370 case 2: /* Detect Invisibility */
3371 (void)detect_monsters_invis(DETECT_RAD_DEFAULT);
3373 case 3: /* Detect Monsters */
3374 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
3377 teleport_player(10, FALSE);
3379 case 5: /* Light Area */
3380 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
3382 case 6: /* Trap & Door Destruction */
3383 if (!get_aim_dir(&dir)) return FALSE;
3385 (void)destroy_door(dir);
3387 case 7: /* Cure Light Wounds */
3388 (void)hp_player(damroll(2, 8));
3389 (void)set_cut(p_ptr->cut - 10);
3391 case 8: /* Detect Doors & Traps */
3392 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
3393 (void)detect_doors(DETECT_RAD_DEFAULT);
3394 (void)detect_stairs(DETECT_RAD_DEFAULT);
3396 case 9: /* Phlogiston */
3399 case 10: /* Detect Treasure */
3400 (void)detect_treasure(DETECT_RAD_DEFAULT);
3401 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
3403 case 11: /* Detect Enchantment */
3404 (void)detect_objects_magic(DETECT_RAD_DEFAULT);
3406 case 12: /* Detect Objects */
3407 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
3409 case 13: /* Cure Poison */
3410 (void)set_poisoned(0);
3412 case 14: /* Resist Cold */
3413 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3415 case 15: /* Resist Fire */
3416 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3418 case 16: /* Resist Lightning */
3419 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3421 case 17: /* Resist Acid */
3422 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3424 case 18: /* Cure Medium Wounds */
3425 (void)hp_player(damroll(4, 8));
3426 (void)set_cut((p_ptr->cut / 2) - 50);
3428 case 19: /* Teleport */
3429 teleport_player(plev * 5, FALSE);
3431 case 20: /* Identify */
3432 return ident_spell(FALSE);
3433 case 21: /* Stone to Mud */
3434 if (!get_aim_dir(&dir)) return FALSE;
3436 (void)wall_to_mud(dir);
3438 case 22: /* Ray of Light */
3439 if (!get_aim_dir(&dir)) return FALSE;
3442 msg_print("¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
3444 msg_print("A line of light appears.");
3447 (void)lite_line(dir);
3449 case 23: /* Satisfy Hunger */
3450 (void)set_food(PY_FOOD_MAX - 1);
3452 case 24: /* See Invisible */
3453 (void)set_tim_invis(randint1(24) + 24, FALSE);
3455 case 25: /* Conjure Elemental */
3456 if (!summon_specific(-1, py, px, plev, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3459 msg_print("¥¨¥ì¥á¥ó¥¿¥ë¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3461 msg_print("No Elementals arrive.");
3465 case 26: /* Teleport Level */
3467 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
3469 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
3471 (void)teleport_level(0);
3473 case 27: /* Teleport Away */
3474 if (!get_aim_dir(&dir)) return FALSE;
3476 (void)fire_beam(GF_AWAY_ALL, dir, plev);
3478 case 28: /* Elemental Ball */
3479 if (!get_aim_dir(&dir)) return FALSE;
3481 switch (randint1(4))
3483 case 1: dummy = GF_FIRE;break;
3484 case 2: dummy = GF_ELEC;break;
3485 case 3: dummy = GF_COLD;break;
3486 default: dummy = GF_ACID;break;
3488 fire_ball(dummy, dir, 75 + (plev), 2);
3490 case 29: /* Detection */
3491 (void)detect_all(DETECT_RAD_DEFAULT);
3493 case 30: /* Word of Recall */
3494 return word_of_recall();
3495 case 31: /* Clairvoyance */
3496 chg_virtue(V_KNOWLEDGE, 1);
3497 chg_virtue(V_ENLIGHTEN, 1);
3499 if (!p_ptr->telepathy)
3501 (void)set_tim_esp(randint1(30) + 25, FALSE);
3505 msg_format("You cast an unknown Arcane spell: %d.", spell);
3513 static bool cast_enchant_spell(int spell)
3515 int plev = p_ptr->lev;
3520 case 0: /* Infravision */
3521 set_tim_infra(100 + randint1(100), FALSE);
3523 case 1: /* Regeneration */
3524 set_tim_regen(80 + randint1(80), FALSE);
3526 case 2: /* Satisfy Hunger */
3527 (void)set_food(PY_FOOD_MAX - 1);
3529 case 3: /* Resist Cold */
3530 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3532 case 4: /* Resist Fire */
3533 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3535 case 5: /* Heroism */
3536 (void)set_hero(randint1(25) + 25, FALSE);
3537 (void)hp_player(10);
3538 (void)set_afraid(0);
3540 case 6: /* Resist Lightning */
3541 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3543 case 7: /* Resist Acid */
3544 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3546 case 8: /* See Invisibility */
3547 (void)set_tim_invis(randint1(24) + 24, FALSE);
3549 case 9: /* Remove Curse */
3553 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
3555 msg_print("You feel as if someone is watching over you.");
3559 case 10: /* Resist Poison */
3560 (void)set_oppose_pois(randint1(20) + 20, FALSE);
3562 case 11: /* Berserk */
3563 (void)set_shero(randint1(25) + 25, FALSE);
3564 (void)hp_player(30);
3565 (void)set_afraid(0);
3567 case 12: /* Self Knowledge */
3568 (void)self_knowledge();
3570 case 13: /* Protection from Evil */
3571 (void)set_protevil(randint1(25) + 3 * p_ptr->lev, FALSE);
3573 case 14: /* Healing */
3579 case 15: /* Mana Branding */
3580 return choose_ele_attack();
3581 case 16: /* Telepathy */
3582 (void)set_tim_esp(randint1(30) + 25, FALSE);
3584 case 17: /* Stone Skin */
3585 (void)set_shield(randint1(20) + 30, FALSE);
3587 case 18: /* Resistance */
3588 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3589 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3590 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3591 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3592 (void)set_oppose_pois(randint1(20) + 20, FALSE);
3594 case 19: /* Haste */
3595 (void)set_fast(randint1(20 + plev) + plev, FALSE);
3597 case 20: /* Walk through Wall */
3598 (void)set_kabenuke(randint1(plev/2) + plev/2, FALSE);
3600 case 21: /* Pulish Shield */
3601 (void)pulish_shield();
3603 case 22: /* Create Golem */
3604 if (summon_specific(-1, py, px, plev, SUMMON_GOLEM, PM_FORCE_PET))
3607 msg_print("¥´¡¼¥ì¥à¤òºî¤Ã¤¿¡£");
3609 msg_print("You make a golem.");
3615 msg_print("¤¦¤Þ¤¯¥´¡¼¥ì¥à¤òºî¤ì¤Ê¤«¤Ã¤¿¡£");
3617 msg_print("No Golems arrive.");
3621 case 23: /* Magic armor */
3622 (void)set_magicdef(randint1(20) + 20, FALSE);
3624 case 24: /* Remove Enchantment */
3625 if (!mundane_spell(TRUE)) return FALSE;
3627 case 25: /* Remove All Curse */
3628 if (remove_all_curse())
3631 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
3633 msg_print("You feel as if someone is watching over you.");
3637 case 26: /* Total Knowledge */
3638 return identify_fully(FALSE);
3639 case 27: /* Enchant Weapon */
3640 return enchant_spell(randint0(4) + 1, randint0(4) + 1, 0);
3641 case 28: /* Enchant Armor */
3642 return enchant_spell(0, 0, randint0(3) + 2);
3643 case 29: /* Brand Weapon */
3644 brand_weapon(randint0(18));
3646 case 30: /* Living Trump */
3648 /* Teleport control */
3651 /* Random teleportation (uncontrolled) */
3653 /* Gain the mutation */
3654 if (gain_random_mutation(dummy))
3656 msg_print("¤¢¤Ê¤¿¤ÏÀ¸¤¤Æ¤¤¤ë¥«¡¼¥É¤ËÊѤï¤Ã¤¿¡£");
3658 msg_print("You have turned into a Living Trump.");
3661 case 31: /* Immune */
3662 return choose_ele_immune(13 + randint1(13));
3664 msg_format("You cast an unknown Craft spell: %d.", spell);
3673 * An "item_tester_hook" for offer
3675 static bool item_tester_offer(object_type *o_ptr)
3677 /* Flasks of oil are okay */
3678 if (o_ptr->tval != TV_CORPSE) return (FALSE);
3680 if (o_ptr->sval != SV_CORPSE) return (FALSE);
3682 if (my_strchr("pht", r_info[o_ptr->pval].d_char)) return (TRUE);
3684 /* Assume not okay */
3689 static bool cast_daemon_spell(int spell)
3692 int plev = p_ptr->lev;
3694 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3695 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3696 else beam = plev / 2;
3700 case 0: /* Magic Missile */
3701 if (!get_aim_dir(&dir)) return FALSE;
3703 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
3704 damroll(3 + ((plev - 1) / 5), 4));
3706 case 1: /* Detect Undead & Demons -> Unlife */
3707 (void)detect_monsters_nonliving(DETECT_RAD_DEFAULT);
3710 (void)set_blessed(randint1(12) + 12, FALSE);
3712 case 3: /* Resist Fire */
3713 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3715 case 4: /* Horrify */
3716 if (!get_aim_dir(&dir)) return FALSE;
3718 (void)fear_monster(dir, plev);
3719 (void)stun_monster(dir, plev);
3721 case 5: /* Nether Bolt */
3722 if (!get_aim_dir(&dir)) return FALSE;
3724 fire_bolt_or_beam(beam, GF_NETHER, dir,
3725 damroll(6 + ((plev - 5) / 4), 8));
3727 case 6: /* Summon monster, demon */
3728 if (!summon_specific(-1, py, px, (plev * 3) / 2, SUMMON_MANES, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3731 msg_print("¸ÅÂå¤Î»àÎî¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3733 msg_print("No Manes arrive.");
3737 case 7: /* Mini Hellfire */
3738 if (!get_aim_dir(&dir)) return FALSE;
3740 fire_ball(GF_HELL_FIRE, dir,
3741 (damroll(3, 6) + plev +
3742 (plev / (((p_ptr->pclass == CLASS_MAGE) ||
3743 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
3744 (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
3745 ((plev < 30) ? 2 : 3));
3747 case 8: /* Enslave Demon */
3748 if (!get_aim_dir(&dir)) return FALSE;
3750 (void)control_one_demon(dir, plev);
3752 case 9: /* Vision */
3753 map_area(DETECT_RAD_MAP);
3755 case 10: /* Resist Nether */
3756 (void)set_tim_res_nether(randint1(20) + 20, FALSE);
3758 case 11: /* Plasma Bolt */
3759 if (!get_aim_dir(&dir)) return FALSE;
3761 fire_bolt_or_beam(beam, GF_PLASMA, dir,
3762 damroll(11 + ((plev - 5) / 4), 8));
3764 case 12: /* Fire Ball */
3765 if (!get_aim_dir(&dir)) return FALSE;
3767 fire_ball(GF_FIRE, dir, plev + 55, 2);
3769 case 13: /* Fire Branding */
3772 case 14: /* Nether Ball */
3773 if (!get_aim_dir(&dir)) return FALSE;
3775 fire_ball(GF_NETHER, dir, plev*3/2 + 100, plev / 20+2);
3777 case 15: /* Summon monster, demon */
3779 bool pet = !one_in_(3);
3782 if (pet) mode |= PM_FORCE_PET;
3783 else mode |= PM_NO_PET;
3784 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
3786 if (summon_specific((pet ? -1 : 0), py, px, plev*2/3+randint1(plev/2), SUMMON_DEMON, mode))
3789 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
3791 msg_print("The area fills with a stench of sulphur and brimstone.");
3797 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
3799 msg_print("'What is thy bidding... Master?'");
3804 msg_print("¡ÖÈܤ·¤¼Ô¤è¡¢²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª ¤ªÁ°¤Îº²¤òĺ¤¯¤¾¡ª¡×");
3806 msg_print("'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'");
3813 msg_print("°Ëâ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3815 msg_print("No demons arrive.");
3820 case 16: /* Telepathy */
3821 (void)set_tim_esp(randint1(30) + 25, FALSE);
3823 case 17: /* Demoncloak */
3825 int dur=randint1(20) + 20;
3827 set_oppose_fire(dur, FALSE);
3828 set_oppose_cold(dur, FALSE);
3829 set_tim_sh_fire(dur, FALSE);
3833 case 18: /* Rain of Lava */
3834 fire_ball(GF_FIRE, 0, (55 + plev)*2, 3);
3835 fire_ball_hide(GF_LAVA_FLOW, 0, 2+randint1(2), 3);
3837 case 19: /* Plasma ball */
3838 if (!get_aim_dir(&dir)) return FALSE;
3840 fire_ball(GF_PLASMA, dir, plev*3/2 + 80, 2 + plev/40);
3842 case 20: /* Mimic demon */
3843 (void)set_mimic(10+plev/2 + randint1(10+plev/2), MIMIC_DEMON, FALSE);
3845 case 21: /* Nether Wave == Dispel Good */
3846 (void)dispel_monsters(randint1(plev * 2));
3847 (void)dispel_good(randint1(plev * 2));
3850 if (!get_aim_dir(&dir)) return FALSE;
3851 fire_ball(GF_NEXUS, dir, 100 + plev*2, 4);
3853 case 23: /* Hand Doom */
3854 if (!get_aim_dir(&dir)) return FALSE;
3856 else msg_print("<ÇËÌǤμê>¤òÊü¤Ã¤¿¡ª");
3858 else msg_print("You invoke the Hand of Doom!");
3861 fire_ball_hide(GF_HAND_DOOM, dir, plev * 2, 0);
3863 case 24: /* Heroism */
3864 (void)set_hero(randint1(25) + 25, FALSE);
3865 (void)hp_player(10);
3866 (void)set_afraid(0);
3868 case 25: /* Tim resist time */
3869 (void)set_tim_res_time(randint1(20)+20, FALSE);
3871 case 26: /* Circle of Madness */
3872 fire_ball(GF_CHAOS, 0, 50+plev, 3+plev/20);
3873 fire_ball(GF_CONFUSION, 0, 50+plev, 3+plev/20);
3874 fire_ball(GF_CHARM, 0, 20+plev, 3+plev/20);
3876 case 27: /* True Discharge Minion */
3879 case 28: /* Summon Greater Demon */
3886 item_tester_hook = item_tester_offer;
3888 q = "¤É¤Î»àÂΤòÊû¤²¤Þ¤¹¤«? ";
3889 s = "Êû¤²¤é¤ì¤ë»àÂΤò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
3891 q = "Sacrifice which corpse? ";
3892 s = "You have nothing to scrifice.";
3894 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return FALSE;
3896 /* Get the item (in the pack) */
3899 o_ptr = &inventory[item];
3902 /* Get the item (on the floor) */
3905 o_ptr = &o_list[0 - item];
3908 summon_lev = p_ptr->lev * 2 / 3 + r_info[o_ptr->pval].level;
3909 if (summon_specific(-1, py, px, summon_lev, SUMMON_HI_DEMON, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3912 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
3914 msg_print("The area fills with a stench of sulphur and brimstone.");
3919 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
3921 msg_print("'What is thy bidding... Master?'");
3924 /* Decrease the item (from the pack) */
3927 inven_item_increase(item, -1);
3928 inven_item_describe(item);
3929 inven_item_optimize(item);
3932 /* Decrease the item (from the floor) */
3935 floor_item_increase(0 - item, -1);
3936 floor_item_describe(0 - item);
3937 floor_item_optimize(0 - item);
3943 msg_print("°Ëâ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3945 msg_print("No Greater Demon arrive.");
3950 case 29: /* Nether Storm */
3951 if (!get_aim_dir(&dir)) return FALSE;
3953 fire_ball(GF_NETHER, dir, plev*15, plev / 5);
3955 case 30: /* Blood curse */
3957 if (!get_aim_dir(&dir)) return FALSE;
3959 fire_ball_hide(GF_BLOOD_CURSE, dir, 600, 0);
3961 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "·ì¤Î¼ö¤¤", -1);
3963 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "Blood curse", -1);
3967 case 31: /* Mimic Demon lord */
3968 (void)set_mimic(15 + randint1(15), MIMIC_DEMON_LORD, FALSE);
3971 msg_format("You cast an unknown Daemon spell: %d.", spell);
3979 static bool cast_crusade_spell(int spell)
3983 int plev = p_ptr->lev;
3985 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3986 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3987 else beam = plev / 2;
3992 if (!get_aim_dir(&dir)) return FALSE;
3994 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
3995 damroll(3 + ((plev - 1) / 5), 4));
3998 (void)detect_monsters_evil(DETECT_RAD_DEFAULT);
4000 case 2: /* Remove Fear */
4001 (void)set_afraid(0);
4004 if (!get_aim_dir(&dir)) return FALSE;
4006 (void)fear_monster(dir, plev);
4009 (void)sleep_monsters_touch();
4012 teleport_player(25 + plev / 2, FALSE);
4015 if (!get_aim_dir(&dir)) return FALSE;
4016 fire_blast(GF_LITE, dir, 3+((plev-1)/9), 2, 10, 3);
4020 (void)set_poisoned(0);
4024 if (!get_aim_dir(&dir)) return FALSE;
4025 (void)fire_ball(GF_AWAY_EVIL, dir, MAX_SIGHT*5, 0);
4027 case 9: /* Holy Orb */
4028 if (!get_aim_dir(&dir)) return FALSE;
4030 fire_ball(GF_HOLY_FIRE, dir,
4031 (damroll(3, 6) + plev +
4032 (plev / ((p_ptr->pclass == CLASS_PRIEST ||
4033 p_ptr->pclass == CLASS_HIGH_MAGE ||
4034 p_ptr->pclass == CLASS_SORCERER) ? 2 : 4))),
4035 ((plev < 30) ? 2 : 3));
4038 case 10: /* Exorcism */
4039 (void)dispel_undead(randint1(plev));
4040 (void)dispel_demons(randint1(plev));
4041 (void)turn_evil(plev);
4043 case 11: /* Remove Curse */
4047 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
4049 msg_print("You feel as if someone is watching over you.");
4053 case 12: /* Sense Unseen */
4054 (void)set_tim_invis(randint1(24) + 24, FALSE);
4056 case 13: /* Protection from Evil */
4057 (void)set_protevil(randint1(25) + 3 * p_ptr->lev, FALSE);
4060 if (!get_aim_dir(&dir)) return FALSE;
4061 (void)fire_bolt(GF_ELEC, dir, plev*5);
4063 case 15: /* Holy Word */
4064 (void)dispel_evil(randint1(plev * 6));
4065 (void)hp_player(100);
4066 (void)set_afraid(0);
4067 (void)set_poisoned(0);
4072 if (!get_aim_dir(&dir)) return FALSE;
4074 (void)destroy_door(dir);
4077 if (!get_aim_dir(&dir)) return FALSE;
4078 (void)stasis_evil(dir);
4081 set_tim_sh_holy(randint1(20)+20, FALSE);
4083 case 19: /* Dispel Undead + Demons */
4084 (void)dispel_undead(randint1(plev * 4));
4085 (void)dispel_demons(randint1(plev * 4));
4087 case 20: /* Dispel Evil */
4088 (void)dispel_evil(randint1(plev * 4));
4093 case 22: /* Star Burst */
4094 if (!get_aim_dir(&dir)) return FALSE;
4096 fire_ball(GF_LITE, dir, 100+plev*2, 4);
4098 case 23: /* Summon monster, angel */
4100 bool pet = !one_in_(3);
4103 if (pet) mode |= PM_FORCE_PET;
4104 else mode |= PM_NO_PET;
4105 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
4107 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, SUMMON_ANGEL, mode))
4111 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
4113 msg_print("'What is thy bidding... Master?'");
4118 msg_print("¡Ö²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª °¹Ô¼Ô¤è¡¢²ù¤¤²þ¤á¤è¡ª¡×");
4120 msg_print("Mortal! Repent of thy impiousness.");
4126 case 24: /* Heroism */
4127 (void)set_hero(randint1(25) + 25, FALSE);
4128 (void)hp_player(10);
4129 (void)set_afraid(0);
4131 case 25: /* Remove All Curse */
4132 if (remove_all_curse())
4135 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
4137 msg_print("You feel as if someone is watching over you.");
4141 case 26: /* Banishment */
4142 if (banish_evil(100))
4145 msg_print("¿ÀÀ»¤ÊÎϤ¬¼Ù°¤òÂǤÁʧ¤Ã¤¿¡ª");
4147 msg_print("The holy power banishes evil!");
4152 case 27: /* Word of Destruction */
4153 (void)destroy_area(py, px, 13 + randint0(5), FALSE);
4155 case 28: /* Eye for an Eye */
4156 set_tim_eyeeye(randint1(10)+10, FALSE);
4163 int b = 10 + randint1(10);
4165 if (!get_aim_dir(&dir)) return FALSE;
4167 /* Use the given direction */
4168 tx = px + 99 * ddx[dir];
4169 ty = py + 99 * ddy[dir];
4171 /* Hack -- Use an actual "target" */
4172 if ((dir == 5) && target_okay())
4183 /* Hack -- Stop at the target */
4184 if ((y == ty) && (x == tx)) break;
4188 mmove2(&ny, &nx, py, px, ty, tx);
4190 /* Stop at maximum range */
4191 if (MAX_RANGE <= distance(py, px, ny, nx)) break;
4193 /* Stopped by walls/doors */
4194 if (!cave_have_flag_bold(ny, nx, FF_PROJECT)) break;
4196 /* Stopped by monsters */
4197 if ((dir != 5) && cave[ny][nx].m_idx != 0) break;
4199 /* Save the new location */
4206 for (i = 0; i < b; i++)
4208 int count = 20, d = 0;
4214 x = tx - 5 + randint0(11);
4215 y = ty - 5 + randint0(11);
4217 dx = (tx > x) ? (tx - x) : (x - tx);
4218 dy = (ty > y) ? (ty - y) : (y - ty);
4220 /* Approximate distance */
4221 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
4222 /* Within the radius */
4226 if (count < 0) continue;
4228 /* Cannot penetrate perm walls */
4229 if (!in_bounds(y,x) ||
4230 cave_stop_disintegration(y,x) ||
4231 !in_disintegration_range(ty, tx, y, x))
4234 project(0, 2, y, x, plev * 3+25, GF_DISINTEGRATE, PROJECT_JUMP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1);
4238 case 30: /* Divine Intervention */
4239 project(0, 1, py, px, plev*11, GF_HOLY_FIRE, PROJECT_KILL, -1);
4240 dispel_monsters(plev * 4);
4242 stun_monsters(plev * 4);
4243 confuse_monsters(plev * 4);
4244 turn_monsters(plev * 4);
4245 stasis_monsters(plev * 4);
4246 (void)hp_player(100);
4252 for (i = 0; i < 12; i++)
4259 scatter(&my, &mx, py, px, 4, 0);
4261 /* Require empty grids */
4262 if (cave_empty_bold2(my, mx)) break;
4264 if (attempt < 0) continue;
4265 summon_specific(-1, my, mx, plev, SUMMON_KNIGHTS, (PM_ALLOW_GROUP | PM_FORCE_PET | PM_HASTE));
4267 (void)set_hero(randint1(25) + 25, FALSE);
4268 (void)set_blessed(randint1(25) + 25, FALSE);
4269 (void)set_fast(randint1(20 + plev) + plev, FALSE);
4270 (void)set_protevil(randint1(25) + 25, FALSE);
4271 (void)set_afraid(0);
4276 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤ÊÇ˼٤μöʸ %d ¤ò¾§¤¨¤¿¡£", spell);
4278 msg_format("You cast an unknown crusade spell: %d.", spell);
4289 void stop_singing(void)
4291 if (p_ptr->pclass != CLASS_BARD) return;
4293 if (p_ptr->magic_num1[1])
4295 p_ptr->magic_num1[1] = 0;
4298 if (!p_ptr->magic_num1[0]) return;
4300 /* Hack -- if called from set_action(), avoid recursive loop */
4301 if (p_ptr->action == ACTION_SING) set_action(ACTION_NONE);
4303 switch(p_ptr->magic_num1[0])
4306 if (!p_ptr->blessed)
4308 msg_print("¹â·é¤Êµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4310 msg_print("The prayer has expired.");
4317 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4319 msg_print("The heroism wears off.");
4321 /* Recalculate hitpoints */
4322 p_ptr->update |= (PU_HP);
4326 if (!p_ptr->tim_esp)
4329 msg_print("°Õ¼±¤Ï¸µ¤ËÌá¤Ã¤¿¡£");
4331 msg_print("Your consciousness contracts again.");
4333 /* Update the monsters */
4334 p_ptr->update |= (PU_MONSTERS);
4338 if (!p_ptr->tim_stealth)
4340 msg_print("»Ñ¤¬¤Ï¤Ã¤¤ê¤È¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
4342 msg_print("You are no longer hided.");
4346 if (!p_ptr->oppose_acid)
4348 msg_print("»À¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4350 msg_print("You feel less resistant to acid.");
4352 if (!p_ptr->oppose_elec)
4354 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4356 msg_print("You feel less resistant to elec.");
4358 if (!p_ptr->oppose_fire)
4360 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4362 msg_print("You feel less resistant to fire.");
4364 if (!p_ptr->oppose_cold)
4366 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4368 msg_print("You feel less resistant to cold.");
4370 if (!p_ptr->oppose_pois)
4372 msg_print("ÆǤؤÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4374 msg_print("You feel less resistant to pois.");
4380 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
4382 msg_print("You feel yourself slow down.");
4389 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4391 msg_print("The heroism wears off.");
4393 /* Recalculate hitpoints */
4394 p_ptr->update |= (PU_HP);
4399 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
4401 msg_print("You feel yourself slow down.");
4408 msg_print("̵Ũ¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£");
4410 msg_print("The invulnerability wears off.");
4413 p_ptr->redraw |= (PR_MAP);
4415 /* Update monsters */
4416 p_ptr->update |= (PU_MONSTERS);
4419 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4423 p_ptr->magic_num1[0] = MUSIC_NONE;
4424 p_ptr->magic_num2[0] = 0;
4426 /* Recalculate bonuses */
4427 p_ptr->update |= (PU_BONUS | PU_HP);
4429 /* Redraw status bar */
4430 p_ptr->redraw |= (PR_STATUS);
4434 static bool cast_music_spell(int spell)
4436 int plev = p_ptr->lev;
4439 if(p_ptr->magic_num1[0])
4444 p_ptr->magic_num2[0] = spell;
4448 case 0: /* Song of Holding ÃÙÆߤβΠ*/
4450 msg_print("¤æ¤Ã¤¯¤ê¤È¤·¤¿¥á¥í¥Ç¥£¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4452 msg_print("You start humming a slow, steady melody...");
4454 p_ptr->magic_num1[0] = MUSIC_SLOW;
4456 case 1: /* Song of Blessing ½ËÊ¡¤Î²Î */
4458 msg_print("¸·¤«¤Ê¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4460 msg_print("The holy power of the Music of the Ainur enters you...");
4462 p_ptr->magic_num1[0] = MUSIC_BLESS;
4465 case 2: /* Wrecking Note Êø²õ¤Î²»¿§ */
4466 if (!get_aim_dir(&dir)) return FALSE;
4467 fire_bolt(GF_SOUND, dir,
4468 damroll(4 + ((plev - 1) / 5), 4));
4470 case 3: /* Stun Pattern Û¯Û°¤ÎÀûΧ */
4472 msg_print("âÁÏǤµ¤»¤ë¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4474 msg_print("You weave a pattern of sounds to bewilder and daze...");
4476 p_ptr->magic_num1[0] = MUSIC_STUN;
4478 case 4: /* Flow of life À¸Ì¿¤Îή¤ì */
4480 msg_print("²Î¤òÄ̤·¤ÆÂΤ˳赤¤¬Ìá¤Ã¤Æ¤¤¿¡¥¡¥¡¥");
4482 msg_print("Life flows through you as you sing a song of healing...");
4484 p_ptr->magic_num1[0] = MUSIC_L_LIFE;
4486 case 5: /* Song of the Sun ÂÀÍۤβΠ*/
4488 msg_print("¸÷¤êµ±¤¯²Î¤¬ÊÕ¤ê¤ò¾È¤é¤·¤¿¡£");
4490 msg_print("Your uplifting song brings brightness to dark places...");
4492 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
4494 case 6: /* Song of fear ¶²ÉݤβΠ*/
4496 msg_print("¤ª¤É¤í¤ª¤É¤í¤·¤¤¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4498 msg_print("You start weaving a fearful pattern...");
4500 p_ptr->magic_num1[0] = MUSIC_FEAR;
4502 case 7: /* Heroic Ballad À襤¤Î²Î */
4504 msg_print("·ã¤·¤¤À襤¤Î²Î¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4506 msg_print("You start singing a song of intense fighting...");
4508 p_ptr->magic_num1[0] = MUSIC_HERO;
4510 case 8: /* Clairaudience ÎîŪÃγР*/
4512 msg_print("ÀŤ«¤Ê²»³Ú¤¬´¶³Ð¤ò¸¦¤®À¡¤Þ¤µ¤»¤¿¡¥¡¥¡¥");
4514 msg_print("Your quiet music sharpens your sense of hearing...");
4516 p_ptr->magic_num1[0] = MUSIC_DETECT;
4518 case 9: /* º²¤Î²Î */
4520 msg_print("Àº¿À¤òDZ¤¸¶Ê¤²¤ë²Î¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4522 msg_print("You start singing a song of soul in pain...");
4524 p_ptr->magic_num1[0] = MUSIC_PSI;
4526 case 10: /* Song of Lore Ãμ±¤Î²Î */
4528 msg_print("¤³¤ÎÀ¤³¦¤ÎÃ챤¬Î®¤ì¹þ¤ó¤Ç¤¤¿¡¥¡¥¡¥");
4530 msg_print("You recall the rich lore of the world...");
4532 p_ptr->magic_num1[0] = MUSIC_ID;
4534 case 11: /* hidding song ±£ÆۤβΠ*/
4536 msg_print("¤¢¤Ê¤¿¤Î»Ñ¤¬·Ê¿§¤Ë¤È¤±¤³¤ó¤Ç¤¤¤Ã¤¿¡¥¡¥¡¥");
4538 msg_print("Your song carries you beyond the sight of mortal eyes...");
4540 p_ptr->magic_num1[0] = MUSIC_STEALTH;
4542 case 12: /* Illusion Pattern ¸¸±Æ¤ÎÀûΧ */
4544 msg_print("ÊÕ¤ê°ìÌ̤˸¸±Æ¤¬¸½¤ì¤¿¡¥¡¥¡¥");
4546 msg_print("You weave a pattern of sounds to beguile and confuse...");
4548 p_ptr->magic_num1[0] = MUSIC_CONF;
4550 case 13: /* Doomcall (vibration song) ÇËÌǤζ«¤Ó */
4552 msg_print("¹ì²»¤¬¶Á¤¤¤¿¡¥¡¥¡¥");
4554 msg_print("The fury of the Downfall of Numenor lashes out...");
4556 p_ptr->magic_num1[0] = MUSIC_SOUND;
4558 case 14: /* Firiel's Song (song of the Undeads) ¥Õ¥£¥ê¥¨¥ë¤Î²Î */
4560 msg_print("À¸Ì¿¤ÈÉü³è¤Î¥Æ¡¼¥Þ¤òÁդǻϤ᤿¡¥¡¥¡¥");
4562 msg_print("The themes of life and revival are woven into your song...");
4564 animate_dead(0, py, px);
4566 case 15: /* Fellowship Chant (charming song) ι¤ÎÃç´Ö */
4568 msg_print("°Â¤é¤«¤Ê¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4570 msg_print("You weave a slow, soothing melody of imploration...");
4572 p_ptr->magic_num1[0] = MUSIC_CHARM;
4574 case 16: /* (wall breaking song) ʬ²ò²»ÇÈ */
4576 msg_print("Ê´ºÕ¤¹¤ë¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4578 msg_print("You weave a violent pattern of sounds to break wall.");
4580 p_ptr->magic_num1[0] = MUSIC_WALL;
4581 project(0, 0, py, px,
4582 0, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM | PROJECT_HIDE, -1);
4584 case 17: /* Finrod's Resistance (song of resistance) ¸µÁÇÂÑÀ */
4586 msg_print("¸µÁǤÎÎϤËÂФ¹¤ëǦÂѤβΤò²Î¤Ã¤¿¡£");
4588 msg_print("You sing a song of perseverance against powers...");
4590 p_ptr->magic_num1[0] = MUSIC_RESIST;
4592 case 18: /* Hobbit Melodies (song of time) ¥Û¥Ó¥Ã¥È¤Î¥á¥í¥Ç¥£ */
4594 msg_print("·Ú²÷¤Ê²Î¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4596 msg_print("You start singing joyful pop song...");
4598 p_ptr->magic_num1[0] = MUSIC_SPEED;
4600 case 19: /* World Contortion ÏĤó¤ÀÀ¤³¦ */
4602 msg_print("²Î¤¬¶õ´Ö¤òÏĤ᤿¡¥¡¥¡¥");
4604 msg_print("Reality whirls wildly as you sing a dizzying melody...");
4606 project(0, plev/15 + 1, py, px, plev * 3 + 1, GF_AWAY_ALL , PROJECT_KILL, -1);
4608 case 20: /* Â໶¤Î²Î */
4610 msg_print("ÂѤ¨¤é¤ì¤Ê¤¤ÉÔ¶¨Ï²»¤¬Å¨¤òÀÕ¤áΩ¤Æ¤¿¡¥¡¥¡¥");
4612 msg_print("You cry out in an ear-wracking voice...");
4614 p_ptr->magic_num1[0] = MUSIC_DISPEL;
4616 case 21: /* The Voice of Saruman ¥µ¥ë¥Þ¥ó¤Î´Å¸À */
4618 msg_print("Í¥¤·¤¯¡¢Ì¥ÎÏŪ¤Ê²Î¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4620 msg_print("You start humming a gentle and attractive song...");
4622 p_ptr->magic_num1[0] = MUSIC_SARUMAN;
4624 case 22: /* Song of Tempest (song of death) Íò¤Î²»¿§ */
4625 if (!get_aim_dir(&dir)) return FALSE;
4626 fire_beam(GF_SOUND, dir,
4627 damroll(15 + ((plev - 1) / 2), 10));
4629 case 23: /* (song of disruption) ¤â¤¦°ì¤Ä¤ÎÀ¤³¦ */
4631 msg_print("¼þ°Ï¤¬ÊѲ½¤·»Ï¤á¤¿¡¥¡¥¡¥");
4633 msg_print("You sing of the primeval shaping of Middle-earth...");
4637 case 24: /* Wrecking Pattern (destruction shriek) Ç˲õ¤ÎÀûΧ */
4639 msg_print("Ç˲õŪ¤Ê²Î¤¬¶Á¤¤ï¤¿¤Ã¤¿¡¥¡¥¡¥");
4641 msg_print("You weave a pattern of sounds to contort and shatter...");
4643 p_ptr->magic_num1[0] = MUSIC_QUAKE;
4645 case 25: /* ÄäÂڤβΠ*/
4647 msg_print("¤æ¤Ã¤¯¤ê¤È¤·¤¿¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4649 msg_print("You weave a very slow pattern which is almost likely to stop...");
4651 p_ptr->magic_num1[0] = MUSIC_STASIS;
4653 case 26: /* ¼é¤ê¤Î²Î */
4655 msg_print("²Î¤¬¿ÀÀ»¤Ê¾ì¤òºî¤ê½Ð¤·¤¿¡¥¡¥¡¥");
4657 msg_print("The holy power of the Music is creating sacred field...");
4661 case 27: /* ±Ñͺ¤Î»í */
4663 msg_print("±Ñͺ¤Î²Î¤ò¸ý¤º¤µ¤ó¤À¡¥¡¥¡¥");
4665 msg_print("You chant a powerful, heroic call to arms...");
4667 p_ptr->magic_num1[0] = MUSIC_SHERO;
4668 (void)hp_player(10);
4669 (void)set_afraid(0);
4671 case 28: /* ¥ä¥ô¥¡¥ó¥Ê¤Î½õ¤± */
4673 msg_print("²Î¤òÄ̤·¤ÆÂΤ˳赤¤¬Ìá¤Ã¤Æ¤¤¿¡¥¡¥¡¥");
4675 msg_print("Life flows through you as you sing the song...");
4677 p_ptr->magic_num1[0] = MUSIC_H_LIFE;
4679 case 29: /* ºÆÀ¸¤Î²Î */
4681 msg_print("°Å¹õ¤ÎÃæ¤Ë¸÷¤ÈÈþ¤ò¤Õ¤ê¤Þ¤¤¤¿¡£ÂΤ¬¸µ¤Î³èÎϤò¼è¤êÌᤷ¤¿¡£");
4683 msg_print("You strewed light and beauty in the dark as you sing. You feel refreshed.");
4685 (void)do_res_stat(A_STR);
4686 (void)do_res_stat(A_INT);
4687 (void)do_res_stat(A_WIS);
4688 (void)do_res_stat(A_DEX);
4689 (void)do_res_stat(A_CON);
4690 (void)do_res_stat(A_CHR);
4691 (void)restore_level();
4693 case 30: /* shriek of death ¥µ¥¦¥í¥ó¤ÎËâ½Ñ */
4694 if (!get_aim_dir(&dir)) return FALSE;
4695 fire_ball(GF_SOUND, dir, damroll(50 + plev, 10), 0);
4697 case 31: /* song of liberty ¥Õ¥£¥ó¥´¥ë¥Õ¥£¥ó¤ÎÄ©Àï */
4699 msg_print("¥Õ¥£¥ó¥´¥ë¥Õ¥£¥ó¤Î̽²¦¤Ø¤ÎÄ©Àï¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4701 msg_print("You recall the valor of Fingolfin's challenge to the Dark Lord...");
4703 p_ptr->magic_num1[0] = MUSIC_INVULN;
4706 p_ptr->redraw |= (PR_MAP);
4708 /* Update monsters */
4709 p_ptr->update |= (PU_MONSTERS);
4712 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4716 msg_format("̤ÃΤβÎ(%d)¤ò²Î¤Ã¤¿¡£", spell);
4718 msg_format("You sing an unknown song: %d.", spell);
4723 if (p_ptr->magic_num1[0]) set_action(ACTION_SING);
4725 /* Recalculate bonuses */
4726 p_ptr->update |= (PU_BONUS | PU_HP);
4728 /* Redraw status bar */
4729 p_ptr->redraw |= (PR_STATUS);
4737 void do_cmd_cast(void)
4739 int item, sval, spell, realm;
4754 /* Require spell ability */
4755 if (!p_ptr->realm1 && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE))
4758 msg_print("¼öʸ¤ò¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4760 msg_print("You cannot cast spells!");
4767 if (p_ptr->blind || no_lite())
4769 if (p_ptr->pclass == CLASS_FORCETRAINER) confirm_use_force(FALSE);
4773 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡ª");
4775 msg_print("You cannot see!");
4782 /* Not when confused */
4783 if (p_ptr->confused)
4786 msg_print("º®Í𤷤Ƥ¤¤Æ¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4788 msg_print("You are too confused!");
4794 if (p_ptr->pclass == CLASS_FORCETRAINER)
4796 if (player_has_no_spellbooks())
4798 confirm_use_force(FALSE);
4801 select_the_force = TRUE;
4804 prayer = spell_category_name(mp_ptr->spell_book);
4806 /* Restrict choices to spell books */
4807 item_tester_tval = mp_ptr->spell_book;
4811 q = "¤É¤Î¼öʸ½ñ¤ò»È¤¤¤Þ¤¹¤«? ";
4813 q = "Use which book? ";
4817 s = "¼öʸ½ñ¤¬¤Ê¤¤¡ª";
4819 s = "You have no spell books!";
4822 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR)))
4824 select_the_force = FALSE;
4827 select_the_force = FALSE;
4829 if (item == INVEN_FORCE) /* the_force */
4835 /* Get the item (in the pack) */
4838 o_ptr = &inventory[item];
4841 /* Get the item (on the floor) */
4844 o_ptr = &o_list[0 - item];
4847 /* Access the item's sval */
4850 if ((p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE) && (o_ptr->tval == REALM2_BOOK)) increment = 32;
4853 /* Track the object kind */
4854 object_kind_track(o_ptr->k_idx);
4856 /* Hack -- Handle stuff */
4859 if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
4860 realm = o_ptr->tval - TV_LIFE_BOOK + 1;
4861 else if (increment) realm = p_ptr->realm2;
4862 else realm = p_ptr->realm1;
4864 /* Ask for a spell */
4866 if (!get_spell(&spell,
4867 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "±Ó¾§¤¹¤ë" : (mp_ptr->spell_book == TV_MUSIC_BOOK) ? "²Î¤¦" : "¾§¤¨¤ë"),
4870 if (spell == -2) msg_format("¤½¤ÎËܤˤÏÃΤäƤ¤¤ë%s¤¬¤Ê¤¤¡£", prayer);
4874 if (!get_spell(&spell, ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "recite" : "cast"),
4878 msg_format("You don't know any %ss in that book.", prayer);
4884 use_realm = tval2realm(o_ptr->tval);
4886 if (!is_magic(use_realm))
4888 s_ptr = &technic_info[use_realm - MIN_TECHNIC][spell];
4892 s_ptr = &mp_ptr->info[realm - 1][spell];
4895 /* Extract mana consumption rate */
4896 need_mana = mod_need_mana(s_ptr->smana, spell, realm);
4898 /* Verify "dangerous" spells */
4899 if (need_mana > p_ptr->csp)
4901 if (flush_failure) flush();
4905 msg_format("¤½¤Î%s¤ò%s¤Î¤Ë½½Ê¬¤Ê¥Þ¥¸¥Ã¥¯¥Ý¥¤¥ó¥È¤¬¤Ê¤¤¡£",prayer,
4906 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "±Ó¾§¤¹¤ë" : (mp_ptr->spell_book == TV_LIFE_BOOK) ? "²Î¤¦" : "¾§¤¨¤ë"));
4908 msg_format("You do not have enough mana to %s this %s.",
4909 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "recite" : "cast"),
4914 if (!over_exert) return;
4918 if (!get_check_strict("¤½¤ì¤Ç¤âÄ©À路¤Þ¤¹¤«? ", CHECK_OKAY_CANCEL)) return;
4920 if (!get_check_strict("Attempt it anyway? ", CHECK_OKAY_CANCEL)) return;
4926 /* Spell failure chance */
4927 chance = spell_chance(spell, use_realm);
4930 if (randint0(100) < chance)
4932 if (flush_failure) flush();
4935 msg_format("%s¤ò¤¦¤Þ¤¯¾§¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡ª", prayer);
4937 msg_format("You failed to get the %s off!", prayer);
4945 if (randint1(100) < chance) chg_virtue(V_VITALITY, -1);
4948 if (randint1(100) < chance) chg_virtue(V_UNLIFE, -1);
4951 if (randint1(100) < chance) chg_virtue(V_NATURE, -1);
4954 if (randint1(100) < chance) chg_virtue(V_JUSTICE, 1);
4957 if (randint1(100) < chance) chg_virtue(V_JUSTICE, -1);
4960 if (randint1(100) < chance) chg_virtue(V_KNOWLEDGE, -1);
4964 if (realm == REALM_TRUMP)
4966 cast_trump_spell(spell, FALSE);
4968 else if ((o_ptr->tval == TV_CHAOS_BOOK) && (randint1(100) < spell))
4971 msg_print("¥«¥ª¥¹Åª¤Ê¸ú²Ì¤òȯÀ¸¤·¤¿¡ª");
4973 msg_print("You produce a chaotic effect!");
4978 else if ((o_ptr->tval == TV_DEATH_BOOK) && (randint1(100) < spell))
4980 if ((sval == 3) && one_in_(2))
4982 sanity_blast(0, TRUE);
4987 msg_print("Äˤ¤¡ª");
4989 msg_print("It hurts!");
4993 take_hit(DAMAGE_LOSELIFE, damroll(o_ptr->sval + 1, 6), "°Å¹õËâË¡¤ÎµÕή", -1);
4995 take_hit(DAMAGE_LOSELIFE, damroll(o_ptr->sval + 1, 6), "a miscast Death spell", -1);
4998 if ((spell > 15) && one_in_(6) && !p_ptr->hold_life)
4999 lose_exp(spell * 250);
5002 else if ((o_ptr->tval == TV_MUSIC_BOOK) && (randint1(200) < spell))
5005 msg_print("¤¤¤ä¤Ê²»¤¬¶Á¤¤¤¿");
5007 msg_print("An infernal sound echoed.");
5010 aggravate_monsters(0);
5012 if (randint1(100) >= chance)
5013 chg_virtue(V_CHANCE,-1);
5022 case REALM_LIFE: /* * LIFE * */
5023 cast = cast_life_spell(spell);
5025 case REALM_SORCERY: /* * SORCERY * */
5026 cast = cast_sorcery_spell(spell);
5028 case REALM_NATURE: /* * NATURE * */
5029 cast = cast_nature_spell(spell);
5031 case REALM_CHAOS: /* * CHAOS * */
5032 cast = cast_chaos_spell(spell);
5034 case REALM_DEATH: /* * DEATH * */
5035 cast = cast_death_spell(spell);
5037 case REALM_TRUMP: /* TRUMP */
5038 cast = cast_trump_spell(spell, TRUE);
5040 case REALM_ARCANE: /* ARCANE */
5041 cast = cast_arcane_spell(spell);
5043 case REALM_ENCHANT: /* ENCHANT */
5044 cast = cast_enchant_spell(spell);
5046 case REALM_DAEMON: /* DAEMON */
5047 cast = cast_daemon_spell(spell);
5049 case REALM_CRUSADE: /* CRUSADE */
5050 cast = cast_crusade_spell(spell);
5052 case REALM_MUSIC: /* MUSIC */
5053 cast = cast_music_spell(spell);
5057 msg_format("You cast a spell from an unknown realm: realm %d, spell %d.", realm, spell);
5061 /* Canceled spells cost neither a turn nor mana */
5064 if (randint1(100) < chance)
5065 chg_virtue(V_CHANCE,1);
5067 /* A spell was cast */
5069 (p_ptr->spell_worked2 & (1L << spell)) :
5070 (p_ptr->spell_worked1 & (1L << spell)))
5071 && (p_ptr->pclass != CLASS_SORCERER)
5072 && (p_ptr->pclass != CLASS_RED_MAGE))
5074 int e = s_ptr->sexp;
5076 /* The spell worked */
5077 if (realm == p_ptr->realm1)
5079 p_ptr->spell_worked1 |= (1L << spell);
5083 p_ptr->spell_worked2 |= (1L << spell);
5086 /* Gain experience */
5087 gain_exp(e * s_ptr->slevel);
5089 /* Redraw object recall */
5090 p_ptr->window |= (PW_OBJECT);
5095 chg_virtue(V_TEMPERANCE, 1);
5096 chg_virtue(V_COMPASSION, 1);
5097 chg_virtue(V_VITALITY, 1);
5098 chg_virtue(V_DILIGENCE, 1);
5101 chg_virtue(V_UNLIFE, 1);
5102 chg_virtue(V_JUSTICE, -1);
5103 chg_virtue(V_FAITH, -1);
5104 chg_virtue(V_VITALITY, -1);
5107 chg_virtue(V_JUSTICE, -1);
5108 chg_virtue(V_FAITH, -1);
5109 chg_virtue(V_HONOUR, -1);
5110 chg_virtue(V_TEMPERANCE, -1);
5113 chg_virtue(V_FAITH, 1);
5114 chg_virtue(V_JUSTICE, 1);
5115 chg_virtue(V_SACRIFICE, 1);
5116 chg_virtue(V_HONOUR, 1);
5119 chg_virtue(V_NATURE, 1);
5120 chg_virtue(V_HARMONY, 1);
5123 chg_virtue(V_KNOWLEDGE, 1);
5130 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_TEMPERANCE, 1);
5131 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_COMPASSION, 1);
5132 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_VITALITY, 1);
5133 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_DILIGENCE, 1);
5136 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_UNLIFE, 1);
5137 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_JUSTICE, -1);
5138 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_FAITH, -1);
5139 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_VITALITY, -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_HONOUR, -1);
5145 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_TEMPERANCE, -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_JUSTICE, 1);
5150 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_SACRIFICE, 1);
5151 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_HONOUR, 1);
5154 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_NATURE, 1);
5155 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_HARMONY, 1);
5158 if (mp_ptr->spell_xtra & MAGIC_GAIN_EXP)
5160 s16b cur_exp = p_ptr->spell_exp[(increment ? 32 : 0)+spell];
5163 if (cur_exp < SPELL_EXP_BEGINNER)
5165 else if (cur_exp < SPELL_EXP_SKILLED)
5167 if ((dun_level > 4) && ((dun_level + 10) > p_ptr->lev))
5170 else if (cur_exp < SPELL_EXP_EXPERT)
5172 if (((dun_level + 5) > p_ptr->lev) && ((dun_level + 5) > s_ptr->slevel))
5175 else if ((cur_exp < SPELL_EXP_MASTER) && !increment)
5177 if (((dun_level + 5) > p_ptr->lev) && (dun_level > s_ptr->slevel))
5180 p_ptr->spell_exp[(increment ? 32 : 0) + spell] += exp_gain;
5187 /* Sufficient mana */
5188 if (need_mana <= p_ptr->csp)
5191 p_ptr->csp -= need_mana;
5194 /* Over-exert the player */
5197 int oops = need_mana;
5201 p_ptr->csp_frac = 0;
5205 msg_print("Àº¿À¤ò½¸Ã椷¤¹¤®¤Æµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
5207 msg_print("You faint from the effort!");
5211 /* Hack -- Bypass free action */
5212 (void)set_paralyzed(p_ptr->paralyzed + randint1(5 * oops + 1));
5217 chg_virtue(V_VITALITY, -10);
5220 chg_virtue(V_UNLIFE, -10);
5223 chg_virtue(V_JUSTICE, 10);
5226 chg_virtue(V_NATURE, -10);
5229 chg_virtue(V_JUSTICE, -10);
5232 chg_virtue(V_KNOWLEDGE, -10);
5236 /* Damage CON (possibly permanently) */
5237 if (randint0(100) < 50)
5239 bool perm = (randint0(100) < 25);
5243 msg_print("ÂΤò°¤¯¤·¤Æ¤·¤Þ¤Ã¤¿¡ª");
5245 msg_print("You have damaged your health!");
5249 /* Reduce constitution */
5250 (void)dec_stat(A_CON, 15 + randint1(10), perm);
5255 p_ptr->redraw |= (PR_MANA);
5258 p_ptr->window |= (PW_PLAYER);
5259 p_ptr->window |= (PW_SPELL);
5264 * Pray a prayer -- Unused in Hengband
5266 void do_cmd_pray(void)
5268 msg_print("Praying is not used in Hengband. Use magic spell casting instead.");
5271 static bool ang_sort_comp_pet_dismiss(vptr u, vptr v, int a, int b)
5273 u16b *who = (u16b*)(u);
5278 monster_type *m_ptr1 = &m_list[w1];
5279 monster_type *m_ptr2 = &m_list[w2];
5280 monster_race *r_ptr1 = &r_info[m_ptr1->r_idx];
5281 monster_race *r_ptr2 = &r_info[m_ptr2->r_idx];
5286 if (w1 == p_ptr->riding) return TRUE;
5287 if (w2 == p_ptr->riding) return FALSE;
5289 if (m_ptr1->nickname && !m_ptr2->nickname) return TRUE;
5290 if (m_ptr2->nickname && !m_ptr1->nickname) return FALSE;
5292 if (!m_ptr1->parent_m_idx && m_ptr2->parent_m_idx) return TRUE;
5293 if (!m_ptr2->parent_m_idx && m_ptr1->parent_m_idx) return FALSE;
5295 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return TRUE;
5296 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return FALSE;
5298 if (r_ptr1->level > r_ptr2->level) return TRUE;
5299 if (r_ptr2->level > r_ptr1->level) return FALSE;
5301 if (m_ptr1->hp > m_ptr2->hp) return TRUE;
5302 if (m_ptr2->hp > m_ptr1->hp) return FALSE;
5307 int calculate_upkeep(void)
5309 s32b old_friend_align = friend_align;
5311 bool have_a_unique = FALSE;
5314 total_friend_levels = 0;
5317 for (m_idx = m_max - 1; m_idx >=1; m_idx--)
5319 monster_type *m_ptr;
5320 monster_race *r_ptr;
5322 m_ptr = &m_list[m_idx];
5323 if (!m_ptr->r_idx) continue;
5324 r_ptr = &r_info[m_ptr->r_idx];
5329 if (r_ptr->flags1 & RF1_UNIQUE)
5331 if (p_ptr->pclass == CLASS_CAVALRY)
5333 if (p_ptr->riding == m_idx)
5334 total_friend_levels += (r_ptr->level+5)*2;
5335 else if (!have_a_unique && (r_info[m_ptr->r_idx].flags7 & RF7_RIDING))
5336 total_friend_levels += (r_ptr->level+5)*7/2;
5338 total_friend_levels += (r_ptr->level+5)*10;
5339 have_a_unique = TRUE;
5342 total_friend_levels += (r_ptr->level+5)*10;
5345 total_friend_levels += r_ptr->level;
5347 /* Determine pet alignment */
5348 if (r_ptr->flags3 & RF3_GOOD) friend_align += r_ptr->level;
5349 if (r_ptr->flags3 & RF3_EVIL) friend_align -= r_ptr->level;
5352 if (old_friend_align != friend_align) p_ptr->update |= (PU_BONUS);
5356 upkeep_factor = (total_friend_levels - (p_ptr->lev * 80 / (cp_ptr->pet_upkeep_div)));
5357 if (upkeep_factor < 0) upkeep_factor = 0;
5358 if (upkeep_factor > 1000) upkeep_factor = 1000;
5359 return upkeep_factor;
5365 void do_cmd_pet_dismiss(void)
5367 monster_type *m_ptr;
5368 bool all_pets = FALSE;
5382 /* Allocate the "who" array */
5383 C_MAKE(who, max_m_idx, u16b);
5385 /* Process the monsters (backwards) */
5386 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
5388 if (is_pet(&m_list[pet_ctr]))
5389 who[max_pet++] = pet_ctr;
5392 /* Select the sort method */
5393 ang_sort_comp = ang_sort_comp_pet_dismiss;
5394 ang_sort_swap = ang_sort_swap_hook;
5396 ang_sort(who, &dummy_why, max_pet);
5398 /* Process the monsters (backwards) */
5399 for (i = 0; i < max_pet; i++)
5402 char friend_name[80];
5406 /* Access the monster */
5408 m_ptr = &m_list[pet_ctr];
5410 delete_this = FALSE;
5411 kakunin = ((pet_ctr == p_ptr->riding) || (m_ptr->nickname));
5412 monster_desc(friend_name, m_ptr, MD_ASSUME_VISIBLE);
5416 /* Hack -- health bar for this monster */
5417 health_track(pet_ctr);
5419 /* Hack -- handle stuff */
5423 sprintf(buf, "%s¤òÊü¤·¤Þ¤¹¤«¡© [Yes/No/Unnamed (%dɤ)]", friend_name, max_pet-i);
5425 sprintf(buf, "Dismiss %s? [Yes/No/Unnamed (%d remain)]", friend_name, max_pet-i);
5430 move_cursor_relative(m_ptr->fy, m_ptr->fx);
5436 if (ch == 'Y' || ch == 'y')
5443 sprintf(buf, "ËÜÅö¤Ë¤è¤í¤·¤¤¤Ç¤¹¤«¡© (%s) ", friend_name);
5445 sprintf(buf, "Are you sure? (%s) ", friend_name);
5447 if (!get_check(buf))
5448 delete_this = FALSE;
5453 if (ch == 'U' || ch == 'u')
5459 if (ch == ESCAPE || ch == 'N' || ch == 'n')
5466 if ((all_pets && !kakunin) || (!all_pets && delete_this))
5468 if (record_named_pet && m_ptr->nickname)
5472 monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
5473 do_cmd_write_nikki(NIKKI_NAMED_PET, 2, m_name);
5476 if (pet_ctr == p_ptr->riding)
5479 msg_format("%s¤«¤é¹ß¤ê¤¿¡£", friend_name);
5481 msg_format("You have got off %s. ", friend_name);
5486 /* Update the monsters */
5487 p_ptr->update |= (PU_BONUS | PU_MONSTERS);
5488 p_ptr->redraw |= (PR_EXTRA | PR_UHEALTH);
5491 /* HACK : Add the line to message buffer */
5493 sprintf(buf, "%s ¤òÊü¤·¤¿¡£", friend_name);
5495 sprintf(buf, "Dismissed %s.", friend_name);
5498 p_ptr->window |= (PW_MESSAGE);
5501 delete_monster_idx(pet_ctr);
5510 C_KILL(who, max_m_idx, u16b);
5513 msg_format("%d ɤ¤Î¥Ú¥Ã¥È¤òÊü¤·¤Þ¤·¤¿¡£", Dismissed);
5515 msg_format("You have dismissed %d pet%s.", Dismissed,
5516 (Dismissed == 1 ? "" : "s"));
5518 if (Dismissed == 0 && all_pets)
5520 msg_print("'U'nnamed ¤Ï¡¢¾èÇϰʳ°¤Î̾Á°¤Î¤Ê¤¤¥Ú¥Ã¥È¤À¤±¤òÁ´¤Æ²òÊü¤·¤Þ¤¹¡£");
5522 msg_print("'U'nnamed means all your pets except named pets and your mount.");
5526 static bool player_can_ride_aux(cave_type *c_ptr, bool now_riding)
5529 bool old_character_xtra = character_xtra;
5530 int old_riding = p_ptr->riding;
5531 bool old_riding_ryoute = p_ptr->riding_ryoute;
5532 bool old_old_riding_ryoute = p_ptr->old_riding_ryoute;
5533 bool old_pf_ryoute = (p_ptr->pet_extra_flags & PF_RYOUTE) ? TRUE : FALSE;
5535 /* Hack -- prevent "icky" message */
5536 character_xtra = TRUE;
5538 if (now_riding) p_ptr->riding = c_ptr->m_idx;
5542 p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5543 p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE;
5548 p_can_enter = player_can_enter(c_ptr->feat, CEM_P_CAN_ENTER_PATTERN);
5550 p_ptr->riding = old_riding;
5551 if (old_pf_ryoute) p_ptr->pet_extra_flags |= (PF_RYOUTE);
5552 else p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5553 p_ptr->riding_ryoute = old_riding_ryoute;
5554 p_ptr->old_riding_ryoute = old_old_riding_ryoute;
5558 character_xtra = old_character_xtra;
5563 bool rakuba(int dam, bool force)
5565 int i, y, x, oy, ox;
5566 int sn = 0, sy = 0, sx = 0;
5568 monster_type *m_ptr = &m_list[p_ptr->riding];
5569 monster_race *r_ptr = &r_info[m_ptr->r_idx];
5570 bool fall_dam = FALSE;
5572 if (!p_ptr->riding) return FALSE;
5573 if (p_ptr->wild_mode) return FALSE;
5575 if (dam >= 0 || force)
5579 int cur = p_ptr->skill_exp[GINOU_RIDING];
5580 int max = s_info[p_ptr->pclass].s_max[GINOU_RIDING];
5581 int ridinglevel = r_ptr->level;
5583 /* ÍîÇϤΤ·¤ä¤¹¤µ */
5584 int rakubalevel = r_ptr->level;
5585 if (p_ptr->riding_ryoute) rakubalevel += 20;
5587 if ((cur < max) && (max > 1000) &&
5588 (dam / 2 + ridinglevel) > (cur / 30 + 10))
5592 if (ridinglevel > (cur / 100 + 15))
5593 inc += 1 + (ridinglevel - cur / 100 - 15);
5597 p_ptr->skill_exp[GINOU_RIDING] = MIN(max, cur + inc);
5600 /* ¥ì¥Ù¥ë¤ÎÄ㤤¾èÇϤ«¤é¤ÏÍîÇϤ·¤Ë¤¯¤¤ */
5601 if (randint0(dam / 2 + rakubalevel * 2) < cur / 30 + 10)
5603 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))
5610 /* Check around the player */
5611 for (i = 0; i < 8; i++)
5615 /* Access the location */
5616 y = py + ddy_ddd[i];
5617 x = px + ddx_ddd[i];
5619 c_ptr = &cave[y][x];
5621 if (c_ptr->m_idx) continue;
5623 /* Skip non-empty grids */
5624 if (!cave_have_flag_grid(c_ptr, FF_MOVE) && !cave_have_flag_grid(c_ptr, FF_CAN_FLY))
5626 if (!player_can_ride_aux(c_ptr, FALSE)) continue;
5629 if (cave_have_flag_grid(c_ptr, FF_PATTERN)) continue;
5631 /* Count "safe" grids */
5634 /* Randomize choice */
5635 if (randint0(sn) > 0) continue;
5637 /* Save the safe location */
5642 monster_desc(m_name, m_ptr, 0);
5644 msg_format("%s¤«¤é¿¶¤êÍî¤È¤µ¤ì¤½¤¦¤Ë¤Ê¤Ã¤Æ¡¢Êɤˤ֤Ĥ«¤Ã¤¿¡£",m_name);
5645 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "Êɤؤξ×ÆÍ", -1);
5647 msg_format("You have nearly fallen from %s, but bumped into wall.",m_name);
5648 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "bumping into wall", -1);
5659 /* Redraw the old spot */
5662 /* Redraw the new spot */
5665 /* Check for new panel */
5670 p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5671 p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE;
5675 p_ptr->update |= (PU_BONUS);
5678 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
5681 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5683 p_ptr->redraw |= (PR_EXTRA);
5685 /* Update health track of mount */
5686 p_ptr->redraw |= (PR_UHEALTH);
5688 if (p_ptr->levitation && !force)
5690 monster_desc(m_name, m_ptr, 0);
5692 msg_format("%s¤«¤éÍî¤Á¤¿¤¬¡¢¶õÃæ¤Ç¤¦¤Þ¤¯ÂÎÀª¤òΩ¤Æľ¤·¤ÆÃåÃϤ·¤¿¡£",m_name);
5694 msg_format("You are thrown from %s, but make a good landing.",m_name);
5700 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "ÍîÇÏ", -1);
5702 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "Falling from riding", -1);
5707 /* Move the player */
5708 if (sy && !p_ptr->is_dead)
5709 (void)move_player_effect(py, px, MPE_DONT_PICKUP | MPE_DONT_SWAP_MON);
5714 bool do_riding(bool force)
5718 monster_type *m_ptr;
5720 if (!get_rep_dir2(&dir)) return FALSE;
5723 c_ptr = &cave[y][x];
5727 /* Skip non-empty grids */
5728 if (!player_can_ride_aux(c_ptr, FALSE))
5731 msg_print("¤½¤Á¤é¤Ë¤Ï¹ß¤ê¤é¤ì¤Þ¤»¤ó¡£");
5733 msg_print("You cannot go to that direction.");
5738 if (!pattern_seq(py, px, y, x)) return FALSE;
5747 msg_print("¥â¥ó¥¹¥¿¡¼¤¬Î©¤Á¤Õ¤µ¤¬¤Ã¤Æ¤¤¤ë¡ª");
5749 msg_print("There is a monster in the way!");
5757 p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5758 p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE;
5762 if (p_ptr->confused)
5765 msg_print("º®Í𤷤Ƥ¤¤Æ¾è¤ì¤Ê¤¤¡ª");
5767 msg_print("You are too confused!");
5772 m_ptr = &m_list[c_ptr->m_idx];
5774 if (!c_ptr->m_idx || !m_ptr->ml)
5777 msg_print("¤½¤Î¾ì½ê¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
5779 msg_print("Here is no monster.");
5784 if (!is_pet(m_ptr) && !force)
5787 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï¥Ú¥Ã¥È¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£");
5789 msg_print("That monster is not a pet.");
5794 if (!(r_info[m_ptr->r_idx].flags7 & RF7_RIDING))
5797 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ë¤Ï¾è¤ì¤Ê¤µ¤½¤¦¤À¡£");
5799 msg_print("This monster doesn't seem suitable for riding.");
5805 if (!pattern_seq(py, px, y, x)) return FALSE;
5807 if (!player_can_ride_aux(c_ptr, TRUE))
5809 /* Feature code (applying "mimic" field) */
5810 feature_type *f_ptr = &f_info[get_feat_mimic(c_ptr)];
5812 msg_format("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï%s¤Î%s¤Ë¤¤¤ë¡£", f_name + f_ptr->name,
5813 ((!have_flag(f_ptr->flags, FF_MOVE) && !have_flag(f_ptr->flags, FF_CAN_FLY)) ||
5814 (!have_flag(f_ptr->flags, FF_LOS) && !have_flag(f_ptr->flags, FF_TREE))) ?
5817 msg_format("This monster is %s the %s.",
5818 ((!have_flag(f_ptr->flags, FF_MOVE) && !have_flag(f_ptr->flags, FF_CAN_FLY)) ||
5819 (!have_flag(f_ptr->flags, FF_LOS) && !have_flag(f_ptr->flags, FF_TREE))) ?
5820 "in" : "on", f_name + f_ptr->name);
5825 if (r_info[m_ptr->r_idx].level > randint1((p_ptr->skill_exp[GINOU_RIDING] / 50 + p_ptr->lev / 2 + 20)))
5828 msg_print("¤¦¤Þ¤¯¾è¤ì¤Ê¤«¤Ã¤¿¡£");
5830 msg_print("You failed to ride.");
5841 monster_desc(m_name, m_ptr, 0);
5844 msg_format("%s¤òµ¯¤³¤·¤¿¡£", m_name);
5846 msg_format("You have waked %s up.", m_name);
5850 p_ptr->riding = c_ptr->m_idx;
5852 /* Hack -- remove tracked monster */
5853 if (p_ptr->riding == p_ptr->health_who) health_track(0);
5858 /* Mega-Hack -- Forget the view and lite */
5859 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
5861 /* Update the monsters */
5862 p_ptr->update |= (PU_BONUS);
5865 p_ptr->redraw |= (PR_MAP | PR_EXTRA);
5867 p_ptr->redraw |= (PR_UHEALTH);
5869 /* Move the player */
5870 (void)move_player_effect(y, x, MPE_HANDLE_STUFF | MPE_ENERGY_USE | MPE_DONT_PICKUP | MPE_DONT_SWAP_MON);
5875 static void do_name_pet(void)
5877 monster_type *m_ptr;
5880 bool old_name = FALSE;
5881 bool old_target_pet = target_pet;
5884 if (!target_set(TARGET_KILL))
5886 target_pet = old_target_pet;
5889 target_pet = old_target_pet;
5891 if (cave[target_row][target_col].m_idx)
5893 m_ptr = &m_list[cave[target_row][target_col].m_idx];
5899 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï¥Ú¥Ã¥È¤Ç¤Ï¤Ê¤¤¡£");
5901 msg_format("This monster is not a pet.");
5905 if (r_info[m_ptr->r_idx].flags1 & RF1_UNIQUE)
5908 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Î̾Á°¤ÏÊѤ¨¤é¤ì¤Ê¤¤¡ª");
5910 msg_format("You cannot change name of this monster!");
5914 monster_desc(m_name, m_ptr, 0);
5918 msg_format("%s¤Ë̾Á°¤ò¤Ä¤±¤ë¡£", m_name);
5920 msg_format("Name %s.", m_name);
5925 /* Start with nothing */
5926 strcpy(out_val, "");
5928 /* Use old inscription */
5929 if (m_ptr->nickname)
5931 /* Start with the old inscription */
5932 strcpy(out_val, quark_str(m_ptr->nickname));
5936 /* Get a new inscription (possibly empty) */
5938 if (get_string("̾Á°: ", out_val, 15))
5940 if (get_string("Name: ", out_val, 15))
5946 /* Save the inscription */
5947 m_ptr->nickname = quark_add(out_val);
5948 if (record_named_pet)
5952 monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
5953 do_cmd_write_nikki(NIKKI_NAMED_PET, 0, m_name);
5958 if (record_named_pet && old_name)
5962 monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
5963 do_cmd_write_nikki(NIKKI_NAMED_PET, 1, m_name);
5965 m_ptr->nickname = 0;
5972 * Issue a pet command
5974 void do_cmd_pet(void)
5979 cptr power_desc[36];
5985 monster_type *m_ptr;
5992 char target_buf[160];
5997 power_desc[num] = "¥Ú¥Ã¥È¤òÊü¤¹";
5999 power_desc[num] = "dismiss pets";
6002 powers[num++] = PET_DISMISS;
6005 sprintf(target_buf,"¥Ú¥Ã¥È¤Î¥¿¡¼¥²¥Ã¥È¤ò»ØÄê (¸½ºß¡§%s)",
6006 (pet_t_m_idx ? r_name + r_info[m_list[pet_t_m_idx].r_idx].name : "»ØÄê¤Ê¤·"));
6008 sprintf(target_buf,"specify a targert of pet (now:%s)",
6009 (pet_t_m_idx ? r_name + r_info[m_list[pet_t_m_idx].r_idx].name : "nothing"));
6011 power_desc[num] = target_buf;
6013 powers[num++] = PET_TARGET;
6016 power_desc[num] = "¶á¤¯¤Ë¤¤¤í";
6018 power_desc[num] = "stay close";
6021 if (p_ptr->pet_follow_distance == PET_CLOSE_DIST) mode = num;
6022 powers[num++] = PET_STAY_CLOSE;
6025 power_desc[num] = "¤Ä¤¤¤ÆÍ褤";
6027 power_desc[num] = "follow me";
6030 if (p_ptr->pet_follow_distance == PET_FOLLOW_DIST) mode = num;
6031 powers[num++] = PET_FOLLOW_ME;
6034 power_desc[num] = "Ũ¤ò¸«¤Ä¤±¤ÆÅݤ»";
6036 power_desc[num] = "seek and destroy";
6039 if (p_ptr->pet_follow_distance == PET_DESTROY_DIST) mode = num;
6040 powers[num++] = PET_SEEK_AND_DESTROY;
6043 power_desc[num] = "¾¯¤·Î¥¤ì¤Æ¤¤¤í";
6045 power_desc[num] = "give me space";
6048 if (p_ptr->pet_follow_distance == PET_SPACE_DIST) mode = num;
6049 powers[num++] = PET_ALLOW_SPACE;
6052 power_desc[num] = "Î¥¤ì¤Æ¤¤¤í";
6054 power_desc[num] = "stay away";
6057 if (p_ptr->pet_follow_distance == PET_AWAY_DIST) mode = num;
6058 powers[num++] = PET_STAY_AWAY;
6060 if (p_ptr->pet_extra_flags & PF_OPEN_DOORS)
6063 power_desc[num] = "¥É¥¢¤ò³«¤±¤ë (¸½ºß:ON)";
6065 power_desc[num] = "pets open doors (now On)";
6072 power_desc[num] = "¥É¥¢¤ò³«¤±¤ë (¸½ºß:OFF)";
6074 power_desc[num] = "pets open doors (now Off)";
6078 powers[num++] = PET_OPEN_DOORS;
6080 if (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS)
6083 power_desc[num] = "¥¢¥¤¥Æ¥à¤ò½¦¤¦ (¸½ºß:ON)";
6085 power_desc[num] = "pets pick up items (now On)";
6092 power_desc[num] = "¥¢¥¤¥Æ¥à¤ò½¦¤¦ (¸½ºß:OFF)";
6094 power_desc[num] = "pets pick up items (now Off)";
6098 powers[num++] = PET_TAKE_ITEMS;
6100 if (p_ptr->pet_extra_flags & PF_TELEPORT)
6103 power_desc[num] = "¥Æ¥ì¥Ý¡¼¥È·ÏËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6105 power_desc[num] = "allow teleport (now On)";
6112 power_desc[num] = "¥Æ¥ì¥Ý¡¼¥È·ÏËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6114 power_desc[num] = "allow teleport (now Off)";
6118 powers[num++] = PET_TELEPORT;
6120 if (p_ptr->pet_extra_flags & PF_ATTACK_SPELL)
6123 power_desc[num] = "¹¶·âËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6125 power_desc[num] = "allow cast attack spell (now On)";
6132 power_desc[num] = "¹¶·âËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6134 power_desc[num] = "allow cast attack spell (now Off)";
6138 powers[num++] = PET_ATTACK_SPELL;
6140 if (p_ptr->pet_extra_flags & PF_SUMMON_SPELL)
6143 power_desc[num] = "¾¤´ËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6145 power_desc[num] = "allow cast summon spell (now On)";
6152 power_desc[num] = "¾¤´ËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6154 power_desc[num] = "allow cast summon spell (now Off)";
6158 powers[num++] = PET_SUMMON_SPELL;
6160 if (p_ptr->pet_extra_flags & PF_BALL_SPELL)
6163 power_desc[num] = "¥×¥ì¥¤¥ä¡¼¤ò´¬¤¹þ¤àÈÏ°ÏËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6165 power_desc[num] = "allow involve player in area spell (now On)";
6172 power_desc[num] = "¥×¥ì¥¤¥ä¡¼¤ò´¬¤¹þ¤àÈÏ°ÏËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6174 power_desc[num] = "allow involve player in area spell (now Off)";
6178 powers[num++] = PET_BALL_SPELL;
6183 power_desc[num] = "¥Ú¥Ã¥È¤«¤é¹ß¤ê¤ë";
6185 power_desc[num] = "get off a pet";
6192 power_desc[num] = "¥Ú¥Ã¥È¤Ë¾è¤ë";
6194 power_desc[num] = "ride a pet";
6198 powers[num++] = PET_RIDING;
6201 power_desc[num] = "¥Ú¥Ã¥È¤Ë̾Á°¤ò¤Ä¤±¤ë";
6203 power_desc[num] = "name pets";
6206 powers[num++] = PET_NAME;
6210 if ((p_ptr->migite && (empty_hands(FALSE) == EMPTY_HAND_LARM) &&
6211 object_allow_two_hands_wielding(&inventory[INVEN_RARM])) ||
6212 (p_ptr->hidarite && (empty_hands(FALSE) == EMPTY_HAND_RARM) &&
6213 object_allow_two_hands_wielding(&inventory[INVEN_LARM])))
6215 if (p_ptr->pet_extra_flags & PF_RYOUTE)
6218 power_desc[num] = "Éð´ï¤òÊÒ¼ê¤Ç»ý¤Ä";
6220 power_desc[num] = "use one hand to control a riding pet";
6226 power_desc[num] = "Éð´ï¤òξ¼ê¤Ç»ý¤Ä";
6228 power_desc[num] = "use both hands for a weapon";
6232 powers[num++] = PET_RYOUTE;
6236 switch (p_ptr->pclass)
6239 case CLASS_FORCETRAINER:
6240 case CLASS_BERSERKER:
6241 if (empty_hands(FALSE) == (EMPTY_HAND_RARM | EMPTY_HAND_LARM))
6243 if (p_ptr->pet_extra_flags & PF_RYOUTE)
6246 power_desc[num] = "ÊÒ¼ê¤Ç³ÊÆ®¤¹¤ë";
6248 power_desc[num] = "use one hand to control a riding pet";
6254 power_desc[num] = "ξ¼ê¤Ç³ÊÆ®¤¹¤ë";
6256 power_desc[num] = "use both hands for melee";
6260 powers[num++] = PET_RYOUTE;
6262 else if ((empty_hands(FALSE) != EMPTY_HAND_NONE) && !buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
6264 if (p_ptr->pet_extra_flags & PF_RYOUTE)
6267 power_desc[num] = "³ÊÆ®¤ò¹Ô¤ï¤Ê¤¤";
6269 power_desc[num] = "use one hand to control a riding pet";
6275 power_desc[num] = "³ÊÆ®¤ò¹Ô¤¦";
6277 power_desc[num] = "use one hand for melee";
6281 powers[num++] = PET_RYOUTE;
6288 /* Nothing chosen yet */
6291 /* Build a prompt (accept all spells) */
6294 /* Build a prompt (accept all spells) */
6296 strnfmt(out_val, 78, "(¥³¥Þ¥ó¥É %c-%c¡¢'*'=°ìÍ÷¡¢ESC=½ªÎ») ¥³¥Þ¥ó¥É¤òÁª¤ó¤Ç¤¯¤À¤µ¤¤:",
6298 strnfmt(out_val, 78, "(Command %c-%c, *=List, ESC=exit) Select a command: ",
6301 I2A(0), I2A(num - 1));
6306 strnfmt(out_val, 78, "(¥³¥Þ¥ó¥É %c-%c¡¢'*'=°ìÍ÷¡¢ESC=½ªÎ») ¥³¥Þ¥ó¥É¤òÁª¤ó¤Ç¤¯¤À¤µ¤¤:",
6308 strnfmt(out_val, 78, "(Command %c-%c, *=List, ESC=exit) Select a command: ",
6311 I2A(0), '0' + num - 27);
6317 /* Save the screen */
6324 prt(format("%s%c) %s", (ctr == mode) ? "*" : " ", I2A(ctr), power_desc[ctr]), y + ctr, x);
6330 prt("", y + ctr, x);
6337 /* Get a command from the user */
6338 while (!flag && get_com(out_val, &choice, TRUE))
6340 /* Request redraw */
6341 if ((choice == ' ') || (choice == '*') || (choice == '?'))
6353 /* Save the screen */
6360 sprintf(buf, "%s%c) %s", (ctr == mode) ? "*" : " ", I2A(ctr), power_desc[ctr]);
6361 prt(buf, y + ctr, x);
6367 prt("", y + ctr, x);
6381 /* Restore the screen */
6389 if (isalpha(choice))
6392 ask = (isupper(choice));
6395 if (ask) choice = tolower(choice);
6397 /* Extract request */
6398 i = (islower(choice) ? A2I(choice) : -1);
6402 ask = FALSE; /* Can't uppercase digits */
6404 i = choice - '0' + 26;
6407 /* Totally Illegal */
6408 if ((i < 0) || (i >= num))
6419 strnfmt(buf, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡© ", power_desc[i]);
6421 strnfmt(buf, 78, "Use %s? ", power_desc[i]);
6425 /* Belay that order */
6426 if (!get_check(buf)) continue;
6433 /* Restore the screen */
6434 if (redraw) Term_load();
6436 /* Abort if needed */
6445 case PET_DISMISS: /* Dismiss pets */
6447 /* Check pets (backwards) */
6448 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
6450 /* Player has pet */
6451 if (is_pet(&m_list[pet_ctr])) break;
6457 msg_print("¥Ú¥Ã¥È¤¬¤¤¤Ê¤¤¡ª");
6459 msg_print("You have no pets!");
6463 do_cmd_pet_dismiss();
6464 (void)calculate_upkeep();
6469 project_length = -1;
6470 if (!target_set(TARGET_KILL)) pet_t_m_idx = 0;
6473 cave_type *c_ptr = &cave[target_row][target_col];
6474 if (c_ptr->m_idx && (m_list[c_ptr->m_idx].ml))
6476 pet_t_m_idx = cave[target_row][target_col].m_idx;
6477 p_ptr->pet_follow_distance = PET_DESTROY_DIST;
6479 else pet_t_m_idx = 0;
6486 case PET_STAY_CLOSE:
6488 p_ptr->pet_follow_distance = PET_CLOSE_DIST;
6495 p_ptr->pet_follow_distance = PET_FOLLOW_DIST;
6499 /* "Seek and destoy" */
6500 case PET_SEEK_AND_DESTROY:
6502 p_ptr->pet_follow_distance = PET_DESTROY_DIST;
6505 /* "Give me space" */
6506 case PET_ALLOW_SPACE:
6508 p_ptr->pet_follow_distance = PET_SPACE_DIST;
6514 p_ptr->pet_follow_distance = PET_AWAY_DIST;
6517 /* flag - allow pets to open doors */
6518 case PET_OPEN_DOORS:
6520 if (p_ptr->pet_extra_flags & PF_OPEN_DOORS) p_ptr->pet_extra_flags &= ~(PF_OPEN_DOORS);
6521 else p_ptr->pet_extra_flags |= (PF_OPEN_DOORS);
6524 /* flag - allow pets to pickup items */
6525 case PET_TAKE_ITEMS:
6527 if (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS)
6529 p_ptr->pet_extra_flags &= ~(PF_PICKUP_ITEMS);
6530 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
6532 /* Access the monster */
6533 m_ptr = &m_list[pet_ctr];
6537 monster_drop_carried_objects(m_ptr);
6541 else p_ptr->pet_extra_flags |= (PF_PICKUP_ITEMS);
6545 /* flag - allow pets to teleport */
6548 if (p_ptr->pet_extra_flags & PF_TELEPORT) p_ptr->pet_extra_flags &= ~(PF_TELEPORT);
6549 else p_ptr->pet_extra_flags |= (PF_TELEPORT);
6552 /* flag - allow pets to cast attack spell */
6553 case PET_ATTACK_SPELL:
6555 if (p_ptr->pet_extra_flags & PF_ATTACK_SPELL) p_ptr->pet_extra_flags &= ~(PF_ATTACK_SPELL);
6556 else p_ptr->pet_extra_flags |= (PF_ATTACK_SPELL);
6559 /* flag - allow pets to cast attack spell */
6560 case PET_SUMMON_SPELL:
6562 if (p_ptr->pet_extra_flags & PF_SUMMON_SPELL) p_ptr->pet_extra_flags &= ~(PF_SUMMON_SPELL);
6563 else p_ptr->pet_extra_flags |= (PF_SUMMON_SPELL);
6566 /* flag - allow pets to cast attack spell */
6567 case PET_BALL_SPELL:
6569 if (p_ptr->pet_extra_flags & PF_BALL_SPELL) p_ptr->pet_extra_flags &= ~(PF_BALL_SPELL);
6570 else p_ptr->pet_extra_flags |= (PF_BALL_SPELL);
6576 (void)do_riding(FALSE);
6588 if (p_ptr->pet_extra_flags & PF_RYOUTE) p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
6589 else p_ptr->pet_extra_flags |= (PF_RYOUTE);
6590 p_ptr->update |= (PU_BONUS);