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);
365 * Peruse the spells/prayers in a book
367 * Note that *all* spells in the book are listed
369 * Note that browsing is allowed while confused or blind,
370 * and in the dark, primarily to allow browsing in stores.
372 void do_cmd_browse(void)
374 int item, sval, use_realm = 0, j, line;
385 /* Warriors are illiterate */
386 if (!(p_ptr->realm1 || p_ptr->realm2) && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE))
389 msg_print("ËܤòÆɤळ¤È¤¬¤Ç¤¤Ê¤¤¡ª");
391 msg_print("You cannot read books!");
397 if (p_ptr->special_defense & KATA_MUSOU)
399 set_action(ACTION_NONE);
402 /* Restrict choices to "useful" books */
403 if (p_ptr->realm2 == REALM_NONE) item_tester_tval = mp_ptr->spell_book;
404 else item_tester_hook = item_tester_learn_spell;
408 q = "¤É¤ÎËܤòÆɤߤޤ¹¤«? ";
410 q = "Browse which book? ";
414 s = "Æɤá¤ëËܤ¬¤Ê¤¤¡£";
416 s = "You have no books that you can read.";
419 if (p_ptr->pclass == CLASS_FORCETRAINER)
420 select_the_force = TRUE;
421 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))){
422 select_the_force = FALSE;
425 select_the_force = FALSE;
427 if (item == INVEN_FORCE) { /* the_force */
428 do_cmd_mind_browse();
431 /* Get the item (in the pack) */
434 o_ptr = &inventory[item];
437 /* Get the item (on the floor) */
440 o_ptr = &o_list[0 - item];
443 /* Access the item's sval */
446 use_realm = tval2realm(o_ptr->tval);
448 /* Track the object kind */
449 object_kind_track(o_ptr->k_idx);
451 /* Hack -- Handle stuff */
456 for (spell = 0; spell < 32; spell++)
458 /* Check for this spell */
459 if ((fake_spell_flags[sval] & (1L << spell)))
461 /* Collect this spell */
462 spells[num++] = spell;
467 /* Save the screen */
470 /* Clear the top line */
473 /* Keep browsing spells. Exit browsing on cancel. */
476 /* Ask for a spell, allow cancel */
478 if (!get_spell(&spell, "Æɤà", o_ptr->sval, TRUE, use_realm))
480 if (!get_spell(&spell, "browse", o_ptr->sval, TRUE, use_realm))
483 /* If cancelled, leave immediately. */
484 if (spell == -1) break;
486 /* Display a list of spells */
487 print_spells(0, spells, num, 1, 15, use_realm);
489 /* Notify that there's nothing to see, and wait. */
490 if (use_realm == REALM_HISSATSU)
492 prt("Æɤá¤ëµ»¤¬¤Ê¤¤¡£", 0, 0);
494 prt("No techniques to browse.", 0, 0);
498 prt("Æɤá¤ë¼öʸ¤¬¤Ê¤¤¡£", 0, 0);
500 prt("No spells to browse.", 0, 0);
505 /* Restore the screen */
511 /* Clear lines, position cursor (really should use strlen here) */
512 Term_erase(14, 14, 255);
513 Term_erase(14, 13, 255);
514 Term_erase(14, 12, 255);
515 Term_erase(14, 11, 255);
517 roff_to_buf(spell_tips[technic2magic(use_realm) - 1][spell], 62, temp, sizeof(temp));
518 for (j = 0, line = 11; temp[j]; j += 1 + strlen(&temp[j]))
520 prt(&temp[j], line, 15);
525 /* Restore the screen */
530 static void change_realm2(int next_realm)
535 for (i = 0; i < 64; i++)
537 p_ptr->spell_order[j] = p_ptr->spell_order[i];
538 if (p_ptr->spell_order[i] < 32) j++;
541 p_ptr->spell_order[j] = 99;
543 for (i = 32; i < 64; i++)
545 p_ptr->spell_exp[i] = SPELL_EXP_UNSKILLED;
547 p_ptr->spell_learned2 = 0L;
548 p_ptr->spell_worked2 = 0L;
549 p_ptr->spell_forgotten2 = 0L;
552 sprintf(tmp,"ËâË¡¤ÎÎΰè¤ò%s¤«¤é%s¤ËÊѹ¹¤·¤¿¡£", realm_names[p_ptr->realm2], realm_names[next_realm]);
554 sprintf(tmp,"change magic realm from %s to %s.", realm_names[p_ptr->realm2], realm_names[next_realm]);
556 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
557 p_ptr->old_realm |= 1 << (p_ptr->realm2-1);
558 p_ptr->realm2 = next_realm;
560 p_ptr->notice |= (PN_REORDER);
561 p_ptr->update |= (PU_SPELLS);
567 * Study a book to gain a new spell/prayer
569 void do_cmd_study(void)
573 bool learned = FALSE;
575 /* Spells of realm2 will have an increment of +32 */
578 cptr p = spell_category_name(mp_ptr->spell_book);
587 msg_print("ËܤòÆɤळ¤È¤¬¤Ç¤¤Ê¤¤¡ª");
589 msg_print("You cannot read books!");
595 if (p_ptr->blind || no_lite())
598 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡ª");
600 msg_print("You cannot see!");
609 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡ª");
611 msg_print("You are too confused!");
617 if (!(p_ptr->new_spells))
620 msg_format("¿·¤·¤¤%s¤ò³Ð¤¨¤ë¤³¤È¤Ï¤Ç¤¤Ê¤¤¡ª", p);
622 msg_format("You cannot learn any new %ss!", p);
628 if (p_ptr->special_defense & KATA_MUSOU)
630 set_action(ACTION_NONE);
634 if( p_ptr->new_spells < 10 ){
635 msg_format("¤¢¤È %d ¤Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
637 msg_format("¤¢¤È %d ¸Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
640 msg_format("You can learn %d new %s%s.", p_ptr->new_spells, p,
641 (p_ptr->new_spells == 1?"":"s"));
647 /* Restrict choices to "useful" books */
648 if (p_ptr->realm2 == REALM_NONE) item_tester_tval = mp_ptr->spell_book;
649 else item_tester_hook = item_tester_learn_spell;
653 q = "¤É¤ÎËܤ«¤é³Ø¤Ó¤Þ¤¹¤«? ";
655 q = "Study which book? ";
659 s = "Æɤá¤ëËܤ¬¤Ê¤¤¡£";
661 s = "You have no books that you can read.";
664 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
666 /* Get the item (in the pack) */
669 o_ptr = &inventory[item];
672 /* Get the item (on the floor) */
675 o_ptr = &o_list[0 - item];
678 /* Access the item's sval */
681 if (o_ptr->tval == REALM2_BOOK) increment = 32;
682 else if (o_ptr->tval != REALM1_BOOK)
685 if (!get_check("ËÜÅö¤ËËâË¡¤ÎÎΰè¤òÊѹ¹¤·¤Þ¤¹¤«¡©")) return;
687 if (!get_check("Really, change magic realm? ")) return;
689 change_realm2(tval2realm(o_ptr->tval));
693 /* Track the object kind */
694 object_kind_track(o_ptr->k_idx);
696 /* Hack -- Handle stuff */
699 /* Mage -- Learn a selected spell */
700 if (mp_ptr->spell_book != TV_LIFE_BOOK)
702 /* Ask for a spell, allow cancel */
704 if (!get_spell(&spell, "³Ø¤Ö", sval, FALSE, o_ptr->tval - TV_LIFE_BOOK + 1)
705 && (spell == -1)) return;
707 if (!get_spell(&spell, "study", sval, FALSE, o_ptr->tval - TV_LIFE_BOOK + 1)
708 && (spell == -1)) return;
713 /* Priest -- Learn a random prayer */
721 for (spell = 0; spell < 32; spell++)
723 /* Check spells in the book */
724 if ((fake_spell_flags[sval] & (1L << spell)))
726 /* Skip non "okay" prayers */
727 if (!spell_okay(spell, FALSE, TRUE,
728 (increment ? p_ptr->realm2 : p_ptr->realm1))) continue;
730 /* Hack -- Prepare the randomizer */
733 /* Hack -- Apply the randomizer */
734 if (one_in_(k)) gift = spell;
742 /* Nothing to study */
747 msg_format("¤½¤ÎËܤˤϳؤ֤٤%s¤¬¤Ê¤¤¡£", p);
749 msg_format("You cannot learn any %ss in that book.", p);
758 if (increment) spell += increment;
760 /* Learn the spell */
763 if (p_ptr->spell_learned1 & (1L << spell)) learned = TRUE;
764 else p_ptr->spell_learned1 |= (1L << spell);
768 if (p_ptr->spell_learned2 & (1L << (spell - 32))) learned = TRUE;
769 else p_ptr->spell_learned2 |= (1L << (spell - 32));
774 int max_exp = (spell < 32) ? SPELL_EXP_MASTER : SPELL_EXP_EXPERT;
775 int old_exp = p_ptr->spell_exp[spell];
776 int new_rank = EXP_LEVEL_UNSKILLED;
777 cptr name = spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell%32];
779 if (old_exp >= max_exp)
782 msg_format("¤½¤Î%s¤Ï´°Á´¤Ë»È¤¤¤³¤Ê¤»¤ë¤Î¤Ç³Ø¤ÖɬÍפϤʤ¤¡£", p);
784 msg_format("You don't need to study this %s anymore.", p);
789 if (!get_check(format("%s¤Î%s¤ò¤µ¤é¤Ë³Ø¤Ó¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©", name, p)))
791 if (!get_check(format("You will study a %s of %s again. Are you sure? ", p, name)))
796 else if (old_exp >= SPELL_EXP_EXPERT)
798 p_ptr->spell_exp[spell] = SPELL_EXP_MASTER;
799 new_rank = EXP_LEVEL_MASTER;
801 else if (old_exp >= SPELL_EXP_SKILLED)
803 if (spell >= 32) p_ptr->spell_exp[spell] = SPELL_EXP_EXPERT;
804 else p_ptr->spell_exp[spell] += SPELL_EXP_EXPERT - SPELL_EXP_SKILLED;
805 new_rank = EXP_LEVEL_EXPERT;
807 else if (old_exp >= SPELL_EXP_BEGINNER)
809 p_ptr->spell_exp[spell] = SPELL_EXP_SKILLED + (old_exp - SPELL_EXP_BEGINNER) * 2 / 3;
810 new_rank = EXP_LEVEL_SKILLED;
814 p_ptr->spell_exp[spell] = SPELL_EXP_BEGINNER + old_exp / 3;
815 new_rank = EXP_LEVEL_BEGINNER;
818 msg_format("%s¤Î½ÏÎýÅÙ¤¬%s¤Ë¾å¤¬¤Ã¤¿¡£", name, exp_level_str[new_rank]);
820 msg_format("Your proficiency of %s is now %s rank.", name, exp_level_str[new_rank]);
825 /* Find the next open entry in "p_ptr->spell_order[]" */
826 for (i = 0; i < 64; i++)
828 /* Stop at the first empty space */
829 if (p_ptr->spell_order[i] == 99) break;
832 /* Add the spell to the known list */
833 p_ptr->spell_order[i++] = spell;
835 /* Mention the result */
837 /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½¤ËÂбþ */
838 if (mp_ptr->spell_book == TV_MUSIC_BOOK)
840 msg_format("%s¤ò³Ø¤ó¤À¡£",
841 spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32]);
845 msg_format("%s¤Î%s¤ò³Ø¤ó¤À¡£",
846 spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32] ,p);
849 msg_format("You have learned the %s of %s.",
850 p, spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32]);
857 switch (mp_ptr->spell_book)
860 chg_virtue(V_FAITH, 1);
863 chg_virtue(V_UNLIFE, 1);
866 chg_virtue(V_NATURE, 1);
869 chg_virtue(V_KNOWLEDGE, 1);
876 /* One less spell available */
877 p_ptr->learned_spells++;
879 /* Message if needed */
880 if (p_ptr->new_spells)
884 if (p_ptr->new_spells < 10) msg_format("¤¢¤È %d ¤Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
885 else msg_format("¤¢¤È %d ¸Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
887 msg_format("You can learn %d more %s%s.", p_ptr->new_spells, p,
888 (p_ptr->new_spells != 1) ? "s" : "");
894 p_ptr->update |= (PU_SPELLS);
897 /* Redraw object recall */
898 p_ptr->window |= (PW_OBJECT);
902 static void wild_magic(int spell)
905 int type = SUMMON_BIZARRE1 + randint0(6);
907 if (type < SUMMON_BIZARRE1) type = SUMMON_BIZARRE1;
908 else if (type > SUMMON_BIZARRE6) type = SUMMON_BIZARRE6;
910 switch (randint1(spell) + randint1(8) + 1)
920 teleport_player(100);
924 teleport_player(200);
934 lite_area(damroll(2, 3), 2);
937 destroy_doors_touch();
942 sleep_monsters_touch();
946 trap_creation(py, px);
955 aggravate_monsters(0);
958 earthquake(py, px, 5);
962 (void)gain_random_mutation(0);
972 fire_ball(GF_CHAOS, 0, spell + 5, 1 + (spell / 10));
979 while (counter++ < 8)
981 (void)summon_specific(0, py, px, (dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET));
986 activate_hi_summon(py, px, FALSE);
989 (void)summon_cyber(-1, py, px);
994 (void)activate_ty_curse(FALSE, &count);
1003 static bool cast_life_spell(int spell)
1006 int plev = p_ptr->lev;
1010 case 0: /* Cure Light Wounds */
1011 (void)hp_player(damroll(2, 10));
1012 (void)set_cut(p_ptr->cut - 10);
1015 (void)set_blessed(randint1(12) + 12, FALSE);
1017 case 2: /* Make Light Wounds */
1018 if (!get_aim_dir(&dir)) return FALSE;
1019 fire_ball_hide(GF_WOUNDS, dir, damroll(3 + ((plev - 1) / 5), 4), 0);
1021 case 3: /* Call Light */
1022 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1024 case 4: /* Detect Traps + Secret Doors */
1025 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1026 (void)detect_doors(DETECT_RAD_DEFAULT);
1027 (void)detect_stairs(DETECT_RAD_DEFAULT);
1029 case 5: /* Cure Medium Wounds */
1030 (void)hp_player(damroll(4, 10));
1031 (void)set_cut((p_ptr->cut / 2) - 20);
1033 case 6: /* Cure Poison */
1034 (void)set_poisoned(0);
1036 case 7: /* Satisfy Hunger */
1037 (void)set_food(PY_FOOD_MAX - 1);
1039 case 8: /* Remove Curse */
1043 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1045 msg_print("You feel as if someone is watching over you.");
1049 case 9: /* Make Medium Wounds */
1050 if (!get_aim_dir(&dir)) return FALSE;
1051 fire_ball_hide(GF_WOUNDS, dir, damroll(8 + ((plev - 5) / 4), 8), 0);
1053 case 10: /* Cure Critical Wounds */
1054 (void)hp_player(damroll(8, 10));
1059 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1060 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1063 map_area(DETECT_RAD_MAP);
1066 (void)turn_undead();
1068 case 14: /* Healing */
1069 (void)hp_player(300);
1073 case 15: /* Glyph of Warding */
1076 case 16: /* Dispel Curse */
1077 if (remove_all_curse())
1080 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1082 msg_print("You feel as if someone is watching over you.");
1086 case 17: /* Perception */
1087 return ident_spell(FALSE);
1088 case 18: /* Dispel Undead */
1089 (void)dispel_undead(randint1(plev * 5));
1091 case 19: /* 'Day of the Dove' */
1092 charm_monsters(plev * 2);
1094 case 20: /* Make Critical Wounds */
1095 if (!get_aim_dir(&dir)) return FALSE;
1096 fire_ball_hide(GF_WOUNDS, dir, damroll(5+((plev - 5) / 3), 15), 0);
1098 case 21: /* Word of Recall */
1099 return word_of_recall();
1100 case 22: /* Alter Reality */
1103 case 23: /* Warding True */
1108 num_repro += MAX_REPRO;
1110 case 25: /* Detection True */
1111 (void)detect_all(DETECT_RAD_DEFAULT);
1113 case 26: /* Genocide Undead */
1114 (void)mass_genocide_undead(plev+50,TRUE);
1116 case 27: /* Clairvoyance */
1119 case 28: /* Restoration */
1120 (void)do_res_stat(A_STR);
1121 (void)do_res_stat(A_INT);
1122 (void)do_res_stat(A_WIS);
1123 (void)do_res_stat(A_DEX);
1124 (void)do_res_stat(A_CON);
1125 (void)do_res_stat(A_CHR);
1126 (void)restore_level();
1128 case 29: /* Healing True */
1129 (void)hp_player(2000);
1133 case 30: /* Holy Vision */
1134 return identify_fully(FALSE);
1135 case 31: /* Ultimate resistance */
1137 int v = randint1(plev/2)+plev/2;
1138 (void)set_fast(v, FALSE);
1139 set_oppose_acid(v, FALSE);
1140 set_oppose_elec(v, FALSE);
1141 set_oppose_fire(v, FALSE);
1142 set_oppose_cold(v, FALSE);
1143 set_oppose_pois(v, FALSE);
1144 set_ultimate_res(v, FALSE);
1149 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥é¥¤¥Õ¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1151 msg_format("You cast an unknown Life spell: %d.", spell);
1162 static bool cast_sorcery_spell(int spell)
1165 int plev = p_ptr->lev;
1169 case 0: /* Detect Monsters */
1170 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1172 case 1: /* Phase Door */
1173 teleport_player(10);
1175 case 2: /* Detect Doors and Traps */
1176 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1177 (void)detect_doors(DETECT_RAD_DEFAULT);
1178 (void)detect_stairs(DETECT_RAD_DEFAULT);
1180 case 3: /* Light Area */
1181 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1183 case 4: /* Confuse Monster */
1184 if (!get_aim_dir(&dir)) return FALSE;
1186 (void)confuse_monster(dir, (plev * 3) / 2);
1188 case 5: /* Teleport */
1189 teleport_player(plev * 5);
1191 case 6: /* Sleep Monster */
1192 if (!get_aim_dir(&dir)) return FALSE;
1194 (void)sleep_monster(dir);
1196 case 7: /* Recharging */
1197 return recharge(plev * 4);
1198 case 8: /* Magic Mapping */
1199 map_area(DETECT_RAD_MAP);
1201 case 9: /* Identify */
1202 return ident_spell(FALSE);
1203 case 10: /* Slow Monster */
1204 if (!get_aim_dir(&dir)) return FALSE;
1206 (void)slow_monster(dir);
1208 case 11: /* Mass Sleep */
1209 (void)sleep_monsters();
1211 case 12: /* Teleport Away */
1212 if (!get_aim_dir(&dir)) return FALSE;
1214 (void)fire_beam(GF_AWAY_ALL, dir, plev);
1216 case 13: /* Haste Self */
1217 (void)set_fast(randint1(20 + plev) + plev, FALSE);
1219 case 14: /* Detection True */
1220 (void)detect_all(DETECT_RAD_DEFAULT);
1222 case 15: /* Identify True */
1223 return identify_fully(FALSE);
1224 case 16: /* Detect Objects and Treasure*/
1225 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
1226 (void)detect_treasure(DETECT_RAD_DEFAULT);
1227 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
1229 case 17: /* Charm Monster */
1230 if (!get_aim_dir(&dir)) return FALSE;
1232 (void)charm_monster(dir, plev);
1234 case 18: /* Sense Minds */
1235 (void)set_tim_esp(randint1(30) + 25, FALSE);
1237 case 19: /* Teleport to town */
1239 case 20: /* Self knowledge */
1240 (void)self_knowledge();
1242 case 21: /* Teleport Level */
1244 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
1246 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
1248 (void)teleport_level(0);
1250 case 22: /* Word of Recall */
1251 return word_of_recall();
1252 case 23: /* Dimension Door */
1254 msg_print("¼¡¸µ¤ÎÈ⤬³«¤¤¤¿¡£ÌÜŪÃϤòÁª¤ó¤Ç²¼¤µ¤¤¡£");
1256 msg_print("You open a dimensional gate. Choose a destination.");
1259 return dimension_door();
1260 case 24: /* Probing */
1263 case 25: /* Explosive Rune */
1266 case 26: /* Telekinesis */
1267 if (!get_aim_dir(&dir)) return FALSE;
1269 fetch(dir, plev * 15, FALSE);
1271 case 27: /* Clairvoyance */
1272 chg_virtue(V_KNOWLEDGE, 1);
1273 chg_virtue(V_ENLIGHTEN, 1);
1276 if (!(p_ptr->telepathy))
1278 (void)set_tim_esp(randint1(30) + 25, FALSE);
1281 case 28: /* Charm Monsters */
1282 charm_monsters(plev * 2);
1284 case 29: /* Alchemy */
1286 case 30: /* Banish */
1287 banish_monsters(plev * 4);
1289 case 31: /* Globe of Invulnerability */
1290 (void)set_invuln(randint1(4) + 4, FALSE);
1294 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥½¡¼¥µ¥ê¡¼¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1296 msg_format("You cast an unknown Sorcery spell: %d.", spell);
1306 static bool cast_nature_spell(int spell)
1310 int plev = p_ptr->lev;
1312 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1313 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1314 else beam = plev / 2;
1318 case 0: /* Detect Creatures */
1319 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1321 case 1: /* Lightning Bolt */
1322 project_length = plev / 6 + 2;
1323 if (!get_aim_dir(&dir)) return FALSE;
1325 fire_beam(GF_ELEC, dir,
1326 damroll(3 + ((plev - 1) / 5), 4));
1328 case 2: /* Detect Doors & Traps */
1329 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1330 (void)detect_doors(DETECT_RAD_DEFAULT);
1331 (void)detect_stairs(DETECT_RAD_DEFAULT);
1333 case 3: /* Produce Food */
1335 object_type forge, *q_ptr = &forge;
1338 msg_print("¿©ÎÁ¤òÀ¸À®¤·¤¿¡£");
1340 msg_print("A food ration is produced.");
1343 /* Create the food ration */
1344 object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_RATION));
1346 /* Drop the object from heaven */
1347 (void)drop_near(q_ptr, -1, py, px);
1351 case 4: /* Daylight */
1352 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1353 if ((prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
1356 msg_print("Æü¤Î¸÷¤¬¤¢¤Ê¤¿¤ÎÆùÂΤò¾Ç¤¬¤·¤¿¡ª");
1358 msg_print("The daylight scorches your flesh!");
1362 take_hit(DAMAGE_NOESCAPE, damroll(2, 2), "Æü¤Î¸÷", -1);
1364 take_hit(DAMAGE_NOESCAPE, damroll(2, 2), "daylight", -1);
1369 case 5: /* Animal Taming */
1370 if (!get_aim_dir(&dir)) return FALSE;
1372 (void)charm_animal(dir, plev);
1374 case 6: /* Resist Environment */
1375 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1376 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1377 (void)set_oppose_elec(randint1(20) + 20, FALSE);
1379 case 7: /* Cure Wounds & Poison */
1380 (void)hp_player(damroll(2, 8));
1382 (void)set_poisoned(0);
1384 case 8: /* Stone to Mud */
1385 if (!get_aim_dir(&dir)) return FALSE;
1387 (void)wall_to_mud(dir);
1389 case 9: /* Frost Bolt */
1390 if (!get_aim_dir(&dir)) return FALSE;
1391 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
1392 damroll(3 + ((plev - 5) / 4), 8));
1394 case 10: /* Nature Awareness -- downgraded */
1395 map_area(DETECT_RAD_MAP);
1396 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1397 (void)detect_doors(DETECT_RAD_DEFAULT);
1398 (void)detect_stairs(DETECT_RAD_DEFAULT);
1399 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1401 case 11: /* Fire Bolt */
1402 if (!get_aim_dir(&dir)) return FALSE;
1403 fire_bolt_or_beam(beam - 10, GF_FIRE, dir,
1404 damroll(5 + ((plev - 5) / 4), 8));
1406 case 12: /* Ray of Sunlight */
1407 if (!get_aim_dir(&dir)) return FALSE;
1409 msg_print("ÂÀÍÛ¸÷Àþ¤¬¸½¤ì¤¿¡£");
1411 msg_print("A line of sunlight appears.");
1414 (void)lite_line(dir);
1416 case 13: /* Entangle */
1419 case 14: /* Summon Animals */
1420 if (!(summon_specific(-1, py, px, plev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET))))
1423 msg_print("ưʪ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
1425 msg_print("No animals arrive.");
1429 case 15: /* Herbal Healing */
1430 (void)hp_player(500);
1433 (void)set_poisoned(0);
1435 case 16: /* Stair Building */
1436 (void)stair_creation();
1438 case 17: /* Stone Skin */
1439 (void)set_shield(randint1(20) + 30, FALSE);
1441 case 18: /* Resistance True */
1442 (void)set_oppose_acid(randint1(20) + 20, FALSE);
1443 (void)set_oppose_elec(randint1(20) + 20, FALSE);
1444 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1445 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1446 (void)set_oppose_pois(randint1(20) + 20, FALSE);
1448 case 19: /* Tree Creation */
1449 (void)tree_creation();
1451 case 20: /* Animal Friendship */
1452 (void)charm_animals(plev * 2);
1454 case 21: /* Stone Tell */
1455 return identify_fully(FALSE);
1456 case 22: /* Wall of Stone */
1459 case 23: /* Protection from Corrosion */
1461 case 24: /* Earthquake */
1462 earthquake(py, px, 10);
1464 case 25: /* Whirlwind Attack */
1468 monster_type *m_ptr;
1470 for (dir = 0; dir < 8; dir++)
1472 y = py + ddy_ddd[dir];
1473 x = px + ddx_ddd[dir];
1474 c_ptr = &cave[y][x];
1476 /* Get the monster */
1477 m_ptr = &m_list[c_ptr->m_idx];
1479 /* Hack -- attack monsters */
1480 if (c_ptr->m_idx && (m_ptr->ml || cave_floor_bold(y, x)))
1485 case 26: /* Blizzard */
1486 if (!get_aim_dir(&dir)) return FALSE;
1488 fire_ball(GF_COLD, dir, 70 + plev * 3 / 2, (plev / 12) + 1);
1490 case 27: /* Lightning Storm */
1491 if (!get_aim_dir(&dir)) return FALSE;
1492 fire_ball(GF_ELEC, dir, 90 + plev * 3 / 2, (plev / 12) + 1);
1494 case 28: /* Whirlpool */
1495 if (!get_aim_dir(&dir)) return FALSE;
1496 fire_ball(GF_WATER, dir, 100 + plev * 3 / 2, (plev / 12) + 1);
1498 case 29: /* Call Sunlight */
1499 fire_ball(GF_LITE, 0, 150, 8);
1500 chg_virtue(V_KNOWLEDGE, 1);
1501 chg_virtue(V_ENLIGHTEN, 1);
1503 if ((prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
1506 msg_print("Æü¸÷¤¬¤¢¤Ê¤¿¤ÎÆùÂΤò¾Ç¤¬¤·¤¿¡ª");
1508 msg_print("The sunlight scorches your flesh!");
1512 take_hit(DAMAGE_NOESCAPE, 50, "Æü¸÷", -1);
1514 take_hit(DAMAGE_NOESCAPE, 50, "sunlight", -1);
1519 case 30: /* Elemental Branding */
1520 brand_weapon(randint0(2));
1522 case 31: /* Nature's Wrath */
1523 (void)dispel_monsters(plev * 4);
1524 earthquake(py, px, 20 + (plev / 2));
1525 project(0, 1 + plev / 12, py, px,
1526 (100 + plev) * 2, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM, -1);
1530 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥Í¥¤¥Á¥ã¡¼¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1532 msg_format("You cast an unknown Nature spell: %d.", spell);
1542 static bool cast_chaos_spell(int spell)
1545 int plev = p_ptr->lev;
1547 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1548 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1549 else beam = plev / 2;
1553 case 0: /* Magic Missile */
1554 if (!get_aim_dir(&dir)) return FALSE;
1556 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
1557 damroll(3 + ((plev - 1) / 5), 4));
1559 case 1: /* Trap / Door destruction */
1560 (void)destroy_doors_touch();
1562 case 2: /* Flash of Light == Light Area */
1563 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1565 case 3: /* Touch of Confusion */
1566 if (!(p_ptr->special_attack & ATTACK_CONFUSE))
1569 msg_print("¤¢¤Ê¤¿¤Î¼ê¤Ï¸÷¤ê»Ï¤á¤¿¡£");
1571 msg_print("Your hands start glowing.");
1574 p_ptr->special_attack |= ATTACK_CONFUSE;
1575 p_ptr->redraw |= (PR_STATUS);
1578 case 4: /* Mana Burst */
1579 if (!get_aim_dir(&dir)) return FALSE;
1581 fire_ball(GF_MISSILE, dir,
1582 (damroll(3, 5) + plev +
1583 (plev / (((p_ptr->pclass == CLASS_MAGE)
1584 || (p_ptr->pclass == CLASS_HIGH_MAGE)
1585 || (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
1586 ((plev < 30) ? 2 : 3));
1587 /* Shouldn't actually use GF_MANA, as it will destroy all
1588 * items on the floor */
1590 case 5: /* Fire Bolt */
1591 if (!get_aim_dir(&dir)) return FALSE;
1593 fire_bolt_or_beam(beam, GF_FIRE, dir,
1594 damroll(8 + ((plev - 5) / 4), 8));
1596 case 6: /* Fist of Force ("Fist of Fun") */
1597 if (!get_aim_dir(&dir)) return FALSE;
1599 fire_ball(GF_DISINTEGRATE, dir,
1600 damroll(8 + ((plev - 5) / 4), 8), 0);
1602 case 7: /* Teleport Self */
1603 teleport_player(plev * 5);
1605 case 8: /* Wonder */
1607 /* This spell should become more useful (more
1608 controlled) as the player gains experience levels.
1609 Thus, add 1/5 of the player's level to the die roll.
1610 This eliminates the worst effects later on, while
1611 keeping the results quite random. It also allows
1612 some potent effects only at high level. */
1614 int die = randint1(100) + plev / 5;
1615 int vir = virtue_number(V_CHANCE);
1618 if (p_ptr->virtues[vir - 1] > 0)
1620 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
1624 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
1629 chg_virtue(V_CHANCE, 1);
1631 if (!get_aim_dir(&dir)) return FALSE;
1634 msg_print("¤¢¤Ê¤¿¤ÏÎϤ¬¤ß¤Ê¤®¤ë¤Î¤ò´¶¤¸¤¿¡ª");
1636 msg_print("You feel a surge of power!");
1639 if (die < 8) clone_monster(dir);
1640 else if (die < 14) speed_monster(dir);
1641 else if (die < 26) heal_monster(dir, damroll(4, 6));
1642 else if (die < 31) poly_monster(dir);
1644 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
1645 damroll(3 + ((plev - 1) / 5), 4));
1646 else if (die < 41) confuse_monster(dir, plev);
1647 else if (die < 46) fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
1648 else if (die < 51) (void)lite_line(dir);
1650 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
1651 damroll(3 + ((plev - 5) / 4), 8));
1653 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
1654 damroll(5 + ((plev - 5) / 4), 8));
1656 fire_bolt_or_beam(beam, GF_ACID, dir,
1657 damroll(6 + ((plev - 5) / 4), 8));
1659 fire_bolt_or_beam(beam, GF_FIRE, dir,
1660 damroll(8 + ((plev - 5) / 4), 8));
1661 else if (die < 76) drain_life(dir, 75);
1662 else if (die < 81) fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
1663 else if (die < 86) fire_ball(GF_ACID, dir, 40 + plev, 2);
1664 else if (die < 91) fire_ball(GF_ICE, dir, 70 + plev, 3);
1665 else if (die < 96) fire_ball(GF_FIRE, dir, 80 + plev, 3);
1666 else if (die < 101) drain_life(dir, 100 + plev);
1669 earthquake(py, px, 12);
1673 (void)destroy_area(py, px, 13 + randint0(5), FALSE);
1677 symbol_genocide(plev+50, TRUE);
1679 else if (die < 110) dispel_monsters(120);
1682 dispel_monsters(150);
1689 case 9: /* Chaos Bolt */
1690 if (!get_aim_dir(&dir)) return FALSE;
1692 fire_bolt_or_beam(beam, GF_CHAOS, dir,
1693 damroll(10 + ((plev - 5) / 4), 8));
1695 case 10: /* Sonic Boom */
1697 msg_print("¥É¡¼¥ó¡ªÉô²°¤¬Íɤ줿¡ª");
1699 msg_print("BOOM! Shake the room!");
1702 project(0, plev / 10 + 2, py, px,
1703 (60 + plev), GF_SOUND, PROJECT_KILL | PROJECT_ITEM, -1);
1705 case 11: /* Doom Bolt -- always beam in 2.0.7 or later */
1706 if (!get_aim_dir(&dir)) return FALSE;
1708 fire_beam(GF_MANA, dir, damroll(11 + ((plev - 5) / 4), 8));
1710 case 12: /* Fire Ball */
1711 if (!get_aim_dir(&dir)) return FALSE;
1713 fire_ball(GF_FIRE, dir, plev + 55, 2);
1715 case 13: /* Teleport Other */
1716 if (!get_aim_dir(&dir)) return FALSE;
1718 (void)fire_beam(GF_AWAY_ALL, dir, plev);
1720 case 14: /* Word of Destruction */
1721 (void)destroy_area(py, px, 13 + randint0(5), FALSE);
1723 case 15: /* Invoke Logrus */
1724 if (!get_aim_dir(&dir)) return FALSE;
1726 fire_ball(GF_CHAOS, dir, plev*2 + 99, plev / 5);
1728 case 16: /* Polymorph Other */
1729 if (!get_aim_dir(&dir)) return FALSE;
1731 (void)poly_monster(dir);
1733 case 17: /* Chain Lightning */
1734 for (dir = 0; dir <= 9; dir++)
1735 fire_beam(GF_ELEC, dir, damroll(5 + (plev / 10), 8));
1737 case 18: /* Arcane Binding == Charging */
1738 return recharge(90);
1739 case 19: /* Disintegration */
1740 if (!get_aim_dir(&dir)) return FALSE;
1742 fire_ball(GF_DISINTEGRATE, dir, plev + 70, 3 + plev / 40);
1744 case 20: /* Alter Reality */
1747 case 21: /* Magic Rocket */
1748 if (!get_aim_dir(&dir)) return FALSE;
1751 msg_print("¥í¥±¥Ã¥Èȯ¼Í¡ª");
1753 msg_print("You launch a rocket!");
1756 fire_rocket(GF_ROCKET, dir, 120 + plev*2, 2);
1758 case 22: /* Chaos Branding */
1761 case 23: /* Summon monster, demon */
1764 bool pet = !one_in_(3);
1766 if (pet) mode |= PM_FORCE_PET;
1767 else mode |= PM_NO_PET;
1768 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
1770 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, SUMMON_DEMON, mode))
1773 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
1775 msg_print("The area fills with a stench of sulphur and brimstone.");
1781 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
1783 msg_print("'What is thy bidding... Master?'");
1788 msg_print("¡ÖÈܤ·¤¼Ô¤è¡¢²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª ¤ªÁ°¤Îº²¤òĺ¤¯¤¾¡ª¡×");
1790 msg_print("'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'");
1796 case 24: /* Beam of Gravity */
1797 if (!get_aim_dir(&dir)) return FALSE;
1799 fire_beam(GF_GRAVITY, dir, damroll(9 + ((plev - 5) / 4), 8));
1801 case 25: /* Meteor Swarm */
1804 int b = 10 + randint1(10);
1805 for (i = 0; i < b; i++)
1807 int count = 0, d = 0;
1812 if (count > 20) break;
1813 x = px - 8 + randint0(17);
1814 y = py - 8 + randint0(17);
1816 if (!in_bounds(y, x) || !have_flag(f_flags_bold(y, x), FF_MOVE) || !player_has_los_bold(y, x)) continue;
1818 dx = (px > x) ? (px - x) : (x - px);
1819 dy = (py > y) ? (py - y) : (y - py);
1821 /* Approximate distance */
1822 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
1826 if (count > 20) continue;
1828 project(0, 2, y, x, plev * 2, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
1832 case 26: /* Flame Strike */
1833 fire_ball(GF_FIRE, 0, 300 + (3 * plev), 8);
1835 case 27: /* Call Chaos */
1838 case 28: /* Polymorph Self */
1840 if (!get_check("ÊѿȤ·¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©")) return FALSE;
1842 if (!get_check("You will polymorph yourself. Are you sure? ")) return FALSE;
1846 case 29: /* Mana Storm */
1847 if (!get_aim_dir(&dir)) return FALSE;
1849 fire_ball(GF_MANA, dir, 300 + (plev * 4), 4);
1851 case 30: /* Breathe Logrus */
1852 if (!get_aim_dir(&dir)) return FALSE;
1854 fire_ball(GF_CHAOS, dir, p_ptr->chp, 2);
1856 case 31: /* Call the Void */
1861 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥«¥ª¥¹¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1863 msg_format("You cast an unknown Chaos spell: %d.", spell);
1873 static bool cast_death_spell(int spell)
1877 int plev = p_ptr->lev;
1880 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1881 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1882 else beam = plev / 2;
1886 case 0: /* Detect Undead & Demons -> Unlife */
1887 (void)detect_monsters_nonliving(DETECT_RAD_DEFAULT);
1889 case 1: /* Malediction */
1890 if (!get_aim_dir(&dir)) return FALSE;
1891 /* A radius-0 ball may (1) be aimed at objects etc.,
1892 * and will affect them; (2) may be aimed at ANY
1893 * visible monster, unlike a 'bolt' which must travel
1894 * to the monster. */
1896 fire_ball(GF_HELL_FIRE, dir,
1897 damroll(3 + ((plev - 1) / 5), 4), 0);
1900 { /* Special effect first */
1901 dummy = randint1(1000);
1903 fire_ball_hide(GF_DEATH_RAY, dir, plev * 200, 0);
1904 else if (dummy < 500)
1905 fire_ball_hide(GF_TURN_ALL, dir, plev, 0);
1906 else if (dummy < 800)
1907 fire_ball_hide(GF_OLD_CONF, dir, plev, 0);
1909 fire_ball_hide(GF_STUN, dir, plev, 0);
1912 case 2: /* Detect Evil */
1913 (void)detect_monsters_evil(DETECT_RAD_DEFAULT);
1915 case 3: /* Stinking Cloud */
1916 if (!get_aim_dir(&dir)) return FALSE;
1918 fire_ball(GF_POIS, dir, 10 + (plev / 2), 2);
1920 case 4: /* Black Sleep */
1921 if (!get_aim_dir(&dir)) return FALSE;
1923 (void)sleep_monster(dir);
1925 case 5: /* Resist Poison */
1926 (void)set_oppose_pois(randint1(20) + 20, FALSE);
1928 case 6: /* Horrify */
1929 if (!get_aim_dir(&dir)) return FALSE;
1931 (void)fear_monster(dir, plev);
1932 (void)stun_monster(dir, plev);
1934 case 7: /* Enslave Undead */
1935 if (!get_aim_dir(&dir)) return FALSE;
1937 (void)control_one_undead(dir, plev);
1939 case 8: /* Orb of Entropy */
1940 if (!get_aim_dir(&dir)) return FALSE;
1942 fire_ball(GF_OLD_DRAIN, dir,
1943 (damroll(3, 6) + plev +
1944 (plev / (((p_ptr->pclass == CLASS_MAGE) ||
1945 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
1946 (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
1947 ((plev < 30) ? 2 : 3));
1949 case 9: /* Nether Bolt */
1950 if (!get_aim_dir(&dir)) return FALSE;
1952 fire_bolt_or_beam(beam, GF_NETHER, dir,
1953 damroll(8 + ((plev - 5) / 4), 8));
1955 case 10: /* Cloud kill */
1956 project(0, plev / 10 + 2, py, px,
1957 (30 + plev) * 2, GF_POIS, PROJECT_KILL | PROJECT_ITEM, -1);
1959 case 11: /* Genocide One */
1960 if (!get_aim_dir(&dir)) return FALSE;
1962 fire_ball_hide(GF_GENOCIDE, dir, plev + 50, 0);
1964 case 12: /* Poison Branding */
1967 case 13: /* Vampiric Drain */
1968 if (!get_aim_dir(&dir)) return FALSE;
1970 dummy = plev * 2 + randint1(plev * 2); /* Dmg */
1971 if (drain_life(dir, dummy))
1973 chg_virtue(V_SACRIFICE, -1);
1974 chg_virtue(V_VITALITY, -1);
1976 (void)hp_player(dummy);
1977 /* Gain nutritional sustenance: 150/hp drained */
1978 /* A Food ration gives 5000 food points (by contrast) */
1979 /* Don't ever get more than "Full" this way */
1980 /* But if we ARE Gorged, it won't cure us */
1981 dummy = p_ptr->food + MIN(5000, 100 * dummy);
1982 if (p_ptr->food < PY_FOOD_MAX) /* Not gorged already */
1983 (void)set_food(dummy >= PY_FOOD_MAX ? PY_FOOD_MAX - 1 : dummy);
1986 case 14: /* Animate Dead */
1987 animate_dead(0, py, px);
1989 case 15: /* Genocide */
1990 (void)symbol_genocide(plev+50, TRUE);
1992 case 16: /* Berserk */
1993 (void)set_shero(randint1(25) + 25, FALSE);
1994 (void)hp_player(30);
1995 (void)set_afraid(0);
1997 case 17: /* Invoke Spirits */
1999 int die = randint1(100) + plev / 5;
2000 int vir = virtue_number(V_CHANCE);
2003 if (p_ptr->virtues[vir - 1] > 0)
2005 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
2009 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
2013 if (!get_aim_dir(&dir)) return FALSE;
2016 msg_print("¤¢¤Ê¤¿¤Ï»à¼Ô¤¿¤Á¤ÎÎϤò¾·½¸¤·¤¿...");
2018 msg_print("You call on the power of the dead...");
2021 chg_virtue(V_CHANCE, 1);
2025 msg_print("¤¢¤Ê¤¿¤Ï¤ª¤É¤í¤ª¤É¤í¤·¤¤ÎϤΤ¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
2027 msg_print("You feel a surge of eldritch force!");
2034 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¤¢¤Ê¤¿¤Î¼þ¤ê¤ÎÃÏÌ̤«¤éµà¤Á¤¿¿Í±Æ¤¬Î©¤Á¾å¤¬¤Ã¤Æ¤¤¿¡ª");
2036 msg_print("Oh no! Mouldering forms rise from the earth around you!");
2039 (void)summon_specific(0, py, px, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
2040 chg_virtue(V_UNLIFE, 1);
2045 msg_print("̾¾õ¤·Æñ¤¤¼Ù°¤Ê¸ºß¤¬¤¢¤Ê¤¿¤Î¿´¤òÄ̤ê²á¤®¤Æ¹Ô¤Ã¤¿...");
2047 msg_print("An unnamable evil brushes against your mind...");
2050 set_afraid(p_ptr->afraid + randint1(4) + 4);
2055 msg_print("¤¢¤Ê¤¿¤ÎƬ¤ËÂçÎ̤ÎÍ©Î¤Á¤ÎÁû¡¹¤·¤¤À¼¤¬²¡¤·´ó¤»¤Æ¤¤¿...");
2057 msg_print("Your head is invaded by a horde of gibbering spectral voices...");
2060 set_confused(p_ptr->confused + randint1(4) + 4);
2068 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
2069 damroll(3 + ((plev - 1) / 5), 4));
2073 confuse_monster (dir, plev);
2077 fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
2081 (void)lite_line(dir);
2085 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
2086 damroll(3+((plev-5)/4),8));
2090 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
2091 damroll(5+((plev-5)/4),8));
2095 fire_bolt_or_beam(beam, GF_ACID, dir,
2096 damroll(6+((plev-5)/4),8));
2100 fire_bolt_or_beam(beam, GF_FIRE, dir,
2101 damroll(8+((plev-5)/4),8));
2105 drain_life(dir, 75);
2109 fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
2113 fire_ball(GF_ACID, dir, 40 + plev, 2);
2117 fire_ball(GF_ICE, dir, 70 + plev, 3);
2121 fire_ball(GF_FIRE, dir, 80 + plev, 3);
2125 drain_life(dir, 100 + plev);
2129 earthquake(py, px, 12);
2133 (void)destroy_area(py, px, 13 + randint0(5), FALSE);
2137 symbol_genocide(plev+50, TRUE);
2141 dispel_monsters(120);
2145 dispel_monsters(150);
2153 msg_print("±¢±µ¤ÊÀ¼¤¬¥¯¥¹¥¯¥¹¾Ð¤¦¡£¡Ö¤â¤¦¤¹¤°¤ª¤Þ¤¨¤Ï²æ¡¹¤ÎÃç´Ö¤Ë¤Ê¤ë¤À¤í¤¦¡£¼å¤¼Ô¤è¡£¡×");
2155 msg_print("Sepulchral voices chuckle. 'Soon you will join us, mortal.'");
2160 case 18: /* Dark Bolt */
2161 if (!get_aim_dir(&dir)) return FALSE;
2163 fire_bolt_or_beam(beam, GF_DARK, dir,
2164 damroll(4 + ((plev - 5) / 4), 8));
2166 case 19: /* Battle Frenzy */
2167 (void)set_shero(randint1(25) + 25, FALSE);
2168 (void)hp_player(30);
2169 (void)set_afraid(0);
2170 (void)set_fast(randint1(20 + (plev / 2)) + (plev / 2), FALSE);
2172 case 20: /* Vampiric Branding */
2175 case 21: /* Vampirism True */
2176 if (!get_aim_dir(&dir)) return FALSE;
2178 chg_virtue(V_SACRIFICE, -1);
2179 chg_virtue(V_VITALITY, -1);
2181 for (dummy = 0; dummy < 3; dummy++)
2183 if (drain_life(dir, 100))
2187 case 22: /* Word of Death */
2188 (void)dispel_living(randint1(plev * 3));
2190 case 23: /* Darkness Storm */
2191 if (!get_aim_dir(&dir)) return FALSE;
2193 fire_ball(GF_DARK, dir, 100+plev*2, 4);
2195 case 24: /* Death Ray */
2196 if (!get_aim_dir(&dir)) return FALSE;
2198 (void)death_ray(dir, plev);
2200 case 25: /* Raise the Dead */
2203 bool pet = one_in_(3);
2206 type = (plev > 47 ? SUMMON_HI_UNDEAD : SUMMON_UNDEAD);
2208 if (!pet || (pet && (plev > 24) && one_in_(3)))
2209 mode |= PM_ALLOW_GROUP;
2211 if (pet) mode |= PM_FORCE_PET;
2212 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
2214 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, type, mode))
2217 msg_print("Î䤿¤¤É÷¤¬¤¢¤Ê¤¿¤Î¼þ¤ê¤Ë¿á¤»Ï¤á¤¿¡£¤½¤ì¤ÏÉåÇÔ½¤ò±¿¤ó¤Ç¤¤¤ë...");
2219 msg_print("Cold winds begin to blow around you, carrying with them the stench of decay...");
2225 msg_print("¸Å¤¨¤Î»à¤»¤ë¼Ô¶¦¤¬¤¢¤Ê¤¿¤Ë»Å¤¨¤ë¤¿¤áÅÚ¤«¤éᴤä¿¡ª");
2227 msg_print("Ancient, long-dead forms arise from the ground to serve you!");
2232 msg_print("»à¼Ô¤¬á´¤Ã¤¿¡£Ì²¤ê¤ò˸¤²¤ë¤¢¤Ê¤¿¤òȳ¤¹¤ë¤¿¤á¤Ë¡ª");
2234 msg_print("'The dead arise... to punish you for disturbing them!'");
2237 chg_virtue(V_UNLIFE, 1);
2242 case 26: /* Esoteria */
2243 if (randint1(50) > plev)
2244 return ident_spell(FALSE);
2246 return identify_fully(FALSE);
2247 case 27: /* Mimic vampire */
2248 (void)set_mimic(10+plev/2 + randint1(10+plev/2), MIMIC_VAMPIRE, FALSE);
2250 case 28: /* Restore Life */
2251 (void)restore_level();
2253 case 29: /* Mass Genocide */
2254 (void)mass_genocide(plev+50, TRUE);
2256 case 30: /* Hellfire */
2257 if (!get_aim_dir(&dir)) return FALSE;
2259 fire_ball(GF_HELL_FIRE, dir, 666, 3);
2261 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "ÃϹö¤Î¹å²Ð¤Î¼öʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
2263 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "the strain of casting Hellfire", -1);
2267 case 31: /* Wraithform */
2268 set_wraith_form(randint1(plev / 2) + (plev / 2), FALSE);
2271 msg_format("You cast an unknown Death spell: %d.", spell);
2279 static bool cast_trump_spell(int spell, bool success)
2282 int plev = p_ptr->lev;
2283 int summon_lev = plev * 2 / 3 + randint1(plev/2);
2285 bool no_trump = FALSE;
2286 bool unique_okay = FALSE;
2288 if (summon_lev < 1) summon_lev = 1;
2289 if (!success || (randint1(50+plev) < plev/10)) unique_okay = TRUE;
2292 case 0: /* Phase Door */
2295 teleport_player(10);
2298 case 1: /* Trump Spiders */
2300 bool pet = success; /* (randint1(5) > 2) */
2301 u32b mode = PM_ALLOW_GROUP;
2303 if (pet) mode |= PM_FORCE_PET;
2304 else mode |= PM_NO_PET;
2307 msg_print("¤¢¤Ê¤¿¤ÏÃØéá¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2309 msg_print("You concentrate on the trump of an spider...");
2312 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_SPIDER, mode))
2316 msg_print("¾¤´¤µ¤ì¤¿ÃØéá¤ÏÅܤäƤ¤¤ë¡ª");
2318 msg_print("The summoned spiders get angry!");
2328 case 2: /* Shuffle */
2331 /* A limited power 'wonder' spell */
2332 int die = randint1(120);
2333 int vir = virtue_number(V_CHANCE);
2335 if ((p_ptr->pclass == CLASS_ROGUE) ||
2336 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
2337 (p_ptr->pclass == CLASS_SORCERER))
2338 die = (randint1(110)) + plev / 5;
2339 /* Card sharks and high mages get a level bonus */
2343 if (p_ptr->virtues[vir - 1] > 0)
2345 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
2349 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
2354 msg_print("¤¢¤Ê¤¿¤Ï¥«¡¼¥É¤òÀڤäưìËç°ú¤¤¤¿...");
2356 msg_print("You shuffle the deck and draw a card...");
2360 chg_virtue(V_CHANCE, 1);
2365 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡Ô»à¡Õ¤À¡ª");
2367 msg_print("Oh no! It's Death!");
2370 for (dummy = 0; dummy < randint1(3); dummy++)
2371 (void)activate_hi_summon(py, px, FALSE);
2376 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡Ô°Ëâ¡Õ¤À¡ª");
2378 msg_print("Oh no! It's the Devil!");
2381 (void)summon_specific(0, py, px, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
2387 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡ÔÄߤé¤ì¤¿ÃË¡Õ¤À¡ª");
2389 msg_print("Oh no! It's the Hanged Man.");
2392 (void)activate_ty_curse(FALSE, &count);
2397 msg_print("¡ÔÉÔĴϤηõ¡Õ¤À¡£");
2399 msg_print("It's the swords of discord.");
2402 aggravate_monsters(0);
2407 msg_print("¡Ô¶ò¼Ô¡Õ¤À¡£");
2409 msg_print("It's the Fool.");
2412 (void)do_dec_stat(A_INT);
2413 (void)do_dec_stat(A_WIS);
2418 msg_print("´ñ̯¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2420 msg_print("It's the picture of a strange monster.");
2423 if (!(summon_specific(0, py, px, (dun_level * 3) / 2, 32 + randint1(6), (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET))))
2429 msg_print("¡Ô·î¡Õ¤À¡£");
2431 msg_print("It's the Moon.");
2439 msg_print("¡Ô±¿Ì¿¤ÎÎØ¡Õ¤À¡£");
2441 msg_print("It's the Wheel of Fortune.");
2444 wild_magic(randint0(32));
2449 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2451 msg_print("It's a teleport trump card.");
2454 teleport_player(10);
2459 msg_print("¡ÔÀµµÁ¡Õ¤À¡£");
2461 msg_print("It's Justice.");
2464 set_blessed(p_ptr->lev, FALSE);
2469 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2471 msg_print("It's a teleport trump card.");
2474 teleport_player(100);
2479 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2481 msg_print("It's a teleport trump card.");
2484 teleport_player(200);
2489 msg_print("¡ÔÅã¡Õ¤À¡£");
2491 msg_print("It's the Tower.");
2499 msg_print("¡ÔÀáÀ©¡Õ¤À¡£");
2501 msg_print("It's Temperance.");
2504 sleep_monsters_touch();
2509 msg_print("¡ÔÅã¡Õ¤À¡£");
2511 msg_print("It's the Tower.");
2514 earthquake(py, px, 5);
2519 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2521 msg_print("It's the picture of a friendly monster.");
2524 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE1, PM_FORCE_PET)))
2530 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2532 msg_print("It's the picture of a friendly monster.");
2535 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE2, PM_FORCE_PET)))
2541 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2543 msg_print("It's the picture of a friendly monster.");
2546 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE4, PM_FORCE_PET)))
2552 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2554 msg_print("It's the picture of a friendly monster.");
2557 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE5, PM_FORCE_PET)))
2563 msg_print("¡ÔÎø¿Í¡Õ¤À¡£");
2565 msg_print("It's the Lovers.");
2568 if (get_aim_dir(&dir))
2569 (void)charm_monster(dir, MIN(p_ptr->lev, 20));
2574 msg_print("¡Ô±£¼Ô¡Õ¤À¡£");
2576 msg_print("It's the Hermit.");
2584 msg_print("¡Ô¿³È½¡Õ¤À¡£");
2586 msg_print("It's the Judgement.");
2589 do_cmd_rerate(FALSE);
2590 if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3)
2593 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
2595 msg_print("You are cured of all mutations.");
2598 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
2599 p_ptr->update |= PU_BONUS;
2606 msg_print("¡ÔÂÀÍÛ¡Õ¤À¡£");
2608 msg_print("It's the Sun.");
2611 chg_virtue(V_KNOWLEDGE, 1);
2612 chg_virtue(V_ENLIGHTEN, 1);
2618 msg_print("¡ÔÀ¤³¦¡Õ¤À¡£");
2620 msg_print("It's the World.");
2623 if (p_ptr->exp < PY_MAX_EXP)
2625 s32b ee = (p_ptr->exp / 25) + 1;
2626 if (ee > 5000) ee = 5000;
2628 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
2630 msg_print("You feel more experienced.");
2638 case 3: /* Reset Recall */
2641 if (!reset_recall()) return FALSE;
2644 case 4: /* Teleport Self */
2647 teleport_player(plev * 4);
2650 case 5: /* Trump Spying */
2653 (void)set_tim_esp(randint1(30) + 25, FALSE);
2656 case 6: /* Teleport Away */
2659 if (!get_aim_dir(&dir)) return FALSE;
2660 (void)fire_beam(GF_AWAY_ALL, dir, plev);
2663 case 7: /* Trump Animals */
2665 bool pet = success; /* was (randint1(5) > 2) */
2666 int type = (pet ? SUMMON_ANIMAL_RANGER : SUMMON_ANIMAL);
2669 if (pet) mode |= PM_FORCE_PET;
2670 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2673 msg_print("¤¢¤Ê¤¿¤Ïưʪ¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2675 msg_print("You concentrate on the trump of an animal...");
2679 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
2683 msg_print("¾¤´¤µ¤ì¤¿Æ°Êª¤ÏÅܤäƤ¤¤ë¡ª");
2685 msg_print("The summoned animal gets angry!");
2696 case 8: /* Trump Reach */
2699 if (!get_aim_dir(&dir)) return FALSE;
2700 fetch(dir, plev * 15, TRUE);
2703 case 9: /* Trump Kamikaze */
2708 if (!target_set(TARGET_KILL)) return FALSE;
2715 msg_print("¤¢¤Ê¤¿¤Ï¥«¥ß¥«¥¼¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2717 msg_print("You concentrate on several trumps at once...");
2721 for (dummy = 2 + randint0(plev / 7); dummy > 0; dummy--)
2723 bool pet = success; /* was (randint1(10) > 3) */
2727 if (pet) mode |= PM_FORCE_PET;
2728 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2730 if (p_ptr->pclass == CLASS_BEASTMASTER)
2732 type = SUMMON_KAMIKAZE_LIVING;
2736 type = SUMMON_KAMIKAZE;
2739 if (summon_specific((pet ? -1 : 0), y, x, summon_lev, type, mode))
2743 msg_print("¾¤´¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
2745 msg_print("The summoned creatures get angry!");
2753 case 10: /* Phantasmal Servant */
2756 if (summon_specific(-1, py, px, (summon_lev * 3) / 2, SUMMON_PHANTOM, PM_FORCE_PET))
2759 msg_print("¸æÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¸æ¼ç¿ÍÍÍ¡©");
2761 msg_print("'Your wish, master?'");
2771 case 11: /* Speed Monster */
2774 bool old_target_pet = target_pet;
2776 if (!get_aim_dir(&dir))
2778 target_pet = old_target_pet;
2781 target_pet = old_target_pet;
2782 (void)speed_monster(dir);
2785 case 12: /* Teleport Level */
2789 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
2791 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
2793 (void)teleport_level(0);
2796 case 13: /* Dimension Door */
2800 msg_print("¼¡¸µ¤ÎÈ⤬³«¤¤¤¿¡£ÌÜŪÃϤòÁª¤ó¤Ç²¼¤µ¤¤¡£");
2802 msg_print("You open a dimensional gate. Choose a destination.");
2805 return dimension_door();
2808 case 14: /* Word of Recall */
2811 return word_of_recall();
2814 case 15: /* Banish */
2817 banish_monsters(plev * 4);
2820 case 16: /* Swap Position */
2824 project_length = -1;
2825 if (!get_aim_dir(&dir))
2832 (void)teleport_swap(dir);
2836 case 17: /* Trump Undead */
2838 bool pet = success; /* (randint1(10) > 3) */
2841 if (pet) mode |= PM_FORCE_PET;
2842 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2845 msg_print("¤¢¤Ê¤¿¤Ï¥¢¥ó¥Ç¥Ã¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2847 msg_print("You concentrate on the trump of an undead creature...");
2851 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_UNDEAD, mode))
2855 msg_print("¾¤´¤µ¤ì¤¿¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
2857 msg_print("The summoned undead creature gets angry!");
2868 case 18: /* Trump Reptiles */
2870 bool pet = success; /* was (randint1(5) > 2) */
2873 if (pet) mode |= PM_FORCE_PET;
2874 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2877 msg_print("¤¢¤Ê¤¿¤Ïà¨ÃîÎà¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2879 msg_print("You concentrate on the trump of a reptile...");
2883 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HYDRA, mode))
2887 msg_print("¾¤´¤µ¤ì¤¿à¨ÃîÎà¤ÏÅܤäƤ¤¤ë¡ª");
2889 msg_print("The summoned reptile gets angry!");
2900 case 19: /* Trump Monsters */
2905 msg_print("¤¢¤Ê¤¿¤Ï¥â¥ó¥¹¥¿¡¼¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2907 msg_print("You concentrate on several trumps at once...");
2911 for (dummy = 0; dummy < 1 + ((plev - 15)/ 10); dummy++)
2913 bool pet = success; /* was (randint1(10) > 3) */
2917 if (pet) mode |= PM_FORCE_PET;
2918 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2920 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
2922 if (p_ptr->pclass == CLASS_BEASTMASTER)
2924 type = SUMMON_LIVING;
2931 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
2935 msg_print("¾¤´¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
2937 msg_print("The summoned creatures get angry!");
2945 case 20: /* Trump Hounds */
2947 bool pet = success; /* was (randint1(5) > 2) */
2948 u32b mode = PM_ALLOW_GROUP;
2950 if (pet) mode |= PM_FORCE_PET;
2951 else mode |= PM_NO_PET;
2954 msg_print("¤¢¤Ê¤¿¤Ï¥Ï¥¦¥ó¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2956 msg_print("You concentrate on the trump of a hound...");
2960 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HOUND, mode))
2964 msg_print("¾¤´¤µ¤ì¤¿¥Ï¥¦¥ó¥É¤ÏÅܤäƤ¤¤ë¡ª");
2966 msg_print("The summoned hounds get angry!");
2977 case 21: /* Trump Branding */
2983 case 22: /* Living Trump */
2987 /* Teleport control */
2990 /* Random teleportation (uncontrolled) */
2992 /* Gain the mutation */
2993 if (gain_random_mutation(dummy))
2995 msg_print("¤¢¤Ê¤¿¤ÏÀ¸¤¤Æ¤¤¤ë¥«¡¼¥É¤ËÊѤï¤Ã¤¿¡£");
2997 msg_print("You have turned into a Living Trump.");
3002 case 23: /* Trump Cyberdemon */
3004 bool pet = success; /* was (randint1(10) > 3) */
3007 if (pet) mode |= PM_FORCE_PET;
3008 else mode |= PM_NO_PET;
3011 msg_print("¤¢¤Ê¤¿¤Ï¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3013 msg_print("You concentrate on the trump of a Cyberdemon...");
3017 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_CYBER, mode))
3021 msg_print("¾¤´¤µ¤ì¤¿¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3023 msg_print("The summoned Cyberdemon gets angry!");
3034 case 24: /* Trump Divination */
3037 (void)detect_all(DETECT_RAD_DEFAULT);
3040 case 25: /* Trump Lore */
3043 return identify_fully(FALSE);
3046 case 26: /* Heal Monster */
3049 bool old_target_pet = target_pet;
3051 if (!get_aim_dir(&dir))
3053 target_pet = old_target_pet;
3056 target_pet = old_target_pet;
3058 (void)heal_monster(dir, p_ptr->lev * 10 + 200);
3061 case 27: /* Trump Dragon */
3063 bool pet = success; /* was (randint1(10) > 3) */
3066 if (pet) mode |= PM_FORCE_PET;
3067 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3070 msg_print("¤¢¤Ê¤¿¤Ï¥É¥é¥´¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3072 msg_print("You concentrate on the trump of a dragon...");
3076 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DRAGON, mode))
3080 msg_print("¾¤´¤µ¤ì¤¿¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3082 msg_print("The summoned dragon gets angry!");
3093 case 28: /* Trump Meteor */
3096 int x, y, dx, dy, i;
3097 int b = 10 + randint1(10);
3098 for (i = 0; i < b; i++)
3100 int count = 0, d = 0;
3105 if (count > 20) break;
3106 x = px - 8 + randint0(17);
3107 y = py - 8 + randint0(17);
3109 if (!in_bounds(y, x) || !have_flag(f_flags_bold(y, x), FF_MOVE) || !player_has_los_bold(y, x)) continue;
3111 dx = (px > x) ? (px - x) : (x - px);
3112 dy = (py > y) ? (py - y) : (y - py);
3114 /* Approximate distance */
3115 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
3119 if (count > 20) continue;
3121 project(0, 2, y, x, plev * 2, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
3125 case 29: /* Trump Demon */
3127 bool pet = success; /* was (randint1(10) > 3) */
3130 if (pet) mode |= PM_FORCE_PET;
3131 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3134 msg_print("¤¢¤Ê¤¿¤Ï¥Ç¡¼¥â¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3136 msg_print("You concentrate on the trump of a demon...");
3140 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DEMON, mode))
3144 msg_print("¾¤´¤µ¤ì¤¿¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3146 msg_print("The summoned demon gets angry!");
3157 case 30: /* Trump Greater Undead */
3159 bool pet = success; /* was (randint1(10) > 3) */
3162 if (pet) mode |= PM_FORCE_PET;
3163 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3165 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
3168 msg_print("¤¢¤Ê¤¿¤Ï¶¯ÎϤʥ¢¥ó¥Ç¥Ã¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3170 msg_print("You concentrate on the trump of a greater undead being...");
3174 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HI_UNDEAD, mode))
3178 msg_print("¾¤´¤µ¤ì¤¿¾åµé¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
3180 msg_print("The summoned greater undead creature gets angry!");
3191 case 31: /* Trump Ancient Dragon */
3193 bool pet = success; /* was (randint1(10) > 3) */
3197 if (pet) mode |= PM_FORCE_PET;
3198 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3200 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
3202 if (p_ptr->pclass == CLASS_BEASTMASTER)
3204 type = SUMMON_HI_DRAGON_LIVING;
3208 type = SUMMON_HI_DRAGON;
3212 msg_print("¤¢¤Ê¤¿¤Ï¸ÅÂå¥É¥é¥´¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3214 msg_print("You concentrate on the trump of an ancient dragon...");
3218 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
3222 msg_print("¾¤´¤µ¤ì¤¿¸ÅÂå¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3224 msg_print("The summoned ancient dragon gets angry!");
3237 msg_format("̤ÃΤΥ«¡¼¥É¤Î¼öʸ¤Ç¤¹: %d", spell);
3239 msg_format("You cast an unknown Trump spell: %d.", spell);
3248 msg_print("ï¤â¤¢¤Ê¤¿¤Î¥«¡¼¥É¤Î¸Æ¤ÓÀ¼¤ËÅú¤¨¤Ê¤¤¡£");
3250 msg_print("Nobody answers to your Trump call.");
3259 static bool cast_arcane_spell(int spell)
3263 int plev = p_ptr->lev;
3266 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3267 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3268 else beam = plev / 2;
3273 if (!get_aim_dir(&dir)) return FALSE;
3275 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
3276 damroll(3 + ((plev - 1) / 5), 3));
3278 case 1: /* Wizard Lock */
3279 if (!get_aim_dir(&dir)) return FALSE;
3281 (void)wizard_lock(dir);
3283 case 2: /* Detect Invisibility */
3284 (void)detect_monsters_invis(DETECT_RAD_DEFAULT);
3286 case 3: /* Detect Monsters */
3287 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
3290 teleport_player(10);
3292 case 5: /* Light Area */
3293 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
3295 case 6: /* Trap & Door Destruction */
3296 if (!get_aim_dir(&dir)) return FALSE;
3298 (void)destroy_door(dir);
3300 case 7: /* Cure Light Wounds */
3301 (void)hp_player(damroll(2, 8));
3302 (void)set_cut(p_ptr->cut - 10);
3304 case 8: /* Detect Doors & Traps */
3305 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
3306 (void)detect_doors(DETECT_RAD_DEFAULT);
3307 (void)detect_stairs(DETECT_RAD_DEFAULT);
3309 case 9: /* Phlogiston */
3312 case 10: /* Detect Treasure */
3313 (void)detect_treasure(DETECT_RAD_DEFAULT);
3314 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
3316 case 11: /* Detect Enchantment */
3317 (void)detect_objects_magic(DETECT_RAD_DEFAULT);
3319 case 12: /* Detect Objects */
3320 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
3322 case 13: /* Cure Poison */
3323 (void)set_poisoned(0);
3325 case 14: /* Resist Cold */
3326 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3328 case 15: /* Resist Fire */
3329 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3331 case 16: /* Resist Lightning */
3332 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3334 case 17: /* Resist Acid */
3335 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3337 case 18: /* Cure Medium Wounds */
3338 (void)hp_player(damroll(4, 8));
3339 (void)set_cut((p_ptr->cut / 2) - 50);
3341 case 19: /* Teleport */
3342 teleport_player(plev * 5);
3344 case 20: /* Identify */
3345 return ident_spell(FALSE);
3346 case 21: /* Stone to Mud */
3347 if (!get_aim_dir(&dir)) return FALSE;
3349 (void)wall_to_mud(dir);
3351 case 22: /* Ray of Light */
3352 if (!get_aim_dir(&dir)) return FALSE;
3355 msg_print("¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
3357 msg_print("A line of light appears.");
3360 (void)lite_line(dir);
3362 case 23: /* Satisfy Hunger */
3363 (void)set_food(PY_FOOD_MAX - 1);
3365 case 24: /* See Invisible */
3366 (void)set_tim_invis(randint1(24) + 24, FALSE);
3368 case 25: /* Conjure Elemental */
3369 if (!summon_specific(-1, py, px, plev, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3372 msg_print("¥¨¥ì¥á¥ó¥¿¥ë¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3374 msg_print("No Elementals arrive.");
3378 case 26: /* Teleport Level */
3380 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
3382 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
3384 (void)teleport_level(0);
3386 case 27: /* Teleport Away */
3387 if (!get_aim_dir(&dir)) return FALSE;
3389 (void)fire_beam(GF_AWAY_ALL, dir, plev);
3391 case 28: /* Elemental Ball */
3392 if (!get_aim_dir(&dir)) return FALSE;
3394 switch (randint1(4))
3396 case 1: dummy = GF_FIRE;break;
3397 case 2: dummy = GF_ELEC;break;
3398 case 3: dummy = GF_COLD;break;
3399 default: dummy = GF_ACID;break;
3401 fire_ball(dummy, dir, 75 + (plev), 2);
3403 case 29: /* Detection */
3404 (void)detect_all(DETECT_RAD_DEFAULT);
3406 case 30: /* Word of Recall */
3407 return word_of_recall();
3408 case 31: /* Clairvoyance */
3409 chg_virtue(V_KNOWLEDGE, 1);
3410 chg_virtue(V_ENLIGHTEN, 1);
3412 if (!p_ptr->telepathy)
3414 (void)set_tim_esp(randint1(30) + 25, FALSE);
3418 msg_format("You cast an unknown Arcane spell: %d.", spell);
3426 static bool cast_enchant_spell(int spell)
3428 int plev = p_ptr->lev;
3433 case 0: /* Infravision */
3434 set_tim_infra(100 + randint1(100), FALSE);
3436 case 1: /* Regeneration */
3437 set_tim_regen(80 + randint1(80), FALSE);
3439 case 2: /* Satisfy Hunger */
3440 (void)set_food(PY_FOOD_MAX - 1);
3442 case 3: /* Resist Cold */
3443 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3445 case 4: /* Resist Fire */
3446 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3448 case 5: /* Heroism */
3449 (void)set_hero(randint1(25) + 25, FALSE);
3450 (void)hp_player(10);
3451 (void)set_afraid(0);
3453 case 6: /* Resist Lightning */
3454 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3456 case 7: /* Resist Acid */
3457 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3459 case 8: /* See Invisibility */
3460 (void)set_tim_invis(randint1(24) + 24, FALSE);
3462 case 9: /* Remove Curse */
3466 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
3468 msg_print("You feel as if someone is watching over you.");
3472 case 10: /* Resist Poison */
3473 (void)set_oppose_pois(randint1(20) + 20, FALSE);
3475 case 11: /* Berserk */
3476 (void)set_shero(randint1(25) + 25, FALSE);
3477 (void)hp_player(30);
3478 (void)set_afraid(0);
3480 case 12: /* Self Knowledge */
3481 (void)self_knowledge();
3483 case 13: /* Protection from Evil */
3484 (void)set_protevil(randint1(25) + 3 * p_ptr->lev, FALSE);
3486 case 14: /* Healing */
3492 case 15: /* Mana Branding */
3493 return choose_ele_attack();
3494 case 16: /* Telepathy */
3495 (void)set_tim_esp(randint1(30) + 25, FALSE);
3497 case 17: /* Stone Skin */
3498 (void)set_shield(randint1(20) + 30, FALSE);
3500 case 18: /* Resistance */
3501 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3502 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3503 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3504 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3505 (void)set_oppose_pois(randint1(20) + 20, FALSE);
3507 case 19: /* Haste */
3508 (void)set_fast(randint1(20 + plev) + plev, FALSE);
3510 case 20: /* Walk through Wall */
3511 (void)set_kabenuke(randint1(plev/2) + plev/2, FALSE);
3513 case 21: /* Pulish Shield */
3514 (void)pulish_shield();
3516 case 22: /* Create Golem */
3517 if (summon_specific(-1, py, px, plev, SUMMON_GOLEM, PM_FORCE_PET))
3520 msg_print("¥´¡¼¥ì¥à¤òºî¤Ã¤¿¡£");
3522 msg_print("You make a golem.");
3528 msg_print("¤¦¤Þ¤¯¥´¡¼¥ì¥à¤òºî¤ì¤Ê¤«¤Ã¤¿¡£");
3530 msg_print("No Golems arrive.");
3534 case 23: /* Magic armor */
3535 (void)set_magicdef(randint1(20) + 20, FALSE);
3537 case 24: /* Remove Enchantment */
3538 if (!mundane_spell(TRUE)) return FALSE;
3540 case 25: /* Remove All Curse */
3541 if (remove_all_curse())
3544 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
3546 msg_print("You feel as if someone is watching over you.");
3550 case 26: /* Total Knowledge */
3551 return identify_fully(FALSE);
3552 case 27: /* Enchant Weapon */
3553 return enchant_spell(randint0(4) + 1, randint0(4) + 1, 0);
3554 case 28: /* Enchant Armor */
3555 return enchant_spell(0, 0, randint0(3) + 2);
3556 case 29: /* Brand Weapon */
3557 brand_weapon(randint0(18));
3559 case 30: /* Living Trump */
3561 /* Teleport control */
3564 /* Random teleportation (uncontrolled) */
3566 /* Gain the mutation */
3567 if (gain_random_mutation(dummy))
3569 msg_print("¤¢¤Ê¤¿¤ÏÀ¸¤¤Æ¤¤¤ë¥«¡¼¥É¤ËÊѤï¤Ã¤¿¡£");
3571 msg_print("You have turned into a Living Trump.");
3574 case 31: /* Immune */
3575 return choose_ele_immune(13 + randint1(13));
3577 msg_format("You cast an unknown Craft spell: %d.", spell);
3586 * An "item_tester_hook" for offer
3588 static bool item_tester_offer(object_type *o_ptr)
3590 /* Flasks of oil are okay */
3591 if (o_ptr->tval != TV_CORPSE) return (FALSE);
3593 if (o_ptr->sval != SV_CORPSE) return (FALSE);
3595 if (my_strchr("pht", r_info[o_ptr->pval].d_char)) return (TRUE);
3597 /* Assume not okay */
3602 static bool cast_daemon_spell(int spell)
3605 int plev = p_ptr->lev;
3607 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3608 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3609 else beam = plev / 2;
3613 case 0: /* Magic Missile */
3614 if (!get_aim_dir(&dir)) return FALSE;
3616 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
3617 damroll(3 + ((plev - 1) / 5), 4));
3619 case 1: /* Detect Undead & Demons -> Unlife */
3620 (void)detect_monsters_nonliving(DETECT_RAD_DEFAULT);
3623 (void)set_blessed(randint1(12) + 12, FALSE);
3625 case 3: /* Resist Fire */
3626 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3628 case 4: /* Horrify */
3629 if (!get_aim_dir(&dir)) return FALSE;
3631 (void)fear_monster(dir, plev);
3632 (void)stun_monster(dir, plev);
3634 case 5: /* Nether Bolt */
3635 if (!get_aim_dir(&dir)) return FALSE;
3637 fire_bolt_or_beam(beam, GF_NETHER, dir,
3638 damroll(6 + ((plev - 5) / 4), 8));
3640 case 6: /* Summon monster, demon */
3641 if (!summon_specific(-1, py, px, (plev * 3) / 2, SUMMON_MANES, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3644 msg_print("¸ÅÂå¤Î»àÎî¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3646 msg_print("No Manes arrive.");
3650 case 7: /* Mini Hellfire */
3651 if (!get_aim_dir(&dir)) return FALSE;
3653 fire_ball(GF_HELL_FIRE, dir,
3654 (damroll(3, 6) + plev +
3655 (plev / (((p_ptr->pclass == CLASS_MAGE) ||
3656 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
3657 (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
3658 ((plev < 30) ? 2 : 3));
3660 case 8: /* Enslave Demon */
3661 if (!get_aim_dir(&dir)) return FALSE;
3663 (void)control_one_demon(dir, plev);
3665 case 9: /* Vision */
3666 map_area(DETECT_RAD_MAP);
3668 case 10: /* Resist Nether */
3669 (void)set_tim_res_nether(randint1(20) + 20, FALSE);
3671 case 11: /* Plasma Bolt */
3672 if (!get_aim_dir(&dir)) return FALSE;
3674 fire_bolt_or_beam(beam, GF_PLASMA, dir,
3675 damroll(11 + ((plev - 5) / 4), 8));
3677 case 12: /* Fire Ball */
3678 if (!get_aim_dir(&dir)) return FALSE;
3680 fire_ball(GF_FIRE, dir, plev + 55, 2);
3682 case 13: /* Fire Branding */
3685 case 14: /* Nether Ball */
3686 if (!get_aim_dir(&dir)) return FALSE;
3688 fire_ball(GF_NETHER, dir, plev*3/2 + 100, plev / 20+2);
3690 case 15: /* Summon monster, demon */
3692 bool pet = !one_in_(3);
3695 if (pet) mode |= PM_FORCE_PET;
3696 else mode |= PM_NO_PET;
3697 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
3699 if (summon_specific((pet ? -1 : 0), py, px, plev*2/3+randint1(plev/2), SUMMON_DEMON, mode))
3702 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
3704 msg_print("The area fills with a stench of sulphur and brimstone.");
3710 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
3712 msg_print("'What is thy bidding... Master?'");
3717 msg_print("¡ÖÈܤ·¤¼Ô¤è¡¢²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª ¤ªÁ°¤Îº²¤òĺ¤¯¤¾¡ª¡×");
3719 msg_print("'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'");
3726 msg_print("°Ëâ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3728 msg_print("No demons arrive.");
3733 case 16: /* Telepathy */
3734 (void)set_tim_esp(randint1(30) + 25, FALSE);
3736 case 17: /* Demoncloak */
3738 int dur=randint1(20) + 20;
3740 set_oppose_fire(dur, FALSE);
3741 set_oppose_cold(dur, FALSE);
3742 set_tim_sh_fire(dur, FALSE);
3746 case 18: /* Rain of Lava */
3747 fire_ball(GF_FIRE, 0, (55 + plev)*2, 3);
3748 fire_ball_hide(GF_LAVA_FLOW, 0, 2+randint1(2), 3);
3750 case 19: /* Plasma ball */
3751 if (!get_aim_dir(&dir)) return FALSE;
3753 fire_ball(GF_PLASMA, dir, plev*3/2 + 80, 2 + plev/40);
3755 case 20: /* Mimic demon */
3756 (void)set_mimic(10+plev/2 + randint1(10+plev/2), MIMIC_DEMON, FALSE);
3758 case 21: /* Nether Wave == Dispel Good */
3759 (void)dispel_monsters(randint1(plev * 2));
3760 (void)dispel_good(randint1(plev * 2));
3763 if (!get_aim_dir(&dir)) return FALSE;
3764 fire_ball(GF_NEXUS, dir, 100 + plev*2, 4);
3766 case 23: /* Hand Doom */
3767 if (!get_aim_dir(&dir)) return FALSE;
3769 else msg_print("<ÇËÌǤμê>¤òÊü¤Ã¤¿¡ª");
3771 else msg_print("You invoke the Hand of Doom!");
3774 fire_ball_hide(GF_HAND_DOOM, dir, plev * 2, 0);
3776 case 24: /* Heroism */
3777 (void)set_hero(randint1(25) + 25, FALSE);
3778 (void)hp_player(10);
3779 (void)set_afraid(0);
3781 case 25: /* Tim resist time */
3782 (void)set_tim_res_time(randint1(20)+20, FALSE);
3784 case 26: /* Circle of Madness */
3785 fire_ball(GF_CHAOS, 0, 50+plev, 3+plev/20);
3786 fire_ball(GF_CONFUSION, 0, 50+plev, 3+plev/20);
3787 fire_ball(GF_CHARM, 0, 20+plev, 3+plev/20);
3789 case 27: /* True Discharge Minion */
3792 case 28: /* Summon Greater Demon */
3799 item_tester_hook = item_tester_offer;
3801 q = "¤É¤Î»àÂΤòÊû¤²¤Þ¤¹¤«? ";
3802 s = "Êû¤²¤é¤ì¤ë»àÂΤò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
3804 q = "Sacrifice which corpse? ";
3805 s = "You have nothing to scrifice.";
3807 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return FALSE;
3809 /* Get the item (in the pack) */
3812 o_ptr = &inventory[item];
3815 /* Get the item (on the floor) */
3818 o_ptr = &o_list[0 - item];
3821 summon_lev = p_ptr->lev * 2 / 3 + r_info[o_ptr->pval].level;
3822 if (summon_specific(-1, py, px, summon_lev, SUMMON_HI_DEMON, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3825 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
3827 msg_print("The area fills with a stench of sulphur and brimstone.");
3832 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
3834 msg_print("'What is thy bidding... Master?'");
3837 /* Decrease the item (from the pack) */
3840 inven_item_increase(item, -1);
3841 inven_item_describe(item);
3842 inven_item_optimize(item);
3845 /* Decrease the item (from the floor) */
3848 floor_item_increase(0 - item, -1);
3849 floor_item_describe(0 - item);
3850 floor_item_optimize(0 - item);
3856 msg_print("°Ëâ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3858 msg_print("No Greater Demon arrive.");
3863 case 29: /* Nether Storm */
3864 if (!get_aim_dir(&dir)) return FALSE;
3866 fire_ball(GF_NETHER, dir, plev*15, plev / 5);
3868 case 30: /* Blood curse */
3870 if (!get_aim_dir(&dir)) return FALSE;
3872 fire_ball_hide(GF_BLOOD_CURSE, dir, 600, 0);
3874 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "·ì¤Î¼ö¤¤", -1);
3876 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "Blood curse", -1);
3880 case 31: /* Mimic Demon lord */
3881 (void)set_mimic(15 + randint1(15), MIMIC_DEMON_LORD, FALSE);
3884 msg_format("You cast an unknown Daemon spell: %d.", spell);
3892 static bool cast_crusade_spell(int spell)
3896 int plev = p_ptr->lev;
3898 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3899 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3900 else beam = plev / 2;
3905 if (!get_aim_dir(&dir)) return FALSE;
3907 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
3908 damroll(3 + ((plev - 1) / 5), 4));
3911 (void)detect_monsters_evil(DETECT_RAD_DEFAULT);
3913 case 2: /* Remove Fear */
3914 (void)set_afraid(0);
3917 if (!get_aim_dir(&dir)) return FALSE;
3919 (void)fear_monster(dir, plev);
3922 (void)sleep_monsters_touch();
3925 teleport_player(25+plev/2);
3928 if (!get_aim_dir(&dir)) return FALSE;
3929 fire_blast(GF_LITE, dir, 3+((plev-1)/9), 2, 10, 3);
3933 (void)set_poisoned(0);
3937 if (!get_aim_dir(&dir)) return FALSE;
3938 (void)fire_ball(GF_AWAY_EVIL, dir, MAX_SIGHT*5, 0);
3940 case 9: /* Holy Orb */
3941 if (!get_aim_dir(&dir)) return FALSE;
3943 fire_ball(GF_HOLY_FIRE, dir,
3944 (damroll(3, 6) + plev +
3945 (plev / ((p_ptr->pclass == CLASS_PRIEST ||
3946 p_ptr->pclass == CLASS_HIGH_MAGE ||
3947 p_ptr->pclass == CLASS_SORCERER) ? 2 : 4))),
3948 ((plev < 30) ? 2 : 3));
3951 case 10: /* Exorcism */
3952 (void)dispel_undead(randint1(plev));
3953 (void)dispel_demons(randint1(plev));
3954 (void)turn_evil(plev);
3956 case 11: /* Remove Curse */
3960 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
3962 msg_print("You feel as if someone is watching over you.");
3966 case 12: /* Sense Unseen */
3967 (void)set_tim_invis(randint1(24) + 24, FALSE);
3969 case 13: /* Protection from Evil */
3970 (void)set_protevil(randint1(25) + 3 * p_ptr->lev, FALSE);
3973 if (!get_aim_dir(&dir)) return FALSE;
3974 (void)fire_bolt(GF_ELEC, dir, plev*5);
3976 case 15: /* Holy Word */
3977 (void)dispel_evil(randint1(plev * 6));
3978 (void)hp_player(100);
3979 (void)set_afraid(0);
3980 (void)set_poisoned(0);
3985 if (!get_aim_dir(&dir)) return FALSE;
3987 (void)destroy_door(dir);
3990 if (!get_aim_dir(&dir)) return FALSE;
3991 (void)stasis_evil(dir);
3994 set_tim_sh_holy(randint1(20)+20, FALSE);
3996 case 19: /* Dispel Undead + Demons */
3997 (void)dispel_undead(randint1(plev * 4));
3998 (void)dispel_demons(randint1(plev * 4));
4000 case 20: /* Dispel Evil */
4001 (void)dispel_evil(randint1(plev * 4));
4006 case 22: /* Star Burst */
4007 if (!get_aim_dir(&dir)) return FALSE;
4009 fire_ball(GF_LITE, dir, 100+plev*2, 4);
4011 case 23: /* Summon monster, angel */
4013 bool pet = !one_in_(3);
4016 if (pet) mode |= PM_FORCE_PET;
4017 else mode |= PM_NO_PET;
4018 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
4020 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, SUMMON_ANGEL, mode))
4024 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
4026 msg_print("'What is thy bidding... Master?'");
4031 msg_print("¡Ö²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª °¹Ô¼Ô¤è¡¢²ù¤¤²þ¤á¤è¡ª¡×");
4033 msg_print("Mortal! Repent of thy impiousness.");
4039 case 24: /* Heroism */
4040 (void)set_hero(randint1(25) + 25, FALSE);
4041 (void)hp_player(10);
4042 (void)set_afraid(0);
4044 case 25: /* Remove All Curse */
4045 if (remove_all_curse())
4048 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
4050 msg_print("You feel as if someone is watching over you.");
4054 case 26: /* Banishment */
4055 if (banish_evil(100))
4058 msg_print("¿ÀÀ»¤ÊÎϤ¬¼Ù°¤òÂǤÁʧ¤Ã¤¿¡ª");
4060 msg_print("The holy power banishes evil!");
4065 case 27: /* Word of Destruction */
4066 (void)destroy_area(py, px, 13 + randint0(5), FALSE);
4068 case 28: /* Eye for an Eye */
4069 set_tim_eyeeye(randint1(10)+10, FALSE);
4076 int b = 10 + randint1(10);
4078 if (!get_aim_dir(&dir)) return FALSE;
4080 /* Use the given direction */
4081 tx = px + 99 * ddx[dir];
4082 ty = py + 99 * ddy[dir];
4084 /* Hack -- Use an actual "target" */
4085 if ((dir == 5) && target_okay())
4096 /* Hack -- Stop at the target */
4097 if ((y == ty) && (x == tx)) break;
4101 mmove2(&ny, &nx, py, px, ty, tx);
4103 /* Stop at maximum range */
4104 if (MAX_RANGE <= distance(py, px, ny, nx)) break;
4106 /* Stopped by walls/doors */
4107 if (!have_flag(f_flags_bold(ny, nx), FF_PROJECT)) break;
4109 /* Stopped by monsters */
4110 if ((dir != 5) && cave[ny][nx].m_idx != 0) break;
4112 /* Save the new location */
4119 for (i = 0; i < b; i++)
4121 int count = 20, d = 0;
4127 x = tx - 5 + randint0(11);
4128 y = ty - 5 + randint0(11);
4130 dx = (tx > x) ? (tx - x) : (x - tx);
4131 dy = (ty > y) ? (ty - y) : (y - ty);
4133 /* Approximate distance */
4134 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
4135 /* Within the radius */
4139 if (count < 0) continue;
4141 /* Cannot penetrate perm walls */
4142 if (!in_bounds(y,x) ||
4143 cave_stop_disintegration(y,x) ||
4144 !in_disintegration_range(ty, tx, y, x))
4147 project(0, 2, y, x, plev * 3+25, GF_DISINTEGRATE, PROJECT_JUMP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1);
4151 case 30: /* Divine Intervention */
4152 project(0, 1, py, px, plev*11, GF_HOLY_FIRE, PROJECT_KILL, -1);
4153 dispel_monsters(plev * 4);
4155 stun_monsters(plev * 4);
4156 confuse_monsters(plev * 4);
4157 turn_monsters(plev * 4);
4158 stasis_monsters(plev * 4);
4159 (void)hp_player(100);
4165 for (i = 0; i < 12; i++)
4172 scatter(&my, &mx, py, px, 4, 0);
4174 /* Require empty grids */
4175 if (cave_empty_bold2(my, mx)) break;
4177 if (attempt < 0) continue;
4178 summon_specific(-1, my, mx, plev, SUMMON_KNIGHTS, (PM_ALLOW_GROUP | PM_FORCE_PET | PM_HASTE));
4180 (void)set_hero(randint1(25) + 25, FALSE);
4181 (void)set_blessed(randint1(25) + 25, FALSE);
4182 (void)set_fast(randint1(20 + plev) + plev, FALSE);
4183 (void)set_protevil(randint1(25) + 25, FALSE);
4184 (void)set_afraid(0);
4189 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤ÊÇ˼٤μöʸ %d ¤ò¾§¤¨¤¿¡£", spell);
4191 msg_format("You cast an unknown crusade spell: %d.", spell);
4202 void stop_singing(void)
4204 if (p_ptr->pclass != CLASS_BARD) return;
4206 if (p_ptr->magic_num1[1])
4208 p_ptr->magic_num1[1] = 0;
4211 if (!p_ptr->magic_num1[0]) return;
4213 /* Hack -- if called from set_action(), avoid recursive loop */
4214 if (p_ptr->action == ACTION_SING) set_action(ACTION_NONE);
4216 switch(p_ptr->magic_num1[0])
4219 if (!p_ptr->blessed)
4221 msg_print("¹â·é¤Êµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4223 msg_print("The prayer has expired.");
4230 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4232 msg_print("The heroism wears off.");
4234 /* Recalculate hitpoints */
4235 p_ptr->update |= (PU_HP);
4239 if (!p_ptr->tim_esp)
4242 msg_print("°Õ¼±¤Ï¸µ¤ËÌá¤Ã¤¿¡£");
4244 msg_print("Your consciousness contracts again.");
4246 /* Update the monsters */
4247 p_ptr->update |= (PU_MONSTERS);
4251 if (!p_ptr->tim_stealth)
4253 msg_print("»Ñ¤¬¤Ï¤Ã¤¤ê¤È¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
4255 msg_print("You are no longer hided.");
4259 if (!p_ptr->oppose_acid)
4261 msg_print("»À¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4263 msg_print("You feel less resistant to acid.");
4265 if (!p_ptr->oppose_elec)
4267 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4269 msg_print("You feel less resistant to elec.");
4271 if (!p_ptr->oppose_fire)
4273 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4275 msg_print("You feel less resistant to fire.");
4277 if (!p_ptr->oppose_cold)
4279 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4281 msg_print("You feel less resistant to cold.");
4283 if (!p_ptr->oppose_pois)
4285 msg_print("ÆǤؤÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4287 msg_print("You feel less resistant to pois.");
4293 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
4295 msg_print("You feel yourself slow down.");
4302 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4304 msg_print("The heroism wears off.");
4306 /* Recalculate hitpoints */
4307 p_ptr->update |= (PU_HP);
4312 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
4314 msg_print("You feel yourself slow down.");
4321 msg_print("̵Ũ¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£");
4323 msg_print("The invulnerability wears off.");
4326 p_ptr->redraw |= (PR_MAP);
4328 /* Update monsters */
4329 p_ptr->update |= (PU_MONSTERS);
4332 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4336 p_ptr->magic_num1[0] = MUSIC_NONE;
4337 p_ptr->magic_num2[0] = 0;
4339 /* Recalculate bonuses */
4340 p_ptr->update |= (PU_BONUS | PU_HP);
4342 /* Redraw status bar */
4343 p_ptr->redraw |= (PR_STATUS);
4347 static bool cast_music_spell(int spell)
4349 int plev = p_ptr->lev;
4352 if(p_ptr->magic_num1[0])
4357 p_ptr->magic_num2[0] = spell;
4361 case 0: /* Song of Holding ÃÙÆߤβΠ*/
4363 msg_print("¤æ¤Ã¤¯¤ê¤È¤·¤¿¥á¥í¥Ç¥£¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4365 msg_print("You start humming a slow, steady melody...");
4367 p_ptr->magic_num1[0] = MUSIC_SLOW;
4369 case 1: /* Song of Blessing ½ËÊ¡¤Î²Î */
4371 msg_print("¸·¤«¤Ê¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4373 msg_print("The holy power of the Music of the Ainur enters you...");
4375 p_ptr->magic_num1[0] = MUSIC_BLESS;
4378 case 2: /* Wrecking Note Êø²õ¤Î²»¿§ */
4379 if (!get_aim_dir(&dir)) return FALSE;
4380 fire_bolt(GF_SOUND, dir,
4381 damroll(4 + ((plev - 1) / 5), 4));
4383 case 3: /* Stun Pattern Û¯Û°¤ÎÀûΧ */
4385 msg_print("âÁÏǤµ¤»¤ë¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4387 msg_print("You weave a pattern of sounds to bewilder and daze...");
4389 p_ptr->magic_num1[0] = MUSIC_STUN;
4391 case 4: /* Flow of life À¸Ì¿¤Îή¤ì */
4393 msg_print("²Î¤òÄ̤·¤ÆÂΤ˳赤¤¬Ìá¤Ã¤Æ¤¤¿¡¥¡¥¡¥");
4395 msg_print("Life flows through you as you sing a song of healing...");
4397 p_ptr->magic_num1[0] = MUSIC_L_LIFE;
4399 case 5: /* Song of the Sun ÂÀÍۤβΠ*/
4401 msg_print("¸÷¤êµ±¤¯²Î¤¬ÊÕ¤ê¤ò¾È¤é¤·¤¿¡£");
4403 msg_print("Your uplifting song brings brightness to dark places...");
4405 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
4407 case 6: /* Song of fear ¶²ÉݤβΠ*/
4409 msg_print("¤ª¤É¤í¤ª¤É¤í¤·¤¤¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4411 msg_print("You start weaving a fearful pattern...");
4413 p_ptr->magic_num1[0] = MUSIC_FEAR;
4415 case 7: /* Heroic Ballad À襤¤Î²Î */
4417 msg_print("·ã¤·¤¤À襤¤Î²Î¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4419 msg_print("You start singing a song of intense fighting...");
4421 p_ptr->magic_num1[0] = MUSIC_HERO;
4423 case 8: /* Clairaudience ÎîŪÃγР*/
4425 msg_print("ÀŤ«¤Ê²»³Ú¤¬´¶³Ð¤ò¸¦¤®À¡¤Þ¤µ¤»¤¿¡¥¡¥¡¥");
4427 msg_print("Your quiet music sharpens your sense of hearing...");
4429 p_ptr->magic_num1[0] = MUSIC_DETECT;
4431 case 9: /* º²¤Î²Î */
4433 msg_print("Àº¿À¤òDZ¤¸¶Ê¤²¤ë²Î¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4435 msg_print("You start singing a song of soul in pain...");
4437 p_ptr->magic_num1[0] = MUSIC_PSI;
4439 case 10: /* Song of Lore Ãμ±¤Î²Î */
4441 msg_print("¤³¤ÎÀ¤³¦¤ÎÃ챤¬Î®¤ì¹þ¤ó¤Ç¤¤¿¡¥¡¥¡¥");
4443 msg_print("You recall the rich lore of the world...");
4445 p_ptr->magic_num1[0] = MUSIC_ID;
4447 case 11: /* hidding song ±£ÆۤβΠ*/
4449 msg_print("¤¢¤Ê¤¿¤Î»Ñ¤¬·Ê¿§¤Ë¤È¤±¤³¤ó¤Ç¤¤¤Ã¤¿¡¥¡¥¡¥");
4451 msg_print("Your song carries you beyond the sight of mortal eyes...");
4453 p_ptr->magic_num1[0] = MUSIC_STEALTH;
4455 case 12: /* Illusion Pattern ¸¸±Æ¤ÎÀûΧ */
4457 msg_print("ÊÕ¤ê°ìÌ̤˸¸±Æ¤¬¸½¤ì¤¿¡¥¡¥¡¥");
4459 msg_print("You weave a pattern of sounds to beguile and confuse...");
4461 p_ptr->magic_num1[0] = MUSIC_CONF;
4463 case 13: /* Doomcall (vibration song) ÇËÌǤζ«¤Ó */
4465 msg_print("¹ì²»¤¬¶Á¤¤¤¿¡¥¡¥¡¥");
4467 msg_print("The fury of the Downfall of Numenor lashes out...");
4469 p_ptr->magic_num1[0] = MUSIC_SOUND;
4471 case 14: /* Firiel's Song (song of the Undeads) ¥Õ¥£¥ê¥¨¥ë¤Î²Î */
4473 msg_print("À¸Ì¿¤ÈÉü³è¤Î¥Æ¡¼¥Þ¤òÁդǻϤ᤿¡¥¡¥¡¥");
4475 msg_print("The themes of life and revival are woven into your song...");
4477 animate_dead(0, py, px);
4479 case 15: /* Fellowship Chant (charming song) ι¤ÎÃç´Ö */
4481 msg_print("°Â¤é¤«¤Ê¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4483 msg_print("You weave a slow, soothing melody of imploration...");
4485 p_ptr->magic_num1[0] = MUSIC_CHARM;
4487 case 16: /* (wall breaking song) ʬ²ò²»ÇÈ */
4489 msg_print("Ê´ºÕ¤¹¤ë¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4491 msg_print("You weave a violent pattern of sounds to break wall.");
4493 p_ptr->magic_num1[0] = MUSIC_WALL;
4494 project(0, 0, py, px,
4495 0, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM | PROJECT_HIDE, -1);
4497 case 17: /* Finrod's Resistance (song of resistance) ¸µÁÇÂÑÀ */
4499 msg_print("¸µÁǤÎÎϤËÂФ¹¤ëǦÂѤβΤò²Î¤Ã¤¿¡£");
4501 msg_print("You sing a song of perseverance against powers...");
4503 p_ptr->magic_num1[0] = MUSIC_RESIST;
4505 case 18: /* Hobbit Melodies (song of time) ¥Û¥Ó¥Ã¥È¤Î¥á¥í¥Ç¥£ */
4507 msg_print("·Ú²÷¤Ê²Î¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4509 msg_print("You start singing joyful pop song...");
4511 p_ptr->magic_num1[0] = MUSIC_SPEED;
4513 case 19: /* World Contortion ÏĤó¤ÀÀ¤³¦ */
4515 msg_print("²Î¤¬¶õ´Ö¤òÏĤ᤿¡¥¡¥¡¥");
4517 msg_print("Reality whirls wildly as you sing a dizzying melody...");
4519 project(0, plev/15 + 1, py, px, plev * 3 + 1, GF_AWAY_ALL , PROJECT_KILL, -1);
4521 case 20: /* Â໶¤Î²Î */
4523 msg_print("ÂѤ¨¤é¤ì¤Ê¤¤ÉÔ¶¨Ï²»¤¬Å¨¤òÀÕ¤áΩ¤Æ¤¿¡¥¡¥¡¥");
4525 msg_print("You cry out in an ear-wracking voice...");
4527 p_ptr->magic_num1[0] = MUSIC_DISPEL;
4529 case 21: /* The Voice of Saruman ¥µ¥ë¥Þ¥ó¤Î´Å¸À */
4531 msg_print("Í¥¤·¤¯¡¢Ì¥ÎÏŪ¤Ê²Î¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4533 msg_print("You start humming a gentle and attractive song...");
4535 p_ptr->magic_num1[0] = MUSIC_SARUMAN;
4537 case 22: /* Song of Tempest (song of death) Íò¤Î²»¿§ */
4538 if (!get_aim_dir(&dir)) return FALSE;
4539 fire_beam(GF_SOUND, dir,
4540 damroll(15 + ((plev - 1) / 2), 10));
4542 case 23: /* (song of disruption) ¤â¤¦°ì¤Ä¤ÎÀ¤³¦ */
4544 msg_print("¼þ°Ï¤¬ÊѲ½¤·»Ï¤á¤¿¡¥¡¥¡¥");
4546 msg_print("You sing of the primeval shaping of Middle-earth...");
4550 case 24: /* Wrecking Pattern (destruction shriek) Ç˲õ¤ÎÀûΧ */
4552 msg_print("Ç˲õŪ¤Ê²Î¤¬¶Á¤¤ï¤¿¤Ã¤¿¡¥¡¥¡¥");
4554 msg_print("You weave a pattern of sounds to contort and shatter...");
4556 p_ptr->magic_num1[0] = MUSIC_QUAKE;
4558 case 25: /* ÄäÂڤβΠ*/
4560 msg_print("¤æ¤Ã¤¯¤ê¤È¤·¤¿¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4562 msg_print("You weave a very slow pattern which is almost likely to stop...");
4564 p_ptr->magic_num1[0] = MUSIC_STASIS;
4566 case 26: /* ¼é¤ê¤Î²Î */
4568 msg_print("²Î¤¬¿ÀÀ»¤Ê¾ì¤òºî¤ê½Ð¤·¤¿¡¥¡¥¡¥");
4570 msg_print("The holy power of the Music is creating sacred field...");
4574 case 27: /* ±Ñͺ¤Î»í */
4576 msg_print("±Ñͺ¤Î²Î¤ò¸ý¤º¤µ¤ó¤À¡¥¡¥¡¥");
4578 msg_print("You chant a powerful, heroic call to arms...");
4580 p_ptr->magic_num1[0] = MUSIC_SHERO;
4581 (void)hp_player(10);
4582 (void)set_afraid(0);
4584 case 28: /* ¥ä¥ô¥¡¥ó¥Ê¤Î½õ¤± */
4586 msg_print("²Î¤òÄ̤·¤ÆÂΤ˳赤¤¬Ìá¤Ã¤Æ¤¤¿¡¥¡¥¡¥");
4588 msg_print("Life flows through you as you sing the song...");
4590 p_ptr->magic_num1[0] = MUSIC_H_LIFE;
4592 case 29: /* ºÆÀ¸¤Î²Î */
4594 msg_print("°Å¹õ¤ÎÃæ¤Ë¸÷¤ÈÈþ¤ò¤Õ¤ê¤Þ¤¤¤¿¡£ÂΤ¬¸µ¤Î³èÎϤò¼è¤êÌᤷ¤¿¡£");
4596 msg_print("You strewed light and beauty in the dark as you sing. You feel refreshed.");
4598 (void)do_res_stat(A_STR);
4599 (void)do_res_stat(A_INT);
4600 (void)do_res_stat(A_WIS);
4601 (void)do_res_stat(A_DEX);
4602 (void)do_res_stat(A_CON);
4603 (void)do_res_stat(A_CHR);
4604 (void)restore_level();
4606 case 30: /* shriek of death ¥µ¥¦¥í¥ó¤ÎËâ½Ñ */
4607 if (!get_aim_dir(&dir)) return FALSE;
4608 fire_ball(GF_SOUND, dir, damroll(50 + plev, 10), 0);
4610 case 31: /* song of liberty ¥Õ¥£¥ó¥´¥ë¥Õ¥£¥ó¤ÎÄ©Àï */
4612 msg_print("¥Õ¥£¥ó¥´¥ë¥Õ¥£¥ó¤Î̽²¦¤Ø¤ÎÄ©Àï¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4614 msg_print("You recall the valor of Fingolfin's challenge to the Dark Lord...");
4616 p_ptr->magic_num1[0] = MUSIC_INVULN;
4619 p_ptr->redraw |= (PR_MAP);
4621 /* Update monsters */
4622 p_ptr->update |= (PU_MONSTERS);
4625 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4629 msg_format("̤ÃΤβÎ(%d)¤ò²Î¤Ã¤¿¡£", spell);
4631 msg_format("You sing an unknown song: %d.", spell);
4636 if (p_ptr->magic_num1[0]) set_action(ACTION_SING);
4638 /* Recalculate bonuses */
4639 p_ptr->update |= (PU_BONUS | PU_HP);
4641 /* Redraw status bar */
4642 p_ptr->redraw |= (PR_STATUS);
4650 void do_cmd_cast(void)
4652 int item, sval, spell, realm;
4667 /* Require spell ability */
4668 if (!p_ptr->realm1 && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE))
4671 msg_print("¼öʸ¤ò¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4673 msg_print("You cannot cast spells!");
4680 if (p_ptr->blind || no_lite())
4683 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡ª");
4685 msg_print("You cannot see!");
4687 if (p_ptr->pclass == CLASS_FORCETRAINER)
4694 /* Not when confused */
4695 if (p_ptr->confused)
4698 msg_print("º®Í𤷤Ƥ¤¤Æ¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4700 msg_print("You are too confused!");
4706 prayer = spell_category_name(mp_ptr->spell_book);
4708 /* Restrict choices to spell books */
4709 item_tester_tval = mp_ptr->spell_book;
4713 q = "¤É¤Î¼öʸ½ñ¤ò»È¤¤¤Þ¤¹¤«? ";
4715 q = "Use which book? ";
4719 s = "¼öʸ½ñ¤¬¤Ê¤¤¡ª";
4721 s = "You have no spell books!";
4724 if (p_ptr->pclass == CLASS_FORCETRAINER)
4725 select_the_force = TRUE;
4726 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))){
4727 select_the_force = FALSE;
4730 select_the_force = FALSE;
4732 if (item == INVEN_FORCE) { /* the_force */
4736 /* Get the item (in the pack) */
4739 o_ptr = &inventory[item];
4742 /* Get the item (on the floor) */
4745 o_ptr = &o_list[0 - item];
4748 /* Access the item's sval */
4751 if ((p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE) && (o_ptr->tval == REALM2_BOOK)) increment = 32;
4754 /* Track the object kind */
4755 object_kind_track(o_ptr->k_idx);
4757 /* Hack -- Handle stuff */
4760 if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
4761 realm = o_ptr->tval - TV_LIFE_BOOK + 1;
4762 else if (increment) realm = p_ptr->realm2;
4763 else realm = p_ptr->realm1;
4765 /* Ask for a spell */
4767 if (!get_spell(&spell,
4768 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "±Ó¾§¤¹¤ë" : (mp_ptr->spell_book == TV_MUSIC_BOOK) ? "²Î¤¦" : "¾§¤¨¤ë"),
4771 if (spell == -2) msg_format("¤½¤ÎËܤˤÏÃΤäƤ¤¤ë%s¤¬¤Ê¤¤¡£", prayer);
4775 if (!get_spell(&spell, ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "recite" : "cast"),
4779 msg_format("You don't know any %ss in that book.", prayer);
4785 use_realm = tval2realm(o_ptr->tval);
4787 if (!is_magic(use_realm))
4789 s_ptr = &technic_info[use_realm - MIN_TECHNIC][spell];
4793 s_ptr = &mp_ptr->info[realm - 1][spell];
4796 /* Extract mana consumption rate */
4797 need_mana = mod_need_mana(s_ptr->smana, spell, realm);
4799 /* Verify "dangerous" spells */
4800 if (need_mana > p_ptr->csp)
4802 if (flush_failure) flush();
4806 msg_format("¤½¤Î%s¤ò%s¤Î¤Ë½½Ê¬¤Ê¥Þ¥¸¥Ã¥¯¥Ý¥¤¥ó¥È¤¬¤Ê¤¤¡£",prayer,
4807 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "±Ó¾§¤¹¤ë" : (mp_ptr->spell_book == TV_LIFE_BOOK) ? "²Î¤¦" : "¾§¤¨¤ë"));
4809 msg_format("You do not have enough mana to %s this %s.",
4810 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "recite" : "cast"),
4815 if (!over_exert) return;
4819 if (!get_check_strict("¤½¤ì¤Ç¤âÄ©À路¤Þ¤¹¤«? ", CHECK_OKAY_CANCEL)) return;
4821 if (!get_check_strict("Attempt it anyway? ", CHECK_OKAY_CANCEL)) return;
4827 /* Spell failure chance */
4828 chance = spell_chance(spell, use_realm);
4831 if (randint0(100) < chance)
4833 if (flush_failure) flush();
4836 msg_format("%s¤ò¤¦¤Þ¤¯¾§¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡ª", prayer);
4838 msg_format("You failed to get the %s off!", prayer);
4846 if (randint1(100) < chance) chg_virtue(V_VITALITY, -1);
4849 if (randint1(100) < chance) chg_virtue(V_UNLIFE, -1);
4852 if (randint1(100) < chance) chg_virtue(V_NATURE, -1);
4855 if (randint1(100) < chance) chg_virtue(V_JUSTICE, 1);
4858 if (randint1(100) < chance) chg_virtue(V_JUSTICE, -1);
4861 if (randint1(100) < chance) chg_virtue(V_KNOWLEDGE, -1);
4865 if (realm == REALM_TRUMP)
4867 cast_trump_spell(spell, FALSE);
4869 else if ((o_ptr->tval == TV_CHAOS_BOOK) && (randint1(100) < spell))
4872 msg_print("¥«¥ª¥¹Åª¤Ê¸ú²Ì¤òȯÀ¸¤·¤¿¡ª");
4874 msg_print("You produce a chaotic effect!");
4879 else if ((o_ptr->tval == TV_DEATH_BOOK) && (randint1(100) < spell))
4881 if ((sval == 3) && one_in_(2))
4883 sanity_blast(0, TRUE);
4888 msg_print("Äˤ¤¡ª");
4890 msg_print("It hurts!");
4894 take_hit(DAMAGE_LOSELIFE, damroll(o_ptr->sval + 1, 6), "°Å¹õËâË¡¤ÎµÕή", -1);
4896 take_hit(DAMAGE_LOSELIFE, damroll(o_ptr->sval + 1, 6), "a miscast Death spell", -1);
4899 if ((spell > 15) && one_in_(6) && !p_ptr->hold_life)
4900 lose_exp(spell * 250);
4903 else if ((o_ptr->tval == TV_MUSIC_BOOK) && (randint1(200) < spell))
4906 msg_print("¤¤¤ä¤Ê²»¤¬¶Á¤¤¤¿");
4908 msg_print("An infernal sound echoed.");
4911 aggravate_monsters(0);
4913 if (randint1(100) >= chance)
4914 chg_virtue(V_CHANCE,-1);
4923 case REALM_LIFE: /* * LIFE * */
4924 cast = cast_life_spell(spell);
4926 case REALM_SORCERY: /* * SORCERY * */
4927 cast = cast_sorcery_spell(spell);
4929 case REALM_NATURE: /* * NATURE * */
4930 cast = cast_nature_spell(spell);
4932 case REALM_CHAOS: /* * CHAOS * */
4933 cast = cast_chaos_spell(spell);
4935 case REALM_DEATH: /* * DEATH * */
4936 cast = cast_death_spell(spell);
4938 case REALM_TRUMP: /* TRUMP */
4939 cast = cast_trump_spell(spell, TRUE);
4941 case REALM_ARCANE: /* ARCANE */
4942 cast = cast_arcane_spell(spell);
4944 case REALM_ENCHANT: /* ENCHANT */
4945 cast = cast_enchant_spell(spell);
4947 case REALM_DAEMON: /* DAEMON */
4948 cast = cast_daemon_spell(spell);
4950 case REALM_CRUSADE: /* CRUSADE */
4951 cast = cast_crusade_spell(spell);
4953 case REALM_MUSIC: /* MUSIC */
4954 cast = cast_music_spell(spell);
4958 msg_format("You cast a spell from an unknown realm: realm %d, spell %d.", realm, spell);
4962 /* Canceled spells cost neither a turn nor mana */
4965 if (randint1(100) < chance)
4966 chg_virtue(V_CHANCE,1);
4968 /* A spell was cast */
4970 (p_ptr->spell_worked2 & (1L << spell)) :
4971 (p_ptr->spell_worked1 & (1L << spell)))
4972 && (p_ptr->pclass != CLASS_SORCERER)
4973 && (p_ptr->pclass != CLASS_RED_MAGE))
4975 int e = s_ptr->sexp;
4977 /* The spell worked */
4978 if (realm == p_ptr->realm1)
4980 p_ptr->spell_worked1 |= (1L << spell);
4984 p_ptr->spell_worked2 |= (1L << spell);
4987 /* Gain experience */
4988 gain_exp(e * s_ptr->slevel);
4990 /* Redraw object recall */
4991 p_ptr->window |= (PW_OBJECT);
4996 chg_virtue(V_TEMPERANCE, 1);
4997 chg_virtue(V_COMPASSION, 1);
4998 chg_virtue(V_VITALITY, 1);
4999 chg_virtue(V_DILIGENCE, 1);
5002 chg_virtue(V_UNLIFE, 1);
5003 chg_virtue(V_JUSTICE, -1);
5004 chg_virtue(V_FAITH, -1);
5005 chg_virtue(V_VITALITY, -1);
5008 chg_virtue(V_JUSTICE, -1);
5009 chg_virtue(V_FAITH, -1);
5010 chg_virtue(V_HONOUR, -1);
5011 chg_virtue(V_TEMPERANCE, -1);
5014 chg_virtue(V_FAITH, 1);
5015 chg_virtue(V_JUSTICE, 1);
5016 chg_virtue(V_SACRIFICE, 1);
5017 chg_virtue(V_HONOUR, 1);
5020 chg_virtue(V_NATURE, 1);
5021 chg_virtue(V_HARMONY, 1);
5024 chg_virtue(V_KNOWLEDGE, 1);
5031 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_TEMPERANCE, 1);
5032 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_COMPASSION, 1);
5033 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_VITALITY, 1);
5034 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_DILIGENCE, 1);
5037 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_UNLIFE, 1);
5038 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_JUSTICE, -1);
5039 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_FAITH, -1);
5040 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_VITALITY, -1);
5043 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_JUSTICE, -1);
5044 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_FAITH, -1);
5045 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_HONOUR, -1);
5046 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_TEMPERANCE, -1);
5049 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_FAITH, 1);
5050 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_JUSTICE, 1);
5051 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_SACRIFICE, 1);
5052 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_HONOUR, 1);
5055 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_NATURE, 1);
5056 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_HARMONY, 1);
5059 if (mp_ptr->spell_xtra & MAGIC_GAIN_EXP)
5061 s16b cur_exp = p_ptr->spell_exp[(increment ? 32 : 0)+spell];
5064 if (cur_exp < SPELL_EXP_BEGINNER)
5066 else if (cur_exp < SPELL_EXP_SKILLED)
5068 if ((dun_level > 4) && ((dun_level + 10) > p_ptr->lev))
5071 else if (cur_exp < SPELL_EXP_EXPERT)
5073 if (((dun_level + 5) > p_ptr->lev) && ((dun_level + 5) > s_ptr->slevel))
5076 else if ((cur_exp < SPELL_EXP_MASTER) && !increment)
5078 if (((dun_level + 5) > p_ptr->lev) && (dun_level > s_ptr->slevel))
5081 p_ptr->spell_exp[(increment ? 32 : 0) + spell] += exp_gain;
5088 /* Sufficient mana */
5089 if (need_mana <= p_ptr->csp)
5092 p_ptr->csp -= need_mana;
5095 /* Over-exert the player */
5098 int oops = need_mana;
5102 p_ptr->csp_frac = 0;
5106 msg_print("Àº¿À¤ò½¸Ã椷¤¹¤®¤Æµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
5108 msg_print("You faint from the effort!");
5112 /* Hack -- Bypass free action */
5113 (void)set_paralyzed(p_ptr->paralyzed + randint1(5 * oops + 1));
5118 chg_virtue(V_VITALITY, -10);
5121 chg_virtue(V_UNLIFE, -10);
5124 chg_virtue(V_JUSTICE, 10);
5127 chg_virtue(V_NATURE, -10);
5130 chg_virtue(V_JUSTICE, -10);
5133 chg_virtue(V_KNOWLEDGE, -10);
5137 /* Damage CON (possibly permanently) */
5138 if (randint0(100) < 50)
5140 bool perm = (randint0(100) < 25);
5144 msg_print("ÂΤò°¤¯¤·¤Æ¤·¤Þ¤Ã¤¿¡ª");
5146 msg_print("You have damaged your health!");
5150 /* Reduce constitution */
5151 (void)dec_stat(A_CON, 15 + randint1(10), perm);
5156 p_ptr->redraw |= (PR_MANA);
5159 p_ptr->window |= (PW_PLAYER);
5160 p_ptr->window |= (PW_SPELL);
5165 * Pray a prayer -- Unused in Hengband
5167 void do_cmd_pray(void)
5169 msg_print("Praying is not used in Hengband. Use magic spell casting instead.");
5172 static bool ang_sort_comp_pet_dismiss(vptr u, vptr v, int a, int b)
5174 u16b *who = (u16b*)(u);
5179 monster_type *m_ptr1 = &m_list[w1];
5180 monster_type *m_ptr2 = &m_list[w2];
5181 monster_race *r_ptr1 = &r_info[m_ptr1->r_idx];
5182 monster_race *r_ptr2 = &r_info[m_ptr2->r_idx];
5187 if (w1 == p_ptr->riding) return TRUE;
5188 if (w2 == p_ptr->riding) return FALSE;
5190 if (m_ptr1->nickname && !m_ptr2->nickname) return TRUE;
5191 if (m_ptr2->nickname && !m_ptr1->nickname) return FALSE;
5193 if (!m_ptr1->parent_m_idx && m_ptr2->parent_m_idx) return TRUE;
5194 if (!m_ptr2->parent_m_idx && m_ptr1->parent_m_idx) return FALSE;
5196 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return TRUE;
5197 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return FALSE;
5199 if (r_ptr1->level > r_ptr2->level) return TRUE;
5200 if (r_ptr2->level > r_ptr1->level) return FALSE;
5202 if (m_ptr1->hp > m_ptr2->hp) return TRUE;
5203 if (m_ptr2->hp > m_ptr1->hp) return FALSE;
5208 int calculate_upkeep(void)
5210 s32b old_friend_align = friend_align;
5212 bool have_a_unique = FALSE;
5215 total_friend_levels = 0;
5218 for (m_idx = m_max - 1; m_idx >=1; m_idx--)
5220 monster_type *m_ptr;
5221 monster_race *r_ptr;
5223 m_ptr = &m_list[m_idx];
5224 if (!m_ptr->r_idx) continue;
5225 r_ptr = &r_info[m_ptr->r_idx];
5230 if (r_ptr->flags1 & RF1_UNIQUE)
5232 if (p_ptr->pclass == CLASS_CAVALRY)
5234 if (p_ptr->riding == m_idx)
5235 total_friend_levels += (r_ptr->level+5)*2;
5236 else if (!have_a_unique && (r_info[m_ptr->r_idx].flags7 & RF7_RIDING))
5237 total_friend_levels += (r_ptr->level+5)*7/2;
5239 total_friend_levels += (r_ptr->level+5)*10;
5240 have_a_unique = TRUE;
5243 total_friend_levels += (r_ptr->level+5)*10;
5246 total_friend_levels += r_ptr->level;
5248 /* Determine pet alignment */
5249 if (r_ptr->flags3 & RF3_GOOD) friend_align += r_ptr->level;
5250 if (r_ptr->flags3 & RF3_EVIL) friend_align -= r_ptr->level;
5253 if (old_friend_align != friend_align) p_ptr->update |= (PU_BONUS);
5257 upkeep_factor = (total_friend_levels - (p_ptr->lev * 80 / (cp_ptr->pet_upkeep_div)));
5258 if (upkeep_factor < 0) upkeep_factor = 0;
5259 if (upkeep_factor > 1000) upkeep_factor = 1000;
5260 return upkeep_factor;
5266 void do_cmd_pet_dismiss(void)
5268 monster_type *m_ptr;
5269 bool all_pets = FALSE;
5283 /* Allocate the "who" array */
5284 C_MAKE(who, max_m_idx, u16b);
5286 /* Process the monsters (backwards) */
5287 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
5289 if (is_pet(&m_list[pet_ctr]))
5290 who[max_pet++] = pet_ctr;
5293 /* Select the sort method */
5294 ang_sort_comp = ang_sort_comp_pet_dismiss;
5295 ang_sort_swap = ang_sort_swap_hook;
5297 ang_sort(who, &dummy_why, max_pet);
5299 /* Process the monsters (backwards) */
5300 for (i = 0; i < max_pet; i++)
5303 char friend_name[80];
5307 /* Access the monster */
5309 m_ptr = &m_list[pet_ctr];
5311 delete_this = FALSE;
5312 kakunin = ((pet_ctr == p_ptr->riding) || (m_ptr->nickname));
5313 monster_desc(friend_name, m_ptr, MD_ASSUME_VISIBLE);
5317 /* Hack -- health bar for this monster */
5318 health_track(pet_ctr);
5320 /* Hack -- handle stuff */
5324 sprintf(buf, "%s¤òÊü¤·¤Þ¤¹¤«¡© [Yes/No/Unnamed (%dɤ)]", friend_name, max_pet-i);
5326 sprintf(buf, "Dismiss %s? [Yes/No/Unnamed (%d remain)]", friend_name, max_pet-i);
5331 move_cursor_relative(m_ptr->fy, m_ptr->fx);
5337 if (ch == 'Y' || ch == 'y')
5344 sprintf(buf, "ËÜÅö¤Ë¤è¤í¤·¤¤¤Ç¤¹¤«¡© (%s) ", friend_name);
5346 sprintf(buf, "Are you sure? (%s) ", friend_name);
5348 if (!get_check(buf))
5349 delete_this = FALSE;
5354 if (ch == 'U' || ch == 'u')
5360 if (ch == ESCAPE || ch == 'N' || ch == 'n')
5367 if ((all_pets && !kakunin) || (!all_pets && delete_this))
5369 if (record_named_pet && m_ptr->nickname)
5373 monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
5374 do_cmd_write_nikki(NIKKI_NAMED_PET, 2, m_name);
5377 if (pet_ctr == p_ptr->riding)
5380 msg_format("%s¤«¤é¹ß¤ê¤¿¡£", friend_name);
5382 msg_format("You have got off %s. ", friend_name);
5387 /* Update the monsters */
5388 p_ptr->update |= (PU_BONUS | PU_MONSTERS);
5389 p_ptr->redraw |= (PR_EXTRA | PR_UHEALTH);
5392 /* HACK : Add the line to message buffer */
5394 sprintf(buf, "%s ¤òÊü¤·¤¿¡£", friend_name);
5396 sprintf(buf, "Dismissed %s.", friend_name);
5399 p_ptr->window |= (PW_MESSAGE);
5402 delete_monster_idx(pet_ctr);
5411 C_KILL(who, max_m_idx, u16b);
5414 msg_format("%d ɤ¤Î¥Ú¥Ã¥È¤òÊü¤·¤Þ¤·¤¿¡£", Dismissed);
5416 msg_format("You have dismissed %d pet%s.", Dismissed,
5417 (Dismissed == 1 ? "" : "s"));
5419 if (Dismissed == 0 && all_pets)
5421 msg_print("'U'nnamed ¤Ï¡¢¾èÇϰʳ°¤Î̾Á°¤Î¤Ê¤¤¥Ú¥Ã¥È¤À¤±¤òÁ´¤Æ²òÊü¤·¤Þ¤¹¡£");
5423 msg_print("'U'nnamed means all your pets except named pets and your mount.");
5426 p_ptr->update |= (PU_MON_LITE);
5429 static bool player_can_ride_aux(cave_type *c_ptr, bool now_riding)
5432 bool old_character_xtra = character_xtra;
5433 int old_riding = p_ptr->riding;
5434 bool old_riding_ryoute = p_ptr->riding_ryoute;
5435 bool old_old_riding_ryoute = p_ptr->old_riding_ryoute;
5436 bool old_pf_ryoute = (p_ptr->pet_extra_flags & PF_RYOUTE) ? TRUE : FALSE;
5438 /* Hack -- prevent "icky" message */
5439 character_xtra = TRUE;
5441 if (now_riding) p_ptr->riding = c_ptr->m_idx;
5445 p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5446 p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE;
5451 p_can_enter = player_can_enter(c_ptr->feat, CEM_P_CAN_ENTER_PATTERN);
5453 p_ptr->riding = old_riding;
5454 if (old_pf_ryoute) p_ptr->pet_extra_flags |= (PF_RYOUTE);
5455 else p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5456 p_ptr->riding_ryoute = old_riding_ryoute;
5457 p_ptr->old_riding_ryoute = old_old_riding_ryoute;
5461 character_xtra = old_character_xtra;
5466 bool rakuba(int dam, bool force)
5468 int i, y, x, oy, ox;
5469 int sn = 0, sy = 0, sx = 0;
5471 monster_type *m_ptr = &m_list[p_ptr->riding];
5472 monster_race *r_ptr = &r_info[m_ptr->r_idx];
5474 if (!p_ptr->riding) return FALSE;
5475 if (p_ptr->wild_mode) return FALSE;
5477 if (dam >= 0 || force)
5481 int cur = p_ptr->skill_exp[GINOU_RIDING];
5482 int max = s_info[p_ptr->pclass].s_max[GINOU_RIDING];
5483 int ridinglevel = r_ptr->level;
5485 /* ÍîÇϤΤ·¤ä¤¹¤µ */
5486 int rakubalevel = r_ptr->level;
5487 if (p_ptr->riding_ryoute) rakubalevel += 20;
5489 if ((cur < max) && (max > 1000) &&
5490 (dam / 2 + ridinglevel) > (cur / 30 + 10))
5494 if (ridinglevel > (cur / 100 + 15))
5495 inc += 1 + (ridinglevel - cur / 100 - 15);
5499 p_ptr->skill_exp[GINOU_RIDING] = MIN(max, cur + inc);
5502 /* ¥ì¥Ù¥ë¤ÎÄ㤤¾èÇϤ«¤é¤ÏÍîÇϤ·¤Ë¤¯¤¤ */
5503 if (randint0(dam / 2 + rakubalevel * 2) < cur / 30 + 10)
5505 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))
5512 /* Check around the player */
5513 for (i = 0; i < 8; i++)
5517 /* Access the location */
5518 y = py + ddy_ddd[i];
5519 x = px + ddx_ddd[i];
5521 c_ptr = &cave[y][x];
5523 if (c_ptr->m_idx) continue;
5525 /* Skip non-empty grids */
5526 if (!have_flag(f_flags_grid(c_ptr), FF_MOVE))
5528 if (!player_can_ride_aux(c_ptr, FALSE)) continue;
5531 if (have_flag(f_flags_grid(c_ptr), FF_PATTERN)) continue;
5533 /* Count "safe" grids */
5536 /* Randomize choice */
5537 if (randint0(sn) > 0) continue;
5539 /* Save the safe location */
5544 monster_desc(m_name, m_ptr, 0);
5546 msg_format("%s¤«¤é¿¶¤êÍî¤È¤µ¤ì¤½¤¦¤Ë¤Ê¤Ã¤Æ¡¢Êɤˤ֤Ĥ«¤Ã¤¿¡£",m_name);
5547 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "Êɤؤξ×ÆÍ", -1);
5549 msg_format("You have nearly fallen from %s, but bumped into wall.",m_name);
5550 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "bumping into wall", -1);
5561 /* Redraw the old spot */
5564 /* Redraw the new spot */
5567 /* Check for new panel */
5572 p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5573 p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE;
5577 p_ptr->update |= (PU_BONUS);
5580 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
5582 /* Update the monsters */
5583 p_ptr->update |= (PU_DISTANCE);
5586 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5588 p_ptr->redraw |= (PR_EXTRA);
5590 /* Update health track of mount */
5591 p_ptr->redraw |= (PR_UHEALTH);
5593 if (p_ptr->ffall && !force)
5595 monster_desc(m_name, m_ptr, 0);
5597 msg_format("%s¤«¤éÍî¤Á¤¿¤¬¡¢¶õÃæ¤Ç¤¦¤Þ¤¯ÂÎÀª¤òΩ¤Æľ¤·¤ÆÃåÃϤ·¤¿¡£",m_name);
5599 msg_format("You are thrown from %s, but make a good landing.",m_name);
5604 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "ÍîÇÏ", -1);
5606 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "Falling from riding", -1);
5612 bool do_riding(bool force)
5614 int oy, ox, x, y, dir = 0;
5616 monster_type *m_ptr;
5618 if (!get_rep_dir2(&dir)) return FALSE;
5621 c_ptr = &cave[y][x];
5625 /* Skip non-empty grids */
5626 if (!player_can_ride_aux(c_ptr, FALSE))
5629 msg_print("¤½¤Á¤é¤Ë¤Ï¹ß¤ê¤é¤ì¤Þ¤»¤ó¡£");
5631 msg_print("You cannot go to that direction.");
5636 if (!pattern_seq(py, px, y, x)) return FALSE;
5645 msg_print("¥â¥ó¥¹¥¿¡¼¤¬Î©¤Á¤Õ¤µ¤¬¤Ã¤Æ¤¤¤ë¡ª");
5647 msg_print("There is a monster in the way!");
5655 p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5656 p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE;
5660 if (p_ptr->confused)
5663 msg_print("º®Í𤷤Ƥ¤¤Æ¾è¤ì¤Ê¤¤¡ª");
5665 msg_print("You are too confused!");
5670 m_ptr = &m_list[c_ptr->m_idx];
5672 if (!c_ptr->m_idx || !m_ptr->ml)
5675 msg_print("¤½¤Î¾ì½ê¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
5677 msg_print("Here is no monster.");
5682 if (!is_pet(m_ptr) && !force)
5685 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï¥Ú¥Ã¥È¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£");
5687 msg_print("That monster is not a pet.");
5692 if (!(r_info[m_ptr->r_idx].flags7 & RF7_RIDING))
5695 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ë¤Ï¾è¤ì¤Ê¤µ¤½¤¦¤À¡£");
5697 msg_print("This monster doesn't seem suitable for riding.");
5703 if (!pattern_seq(py, px, y, x)) return FALSE;
5705 if (!player_can_ride_aux(c_ptr, TRUE))
5707 feature_type *f_ptr = &f_info[c_ptr->feat];
5709 msg_format("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï%s¤Î%s¤Ë¤¤¤ë¡£", f_name + f_ptr->name,
5710 (!have_flag(f_ptr->flags, FF_MOVE) ||
5711 (!have_flag(f_ptr->flags, FF_LOS) &&
5712 !have_flag(f_ptr->flags, FF_TREE))) ? "Ãæ" : "¾å");
5714 msg_format("This monster is %s the %s.",
5715 (!have_flag(f_ptr->flags, FF_MOVE) ||
5716 (!have_flag(f_ptr->flags, FF_LOS) &&
5717 !have_flag(f_ptr->flags, FF_TREE))) ? "in" : "on",
5718 f_name + f_ptr->name);
5723 if (r_info[m_ptr->r_idx].level > randint1((p_ptr->skill_exp[GINOU_RIDING] / 50 + p_ptr->lev / 2 + 20)))
5726 msg_print("¤¦¤Þ¤¯¾è¤ì¤Ê¤«¤Ã¤¿¡£");
5728 msg_print("You failed to ride.");
5739 monster_desc(m_name, m_ptr, 0);
5742 msg_format("%s¤òµ¯¤³¤·¤¿¡£", m_name);
5744 msg_format("You have waked %s up.", m_name);
5748 p_ptr->riding = c_ptr->m_idx;
5750 /* Hack -- remove tracked monster */
5751 if (p_ptr->riding == p_ptr->health_who) health_track(0);
5754 /* Save the old location */
5758 /* Move the player to the safe location */
5762 /* Redraw the old spot */
5765 /* Redraw the new spot */
5768 /* Check for new panel */
5773 /* Mega-Hack -- Forget the view and lite */
5774 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
5777 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
5779 /* Update the monsters */
5780 p_ptr->update |= (PU_DISTANCE);
5782 /* Update the monsters */
5783 p_ptr->update |= (PU_BONUS);
5786 p_ptr->redraw |= (PR_MAP | PR_EXTRA);
5789 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5791 p_ptr->redraw |= (PR_UHEALTH);
5797 static void do_name_pet(void)
5799 monster_type *m_ptr;
5802 bool old_name = FALSE;
5803 bool old_target_pet = target_pet;
5806 if (!target_set(TARGET_KILL))
5808 target_pet = old_target_pet;
5811 target_pet = old_target_pet;
5813 if (cave[target_row][target_col].m_idx)
5815 m_ptr = &m_list[cave[target_row][target_col].m_idx];
5821 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï¥Ú¥Ã¥È¤Ç¤Ï¤Ê¤¤¡£");
5823 msg_format("This monster is not a pet.");
5827 if (r_info[m_ptr->r_idx].flags1 & RF1_UNIQUE)
5830 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Î̾Á°¤ÏÊѤ¨¤é¤ì¤Ê¤¤¡ª");
5832 msg_format("You cannot change name of this monster!");
5836 monster_desc(m_name, m_ptr, 0);
5840 msg_format("%s¤Ë̾Á°¤ò¤Ä¤±¤ë¡£", m_name);
5842 msg_format("Name %s.", m_name);
5847 /* Start with nothing */
5848 strcpy(out_val, "");
5850 /* Use old inscription */
5851 if (m_ptr->nickname)
5853 /* Start with the old inscription */
5854 strcpy(out_val, quark_str(m_ptr->nickname));
5858 /* Get a new inscription (possibly empty) */
5860 if (get_string("̾Á°: ", out_val, 15))
5862 if (get_string("Name: ", out_val, 15))
5868 /* Save the inscription */
5869 m_ptr->nickname = quark_add(out_val);
5870 if (record_named_pet)
5874 monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
5875 do_cmd_write_nikki(NIKKI_NAMED_PET, 0, m_name);
5880 if (record_named_pet && old_name)
5884 monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
5885 do_cmd_write_nikki(NIKKI_NAMED_PET, 1, m_name);
5887 m_ptr->nickname = 0;
5894 * Issue a pet command
5896 void do_cmd_pet(void)
5901 cptr power_desc[36];
5907 monster_type *m_ptr;
5914 char target_buf[160];
5919 power_desc[num] = "¥Ú¥Ã¥È¤òÊü¤¹";
5921 power_desc[num] = "dismiss pets";
5924 powers[num++] = PET_DISMISS;
5927 sprintf(target_buf,"¥Ú¥Ã¥È¤Î¥¿¡¼¥²¥Ã¥È¤ò»ØÄê (¸½ºß¡§%s)",
5928 (pet_t_m_idx ? r_name + r_info[m_list[pet_t_m_idx].r_idx].name : "»ØÄê¤Ê¤·"));
5930 sprintf(target_buf,"specify a targert of pet (now:%s)",
5931 (pet_t_m_idx ? r_name + r_info[m_list[pet_t_m_idx].r_idx].name : "nothing"));
5933 power_desc[num] = target_buf;
5935 powers[num++] = PET_TARGET;
5938 power_desc[num] = "¶á¤¯¤Ë¤¤¤í";
5940 power_desc[num] = "stay close";
5943 if (p_ptr->pet_follow_distance == PET_CLOSE_DIST) mode = num;
5944 powers[num++] = PET_STAY_CLOSE;
5947 power_desc[num] = "¤Ä¤¤¤ÆÍ褤";
5949 power_desc[num] = "follow me";
5952 if (p_ptr->pet_follow_distance == PET_FOLLOW_DIST) mode = num;
5953 powers[num++] = PET_FOLLOW_ME;
5956 power_desc[num] = "Ũ¤ò¸«¤Ä¤±¤ÆÅݤ»";
5958 power_desc[num] = "seek and destroy";
5961 if (p_ptr->pet_follow_distance == PET_DESTROY_DIST) mode = num;
5962 powers[num++] = PET_SEEK_AND_DESTROY;
5965 power_desc[num] = "¾¯¤·Î¥¤ì¤Æ¤¤¤í";
5967 power_desc[num] = "give me space";
5970 if (p_ptr->pet_follow_distance == PET_SPACE_DIST) mode = num;
5971 powers[num++] = PET_ALLOW_SPACE;
5974 power_desc[num] = "Î¥¤ì¤Æ¤¤¤í";
5976 power_desc[num] = "stay away";
5979 if (p_ptr->pet_follow_distance == PET_AWAY_DIST) mode = num;
5980 powers[num++] = PET_STAY_AWAY;
5982 if (p_ptr->pet_extra_flags & PF_OPEN_DOORS)
5985 power_desc[num] = "¥É¥¢¤ò³«¤±¤ë (¸½ºß:ON)";
5987 power_desc[num] = "pets open doors (now On)";
5994 power_desc[num] = "¥É¥¢¤ò³«¤±¤ë (¸½ºß:OFF)";
5996 power_desc[num] = "pets open doors (now Off)";
6000 powers[num++] = PET_OPEN_DOORS;
6002 if (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS)
6005 power_desc[num] = "¥¢¥¤¥Æ¥à¤ò½¦¤¦ (¸½ºß:ON)";
6007 power_desc[num] = "pets pick up items (now On)";
6014 power_desc[num] = "¥¢¥¤¥Æ¥à¤ò½¦¤¦ (¸½ºß:OFF)";
6016 power_desc[num] = "pets pick up items (now Off)";
6020 powers[num++] = PET_TAKE_ITEMS;
6022 if (p_ptr->pet_extra_flags & PF_TELEPORT)
6025 power_desc[num] = "¥Æ¥ì¥Ý¡¼¥È·ÏËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6027 power_desc[num] = "allow teleport (now On)";
6034 power_desc[num] = "¥Æ¥ì¥Ý¡¼¥È·ÏËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6036 power_desc[num] = "allow teleport (now Off)";
6040 powers[num++] = PET_TELEPORT;
6042 if (p_ptr->pet_extra_flags & PF_ATTACK_SPELL)
6045 power_desc[num] = "¹¶·âËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6047 power_desc[num] = "allow cast attack spell (now On)";
6054 power_desc[num] = "¹¶·âËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6056 power_desc[num] = "allow cast attack spell (now Off)";
6060 powers[num++] = PET_ATTACK_SPELL;
6062 if (p_ptr->pet_extra_flags & PF_SUMMON_SPELL)
6065 power_desc[num] = "¾¤´ËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6067 power_desc[num] = "allow cast summon spell (now On)";
6074 power_desc[num] = "¾¤´ËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6076 power_desc[num] = "allow cast summon spell (now Off)";
6080 powers[num++] = PET_SUMMON_SPELL;
6082 if (p_ptr->pet_extra_flags & PF_BALL_SPELL)
6085 power_desc[num] = "¥×¥ì¥¤¥ä¡¼¤ò´¬¤¹þ¤àÈÏ°ÏËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6087 power_desc[num] = "allow involve player in area spell (now On)";
6094 power_desc[num] = "¥×¥ì¥¤¥ä¡¼¤ò´¬¤¹þ¤àÈÏ°ÏËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6096 power_desc[num] = "allow involve player in area spell (now Off)";
6100 powers[num++] = PET_BALL_SPELL;
6105 power_desc[num] = "¥Ú¥Ã¥È¤«¤é¹ß¤ê¤ë";
6107 power_desc[num] = "get off a pet";
6114 power_desc[num] = "¥Ú¥Ã¥È¤Ë¾è¤ë";
6116 power_desc[num] = "ride a pet";
6120 powers[num++] = PET_RIDING;
6123 power_desc[num] = "¥Ú¥Ã¥È¤Ë̾Á°¤ò¤Ä¤±¤ë¡£";
6125 power_desc[num] = "name pets";
6128 powers[num++] = PET_NAME;
6130 if (p_ptr->riding && buki_motteruka(INVEN_RARM) && (empty_hands(FALSE) & EMPTY_HAND_LARM) && ((inventory[INVEN_RARM].weight > 99) || (inventory[INVEN_RARM].tval == TV_POLEARM)))
6132 if (p_ptr->pet_extra_flags & PF_RYOUTE)
6135 power_desc[num] = "Éð´ï¤òÊÒ¼ê¤Ç»ý¤Ä";
6137 power_desc[num] = "use one hand to control a riding pet";
6144 power_desc[num] = "Éð´ï¤òξ¼ê¤Ç»ý¤Ä";
6146 power_desc[num] = "use both hands for a weapon.";
6151 powers[num++] = PET_RYOUTE;
6154 /* Nothing chosen yet */
6157 /* Build a prompt (accept all spells) */
6160 /* Build a prompt (accept all spells) */
6162 strnfmt(out_val, 78, "(¥³¥Þ¥ó¥É %c-%c¡¢'*'=°ìÍ÷¡¢ESC=½ªÎ») ¥³¥Þ¥ó¥É¤òÁª¤ó¤Ç¤¯¤À¤µ¤¤:",
6164 strnfmt(out_val, 78, "(Command %c-%c, *=List, ESC=exit) Select a command: ",
6167 I2A(0), I2A(num - 1));
6172 strnfmt(out_val, 78, "(¥³¥Þ¥ó¥É %c-%c¡¢'*'=°ìÍ÷¡¢ESC=½ªÎ») ¥³¥Þ¥ó¥É¤òÁª¤ó¤Ç¤¯¤À¤µ¤¤:",
6174 strnfmt(out_val, 78, "(Command %c-%c, *=List, ESC=exit) Select a command: ",
6177 I2A(0), '0' + num - 27);
6183 /* Save the screen */
6190 prt(format("%s%c) %s", (ctr == mode) ? "*" : " ", I2A(ctr), power_desc[ctr]), y + ctr, x);
6196 prt("", y + ctr, x);
6203 /* Get a command from the user */
6204 while (!flag && get_com(out_val, &choice, TRUE))
6206 /* Request redraw */
6207 if ((choice == ' ') || (choice == '*') || (choice == '?'))
6219 /* Save the screen */
6226 sprintf(buf, "%s%c) %s", (ctr == mode) ? "*" : " ", I2A(ctr), power_desc[ctr]);
6227 prt(buf, y + ctr, x);
6233 prt("", y + ctr, x);
6247 /* Restore the screen */
6255 if (isalpha(choice))
6258 ask = (isupper(choice));
6261 if (ask) choice = tolower(choice);
6263 /* Extract request */
6264 i = (islower(choice) ? A2I(choice) : -1);
6268 ask = FALSE; /* Can't uppercase digits */
6270 i = choice - '0' + 26;
6273 /* Totally Illegal */
6274 if ((i < 0) || (i >= num))
6285 strnfmt(buf, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡© ", power_desc[i]);
6287 strnfmt(buf, 78, "Use %s? ", power_desc[i]);
6291 /* Belay that order */
6292 if (!get_check(buf)) continue;
6299 /* Restore the screen */
6300 if (redraw) Term_load();
6302 /* Abort if needed */
6311 case PET_DISMISS: /* Dismiss pets */
6313 /* Check pets (backwards) */
6314 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
6316 /* Player has pet */
6317 if (is_pet(&m_list[pet_ctr])) break;
6323 msg_print("¥Ú¥Ã¥È¤¬¤¤¤Ê¤¤¡ª");
6325 msg_print("You have no pets!");
6329 do_cmd_pet_dismiss();
6330 (void)calculate_upkeep();
6335 project_length = -1;
6336 if (!target_set(TARGET_KILL)) pet_t_m_idx = 0;
6339 cave_type *c_ptr = &cave[target_row][target_col];
6340 if (c_ptr->m_idx && (m_list[c_ptr->m_idx].ml))
6342 pet_t_m_idx = cave[target_row][target_col].m_idx;
6343 p_ptr->pet_follow_distance = PET_DESTROY_DIST;
6345 else pet_t_m_idx = 0;
6352 case PET_STAY_CLOSE:
6354 p_ptr->pet_follow_distance = PET_CLOSE_DIST;
6361 p_ptr->pet_follow_distance = PET_FOLLOW_DIST;
6365 /* "Seek and destoy" */
6366 case PET_SEEK_AND_DESTROY:
6368 p_ptr->pet_follow_distance = PET_DESTROY_DIST;
6371 /* "Give me space" */
6372 case PET_ALLOW_SPACE:
6374 p_ptr->pet_follow_distance = PET_SPACE_DIST;
6380 p_ptr->pet_follow_distance = PET_AWAY_DIST;
6383 /* flag - allow pets to open doors */
6384 case PET_OPEN_DOORS:
6386 if (p_ptr->pet_extra_flags & PF_OPEN_DOORS) p_ptr->pet_extra_flags &= ~(PF_OPEN_DOORS);
6387 else p_ptr->pet_extra_flags |= (PF_OPEN_DOORS);
6390 /* flag - allow pets to pickup items */
6391 case PET_TAKE_ITEMS:
6393 if (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS)
6395 p_ptr->pet_extra_flags &= ~(PF_PICKUP_ITEMS);
6396 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
6398 /* Access the monster */
6399 m_ptr = &m_list[pet_ctr];
6403 monster_drop_carried_objects(m_ptr);
6407 else p_ptr->pet_extra_flags |= (PF_PICKUP_ITEMS);
6411 /* flag - allow pets to teleport */
6414 if (p_ptr->pet_extra_flags & PF_TELEPORT) p_ptr->pet_extra_flags &= ~(PF_TELEPORT);
6415 else p_ptr->pet_extra_flags |= (PF_TELEPORT);
6418 /* flag - allow pets to cast attack spell */
6419 case PET_ATTACK_SPELL:
6421 if (p_ptr->pet_extra_flags & PF_ATTACK_SPELL) p_ptr->pet_extra_flags &= ~(PF_ATTACK_SPELL);
6422 else p_ptr->pet_extra_flags |= (PF_ATTACK_SPELL);
6425 /* flag - allow pets to cast attack spell */
6426 case PET_SUMMON_SPELL:
6428 if (p_ptr->pet_extra_flags & PF_SUMMON_SPELL) p_ptr->pet_extra_flags &= ~(PF_SUMMON_SPELL);
6429 else p_ptr->pet_extra_flags |= (PF_SUMMON_SPELL);
6432 /* flag - allow pets to cast attack spell */
6433 case PET_BALL_SPELL:
6435 if (p_ptr->pet_extra_flags & PF_BALL_SPELL) p_ptr->pet_extra_flags &= ~(PF_BALL_SPELL);
6436 else p_ptr->pet_extra_flags |= (PF_BALL_SPELL);
6442 (void)do_riding(FALSE);
6454 if (p_ptr->pet_extra_flags & PF_RYOUTE) p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
6455 else p_ptr->pet_extra_flags |= (PF_RYOUTE);
6456 p_ptr->update |= (PU_BONUS);