3 /* Purpose: Spell/Prayer commands */
6 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research, and
9 * not for profit purposes provided that this copyright and statement are
10 * included in all such copies.
15 #include "spellstips.h"
17 cptr spell_categoly_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_spellbook=FALSE;
55 bool select_the_force=FALSE;
57 static int get_spell(int *sn, cptr prompt, int sval, bool learned, int use_realm)
65 bool flag, redraw, okay;
73 int menu_line = (use_menu ? 1 : 0);
75 #ifdef ALLOW_REPEAT /* TNB */
77 /* Get the spell, if available */
80 /* Verify the spell */
81 if (spell_okay(*sn, learned, FALSE, use_realm - 1))
88 #endif /* ALLOW_REPEAT -- TNB */
90 p = spell_categoly_name(mp_ptr->spell_book);
93 for (spell = 0; spell < 32; spell++)
95 /* Check for this spell */
96 if ((fake_spell_flags[sval] & (1L << spell)))
98 /* Collect this spell */
99 spells[num++] = spell;
103 /* Assume no usable spells */
106 /* Assume no spells available */
109 /* Check for "okay" spells */
110 for (i = 0; i < num; i++)
112 /* Look for "okay" spells */
113 if (spell_okay(spells[i], learned, FALSE, use_realm - 1)) okay = TRUE;
116 /* No "okay" spells */
117 if (!okay) return (FALSE);
118 if (((use_realm) != p_ptr->realm1) && ((use_realm) != p_ptr->realm2) && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE)) return FALSE;
119 if (((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE)) && !is_magic(use_realm)) return FALSE;
120 if ((p_ptr->pclass == CLASS_RED_MAGE) && ((use_realm) != REALM_ARCANE) && (sval > 1)) return FALSE;
122 /* Assume cancelled */
125 /* Nothing chosen yet */
135 p_ptr->window |= (PW_SPELL);
141 /* Build a prompt (accept all spells) */
143 jverb1( prompt, jverb_buf );
144 (void) strnfmt(out_val, 78, "(%^s:%c-%c, '*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤Î%s¤ò%^s¤Þ¤¹¤«? ",
145 p, I2A(0), I2A(num - 1), p, jverb_buf );
147 (void)strnfmt(out_val, 78, "(%^ss %c-%c, *=List, ESC=exit) %^s which %s? ",
148 p, I2A(0), I2A(num - 1), prompt, p);
151 /* Get a spell from the user */
153 choice = (always_show_list || use_menu) ? ESCAPE:1;
156 if( choice==ESCAPE ) choice = ' ';
157 else if( !get_com(out_val, &choice, TRUE) )break;
159 if (use_menu && choice != ' ')
174 menu_line += (num - 1);
196 if (menu_line > num) menu_line -= num;
197 /* Display a list of spells */
198 print_spells(menu_line, spells, num, 1, 15, use_realm - 1);
204 if ((choice == ' ') || (choice == '*') || (choice == '?'))
212 /* Save the screen */
215 /* Display a list of spells */
216 print_spells(menu_line, spells, num, 1, 15, use_realm - 1);
222 if (use_menu) continue;
227 /* Restore the screen */
237 ask = (isupper(choice));
240 if (ask) choice = tolower(choice);
242 /* Extract request */
243 i = (islower(choice) ? A2I(choice) : -1);
246 /* Totally Illegal */
247 if ((i < 0) || (i >= num))
253 /* Save the spell index */
256 /* Require "okay" spells */
257 if (!spell_okay(spell, learned, FALSE, use_realm - 1))
261 msg_format("¤½¤Î%s¤ò%s¤³¤È¤Ï¤Ç¤¤Þ¤»¤ó¡£", p, prompt);
263 msg_format("You may not %s that %s.", prompt, p);
274 /* Access the spell */
275 if (!is_magic(use_realm))
277 s_ptr = &technic_info[use_realm - MIN_TECHNIC - 1][spell];
281 s_ptr = &mp_ptr->info[use_realm - 1][spell % 32];
284 if (use_realm == REALM_HISSATSU)
286 shouhimana = s_ptr->smana;
290 /* Extract mana consumption rate */
291 shouhimana = s_ptr->smana*(3800 - experience_of_spell(spell, use_realm)) + 2399;
294 else shouhimana *= 4;
296 if(shouhimana < 1) shouhimana = 1;
301 jverb1( prompt, jverb_buf );
302 /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½¤ËÂбþ */
303 (void) strnfmt(tmp_val, 78, "%s(MP%d, ¼ºÇÔΨ%d%%)¤ò%s¤Þ¤¹¤«? ",
304 spell_names[technic2magic(use_realm)-1][spell % 32], shouhimana,
305 spell_chance(spell, use_realm -1),jverb_buf);
307 (void)strnfmt(tmp_val, 78, "%^s %s (%d mana, %d%% fail)? ",
308 prompt, spell_names[technic2magic(use_realm)-1][spell % 32], shouhimana,
309 spell_chance(spell, use_realm - 1));
313 /* Belay that order */
314 if (!get_check(tmp_val)) continue;
322 /* Restore the screen */
323 if (redraw) screen_load();
330 p_ptr->window |= (PW_SPELL);
337 /* Abort if needed */
338 if (!flag) return (FALSE);
340 /* Save the choice */
343 #ifdef ALLOW_REPEAT /* TNB */
347 #endif /* ALLOW_REPEAT -- TNB */
354 static bool item_tester_learn_spell(object_type *o_ptr)
356 s32b choices = realm_choices2[p_ptr->pclass];
358 if (p_ptr->pclass == CLASS_PRIEST)
360 if (is_good_realm(p_ptr->realm1))
362 choices &= ~(CH_DEATH | CH_DAEMON);
366 choices &= ~(CH_LIFE | CH_CRUSADE);
370 if ((o_ptr->tval < TV_LIFE_BOOK) || (o_ptr->tval > (TV_LIFE_BOOK + MAX_REALM - 1))) return (FALSE);
371 if ((o_ptr->tval == TV_MUSIC_BOOK) && (p_ptr->pclass == CLASS_BARD)) return (TRUE);
372 else if (!is_magic(tval2realm(o_ptr->tval))) return FALSE;
373 if ((REALM1_BOOK == o_ptr->tval) || (REALM2_BOOK == o_ptr->tval)) return (TRUE);
374 if (choices & (0x0001 << (tval2realm(o_ptr->tval) - 1))) return (TRUE);
380 * Peruse the spells/prayers in a book
382 * Note that *all* spells in the book are listed
384 * Note that browsing is allowed while confused or blind,
385 * and in the dark, primarily to allow browsing in stores.
387 void do_cmd_browse(void)
389 int item, sval, use_realm = 0, j, line;
402 /* Warriors are illiterate */
403 if (!(p_ptr->realm1 || p_ptr->realm2) && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE))
406 msg_print("ËܤòÆɤळ¤È¤¬¤Ç¤¤Ê¤¤¡ª");
408 msg_print("You cannot read books!");
414 if (p_ptr->special_defense & KATA_MUSOU)
416 set_action(ACTION_NONE);
419 /* Restrict choices to "useful" books */
420 if (p_ptr->realm2 == REALM_NONE) item_tester_tval = mp_ptr->spell_book;
421 else item_tester_hook = item_tester_learn_spell;
425 q = "¤É¤ÎËܤòÆɤߤޤ¹¤«? ";
427 q = "Browse which book? ";
431 s = "Æɤá¤ëËܤ¬¤Ê¤¤¡£";
433 s = "You have no books that you can read.";
436 select_spellbook=TRUE;
437 if (p_ptr->pclass == CLASS_FORCETRAINER)
438 select_the_force = TRUE;
439 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))){
440 select_spellbook = FALSE;
441 select_the_force = FALSE;
444 select_spellbook = FALSE;
445 select_the_force = FALSE;
447 if (item == 1111) { /* the_force */
448 do_cmd_mind_browse();
451 /* Get the item (in the pack) */
454 o_ptr = &inventory[item];
457 /* Get the item (on the floor) */
460 o_ptr = &o_list[0 - item];
463 /* Access the item's sval */
466 use_realm = tval2realm(o_ptr->tval);
467 if ((p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE) && is_magic(use_realm))
469 if (o_ptr->tval == REALM2_BOOK) increment = 32;
470 else if (o_ptr->tval != REALM1_BOOK) increment = 64;
473 /* Track the object kind */
474 object_kind_track(o_ptr->k_idx);
476 /* Hack -- Handle stuff */
481 for (spell = 0; spell < 32; spell++)
483 /* Check for this spell */
484 if ((fake_spell_flags[sval] & (1L << spell)))
486 /* Collect this spell */
487 spells[num++] = spell;
492 /* Save the screen */
495 /* Clear the top line */
498 /* Keep browsing spells. Exit browsing on cancel. */
501 /* Ask for a spell, allow cancel */
503 if (!get_spell(&spell, "Æɤà", o_ptr->sval, TRUE, use_realm))
505 if (!get_spell(&spell, "browse", o_ptr->sval, TRUE, use_realm))
508 /* If cancelled, leave immediately. */
509 if (spell == -1) break;
511 /* Display a list of spells */
512 print_spells(0, spells, num, 1, 15, use_realm - 1);
514 /* Notify that there's nothing to see, and wait. */
515 if (use_realm == REALM_HISSATSU)
517 prt("Æɤá¤ëµ»¤¬¤Ê¤¤¡£", 0, 0);
519 prt("No techniques to browse.", 0, 0);
523 prt("Æɤá¤ë¼öʸ¤¬¤Ê¤¤¡£", 0, 0);
525 prt("No spells to browse.", 0, 0);
530 /* Restore the screen */
536 /* Clear lines, position cursor (really should use strlen here) */
537 Term_erase(14, 14, 255);
538 Term_erase(14, 13, 255);
539 Term_erase(14, 12, 255);
540 Term_erase(14, 11, 255);
542 /* Access the spell */
543 if (!is_magic(use_realm))
545 s_ptr = &technic_info[use_realm - MIN_TECHNIC - 1][spell];
549 s_ptr = &mp_ptr->info[use_realm - 1][spell];
552 roff_to_buf( spell_tips[technic2magic(use_realm)-1][spell] ,62,temp);
553 for(j=0, line = 11;temp[j];j+=(1+strlen(&temp[j])))
555 prt(&temp[j], line, 15);
560 /* Restore the screen */
565 static void change_realm2(int next_realm)
570 for (i = 0; i < 64; i++)
572 p_ptr->spell_order[j] = p_ptr->spell_order[i];
573 if(p_ptr->spell_order[i] < 32) j++;
576 p_ptr->spell_order[j] = 99;
578 for (i = 32; i < 64; i++)
580 p_ptr->spell_exp[i] = 0;
582 p_ptr->spell_learned2 = 0L;
583 p_ptr->spell_worked2 = 0L;
584 p_ptr->spell_forgotten2 = 0L;
587 sprintf(tmp,"ËâË¡¤ÎÎΰè¤ò%s¤«¤é%s¤ËÊѹ¹¤·¤¿¡£", realm_names[p_ptr->realm2], realm_names[next_realm]);
589 sprintf(tmp,"change magic realm from %s to %s.", realm_names[p_ptr->realm2], realm_names[next_realm]);
591 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
592 p_ptr->old_realm |= 1 << (p_ptr->realm2-1);
593 p_ptr->realm2 = next_realm;
595 p_ptr->notice |= (PN_REORDER);
596 p_ptr->update |= (PU_SPELLS);
602 * Study a book to gain a new spell/prayer
604 void do_cmd_study(void)
608 bool learned = FALSE;
610 /* Spells of realm2 will have an increment of +32 */
613 cptr p = spell_categoly_name(mp_ptr->spell_book);
622 msg_print("ËܤòÆɤळ¤È¤¬¤Ç¤¤Ê¤¤¡ª");
624 msg_print("You cannot read books!");
630 if (p_ptr->blind || no_lite())
633 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡ª");
635 msg_print("You cannot see!");
644 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡ª");
646 msg_print("You are too confused!");
652 if (!(p_ptr->new_spells))
655 msg_format("¿·¤·¤¤%s¤ò³Ð¤¨¤ë¤³¤È¤Ï¤Ç¤¤Ê¤¤¡ª", p);
657 msg_format("You cannot learn any new %ss!", p);
663 if (p_ptr->special_defense & KATA_MUSOU)
665 set_action(ACTION_NONE);
668 p = spell_categoly_name(mp_ptr->spell_book);
671 if( p_ptr->new_spells < 10 ){
672 msg_format("¤¢¤È %d ¤Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
674 msg_format("¤¢¤È %d ¸Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
677 msg_format("You can learn %d new %s%s.", p_ptr->new_spells, p,
678 (p_ptr->new_spells == 1?"":"s"));
684 /* Restrict choices to "useful" books */
685 if (p_ptr->realm2 == REALM_NONE) item_tester_tval = mp_ptr->spell_book;
686 else item_tester_hook = item_tester_learn_spell;
690 q = "¤É¤ÎËܤ«¤é³Ø¤Ó¤Þ¤¹¤«? ";
692 q = "Study which book? ";
696 s = "Æɤá¤ëËܤ¬¤Ê¤¤¡£";
698 s = "You have no books that you can read.";
701 select_spellbook=TRUE;
702 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
703 select_spellbook=FALSE;
705 /* Get the item (in the pack) */
708 o_ptr = &inventory[item];
711 /* Get the item (on the floor) */
714 o_ptr = &o_list[0 - item];
717 /* Access the item's sval */
720 if (o_ptr->tval == REALM2_BOOK) increment = 32;
721 else if (o_ptr->tval != REALM1_BOOK)
724 if (!get_check("ËÜÅö¤ËËâË¡¤ÎÎΰè¤òÊѹ¹¤·¤Þ¤¹¤«¡©")) return;
726 if (!get_check("Really, change magic realm? ")) return;
728 change_realm2(tval2realm(o_ptr->tval));
732 /* Track the object kind */
733 object_kind_track(o_ptr->k_idx);
735 /* Hack -- Handle stuff */
738 /* Mage -- Learn a selected spell */
739 if (mp_ptr->spell_book != TV_LIFE_BOOK)
741 /* Ask for a spell, allow cancel */
743 if (!get_spell(&spell, "³Ø¤Ö", sval, FALSE, o_ptr->tval - TV_LIFE_BOOK + 1)
744 && (spell == -1)) return;
746 if (!get_spell(&spell, "study", sval, FALSE, o_ptr->tval - TV_LIFE_BOOK + 1)
747 && (spell == -1)) return;
752 /* Priest -- Learn a random prayer */
760 for (spell = 0; spell < 32; spell++)
762 /* Check spells in the book */
763 if ((fake_spell_flags[sval] & (1L << spell)))
765 /* Skip non "okay" prayers */
766 if (!spell_okay(spell, FALSE, TRUE,
767 (increment ? p_ptr->realm2 - 1 : p_ptr->realm1 - 1))) continue;
769 /* Hack -- Prepare the randomizer */
772 /* Hack -- Apply the randomizer */
773 if (one_in_(k)) gift = spell;
781 /* Nothing to study */
786 msg_format("¤½¤ÎËܤˤϳؤ֤٤%s¤¬¤Ê¤¤¡£", p);
788 msg_format("You cannot learn any %ss in that book.", p);
797 if (increment) spell += increment;
799 /* Learn the spell */
802 if (p_ptr->spell_learned1 & (1L << spell)) learned = TRUE;
803 else p_ptr->spell_learned1 |= (1L << spell);
807 if (p_ptr->spell_learned2 & (1L << (spell - 32))) learned = TRUE;
808 else p_ptr->spell_learned2 |= (1L << (spell - 32));
813 int max_exp = (spell < 32) ? 1600 : 1400;
814 int old_exp = p_ptr->spell_exp[spell];
816 cptr name = spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell%32];
818 if (old_exp >= max_exp)
821 msg_format("¤½¤Î%s¤Ï´°Á´¤Ë»È¤¤¤³¤Ê¤»¤ë¤Î¤Ç³Ø¤ÖɬÍפϤʤ¤¡£", spell_categoly_name(mp_ptr->spell_book));
823 msg_format("You don't need to study this %s anymore.", spell_categoly_name(mp_ptr->spell_book));
828 if (!get_check(format("%s¤Î%s¤ò¤µ¤é¤Ë³Ø¤Ó¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©", name, spell_categoly_name(mp_ptr->spell_book))))
830 if (!get_check(format("You will study a %s of %s again. Are you sure? ", spell_categoly_name(mp_ptr->spell_book), name)))
835 else if (old_exp >= 1400)
837 p_ptr->spell_exp[spell] = 1600;
840 else if (old_exp >= 1200)
842 if (spell >= 32) p_ptr->spell_exp[spell] = 1400;
843 else p_ptr->spell_exp[spell] += 200;
846 else if (old_exp >= 900)
848 p_ptr->spell_exp[spell] = 1200+(old_exp-900)*2/3;
853 p_ptr->spell_exp[spell] = 900+(old_exp)/3;
857 msg_format("%s¤Î½ÏÎýÅÙ¤¬%s¤Ë¾å¤¬¤Ã¤¿¡£", name, shougou_moji[new_rank]);
859 msg_format("Your proficiency of %s is now %s rank.", name, shougou_moji[new_rank]);
864 /* Find the next open entry in "p_ptr->spell_order[]" */
865 for (i = 0; i < 64; i++)
867 /* Stop at the first empty space */
868 if (p_ptr->spell_order[i] == 99) break;
871 /* Add the spell to the known list */
872 p_ptr->spell_order[i++] = spell;
874 /* Mention the result */
876 /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½¤ËÂбþ */
877 if (mp_ptr->spell_book == TV_MUSIC_BOOK)
879 msg_format("%s¤ò³Ø¤ó¤À¡£",
880 spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32]);
884 msg_format("%s¤Î%s¤ò³Ø¤ó¤À¡£",
885 spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32] ,p);
888 msg_format("You have learned the %s of %s.",
889 p, spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32]);
896 if (mp_ptr->spell_book == TV_LIFE_BOOK)
897 chg_virtue(V_FAITH, 1);
898 else if (mp_ptr->spell_book == TV_DEATH_BOOK)
899 chg_virtue(V_UNLIFE, 1);
900 else if (mp_ptr->spell_book == TV_NATURE_BOOK)
901 chg_virtue(V_NATURE, 1);
903 chg_virtue(V_KNOWLEDGE, 1);
908 /* One less spell available */
909 p_ptr->learned_spells++;
911 /* Message if needed */
912 if (p_ptr->new_spells)
916 if( p_ptr->new_spells < 10 ){
917 msg_format("¤¢¤È %d ¤Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
919 msg_format("¤¢¤È %d ¸Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
922 msg_format("You can learn %d more %s%s.",
923 p_ptr->new_spells, p,
924 (p_ptr->new_spells != 1) ? "s" : "");
931 p_ptr->update |= (PU_SPELLS);
936 static void wild_magic(int spell)
939 int type = SUMMON_BIZARRE1 + randint0(6);
941 if (type < SUMMON_BIZARRE1) type = SUMMON_BIZARRE1;
942 else if (type > SUMMON_BIZARRE6) type = SUMMON_BIZARRE6;
944 switch (randint1(spell) + randint1(8) + 1)
954 teleport_player(100);
958 teleport_player(200);
968 lite_area(damroll(2, 3), 2);
971 destroy_doors_touch();
976 sleep_monsters_touch();
980 trap_creation(py, px);
989 aggravate_monsters(0);
992 earthquake(py, px, 5);
996 (void)gain_random_mutation(0);
1000 apply_disenchant(1);
1006 fire_ball(GF_CHAOS, 0, spell + 5, 1 + (spell / 10));
1013 while (counter++ < 8)
1015 (void)summon_specific(0, py, px, (dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET));
1020 activate_hi_summon(py, px, FALSE);
1023 (void)summon_cyber(-1, py, px);
1028 (void)activate_ty_curse(FALSE, &count);
1037 static bool cast_life_spell(int spell)
1040 int plev = p_ptr->lev;
1044 case 0: /* Cure Light Wounds */
1045 (void)hp_player(damroll(2, 10));
1046 (void)set_cut(p_ptr->cut - 10);
1049 (void)set_blessed(randint1(12) + 12, FALSE);
1051 case 2: /* Make Light Wounds */
1052 if (!get_aim_dir(&dir)) return FALSE;
1053 fire_ball_hide(GF_WOUNDS, dir, damroll(3 + ((plev - 1) / 5), 4), 0);
1055 case 3: /* Call Light */
1056 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1058 case 4: /* Detect Traps + Secret Doors */
1059 (void)detect_traps(DETECT_RAD_DEFAULT);
1060 (void)detect_doors(DETECT_RAD_DEFAULT);
1061 (void)detect_stairs(DETECT_RAD_DEFAULT);
1063 case 5: /* Cure Medium Wounds */
1064 (void)hp_player(damroll(4, 10));
1065 (void)set_cut((p_ptr->cut / 2) - 20);
1067 case 6: /* Cure Poison */
1068 (void)set_poisoned(0);
1070 case 7: /* Satisfy Hunger */
1071 (void)set_food(PY_FOOD_MAX - 1);
1073 case 8: /* Remove Curse */
1077 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1079 msg_print("You feel as if someone is watching over you.");
1083 case 9: /* Make Medium Wounds */
1084 if (!get_aim_dir(&dir)) return FALSE;
1085 fire_ball_hide(GF_WOUNDS, dir, damroll(8 + ((plev - 5) / 4), 8), 0);
1087 case 10: /* Cure Critical Wounds */
1088 (void)hp_player(damroll(8, 10));
1093 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1094 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1097 map_area(DETECT_RAD_MAP);
1100 (void)turn_undead();
1102 case 14: /* Healing */
1103 (void)hp_player(300);
1107 case 15: /* Glyph of Warding */
1110 case 16: /* Dispel Curse */
1111 if (remove_all_curse())
1114 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1116 msg_print("You feel as if someone is watching over you.");
1120 case 17: /* Perception */
1121 return ident_spell(FALSE, FALSE);
1122 case 18: /* Dispel Undead */
1123 (void)dispel_undead(randint1(plev * 5));
1125 case 19: /* 'Day of the Dove' */
1126 charm_monsters(plev * 2);
1128 case 20: /* Make Critical Wounds */
1129 if (!get_aim_dir(&dir)) return FALSE;
1130 fire_ball_hide(GF_WOUNDS, dir, damroll(5+((plev - 5) / 3), 15), 0);
1132 case 21: /* Word of Recall */
1133 if (!word_of_recall()) return FALSE;
1135 case 22: /* Alter Reality */
1138 case 23: /* Warding True */
1143 num_repro += MAX_REPRO;
1145 case 25: /* Detection True */
1146 (void)detect_all(DETECT_RAD_DEFAULT);
1148 case 26: /* Genocide Undead */
1149 (void)mass_genocide_undead(plev+50,TRUE);
1151 case 27: /* Clairvoyance */
1152 wiz_lite(FALSE, FALSE);
1154 case 28: /* Restoration */
1155 (void)do_res_stat(A_STR);
1156 (void)do_res_stat(A_INT);
1157 (void)do_res_stat(A_WIS);
1158 (void)do_res_stat(A_DEX);
1159 (void)do_res_stat(A_CON);
1160 (void)do_res_stat(A_CHR);
1161 (void)restore_level();
1163 case 29: /* Healing True */
1164 (void)hp_player(2000);
1168 case 30: /* Holy Vision */
1169 return identify_fully(FALSE, FALSE);
1170 case 31: /* Ultimate resistance */
1172 int v = randint1(plev/2)+plev/2;
1173 (void)set_fast(v, FALSE);
1174 set_oppose_acid(v, FALSE);
1175 set_oppose_elec(v, FALSE);
1176 set_oppose_fire(v, FALSE);
1177 set_oppose_cold(v, FALSE);
1178 set_oppose_pois(v, FALSE);
1179 set_ultimate_res(v, FALSE);
1184 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥é¥¤¥Õ¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1186 msg_format("You cast an unknown Life spell: %d.", spell);
1197 static bool cast_sorcery_spell(int spell)
1200 int plev = p_ptr->lev;
1204 case 0: /* Detect Monsters */
1205 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1207 case 1: /* Phase Door */
1208 teleport_player(10);
1210 case 2: /* Detect Doors and Traps */
1211 (void)detect_traps(DETECT_RAD_DEFAULT);
1212 (void)detect_doors(DETECT_RAD_DEFAULT);
1213 (void)detect_stairs(DETECT_RAD_DEFAULT);
1215 case 3: /* Light Area */
1216 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1218 case 4: /* Confuse Monster */
1219 if (!get_aim_dir(&dir)) return FALSE;
1221 (void)confuse_monster(dir, (plev * 3) / 2);
1223 case 5: /* Teleport */
1224 teleport_player(plev * 5);
1226 case 6: /* Sleep Monster */
1227 if (!get_aim_dir(&dir)) return FALSE;
1229 (void)sleep_monster(dir);
1231 case 7: /* Recharging */
1232 return recharge(plev * 4);
1233 case 8: /* Magic Mapping */
1234 map_area(DETECT_RAD_MAP);
1236 case 9: /* Identify */
1237 return ident_spell(FALSE, FALSE);
1238 case 10: /* Slow Monster */
1239 if (!get_aim_dir(&dir)) return FALSE;
1241 (void)slow_monster(dir);
1243 case 11: /* Mass Sleep */
1244 (void)sleep_monsters();
1246 case 12: /* Teleport Away */
1247 if (!get_aim_dir(&dir)) return FALSE;
1249 (void)fire_beam(GF_AWAY_ALL, dir, plev);
1251 case 13: /* Haste Self */
1252 (void)set_fast(randint1(20 + plev) + plev, FALSE);
1254 case 14: /* Detection True */
1255 (void)detect_all(DETECT_RAD_DEFAULT);
1257 case 15: /* Identify True */
1258 return identify_fully(FALSE, FALSE);
1259 case 16: /* Detect Objects and Treasure*/
1260 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
1261 (void)detect_treasure(DETECT_RAD_DEFAULT);
1262 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
1264 case 17: /* Charm Monster */
1265 if (!get_aim_dir(&dir)) return FALSE;
1267 (void)charm_monster(dir, plev);
1269 case 18: /* Sense Minds */
1270 (void)set_tim_esp(randint1(30) + 25, FALSE);
1272 case 19: /* Teleport to town */
1275 case 20: /* Self knowledge */
1276 (void)self_knowledge();
1278 case 21: /* Teleport Level */
1280 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
1282 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
1284 (void)teleport_player_level();
1286 case 22: /* Word of Recall */
1287 if (!word_of_recall()) return FALSE;
1289 case 23: /* Dimension Door */
1291 msg_print("¼¡¸µ¤ÎÈ⤬³«¤¤¤¿¡£ÌÜŪÃϤòÁª¤ó¤Ç²¼¤µ¤¤¡£");
1293 msg_print("You open a dimensional gate. Choose a destination.");
1296 return dimension_door();
1297 case 24: /* Probing */
1300 case 25: /* Explosive Rune */
1303 case 26: /* Telekinesis */
1304 if (!get_aim_dir(&dir)) return FALSE;
1306 fetch(dir, plev * 15, FALSE);
1308 case 27: /* Clairvoyance */
1309 chg_virtue(V_KNOWLEDGE, 1);
1310 chg_virtue(V_ENLIGHTEN, 1);
1312 wiz_lite(FALSE, FALSE);
1313 if (!(p_ptr->telepathy))
1315 (void)set_tim_esp(randint1(30) + 25, FALSE);
1318 case 28: /* Charm Monsters */
1319 charm_monsters(plev * 2);
1321 case 29: /* Alchemy */
1323 case 30: /* Banish */
1324 banish_monsters(plev * 4);
1326 case 31: /* Globe of Invulnerability */
1327 (void)set_invuln(randint1(4) + 4, FALSE);
1331 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥½¡¼¥µ¥ê¡¼¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1333 msg_format("You cast an unknown Sorcery spell: %d.", spell);
1343 static bool cast_nature_spell(int spell)
1347 int plev = p_ptr->lev;
1348 bool no_trump = FALSE;
1350 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1351 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1352 else beam = plev / 2;
1356 case 0: /* Detect Creatures */
1357 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1359 case 1: /* Lightning Bolt */
1360 project_length = plev / 6 + 2;
1361 if (!get_aim_dir(&dir)) return FALSE;
1363 fire_beam(GF_ELEC, dir,
1364 damroll(3 + ((plev - 1) / 5), 4));
1366 case 2: /* Detect Doors & Traps */
1367 (void)detect_traps(DETECT_RAD_DEFAULT);
1368 (void)detect_doors(DETECT_RAD_DEFAULT);
1369 (void)detect_stairs(DETECT_RAD_DEFAULT);
1371 case 3: /* Produce Food */
1372 (void)set_food(PY_FOOD_MAX - 1);
1374 case 4: /* Daylight */
1375 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1376 if ((prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
1379 msg_print("Æü¤Î¸÷¤¬¤¢¤Ê¤¿¤ÎÆùÂΤò¾Ç¤¬¤·¤¿¡ª");
1381 msg_print("The daylight scorches your flesh!");
1385 take_hit(DAMAGE_NOESCAPE, damroll(2, 2), "Æü¤Î¸÷", -1);
1387 take_hit(DAMAGE_NOESCAPE, damroll(2, 2), "daylight", -1);
1392 case 5: /* Animal Taming */
1393 if (!get_aim_dir(&dir)) return FALSE;
1395 (void)charm_animal(dir, plev);
1397 case 6: /* Resist Environment */
1398 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1399 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1400 (void)set_oppose_elec(randint1(20) + 20, FALSE);
1402 case 7: /* Cure Wounds & Poison */
1403 (void)hp_player(damroll(2, 8));
1405 (void)set_poisoned(0);
1407 case 8: /* Stone to Mud */
1408 if (!get_aim_dir(&dir)) return FALSE;
1410 (void)wall_to_mud(dir);
1412 case 9: /* Frost Bolt */
1413 if (!get_aim_dir(&dir)) return FALSE;
1414 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
1415 damroll(3 + ((plev - 5) / 4), 8));
1417 case 10: /* Nature Awareness -- downgraded */
1418 map_area(DETECT_RAD_MAP);
1419 (void)detect_traps(DETECT_RAD_DEFAULT);
1420 (void)detect_doors(DETECT_RAD_DEFAULT);
1421 (void)detect_stairs(DETECT_RAD_DEFAULT);
1422 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1424 case 11: /* Fire Bolt */
1425 if (!get_aim_dir(&dir)) return FALSE;
1426 fire_bolt_or_beam(beam - 10, GF_FIRE, dir,
1427 damroll(5 + ((plev - 5) / 4), 8));
1429 case 12: /* Ray of Sunlight */
1430 if (!get_aim_dir(&dir)) return FALSE;
1432 msg_print("ÂÀÍÛ¸÷Àþ¤¬¸½¤ì¤¿¡£");
1434 msg_print("A line of sunlight appears.");
1437 (void)lite_line(dir);
1439 case 13: /* Entangle */
1442 case 14: /* Summon Animals */
1443 if (!(summon_specific(-1, py, px, plev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET))))
1446 case 15: /* Herbal Healing */
1447 (void)hp_player(500);
1450 (void)set_poisoned(0);
1452 case 16: /* Stair Building */
1453 (void)stair_creation();
1455 case 17: /* Stone Skin */
1456 (void)set_shield(randint1(20) + 30, FALSE);
1458 case 18: /* Resistance True */
1459 (void)set_oppose_acid(randint1(20) + 20, FALSE);
1460 (void)set_oppose_elec(randint1(20) + 20, FALSE);
1461 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1462 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1463 (void)set_oppose_pois(randint1(20) + 20, FALSE);
1465 case 19: /* Tree Creation */
1466 (void)tree_creation();
1468 case 20: /* Animal Friendship */
1469 (void)charm_animals(plev * 2);
1471 case 21: /* Stone Tell */
1472 return identify_fully(FALSE, FALSE);
1473 case 22: /* Wall of Stone */
1476 case 23: /* Protection from Corrosion */
1478 case 24: /* Earthquake */
1479 earthquake(py, px, 10);
1481 case 25: /* Whirlwind Attack */
1485 monster_type *m_ptr;
1487 for (dir = 0; dir < 8; dir++)
1489 y = py + ddy_ddd[dir];
1490 x = px + ddx_ddd[dir];
1491 c_ptr = &cave[y][x];
1493 /* Get the monster */
1494 m_ptr = &m_list[c_ptr->m_idx];
1496 /* Hack -- attack monsters */
1497 if (c_ptr->m_idx && (m_ptr->ml || cave_floor_bold(y, x)))
1502 case 26: /* Blizzard */
1503 if (!get_aim_dir(&dir)) return FALSE;
1505 fire_ball(GF_COLD, dir, 70 + plev * 3 / 2, (plev / 12) + 1);
1507 case 27: /* Lightning Storm */
1508 if (!get_aim_dir(&dir)) return FALSE;
1509 fire_ball(GF_ELEC, dir, 90 + plev * 3 / 2, (plev / 12) + 1);
1511 case 28: /* Whirlpool */
1512 if (!get_aim_dir(&dir)) return FALSE;
1513 fire_ball(GF_WATER, dir, 100 + plev * 3 / 2, (plev / 12) + 1);
1515 case 29: /* Call Sunlight */
1516 fire_ball(GF_LITE, 0, 150, 8);
1517 chg_virtue(V_KNOWLEDGE, 1);
1518 chg_virtue(V_ENLIGHTEN, 1);
1519 wiz_lite(FALSE, FALSE);
1520 if ((prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
1523 msg_print("Æü¸÷¤¬¤¢¤Ê¤¿¤ÎÆùÂΤò¾Ç¤¬¤·¤¿¡ª");
1525 msg_print("The sunlight scorches your flesh!");
1529 take_hit(DAMAGE_NOESCAPE, 50, "Æü¸÷", -1);
1531 take_hit(DAMAGE_NOESCAPE, 50, "sunlight", -1);
1536 case 30: /* Elemental Branding */
1537 brand_weapon(randint0(2));
1539 case 31: /* Nature's Wrath */
1540 (void)dispel_monsters(plev * 4);
1541 earthquake(py, px, 20 + (plev / 2));
1542 project(0, 1 + plev / 12, py, px,
1543 (100 + plev) * 2, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM, -1);
1547 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥Í¥¤¥Á¥ã¡¼¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1549 msg_format("You cast an unknown Nature spell: %d.", spell);
1557 msg_print("ưʪ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
1559 msg_print("No animals arrive.");
1567 static bool cast_chaos_spell(int spell)
1570 int plev = p_ptr->lev;
1572 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1573 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1574 else beam = plev / 2;
1578 case 0: /* Magic Missile */
1579 if (!get_aim_dir(&dir)) return FALSE;
1581 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
1582 damroll(3 + ((plev - 1) / 5), 4));
1584 case 1: /* Trap / Door destruction */
1585 (void)destroy_doors_touch();
1587 case 2: /* Flash of Light == Light Area */
1588 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1590 case 3: /* Touch of Confusion */
1591 if (!(p_ptr->special_attack & ATTACK_CONFUSE))
1594 msg_print("¤¢¤Ê¤¿¤Î¼ê¤Ï¸÷¤ê»Ï¤á¤¿¡£");
1596 msg_print("Your hands start glowing.");
1599 p_ptr->special_attack |= ATTACK_CONFUSE;
1600 p_ptr->redraw |= (PR_STATUS);
1603 case 4: /* Mana Burst */
1604 if (!get_aim_dir(&dir)) return FALSE;
1606 fire_ball(GF_MISSILE, dir,
1607 (damroll(3, 5) + plev +
1608 (plev / (((p_ptr->pclass == CLASS_MAGE)
1609 || (p_ptr->pclass == CLASS_HIGH_MAGE)
1610 || (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
1611 ((plev < 30) ? 2 : 3));
1612 /* Shouldn't actually use GF_MANA, as it will destroy all
1613 * items on the floor */
1615 case 5: /* Fire Bolt */
1616 if (!get_aim_dir(&dir)) return FALSE;
1618 fire_bolt_or_beam(beam, GF_FIRE, dir,
1619 damroll(8 + ((plev - 5) / 4), 8));
1621 case 6: /* Fist of Force ("Fist of Fun") */
1622 if (!get_aim_dir(&dir)) return FALSE;
1624 fire_ball(GF_DISINTEGRATE, dir,
1625 damroll(8 + ((plev - 5) / 4), 8), 0);
1627 case 7: /* Teleport Self */
1628 teleport_player(plev * 5);
1630 case 8: /* Wonder */
1632 /* This spell should become more useful (more
1633 controlled) as the player gains experience levels.
1634 Thus, add 1/5 of the player's level to the die roll.
1635 This eliminates the worst effects later on, while
1636 keeping the results quite random. It also allows
1637 some potent effects only at high level. */
1639 int die = randint1(100) + plev / 5;
1640 int vir = virtue_number(V_CHANCE);
1643 if (p_ptr->virtues[vir - 1] > 0)
1645 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
1649 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
1654 chg_virtue(V_CHANCE, 1);
1656 if (!get_aim_dir(&dir)) return FALSE;
1659 msg_print("¤¢¤Ê¤¿¤ÏÎϤ¬¤ß¤Ê¤®¤ë¤Î¤ò´¶¤¸¤¿¡ª");
1661 msg_print("You feel a surge of power!");
1664 if (die < 8) clone_monster(dir);
1665 else if (die < 14) speed_monster(dir);
1666 else if (die < 26) heal_monster(dir, damroll(4, 6));
1667 else if (die < 31) poly_monster(dir);
1669 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
1670 damroll(3 + ((plev - 1) / 5), 4));
1671 else if (die < 41) confuse_monster(dir, plev);
1672 else if (die < 46) fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
1673 else if (die < 51) (void)lite_line(dir);
1675 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
1676 damroll(3 + ((plev - 5) / 4), 8));
1678 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
1679 damroll(5 + ((plev - 5) / 4), 8));
1681 fire_bolt_or_beam(beam, GF_ACID, dir,
1682 damroll(6 + ((plev - 5) / 4), 8));
1684 fire_bolt_or_beam(beam, GF_FIRE, dir,
1685 damroll(8 + ((plev - 5) / 4), 8));
1686 else if (die < 76) drain_life(dir, 75);
1687 else if (die < 81) fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
1688 else if (die < 86) fire_ball(GF_ACID, dir, 40 + plev, 2);
1689 else if (die < 91) fire_ball(GF_ICE, dir, 70 + plev, 3);
1690 else if (die < 96) fire_ball(GF_FIRE, dir, 80 + plev, 3);
1691 else if (die < 101) drain_life(dir, 100 + plev);
1694 earthquake(py, px, 12);
1698 destroy_area(py, px, 13+randint0(5), TRUE);
1702 symbol_genocide(plev+50, TRUE);
1704 else if (die < 110) dispel_monsters(120);
1707 dispel_monsters(150);
1715 case 9: /* Chaos Bolt */
1716 if (!get_aim_dir(&dir)) return FALSE;
1718 fire_bolt_or_beam(beam, GF_CHAOS, dir,
1719 damroll(10 + ((plev - 5) / 4), 8));
1721 case 10: /* Sonic Boom */
1723 msg_print("¥É¡¼¥ó¡ªÉô²°¤¬Íɤ줿¡ª");
1725 msg_print("BOOM! Shake the room!");
1728 project(0, plev / 10 + 2, py, px,
1729 (60 + plev), GF_SOUND, PROJECT_KILL | PROJECT_ITEM, -1);
1731 case 11: /* Doom Bolt -- always beam in 2.0.7 or later */
1732 if (!get_aim_dir(&dir)) return FALSE;
1734 fire_beam(GF_MANA, dir, damroll(11 + ((plev - 5) / 4), 8));
1736 case 12: /* Fire Ball */
1737 if (!get_aim_dir(&dir)) return FALSE;
1739 fire_ball(GF_FIRE, dir, plev + 55, 2);
1741 case 13: /* Teleport Other */
1742 if (!get_aim_dir(&dir)) return FALSE;
1744 (void)fire_beam(GF_AWAY_ALL, dir, plev);
1746 case 14: /* Word of Destruction */
1747 destroy_area(py, px, 13+randint0(5), TRUE);
1749 case 15: /* Invoke Logrus */
1750 if (!get_aim_dir(&dir)) return FALSE;
1752 fire_ball(GF_CHAOS, dir, plev*2 + 99, plev / 5);
1754 case 16: /* Polymorph Other */
1755 if (!get_aim_dir(&dir)) return FALSE;
1757 (void)poly_monster(dir);
1759 case 17: /* Chain Lightning */
1760 for (dir = 0; dir <= 9; dir++)
1761 fire_beam(GF_ELEC, dir, damroll(5 + (plev / 10), 8));
1763 case 18: /* Arcane Binding == Charging */
1764 return recharge(90);
1765 case 19: /* Disintegration */
1766 if (!get_aim_dir(&dir)) return FALSE;
1768 fire_ball(GF_DISINTEGRATE, dir, plev + 70, 3 + plev / 40);
1770 case 20: /* Alter Reality */
1773 case 21: /* Magic Rocket */
1774 if (!get_aim_dir(&dir)) return FALSE;
1777 msg_print("¥í¥±¥Ã¥Èȯ¼Í¡ª");
1779 msg_print("You launch a rocket!");
1782 fire_rocket(GF_ROCKET, dir, 120 + plev*2, 2);
1784 case 22: /* Chaos Branding */
1787 case 23: /* Summon monster, demon */
1790 bool pet = !one_in_(3);
1792 if (pet) mode |= PM_FORCE_PET;
1793 else mode |= PM_NO_PET;
1794 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
1796 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, SUMMON_DEMON, mode))
1799 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
1801 msg_print("The area fills with a stench of sulphur and brimstone.");
1807 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
1809 msg_print("'What is thy bidding... Master?'");
1814 msg_print("¡ÖÈܤ·¤¼Ô¤è¡¢²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª ¤ªÁ°¤Îº²¤òĺ¤¯¤¾¡ª¡×");
1816 msg_print("'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'");
1822 case 24: /* Beam of Gravity */
1823 if (!get_aim_dir(&dir)) return FALSE;
1825 fire_beam(GF_GRAVITY, dir, damroll(9 + ((plev - 5) / 4), 8));
1827 case 25: /* Meteor Swarm */
1830 int b = 10 + randint1(10);
1831 for (i = 0; i < b; i++)
1833 int count = 0, d = 0;
1838 if (count > 20) break;
1839 x = px - 8 + randint0(17);
1840 y = py - 8 + randint0(17);
1842 if (!in_bounds(y,x) || (!cave_floor_bold(y,x) && (cave[y][x].feat != FEAT_TREES)) || !player_has_los_bold(y, x)) continue;
1844 dx = (px > x) ? (px - x) : (x - px);
1845 dy = (py > y) ? (py - y) : (y - py);
1847 /* Approximate distance */
1848 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
1852 if (count > 20) continue;
1854 project(0, 2, y, x, plev * 2, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
1858 case 26: /* Flame Strike */
1859 fire_ball(GF_FIRE, 0, 300 + (3 * plev), 8);
1861 case 27: /* Call Chaos */
1864 case 28: /* Polymorph Self */
1866 if (!get_check("ÊѿȤ·¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©")) return FALSE;
1868 if (!get_check("You will polymorph yourself. Are you sure? ")) return FALSE;
1872 case 29: /* Mana Storm */
1873 if (!get_aim_dir(&dir)) return FALSE;
1875 fire_ball(GF_MANA, dir, 300 + (plev * 4), 4);
1877 case 30: /* Breathe Logrus */
1878 if (!get_aim_dir(&dir)) return FALSE;
1880 fire_ball(GF_CHAOS, dir, p_ptr->chp, 2);
1882 case 31: /* Call the Void */
1887 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥«¥ª¥¹¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1889 msg_format("You cast an unknown Chaos spell: %d.", spell);
1899 static bool cast_death_spell(int spell)
1903 int plev = p_ptr->lev;
1906 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1907 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1908 else beam = plev / 2;
1912 case 0: /* Detect Undead & Demons -> Unlife */
1913 (void)detect_monsters_nonliving(DETECT_RAD_DEFAULT);
1915 case 1: /* Malediction */
1916 if (!get_aim_dir(&dir)) return FALSE;
1917 /* A radius-0 ball may (1) be aimed at objects etc.,
1918 * and will affect them; (2) may be aimed at ANY
1919 * visible monster, unlike a 'bolt' which must travel
1920 * to the monster. */
1922 fire_ball(GF_HELL_FIRE, dir,
1923 damroll(3 + ((plev - 1) / 5), 4), 0);
1926 { /* Special effect first */
1927 dummy = randint1(1000);
1929 fire_ball_hide(GF_DEATH_RAY, dir, plev * 200, 0);
1930 else if (dummy < 500)
1931 fire_ball_hide(GF_TURN_ALL, dir, plev, 0);
1932 else if (dummy < 800)
1933 fire_ball_hide(GF_OLD_CONF, dir, plev, 0);
1935 fire_ball_hide(GF_STUN, dir, plev, 0);
1938 case 2: /* Detect Evil */
1939 (void)detect_monsters_evil(DETECT_RAD_DEFAULT);
1941 case 3: /* Stinking Cloud */
1942 if (!get_aim_dir(&dir)) return FALSE;
1944 fire_ball(GF_POIS, dir, 10 + (plev / 2), 2);
1946 case 4: /* Black Sleep */
1947 if (!get_aim_dir(&dir)) return FALSE;
1949 (void)sleep_monster(dir);
1951 case 5: /* Resist Poison */
1952 (void)set_oppose_pois(randint1(20) + 20, FALSE);
1954 case 6: /* Horrify */
1955 if (!get_aim_dir(&dir)) return FALSE;
1957 (void)fear_monster(dir, plev);
1958 (void)stun_monster(dir, plev);
1960 case 7: /* Enslave Undead */
1961 if (!get_aim_dir(&dir)) return FALSE;
1963 (void)control_one_undead(dir, plev);
1965 case 8: /* Orb of Entropy */
1966 if (!get_aim_dir(&dir)) return FALSE;
1968 fire_ball(GF_OLD_DRAIN, dir,
1969 (damroll(3, 6) + plev +
1970 (plev / (((p_ptr->pclass == CLASS_MAGE) ||
1971 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
1972 (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
1973 ((plev < 30) ? 2 : 3));
1975 case 9: /* Nether Bolt */
1976 if (!get_aim_dir(&dir)) return FALSE;
1978 fire_bolt_or_beam(beam, GF_NETHER, dir,
1979 damroll(8 + ((plev - 5) / 4), 8));
1981 case 10: /* Cloud kill */
1982 project(0, plev / 10 + 2, py, px,
1983 (30 + plev) * 2, GF_POIS, PROJECT_KILL | PROJECT_ITEM, -1);
1985 case 11: /* Genocide One */
1986 if (!get_aim_dir(&dir)) return FALSE;
1988 fire_ball_hide(GF_GENOCIDE, dir, plev + 50, 0);
1990 case 12: /* Poison Branding */
1993 case 13: /* Vampiric Drain */
1994 if (!get_aim_dir(&dir)) return FALSE;
1996 dummy = plev * 2 + randint1(plev * 2); /* Dmg */
1997 if (drain_life(dir, dummy))
1999 chg_virtue(V_SACRIFICE, -1);
2000 chg_virtue(V_VITALITY, -1);
2002 (void)hp_player(dummy);
2003 /* Gain nutritional sustenance: 150/hp drained */
2004 /* A Food ration gives 5000 food points (by contrast) */
2005 /* Don't ever get more than "Full" this way */
2006 /* But if we ARE Gorged, it won't cure us */
2007 dummy = p_ptr->food + MIN(5000, 100 * dummy);
2008 if (p_ptr->food < PY_FOOD_MAX) /* Not gorged already */
2009 (void)set_food(dummy >= PY_FOOD_MAX ? PY_FOOD_MAX - 1 : dummy);
2012 case 14: /* Animate Dead */
2013 animate_dead(0, py, px);
2015 case 15: /* Genocide */
2016 (void)symbol_genocide(plev+50, TRUE);
2018 case 16: /* Berserk */
2019 (void)set_shero(randint1(25) + 25, FALSE);
2020 (void)hp_player(30);
2021 (void)set_afraid(0);
2023 case 17: /* Invoke Spirits */
2025 int die = randint1(100) + plev / 5;
2026 int vir = virtue_number(V_CHANCE);
2029 if (p_ptr->virtues[vir - 1] > 0)
2031 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
2035 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
2039 if (!get_aim_dir(&dir)) return FALSE;
2042 msg_print("¤¢¤Ê¤¿¤Ï»à¼Ô¤¿¤Á¤ÎÎϤò¾·½¸¤·¤¿...");
2044 msg_print("You call on the power of the dead...");
2047 chg_virtue(V_CHANCE, 1);
2051 msg_print("¤¢¤Ê¤¿¤Ï¤ª¤É¤í¤ª¤É¤í¤·¤¤ÎϤΤ¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
2053 msg_print("You feel a surge of eldritch force!");
2060 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¤¢¤Ê¤¿¤Î¼þ¤ê¤ÎÃÏÌ̤«¤éµà¤Á¤¿¿Í±Æ¤¬Î©¤Á¾å¤¬¤Ã¤Æ¤¤¿¡ª");
2062 msg_print("Oh no! Mouldering forms rise from the earth around you!");
2065 (void)summon_specific(0, py, px, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
2066 chg_virtue(V_UNLIFE, 1);
2071 msg_print("̾¾õ¤·Æñ¤¤¼Ù°¤Ê¸ºß¤¬¤¢¤Ê¤¿¤Î¿´¤òÄ̤ê²á¤®¤Æ¹Ô¤Ã¤¿...");
2073 msg_print("An unnamable evil brushes against your mind...");
2076 set_afraid(p_ptr->afraid + randint1(4) + 4);
2081 msg_print("¤¢¤Ê¤¿¤ÎƬ¤ËÂçÎ̤ÎÍ©Î¤Á¤ÎÁû¡¹¤·¤¤À¼¤¬²¡¤·´ó¤»¤Æ¤¤¿...");
2083 msg_print("Your head is invaded by a horde of gibbering spectral voices...");
2086 set_confused(p_ptr->confused + randint1(4) + 4);
2094 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
2095 damroll(3 + ((plev - 1) / 5), 4));
2099 confuse_monster (dir, plev);
2103 fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
2107 (void)lite_line(dir);
2111 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
2112 damroll(3+((plev-5)/4),8));
2116 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
2117 damroll(5+((plev-5)/4),8));
2121 fire_bolt_or_beam(beam, GF_ACID, dir,
2122 damroll(6+((plev-5)/4),8));
2126 fire_bolt_or_beam(beam, GF_FIRE, dir,
2127 damroll(8+((plev-5)/4),8));
2131 drain_life(dir, 75);
2135 fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
2139 fire_ball(GF_ACID, dir, 40 + plev, 2);
2143 fire_ball(GF_ICE, dir, 70 + plev, 3);
2147 fire_ball(GF_FIRE, dir, 80 + plev, 3);
2151 drain_life(dir, 100 + plev);
2155 earthquake(py, px, 12);
2159 destroy_area(py, px, 13+randint0(5), TRUE);
2163 symbol_genocide(plev+50, TRUE);
2167 dispel_monsters(120);
2171 dispel_monsters(150);
2179 msg_print("±¢±µ¤ÊÀ¼¤¬¥¯¥¹¥¯¥¹¾Ð¤¦¡£¡Ö¤â¤¦¤¹¤°¤ª¤Þ¤¨¤Ï²æ¡¹¤ÎÃç´Ö¤Ë¤Ê¤ë¤À¤í¤¦¡£¼å¤¼Ô¤è¡£¡×");
2181 msg_print("Sepulchral voices chuckle. 'Soon you will join us, mortal.'");
2186 case 18: /* Dark Bolt */
2187 if (!get_aim_dir(&dir)) return FALSE;
2189 fire_bolt_or_beam(beam, GF_DARK, dir,
2190 damroll(4 + ((plev - 5) / 4), 8));
2192 case 19: /* Battle Frenzy */
2193 (void)set_shero(randint1(25) + 25, FALSE);
2194 (void)hp_player(30);
2195 (void)set_afraid(0);
2196 (void)set_fast(randint1(20 + (plev / 2)) + (plev / 2), FALSE);
2198 case 20: /* Vampiric Branding */
2201 case 21: /* Vampirism True */
2202 if (!get_aim_dir(&dir)) return FALSE;
2204 chg_virtue(V_SACRIFICE, -1);
2205 chg_virtue(V_VITALITY, -1);
2207 for (dummy = 0; dummy < 3; dummy++)
2209 if (drain_life(dir, 100))
2213 case 22: /* Word of Death */
2214 (void)dispel_living(randint1(plev * 3));
2216 case 23: /* Darkness Storm */
2217 if (!get_aim_dir(&dir)) return FALSE;
2219 fire_ball(GF_DARK, dir, 100+plev*2, 4);
2221 case 24: /* Death Ray */
2222 if (!get_aim_dir(&dir)) return FALSE;
2224 (void)death_ray(dir, plev);
2226 case 25: /* Raise the Dead */
2229 bool pet = one_in_(3);
2232 type = (plev > 47 ? SUMMON_HI_UNDEAD : SUMMON_UNDEAD);
2234 if (!pet || (pet && (plev > 24) && one_in_(3)))
2235 mode |= PM_ALLOW_GROUP;
2237 if (pet) mode |= PM_FORCE_PET;
2238 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
2240 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, type, mode))
2243 msg_print("Î䤿¤¤É÷¤¬¤¢¤Ê¤¿¤Î¼þ¤ê¤Ë¿á¤»Ï¤á¤¿¡£¤½¤ì¤ÏÉåÇÔ½¤ò±¿¤ó¤Ç¤¤¤ë...");
2245 msg_print("Cold winds begin to blow around you, carrying with them the stench of decay...");
2251 msg_print("¸Å¤¨¤Î»à¤»¤ë¼Ô¶¦¤¬¤¢¤Ê¤¿¤Ë»Å¤¨¤ë¤¿¤áÅÚ¤«¤éᴤä¿¡ª");
2253 msg_print("Ancient, long-dead forms arise from the ground to serve you!");
2258 msg_print("»à¼Ô¤¬á´¤Ã¤¿¡£Ì²¤ê¤ò˸¤²¤ë¤¢¤Ê¤¿¤òȳ¤¹¤ë¤¿¤á¤Ë¡ª");
2260 msg_print("'The dead arise... to punish you for disturbing them!'");
2263 chg_virtue(V_UNLIFE, 1);
2268 case 26: /* Esoteria */
2269 if (randint1(50) > plev)
2270 return ident_spell(FALSE, FALSE);
2272 return identify_fully(FALSE, FALSE);
2274 case 27: /* Mimic vampire */
2275 (void)set_mimic(10+plev/2 + randint1(10+plev/2), MIMIC_VAMPIRE, FALSE);
2277 case 28: /* Restore Life */
2278 (void)restore_level();
2280 case 29: /* Mass Genocide */
2281 (void)mass_genocide(plev+50, TRUE);
2283 case 30: /* Hellfire */
2284 if (!get_aim_dir(&dir)) return FALSE;
2286 fire_ball(GF_HELL_FIRE, dir, 666, 3);
2288 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "ÃϹö¤Î¹å²Ð¤Î¼öʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
2290 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "the strain of casting Hellfire", -1);
2294 case 31: /* Wraithform */
2295 set_wraith_form(randint1(plev / 2) + (plev / 2), FALSE);
2298 msg_format("You cast an unknown Death spell: %d.", spell);
2306 static bool cast_trump_spell(int spell, bool success)
2310 int plev = p_ptr->lev;
2311 int summon_lev = plev * 2 / 3 + randint1(plev/2);
2313 bool no_trump = FALSE;
2314 bool unique_okay = FALSE;
2317 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
2318 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
2319 else beam = plev / 2;
2321 if (summon_lev < 1) summon_lev = 1;
2322 if (!success || (randint1(50+plev) < plev/10)) unique_okay = TRUE;
2325 case 0: /* Phase Door */
2328 teleport_player(10);
2331 case 1: /* Trump Spiders */
2333 bool pet = success; /* (randint1(5) > 2) */
2334 u32b mode = PM_ALLOW_GROUP;
2336 if (pet) mode |= PM_FORCE_PET;
2337 else mode |= PM_NO_PET;
2340 msg_print("¤¢¤Ê¤¿¤ÏÃØéá¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2342 msg_print("You concentrate on the trump of an spider...");
2345 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_SPIDER, mode))
2349 msg_print("¾¤´Ô¤µ¤ì¤¿ÃØéá¤ÏÅܤäƤ¤¤ë¡ª");
2351 msg_print("The summoned spiders get angry!");
2361 case 2: /* Shuffle */
2364 /* A limited power 'wonder' spell */
2365 int die = randint1(120);
2366 int vir = virtue_number(V_CHANCE);
2368 if ((p_ptr->pclass == CLASS_ROGUE) ||
2369 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
2370 (p_ptr->pclass == CLASS_SORCERER))
2371 die = (randint1(110)) + plev / 5;
2372 /* Card sharks and high mages get a level bonus */
2376 if (p_ptr->virtues[vir - 1] > 0)
2378 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
2382 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
2387 msg_print("¤¢¤Ê¤¿¤Ï¥«¡¼¥É¤òÀڤäưìËç°ú¤¤¤¿...");
2389 msg_print("You shuffle the deck and draw a card...");
2393 chg_virtue(V_CHANCE, 1);
2398 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡Ô»à¡Õ¤À¡ª");
2400 msg_print("Oh no! It's Death!");
2403 for (dummy = 0; dummy < randint1(3); dummy++)
2404 (void)activate_hi_summon(py, px, FALSE);
2409 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡Ô°Ëâ¡Õ¤À¡ª");
2411 msg_print("Oh no! It's the Devil!");
2414 (void)summon_specific(0, py, px, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
2420 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡ÔÄߤé¤ì¤¿ÃË¡Õ¤À¡ª");
2422 msg_print("Oh no! It's the Hanged Man.");
2425 (void)activate_ty_curse(FALSE, &count);
2430 msg_print("¡ÔÉÔĴϤηõ¡Õ¤À¡£");
2432 msg_print("It's the swords of discord.");
2435 aggravate_monsters(0);
2440 msg_print("¡Ô¶ò¼Ô¡Õ¤À¡£");
2442 msg_print("It's the Fool.");
2445 (void)do_dec_stat(A_INT);
2446 (void)do_dec_stat(A_WIS);
2451 msg_print("´ñ̯¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2453 msg_print("It's the picture of a strange monster.");
2456 if (!(summon_specific(0, py, px, (dun_level * 3) / 2, 32 + randint1(6), (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET))))
2462 msg_print("¡Ô·î¡Õ¤À¡£");
2464 msg_print("It's the Moon.");
2472 msg_print("¡Ô±¿Ì¿¤ÎÎØ¡Õ¤À¡£");
2474 msg_print("It's the Wheel of Fortune.");
2477 wild_magic(randint0(32));
2482 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2484 msg_print("It's a teleport trump card.");
2487 teleport_player(10);
2492 msg_print("¡ÔÀµµÁ¡Õ¤À¡£");
2494 msg_print("It's Justice.");
2497 set_blessed(p_ptr->lev, FALSE);
2502 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2504 msg_print("It's a teleport trump card.");
2507 teleport_player(100);
2512 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2514 msg_print("It's a teleport trump card.");
2517 teleport_player(200);
2522 msg_print("¡ÔÅã¡Õ¤À¡£");
2524 msg_print("It's the Tower.");
2532 msg_print("¡ÔÀáÀ©¡Õ¤À¡£");
2534 msg_print("It's Temperance.");
2537 sleep_monsters_touch();
2542 msg_print("¡ÔÅã¡Õ¤À¡£");
2544 msg_print("It's the Tower.");
2547 earthquake(py, px, 5);
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_BIZARRE1, PM_FORCE_PET)))
2563 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2565 msg_print("It's the picture of a friendly monster.");
2568 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE2, PM_FORCE_PET)))
2574 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2576 msg_print("It's the picture of a friendly monster.");
2579 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE4, PM_FORCE_PET)))
2585 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2587 msg_print("It's the picture of a friendly monster.");
2590 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE5, PM_FORCE_PET)))
2596 msg_print("¡ÔÎø¿Í¡Õ¤À¡£");
2598 msg_print("It's the Lovers.");
2601 if (get_aim_dir(&dir))
2602 (void)charm_monster(dir, MIN(p_ptr->lev, 20));
2607 msg_print("¡Ô±£¼Ô¡Õ¤À¡£");
2609 msg_print("It's the Hermit.");
2617 msg_print("¡Ô¿³È½¡Õ¤À¡£");
2619 msg_print("It's the Judgement.");
2622 do_cmd_rerate(FALSE);
2623 if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3)
2626 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
2628 msg_print("You are cured of all mutations.");
2631 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
2632 p_ptr->update |= PU_BONUS;
2639 msg_print("¡ÔÂÀÍÛ¡Õ¤À¡£");
2641 msg_print("It's the Sun.");
2644 chg_virtue(V_KNOWLEDGE, 1);
2645 chg_virtue(V_ENLIGHTEN, 1);
2646 wiz_lite(FALSE, FALSE);
2651 msg_print("¡ÔÀ¤³¦¡Õ¤À¡£");
2653 msg_print("It's the World.");
2656 if (p_ptr->exp < PY_MAX_EXP)
2658 s32b ee = (p_ptr->exp / 25) + 1;
2659 if (ee > 5000) ee = 5000;
2661 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
2663 msg_print("You feel more experienced.");
2671 case 3: /* Reset Recall */
2674 if (!reset_recall()) return FALSE;
2677 case 4: /* Teleport Self */
2680 teleport_player(plev * 4);
2683 case 5: /* Trump Spying */
2686 (void)set_tim_esp(randint1(30) + 25, FALSE);
2689 case 6: /* Teleport Away */
2692 if (!get_aim_dir(&dir)) return FALSE;
2693 (void)fire_beam(GF_AWAY_ALL, dir, plev);
2696 case 7: /* Trump Animals */
2698 bool pet = success; /* was (randint1(5) > 2) */
2699 int type = (pet ? SUMMON_ANIMAL_RANGER : SUMMON_ANIMAL);
2702 if (pet) mode |= PM_FORCE_PET;
2703 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2706 msg_print("¤¢¤Ê¤¿¤Ïưʪ¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2708 msg_print("You concentrate on the trump of an animal...");
2712 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
2716 msg_print("¾¤´¤µ¤ì¤¿Æ°Êª¤ÏÅܤäƤ¤¤ë¡ª");
2718 msg_print("The summoned animal gets angry!");
2729 case 8: /* Trump Reach */
2732 if (!get_aim_dir(&dir)) return FALSE;
2733 fetch(dir, plev * 15, TRUE);
2736 case 9: /* Trump Kamikaze */
2741 if (!target_set(TARGET_KILL)) return FALSE;
2748 msg_print("¤¢¤Ê¤¿¤Ï¥«¥ß¥«¥¼¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2750 msg_print("You concentrate on several trumps at once...");
2754 for (dummy = 2 + randint0(plev / 7); dummy > 0; dummy--)
2756 bool pet = success; /* was (randint1(10) > 3) */
2760 if (pet) mode |= PM_FORCE_PET;
2761 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2763 if (p_ptr->pclass == CLASS_BEASTMASTER)
2765 type = SUMMON_KAMIKAZE_LIVING;
2769 type = SUMMON_KAMIKAZE;
2772 if (summon_specific((pet ? -1 : 0), y, x, summon_lev, type, mode))
2776 msg_print("¾¤´Ô¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
2778 msg_print("The summoned creatures get angry!");
2786 case 10: /* Phantasmal Servant */
2789 if (summon_specific(-1, py, px, (summon_lev * 3) / 2, SUMMON_PHANTOM, PM_FORCE_PET))
2792 msg_print("¸æÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¸æ¼ç¿ÍÍÍ¡©");
2794 msg_print("'Your wish, master?'");
2804 case 11: /* Speed Monster */
2807 bool old_target_pet = target_pet;
2809 if (!get_aim_dir(&dir))
2811 target_pet = old_target_pet;
2814 target_pet = old_target_pet;
2815 (void)speed_monster(dir);
2818 case 12: /* Teleport Level */
2822 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
2824 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
2826 (void)teleport_player_level();
2829 case 13: /* Dimension Door */
2833 msg_print("¼¡¸µ¤ÎÈ⤬³«¤¤¤¿¡£ÌÜŪÃϤòÁª¤ó¤Ç²¼¤µ¤¤¡£");
2835 msg_print("You open a dimensional gate. Choose a destination.");
2838 return dimension_door();
2841 case 14: /* Word of Recall */
2844 if (!word_of_recall()) return FALSE;
2847 case 15: /* Banish */
2850 banish_monsters(plev * 4);
2853 case 16: /* Swap Position */
2857 project_length = -1;
2858 if (!get_aim_dir(&dir))
2865 (void)teleport_swap(dir);
2869 case 17: /* Trump Undead */
2871 bool pet = success; /* (randint1(10) > 3) */
2874 if (pet) mode |= PM_FORCE_PET;
2875 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2878 msg_print("¤¢¤Ê¤¿¤Ï¥¢¥ó¥Ç¥Ã¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2880 msg_print("You concentrate on the trump of an undead creature...");
2884 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_UNDEAD, mode))
2888 msg_print("¾¤´Ô¤µ¤ì¤¿¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
2890 msg_print("The summoned undead creature gets angry!");
2901 case 18: /* Trump Reptiles */
2903 bool pet = success; /* was (randint1(5) > 2) */
2906 if (pet) mode |= PM_FORCE_PET;
2907 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2910 msg_print("¤¢¤Ê¤¿¤Ïà¨ÃîÎà¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2912 msg_print("You concentrate on the trump of a reptile...");
2916 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HYDRA, mode))
2920 msg_print("¾¤´Ô¤µ¤ì¤¿à¨ÃîÎà¤ÏÅܤäƤ¤¤ë¡ª");
2922 msg_print("The summoned reptile gets angry!");
2933 case 19: /* Trump Monsters */
2938 msg_print("¤¢¤Ê¤¿¤Ï¥â¥ó¥¹¥¿¡¼¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2940 msg_print("You concentrate on several trumps at once...");
2944 for (dummy = 0; dummy < 1 + ((plev - 15)/ 10); dummy++)
2946 bool pet = success; /* was (randint1(10) > 3) */
2950 if (pet) mode |= PM_FORCE_PET;
2951 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2953 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
2955 if (p_ptr->pclass == CLASS_BEASTMASTER)
2957 type = SUMMON_LIVING;
2964 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
2968 msg_print("¾¤´Ô¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
2970 msg_print("The summoned creatures get angry!");
2978 case 20: /* Trump Hounds */
2980 bool pet = success; /* was (randint1(5) > 2) */
2981 u32b mode = PM_ALLOW_GROUP;
2983 if (pet) mode |= PM_FORCE_PET;
2984 else mode |= PM_NO_PET;
2987 msg_print("¤¢¤Ê¤¿¤Ï¥Ï¥¦¥ó¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2989 msg_print("You concentrate on the trump of a hound...");
2993 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HOUND, mode))
2997 msg_print("¾¤´Ô¤µ¤ì¤¿¥Ï¥¦¥ó¥É¤ÏÅܤäƤ¤¤ë¡ª");
2999 msg_print("The summoned hounds get angry!");
3010 case 21: /* Trump Branding */
3016 case 22: /* Living Trump */
3020 /* Teleport control */
3023 /* Random teleportation (uncontrolled) */
3025 /* Gain the mutation */
3026 if (gain_random_mutation(dummy))
3028 msg_print("¤¢¤Ê¤¿¤ÏÀ¸¤¤Æ¤¤¤ë¥«¡¼¥É¤ËÊѤï¤Ã¤¿¡£");
3030 msg_print("You have turned into a Living Trump.");
3035 case 23: /* Trump Cyberdemon */
3037 bool pet = success; /* was (randint1(10) > 3) */
3040 if (pet) mode |= PM_FORCE_PET;
3041 else mode |= PM_NO_PET;
3044 msg_print("¤¢¤Ê¤¿¤Ï¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3046 msg_print("You concentrate on the trump of a Cyberdemon...");
3050 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_CYBER, mode))
3054 msg_print("¾¤´Ô¤µ¤ì¤¿¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3056 msg_print("The summoned Cyberdemon gets angry!");
3067 case 24: /* Trump Divination */
3070 (void)detect_all(DETECT_RAD_DEFAULT);
3073 case 25: /* Trump Lore */
3076 return identify_fully(FALSE, FALSE);
3079 case 26: /* Heal Monster */
3082 bool old_target_pet = target_pet;
3084 if (!get_aim_dir(&dir))
3086 target_pet = old_target_pet;
3089 target_pet = old_target_pet;
3091 (void)heal_monster(dir, p_ptr->lev * 10 + 200);
3094 case 27: /* Trump Dragon */
3096 bool pet = success; /* was (randint1(10) > 3) */
3099 if (pet) mode |= PM_FORCE_PET;
3100 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3103 msg_print("¤¢¤Ê¤¿¤Ï¥É¥é¥´¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3105 msg_print("You concentrate on the trump of a dragon...");
3109 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DRAGON, mode))
3113 msg_print("¾¤´Ô¤µ¤ì¤¿¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3115 msg_print("The summoned dragon gets angry!");
3126 case 28: /* Trump Meteor */
3129 int x, y, dx, dy, i;
3130 int b = 10 + randint1(10);
3131 for (i = 0; i < b; i++)
3133 int count = 0, d = 0;
3138 if (count > 20) break;
3139 x = px - 8 + randint0(17);
3140 y = py - 8 + randint0(17);
3142 if (!in_bounds(y,x) || (!cave_floor_bold(y,x) && (cave[y][x].feat != FEAT_TREES)) || !player_has_los_bold(y, x)) continue;
3144 dx = (px > x) ? (px - x) : (x - px);
3145 dy = (py > y) ? (py - y) : (y - py);
3147 /* Approximate distance */
3148 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
3152 if (count > 20) continue;
3154 project(0, 2, y, x, plev * 2, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
3158 case 29: /* Trump Demon */
3160 bool pet = success; /* was (randint1(10) > 3) */
3163 if (pet) mode |= PM_FORCE_PET;
3164 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3167 msg_print("¤¢¤Ê¤¿¤Ï¥Ç¡¼¥â¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3169 msg_print("You concentrate on the trump of a demon...");
3173 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DEMON, mode))
3177 msg_print("¾¤´Ô¤µ¤ì¤¿¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3179 msg_print("The summoned demon gets angry!");
3190 case 30: /* Trump Greater Undead */
3192 bool pet = success; /* was (randint1(10) > 3) */
3195 if (pet) mode |= PM_FORCE_PET;
3196 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3198 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
3201 msg_print("¤¢¤Ê¤¿¤Ï¶¯ÎϤʥ¢¥ó¥Ç¥Ã¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3203 msg_print("You concentrate on the trump of a greater undead being...");
3207 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HI_UNDEAD, mode))
3211 msg_print("¾¤´Ô¤µ¤ì¤¿¾åµé¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
3213 msg_print("The summoned greater undead creature gets angry!");
3224 case 31: /* Trump Ancient Dragon */
3226 bool pet = success; /* was (randint1(10) > 3) */
3230 if (pet) mode |= PM_FORCE_PET;
3231 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3233 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
3235 if (p_ptr->pclass == CLASS_BEASTMASTER)
3237 type = SUMMON_HI_DRAGON_LIVING;
3241 type = SUMMON_HI_DRAGON;
3245 msg_print("¤¢¤Ê¤¿¤Ï¸ÅÂå¥É¥é¥´¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3247 msg_print("You concentrate on the trump of an ancient dragon...");
3251 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
3255 msg_print("¾¤´Ô¤µ¤ì¤¿¸ÅÂå¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3257 msg_print("The summoned ancient dragon gets angry!");
3270 msg_format("̤ÃΤΥ«¡¼¥É¤Î¼öʸ¤Ç¤¹: %d", spell);
3272 msg_format("You cast an unknown Trump spell: %d.", spell);
3281 msg_print("ï¤â¤¢¤Ê¤¿¤Î¥«¡¼¥É¤Î¸Æ¤ÓÀ¼¤ËÅú¤¨¤Ê¤¤¡£");
3283 msg_print("Nobody answers to your Trump call.");
3292 static bool cast_arcane_spell(int spell)
3296 int plev = p_ptr->lev;
3298 bool no_trump = FALSE;
3300 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3301 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3302 else beam = plev / 2;
3307 if (!get_aim_dir(&dir)) return FALSE;
3309 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
3310 damroll(3 + ((plev - 1) / 5), 3));
3312 case 1: /* Wizard Lock */
3313 if (!get_aim_dir(&dir)) return FALSE;
3315 (void)wizard_lock(dir);
3317 case 2: /* Detect Invisibility */
3318 (void)detect_monsters_invis(DETECT_RAD_DEFAULT);
3320 case 3: /* Detect Monsters */
3321 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
3324 teleport_player(10);
3326 case 5: /* Light Area */
3327 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
3329 case 6: /* Trap & Door Destruction */
3330 if (!get_aim_dir(&dir)) return FALSE;
3332 (void)destroy_door(dir);
3334 case 7: /* Cure Light Wounds */
3335 (void)hp_player(damroll(2, 8));
3336 (void)set_cut(p_ptr->cut - 10);
3338 case 8: /* Detect Doors & Traps */
3339 (void)detect_traps(DETECT_RAD_DEFAULT);
3340 (void)detect_doors(DETECT_RAD_DEFAULT);
3341 (void)detect_stairs(DETECT_RAD_DEFAULT);
3343 case 9: /* Phlogiston */
3346 case 10: /* Detect Treasure */
3347 (void)detect_treasure(DETECT_RAD_DEFAULT);
3348 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
3350 case 11: /* Detect Enchantment */
3351 (void)detect_objects_magic(DETECT_RAD_DEFAULT);
3353 case 12: /* Detect Objects */
3354 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
3356 case 13: /* Cure Poison */
3357 (void)set_poisoned(0);
3359 case 14: /* Resist Cold */
3360 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3362 case 15: /* Resist Fire */
3363 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3365 case 16: /* Resist Lightning */
3366 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3368 case 17: /* Resist Acid */
3369 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3371 case 18: /* Cure Medium Wounds */
3372 (void)hp_player(damroll(4, 8));
3373 (void)set_cut((p_ptr->cut / 2) - 50);
3375 case 19: /* Teleport */
3376 teleport_player(plev * 5);
3378 case 20: /* Identify */
3379 return ident_spell(FALSE, FALSE);
3380 case 21: /* Stone to Mud */
3381 if (!get_aim_dir(&dir)) return FALSE;
3383 (void)wall_to_mud(dir);
3385 case 22: /* Ray of Light */
3386 if (!get_aim_dir(&dir)) return FALSE;
3389 msg_print("¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
3391 msg_print("A line of light appears.");
3394 (void)lite_line(dir);
3396 case 23: /* Satisfy Hunger */
3397 (void)set_food(PY_FOOD_MAX - 1);
3399 case 24: /* See Invisible */
3400 (void)set_tim_invis(randint1(24) + 24, FALSE);
3402 case 25: /* Conjure Elemental */
3403 if (!summon_specific(-1, py, px, plev, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3406 case 26: /* Teleport Level */
3408 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
3410 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
3412 (void)teleport_player_level();
3414 case 27: /* Teleport Away */
3415 if (!get_aim_dir(&dir)) return FALSE;
3417 (void)fire_beam(GF_AWAY_ALL, dir, plev);
3419 case 28: /* Elemental Ball */
3420 if (!get_aim_dir(&dir)) return FALSE;
3422 switch (randint1(4))
3424 case 1: dummy = GF_FIRE;break;
3425 case 2: dummy = GF_ELEC;break;
3426 case 3: dummy = GF_COLD;break;
3427 default: dummy = GF_ACID;break;
3429 fire_ball(dummy, dir, 75 + (plev), 2);
3431 case 29: /* Detection */
3432 (void)detect_all(DETECT_RAD_DEFAULT);
3434 case 30: /* Word of Recall */
3435 if (!word_of_recall()) return FALSE;
3437 case 31: /* Clairvoyance */
3438 chg_virtue(V_KNOWLEDGE, 1);
3439 chg_virtue(V_ENLIGHTEN, 1);
3440 wiz_lite(FALSE, FALSE);
3441 if (!p_ptr->telepathy)
3443 (void)set_tim_esp(randint1(30) + 25, FALSE);
3447 msg_format("You cast an unknown Arcane spell: %d.", spell);
3453 msg_print("¥¨¥ì¥á¥ó¥¿¥ë¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3455 msg_print("No Elementals arrive.");
3462 static bool cast_enchant_spell(int spell)
3464 int plev = p_ptr->lev;
3466 bool no_trump = FALSE;
3470 case 0: /* Infravision */
3471 set_tim_infra(100 + randint1(100), FALSE);
3473 case 1: /* Regeneration */
3474 set_tim_regen(80 + randint1(80), FALSE);
3476 case 2: /* Satisfy Hunger */
3477 (void)set_food(PY_FOOD_MAX - 1);
3479 case 3: /* Resist Cold */
3480 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3482 case 4: /* Resist Fire */
3483 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3485 case 5: /* Heroism */
3486 (void)set_hero(randint1(25) + 25, FALSE);
3487 (void)hp_player(10);
3488 (void)set_afraid(0);
3490 case 6: /* Resist Lightning */
3491 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3493 case 7: /* Resist Acid */
3494 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3496 case 8: /* See Invisibility */
3497 (void)set_tim_invis(randint1(24) + 24, FALSE);
3499 case 9: /* Remove Curse */
3503 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
3505 msg_print("You feel as if someone is watching over you.");
3509 case 10: /* Resist Poison */
3510 (void)set_oppose_pois(randint1(20) + 20, FALSE);
3512 case 11: /* Berserk */
3513 (void)set_shero(randint1(25) + 25, FALSE);
3514 (void)hp_player(30);
3515 (void)set_afraid(0);
3517 case 12: /* Self Knowledge */
3518 (void)self_knowledge();
3520 case 13: /* Protection from Evil */
3521 (void)set_protevil(randint1(25) + 3 * p_ptr->lev, FALSE);
3523 case 14: /* Healing */
3529 case 15: /* Mana Branding */
3530 return choose_ele_attack();
3532 case 16: /* Telepathy */
3533 (void)set_tim_esp(randint1(30) + 25, FALSE);
3535 case 17: /* Stone Skin */
3536 (void)set_shield(randint1(20) + 30, FALSE);
3538 case 18: /* Resistance */
3539 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3540 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3541 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3542 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3543 (void)set_oppose_pois(randint1(20) + 20, FALSE);
3545 case 19: /* Haste */
3546 (void)set_fast(randint1(20 + plev) + plev, FALSE);
3548 case 20: /* Walk through Wall */
3549 (void)set_kabenuke(randint1(plev/2) + plev/2, FALSE);
3551 case 21: /* Pulish Shield */
3552 (void)pulish_shield();
3554 case 22: /* Create Golem */
3555 if (summon_specific(-1, py, px, plev, SUMMON_GOLEM, PM_FORCE_PET))
3558 msg_print("¥´¡¼¥ì¥à¤òºî¤Ã¤¿¡£");
3560 msg_print("You make a golem.");
3568 case 23: /* Magic armor */
3569 (void)set_magicdef(randint1(20) + 20, FALSE);
3571 case 24: /* Remove Enchantment */
3572 if (!mundane_spell(TRUE)) return FALSE;
3574 case 25: /* Remove All Curse */
3575 if (remove_all_curse())
3578 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
3580 msg_print("You feel as if someone is watching over you.");
3584 case 26: /* Total Knowledge */
3585 return identify_fully(FALSE, FALSE);
3587 case 27: /* Enchant Weapon */
3588 return enchant_spell(randint0(4) + 1, randint0(4) + 1, 0);
3590 case 28: /* Enchant Armor */
3591 return enchant_spell(0, 0, randint0(3) + 2);
3593 case 29: /* Brand Weapon */
3594 brand_weapon(randint0(18));
3596 case 30: /* Living Trump */
3598 /* Teleport control */
3601 /* Random teleportation (uncontrolled) */
3603 /* Gain the mutation */
3604 if (gain_random_mutation(dummy))
3606 msg_print("¤¢¤Ê¤¿¤ÏÀ¸¤¤Æ¤¤¤ë¥«¡¼¥É¤ËÊѤï¤Ã¤¿¡£");
3608 msg_print("You have turned into a Living Trump.");
3611 case 31: /* Immune */
3612 return (choose_ele_immune(13 + randint1(13)));
3615 msg_format("You cast an unknown Craft spell: %d.", spell);
3621 msg_print("¤¦¤Þ¤¯¥´¡¼¥ì¥à¤òºî¤ì¤Ê¤«¤Ã¤¿¡£");
3623 msg_print("No Golems arrive.");
3631 * An "item_tester_hook" for offer
3633 static bool item_tester_offer(object_type *o_ptr)
3635 /* Flasks of oil are okay */
3636 if (o_ptr->tval != TV_CORPSE) return (FALSE);
3638 if (o_ptr->sval != SV_CORPSE) return (FALSE);
3640 if (strchr("pht", r_info[o_ptr->pval].d_char)) return (TRUE);
3642 /* Assume not okay */
3647 static bool cast_daemon_spell(int spell)
3650 int plev = p_ptr->lev;
3652 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3653 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3654 else beam = plev / 2;
3658 case 0: /* Magic Missile */
3659 if (!get_aim_dir(&dir)) return FALSE;
3661 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
3662 damroll(3 + ((plev - 1) / 5), 4));
3664 case 1: /* Detect Undead & Demons -> Unlife */
3665 (void)detect_monsters_nonliving(DETECT_RAD_DEFAULT);
3668 (void)set_blessed(randint1(12) + 12, FALSE);
3670 case 3: /* Resist Fire */
3671 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3673 case 4: /* Horrify */
3674 if (!get_aim_dir(&dir)) return FALSE;
3676 (void)fear_monster(dir, plev);
3677 (void)stun_monster(dir, plev);
3679 case 5: /* Nether Bolt */
3680 if (!get_aim_dir(&dir)) return FALSE;
3682 fire_bolt_or_beam(beam, GF_NETHER, dir,
3683 damroll(6 + ((plev - 5) / 4), 8));
3685 case 6: /* Summon monster, demon */
3686 if (!summon_specific(-1, py, px, (plev * 3) / 2, SUMMON_MANES, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3689 msg_print("¸ÅÂå¤Î»àÎî¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3691 msg_print("No Manes arrive.");
3695 case 7: /* Mini Hellfire */
3696 if (!get_aim_dir(&dir)) return FALSE;
3698 fire_ball(GF_HELL_FIRE, dir,
3699 (damroll(3, 6) + plev +
3700 (plev / (((p_ptr->pclass == CLASS_MAGE) ||
3701 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
3702 (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
3703 ((plev < 30) ? 2 : 3));
3705 case 8: /* Enslave Demon */
3706 if (!get_aim_dir(&dir)) return FALSE;
3708 (void)control_one_demon(dir, plev);
3710 case 9: /* Vision */
3711 map_area(DETECT_RAD_MAP);
3713 case 10: /* Resist Nether */
3714 (void)set_tim_res_nether(randint1(20) + 20, FALSE);
3716 case 11: /* Plasma Bolt */
3717 if (!get_aim_dir(&dir)) return FALSE;
3719 fire_bolt_or_beam(beam, GF_PLASMA, dir,
3720 damroll(11 + ((plev - 5) / 4), 8));
3722 case 12: /* Fire Ball */
3723 if (!get_aim_dir(&dir)) return FALSE;
3725 fire_ball(GF_FIRE, dir, plev + 55, 2);
3727 case 13: /* Fire Branding */
3730 case 14: /* Nether Ball */
3731 if (!get_aim_dir(&dir)) return FALSE;
3733 fire_ball(GF_NETHER, dir, plev*3/2 + 100, plev / 20+2);
3735 case 15: /* Summon monster, demon */
3737 bool pet = !one_in_(3);
3740 if (pet) mode |= PM_FORCE_PET;
3741 else mode |= PM_NO_PET;
3742 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
3744 if (summon_specific((pet ? -1 : 0), py, px, plev*2/3+randint1(plev/2), SUMMON_DEMON, mode))
3747 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
3749 msg_print("The area fills with a stench of sulphur and brimstone.");
3755 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
3757 msg_print("'What is thy bidding... Master?'");
3762 msg_print("¡ÖÈܤ·¤¼Ô¤è¡¢²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª ¤ªÁ°¤Îº²¤òĺ¤¯¤¾¡ª¡×");
3764 msg_print("'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'");
3771 msg_print("°Ëâ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3773 msg_print("No Greater Demon arrive.");
3778 case 16: /* Telepathy */
3779 (void)set_tim_esp(randint1(30) + 25, FALSE);
3781 case 17: /* Demoncloak */
3783 int dur=randint1(20) + 20;
3785 set_oppose_fire(dur, FALSE);
3786 set_oppose_cold(dur, FALSE);
3787 set_tim_sh_fire(dur, FALSE);
3791 case 18: /* Rain of Lava */
3792 fire_ball(GF_FIRE, 0, (55 + plev)*2, 3);
3793 fire_ball_hide(GF_LAVA_FLOW, 0, 2+randint1(2), 3);
3795 case 19: /* Plasma ball */
3796 if (!get_aim_dir(&dir)) return FALSE;
3798 fire_ball(GF_PLASMA, dir, plev*3/2 + 80, 2 + plev/40);
3800 case 20: /* Mimic demon */
3801 (void)set_mimic(10+plev/2 + randint1(10+plev/2), MIMIC_DEMON, FALSE);
3803 case 21: /* Nether Wave == Dispel Good */
3804 (void)dispel_monsters(randint1(plev * 2));
3805 (void)dispel_good(randint1(plev * 2));
3808 if (!get_aim_dir(&dir)) return FALSE;
3809 fire_ball(GF_NEXUS, dir, 100 + plev*2, 4);
3811 case 23: /* Hand Doom */
3812 if (!get_aim_dir(&dir)) return FALSE;
3814 else msg_print("<ÇËÌǤμê>¤òÊü¤Ã¤¿¡ª");
3816 else msg_print("You invokes the Hand of Doom!");
3819 fire_ball_hide(GF_HAND_DOOM, dir, plev * 2, 0);
3821 case 24: /* Heroism */
3822 (void)set_hero(randint1(25) + 25, FALSE);
3823 (void)hp_player(10);
3824 (void)set_afraid(0);
3826 case 25: /* Tim resist time */
3827 (void)set_tim_res_time(randint1(20)+20, FALSE);
3829 case 26: /* Circle of Madness */
3830 fire_ball(GF_CHAOS, 0, 50+plev, 3+plev/20);
3831 fire_ball(GF_CONFUSION, 0, 50+plev, 3+plev/20);
3832 fire_ball(GF_CHARM, 0, 20+plev, 3+plev/20);
3834 case 27: /* True Discharge Minion */
3837 case 28: /* Summon Greater Demon */
3844 item_tester_hook = item_tester_offer;
3846 q = "¤É¤Î»àÂΤòÊû¤²¤Þ¤¹¤«? ";
3847 s = "Êû¤²¤é¤ì¤ë»àÂΤò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
3849 q = "Sacrifice which corpse? ";
3850 s = "You have nothing to scrifice.";
3852 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return FALSE;
3854 /* Get the item (in the pack) */
3857 o_ptr = &inventory[item];
3860 /* Get the item (on the floor) */
3863 o_ptr = &o_list[0 - item];
3866 summon_lev = p_ptr->lev * 2 / 3 + r_info[o_ptr->pval].level;
3867 if (summon_specific(-1, py, px, summon_lev, SUMMON_HI_DEMON, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3870 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
3872 msg_print("The area fills with a stench of sulphur and brimstone.");
3877 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
3879 msg_print("'What is thy bidding... Master?'");
3882 /* Decrease the item (from the pack) */
3885 inven_item_increase(item, -1);
3886 inven_item_describe(item);
3887 inven_item_optimize(item);
3890 /* Decrease the item (from the floor) */
3893 floor_item_increase(0 - item, -1);
3894 floor_item_describe(0 - item);
3895 floor_item_optimize(0 - item);
3901 msg_print("°Ëâ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3903 msg_print("No Greater Demon arrive.");
3908 case 29: /* Nether Storm */
3909 if (!get_aim_dir(&dir)) return FALSE;
3911 fire_ball(GF_NETHER, dir, plev*15, plev / 5);
3913 case 30: /* Blood curse */
3915 if (!get_aim_dir(&dir)) return FALSE;
3917 fire_ball_hide(GF_BLOOD_CURSE, dir, 600, 0);
3919 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "·ì¤Î¼ö¤¤", -1);
3921 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "Blood curse", -1);
3925 case 31: /* Mimic Demon lord */
3926 (void)set_mimic(15 + randint1(15), MIMIC_DEMON_LORD, FALSE);
3929 msg_format("You cast an unknown Daemon spell: %d.", spell);
3937 static bool cast_crusade_spell(int spell)
3941 int plev = p_ptr->lev;
3943 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3944 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3945 else beam = plev / 2;
3950 if (!get_aim_dir(&dir)) return FALSE;
3952 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
3953 damroll(3 + ((plev - 1) / 5), 4));
3956 (void)detect_monsters_evil(DETECT_RAD_DEFAULT);
3958 case 2: /* Remove Fear */
3959 (void)set_afraid(0);
3962 if (!get_aim_dir(&dir)) return FALSE;
3964 (void)fear_monster(dir, plev);
3967 (void)sleep_monsters_touch();
3970 teleport_player(25+plev/2);
3973 if (!get_aim_dir(&dir)) return FALSE;
3974 fire_blast(GF_LITE, dir, 3+((plev-1)/9), 2, 10, 3);
3978 (void)set_poisoned(0);
3982 if (!get_aim_dir(&dir)) return FALSE;
3983 (void)fire_ball(GF_AWAY_EVIL, dir, MAX_SIGHT*5, 0);
3985 case 9: /* Holy Orb */
3986 if (!get_aim_dir(&dir)) return FALSE;
3988 fire_ball(GF_HOLY_FIRE, dir,
3989 (damroll(3, 6) + plev +
3990 (plev / ((p_ptr->pclass == CLASS_PRIEST ||
3991 p_ptr->pclass == CLASS_HIGH_MAGE ||
3992 p_ptr->pclass == CLASS_SORCERER) ? 2 : 4))),
3993 ((plev < 30) ? 2 : 3));
3996 case 10: /* Exorcism */
3997 (void)dispel_undead(randint1(plev));
3998 (void)dispel_demons(randint1(plev));
3999 (void)turn_evil(plev);
4001 case 11: /* Remove Curse */
4005 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
4007 msg_print("You feel as if someone is watching over you.");
4011 case 12: /* Sense Unseen */
4012 (void)set_tim_invis(randint1(24) + 24, FALSE);
4014 case 13: /* Protection from Evil */
4015 (void)set_protevil(randint1(25) + 3 * p_ptr->lev, FALSE);
4018 if (!get_aim_dir(&dir)) return FALSE;
4019 (void)fire_bolt(GF_ELEC, dir, plev*5);
4021 case 15: /* Holy Word */
4022 (void)dispel_evil(randint1(plev * 6));
4023 (void)hp_player(100);
4024 (void)set_afraid(0);
4025 (void)set_poisoned(0);
4030 if (!get_aim_dir(&dir)) return FALSE;
4032 (void)destroy_door(dir);
4035 if (!get_aim_dir(&dir)) return FALSE;
4036 (void)stasis_evil(dir);
4039 set_tim_sh_holy(randint1(20)+20, FALSE);
4041 case 19: /* Dispel Undead + Demons */
4042 (void)dispel_undead(randint1(plev * 4));
4043 (void)dispel_demons(randint1(plev * 4));
4045 case 20: /* Dispel Evil */
4046 (void)dispel_evil(randint1(plev * 4));
4051 case 22: /* Star Burst */
4052 if (!get_aim_dir(&dir)) return FALSE;
4054 fire_ball(GF_LITE, dir, 100+plev*2, 4);
4056 case 23: /* Summon monster, angel */
4058 bool pet = !one_in_(3);
4061 if (pet) mode |= PM_FORCE_PET;
4062 else mode |= PM_NO_PET;
4063 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
4065 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, SUMMON_ANGEL, mode))
4069 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
4071 msg_print("'What is thy bidding... Master?'");
4076 msg_print("¡Ö²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª °¹Ô¼Ô¤è¡¢²ù¤¤²þ¤á¤è¡ª¡×");
4078 msg_print("Mortal! Repent of thy impiousness.");
4084 case 24: /* Heroism */
4085 (void)set_hero(randint1(25) + 25, FALSE);
4086 (void)hp_player(10);
4087 (void)set_afraid(0);
4089 case 25: /* Remove All Curse */
4090 if (remove_all_curse())
4093 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
4095 msg_print("You feel as if someone is watching over you.");
4099 case 26: /* Banishment */
4100 if (banish_evil(100))
4103 msg_print("¿ÀÀ»¤ÊÎϤ¬¼Ù°¤òÂǤÁʧ¤Ã¤¿¡ª");
4105 msg_print("The holy power banishes evil!");
4110 case 27: /* Word of Destruction */
4111 destroy_area(py, px, 13+randint0(5), TRUE);
4113 case 28: /* Eye for an Eye */
4114 set_tim_eyeeye(randint1(10)+10, FALSE);
4121 int b = 10 + randint1(10);
4123 if (!get_aim_dir(&dir)) return FALSE;
4125 /* Use the given direction */
4126 tx = px + 99 * ddx[dir];
4127 ty = py + 99 * ddy[dir];
4129 /* Hack -- Use an actual "target" */
4130 if ((dir == 5) && target_okay())
4141 /* Hack -- Stop at the target */
4142 if ((y == ty) && (x == tx)) break;
4146 mmove2(&ny, &nx, py, px, ty, tx);
4148 /* Stop at maximum range */
4149 if (MAX_SIGHT*2 < distance(py, px, ny, nx)) break;
4151 /* Stopped by walls/doors */
4152 if (!cave_floor_bold(ny, nx)) break;
4154 /* Stopped by monsters */
4155 if ((dir != 5) && cave[ny][nx].m_idx != 0) break;
4157 /* Save the new location */
4164 for (i = 0; i < b; i++)
4166 int count = 20, d = 0;
4172 x = tx - 5 + randint0(11);
4173 y = ty - 5 + randint0(11);
4175 dx = (tx > x) ? (tx - x) : (x - tx);
4176 dy = (ty > y) ? (ty - y) : (y - ty);
4178 /* Approximate distance */
4179 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
4180 /* Within the radius */
4184 if (count < 0) continue;
4186 /* Cannot penetrate perm walls */
4187 if (!in_bounds(y,x) ||
4188 cave_stop_disintegration(y,x) ||
4189 !in_disintegration_range(ty, tx, y, x))
4192 project(0, 2, y, x, plev * 3+25, GF_DISINTEGRATE, PROJECT_JUMP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1);
4196 case 30: /* Divine Intervention */
4197 project(0, 1, py, px, plev*11, GF_HOLY_FIRE, PROJECT_KILL, -1);
4198 dispel_monsters(plev * 4);
4200 stun_monsters(plev * 4);
4201 confuse_monsters(plev * 4);
4202 turn_monsters(plev * 4);
4203 stasis_monsters(plev * 4);
4204 (void)hp_player(100);
4210 for (i = 0; i < 12; i++)
4217 scatter(&my, &mx, py, px, 4, 0);
4219 /* Require empty grids */
4220 if (cave_empty_bold2(my, mx)) break;
4222 if (attempt < 0) continue;
4223 summon_specific(-1, my, mx, plev, SUMMON_KNIGHTS, (PM_ALLOW_GROUP | PM_FORCE_PET | PM_HASTE));
4225 (void)set_hero(randint1(25) + 25, FALSE);
4226 (void)set_blessed(randint1(25) + 25, FALSE);
4227 (void)set_fast(randint1(20 + plev) + plev, FALSE);
4228 (void)set_protevil(randint1(25) + 25, FALSE);
4229 (void)set_afraid(0);
4234 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤ÊÇ˼٤μöʸ %d ¤ò¾§¤¨¤¿¡£", spell);
4236 msg_format("You cast an unknown crusade spell: %d.", spell);
4247 void stop_singing(void)
4249 if (p_ptr->pclass != CLASS_BARD) return;
4251 if (p_ptr->magic_num1[1])
4253 p_ptr->magic_num1[1] = 0;
4256 if (!p_ptr->magic_num1[0]) return;
4258 set_action(ACTION_NONE);
4260 switch(p_ptr->magic_num1[0])
4263 if (!p_ptr->blessed)
4265 msg_print("¹â·é¤Êµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4267 msg_print("The prayer has expired.");
4274 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4276 msg_print("The heroism wears off.");
4278 /* Recalculate hitpoints */
4279 p_ptr->update |= (PU_HP);
4283 if (!p_ptr->tim_esp)
4286 msg_print("°Õ¼±¤Ï¸µ¤ËÌá¤Ã¤¿¡£");
4288 msg_print("Your consciousness contracts again.");
4290 /* Update the monsters */
4291 p_ptr->update |= (PU_MONSTERS);
4295 if (!p_ptr->tim_stealth)
4297 msg_print("»Ñ¤¬¤Ï¤Ã¤¤ê¤È¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
4299 msg_print("You are no longer hided.");
4303 if (!p_ptr->oppose_acid)
4305 msg_print("»À¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4307 msg_print("You feel less resistant to acid.");
4309 if (!p_ptr->oppose_elec)
4311 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4313 msg_print("You feel less resistant to elec.");
4315 if (!p_ptr->oppose_fire)
4317 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4319 msg_print("You feel less resistant to fire.");
4321 if (!p_ptr->oppose_cold)
4323 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4325 msg_print("You feel less resistant to cold.");
4327 if (!p_ptr->oppose_pois)
4329 msg_print("ÆǤؤÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4331 msg_print("You feel less resistant to pois.");
4337 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
4339 msg_print("You feel yourself slow down.");
4346 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4348 msg_print("The heroism wears off.");
4350 /* Recalculate hitpoints */
4351 p_ptr->update |= (PU_HP);
4356 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
4358 msg_print("You feel yourself slow down.");
4365 msg_print("̵Ũ¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£");
4367 msg_print("The invulnerability wears off.");
4370 p_ptr->redraw |= (PR_MAP);
4372 /* Update monsters */
4373 p_ptr->update |= (PU_MONSTERS);
4376 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4380 p_ptr->magic_num1[0] = MUSIC_NONE;
4381 p_ptr->magic_num2[0] = 0;
4383 /* Recalculate bonuses */
4384 p_ptr->update |= (PU_BONUS | PU_HP);
4386 /* Redraw status bar */
4387 p_ptr->redraw |= (PR_STATUS);
4391 static bool cast_music_spell(int spell)
4393 int plev = p_ptr->lev;
4396 if(p_ptr->magic_num1[0])
4401 p_ptr->magic_num2[0] = spell;
4405 case 0: /* Song of Holding ÃÙÆߤβΠ*/
4407 msg_print("¤æ¤Ã¤¯¤ê¤È¤·¤¿¥á¥í¥Ç¥£¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4409 msg_print("You start humming a slow, steady melody...");
4411 p_ptr->magic_num1[0] = MUSIC_SLOW;
4413 case 1: /* Song of Blessing ½ËÊ¡¤Î²Î */
4415 msg_print("¸·¤«¤Ê¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4417 msg_print("The holy power of the Music of the Ainur enters you...");
4419 p_ptr->magic_num1[0] = MUSIC_BLESS;
4422 case 2: /* Wrecking Note Êø²õ¤Î²»¿§ */
4423 if (!get_aim_dir(&dir)) return FALSE;
4424 fire_bolt(GF_SOUND, dir,
4425 damroll(4 + ((plev - 1) / 5), 4));
4427 case 3: /* Stun Pattern Û¯Û°¤ÎÀûΧ */
4429 msg_print("âÁÏǤµ¤»¤ë¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4431 msg_print("You weave a pattern of sounds to bewilder and daze...");
4433 p_ptr->magic_num1[0] = MUSIC_STUN;
4435 case 4: /* Flow of life À¸Ì¿¤Îή¤ì */
4437 msg_print("²Î¤òÄ̤·¤ÆÂΤ˳赤¤¬Ìá¤Ã¤Æ¤¤¿¡¥¡¥¡¥");
4439 msg_print("Life flows through you as you sing a song of healing...");
4441 p_ptr->magic_num1[0] = MUSIC_L_LIFE;
4443 case 5: /* Song of the Sun ÂÀÍۤβΠ*/
4445 msg_print("¸÷¤êµ±¤¯²Î¤¬ÊÕ¤ê¤ò¾È¤é¤·¤¿¡£");
4447 msg_print("Your uplifting song brings brightness to dark places...");
4449 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
4451 case 6: /* Song of fear ¶²ÉݤβΠ*/
4453 msg_print("¤ª¤É¤í¤ª¤É¤í¤·¤¤¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4455 msg_print("You start weaving a fearful pattern...");
4457 p_ptr->magic_num1[0] = MUSIC_FEAR;
4459 case 7: /* Heroic Ballad À襤¤Î²Î */
4461 msg_print("·ã¤·¤¤À襤¤Î²Î¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4463 msg_print("You start singing a song of intense fighting...");
4465 p_ptr->magic_num1[0] = MUSIC_HERO;
4467 case 8: /* Clairaudience ÎîŪÃγР*/
4469 msg_print("ÀŤ«¤Ê²»³Ú¤¬´¶³Ð¤ò¸¦¤®À¡¤Þ¤µ¤»¤¿¡¥¡¥¡¥");
4471 msg_print("Your quiet music sharpens your sense of hearing...");
4473 p_ptr->magic_num1[0] = MUSIC_DETECT;
4475 case 9: /* º²¤Î²Î */
4477 msg_print("Àº¿À¤òDZ¤¸¶Ê¤²¤ë²Î¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4479 msg_print("You start singing a song of soul in pain...");
4481 p_ptr->magic_num1[0] = MUSIC_PSI;
4483 case 10: /* Song of Lore Ãμ±¤Î²Î */
4485 msg_print("¤³¤ÎÀ¤³¦¤ÎÃ챤¬Î®¤ì¹þ¤ó¤Ç¤¤¿¡¥¡¥¡¥");
4487 msg_print("You recall the rich lore of the world...");
4489 p_ptr->magic_num1[0] = MUSIC_ID;
4491 case 11: /* hidding song ±£ÆۤβΠ*/
4493 msg_print("¤¢¤Ê¤¿¤Î»Ñ¤¬·Ê¿§¤Ë¤È¤±¤³¤ó¤Ç¤¤¤Ã¤¿¡¥¡¥¡¥");
4495 msg_print("Your song carries you beyond the sight of mortal eyes...");
4497 p_ptr->magic_num1[0] = MUSIC_STEALTH;
4499 case 12: /* Illusion Pattern ¸¸±Æ¤ÎÀûΧ */
4501 msg_print("ÊÕ¤ê°ìÌ̤˸¸±Æ¤¬¸½¤ì¤¿¡¥¡¥¡¥");
4503 msg_print("You weave a pattern of sounds to beguile and confuse...");
4505 p_ptr->magic_num1[0] = MUSIC_CONF;
4507 case 13: /* Doomcall (vibration song) ÇËÌǤζ«¤Ó */
4509 msg_print("¹ì²»¤¬¶Á¤¤¤¿¡¥¡¥¡¥");
4511 msg_print("The fury of the Downfall of Numenor lashes out...");
4513 p_ptr->magic_num1[0] = MUSIC_SOUND;
4515 case 14: /* Firiel's Song (song of the Undeads) ¥Õ¥£¥ê¥¨¥ë¤Î²Î */
4517 msg_print("À¸Ì¿¤ÈÉü³è¤Î¥Æ¡¼¥Þ¤òÁդǻϤ᤿¡¥¡¥¡¥");
4519 msg_print("The themes of life and revival are woven into your song...");
4521 animate_dead(0, py, px);
4523 case 15: /* Fellowship Chant (charming song) ι¤ÎÃç´Ö */
4525 msg_print("°Â¤é¤«¤Ê¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4527 msg_print("You weave a slow, soothing melody of imploration...");
4529 p_ptr->magic_num1[0] = MUSIC_CHARM;
4531 case 16: /* (wall breaking song) ʬ²ò²»ÇÈ */
4533 msg_print("Ê´ºÕ¤¹¤ë¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4535 msg_print("You weave a violent pattern of sounds to break wall.");
4537 p_ptr->magic_num1[0] = MUSIC_WALL;
4538 project(0, 0, py, px,
4539 0, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM | PROJECT_HIDE, -1);
4541 case 17: /* Finrod's Resistance (song of resistance) ¸µÁÇÂÑÀ */
4543 msg_print("¸µÁǤÎÎϤËÂФ¹¤ëǦÂѤβΤò²Î¤Ã¤¿¡£");
4545 msg_print("You sing a song of perseverance against powers...");
4547 p_ptr->magic_num1[0] = MUSIC_RESIST;
4549 case 18: /* Hobbit Melodies (song of time) ¥Û¥Ó¥Ã¥È¤Î¥á¥í¥Ç¥£ */
4551 msg_print("·Ú²÷¤Ê²Î¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4553 msg_print("You start singing joyful pop song...");
4555 p_ptr->magic_num1[0] = MUSIC_SPEED;
4557 case 19: /* World Contortion ÏĤó¤ÀÀ¤³¦ */
4559 msg_print("²Î¤¬¶õ´Ö¤òÏĤ᤿¡¥¡¥¡¥");
4561 msg_print("Reality whirls wildly as you sing a dizzying melody...");
4563 project(0, plev/15 + 1, py, px, plev * 3 + 1, GF_AWAY_ALL , PROJECT_KILL, -1);
4565 case 20: /* Â໶¤Î²Î */
4567 msg_print("ÂѤ¨¤é¤ì¤Ê¤¤ÉÔ¶¨Ï²»¤¬Å¨¤òÀÕ¤áΩ¤Æ¤¿¡¥¡¥¡¥");
4569 msg_print("You cry out in an ear-wracking voice...");
4571 p_ptr->magic_num1[0] = MUSIC_DISPEL;
4573 case 21: /* The Voice of Saruman ¥µ¥ë¥Þ¥ó¤Î´Å¸À */
4575 msg_print("Í¥¤·¤¯¡¢Ì¥ÎÏŪ¤Ê²Î¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4577 msg_print("You start humming a gentle and attractive song...");
4579 p_ptr->magic_num1[0] = MUSIC_SARUMAN;
4581 case 22: /* Song of Tempest (song of death) Íò¤Î²»¿§ */
4582 if (!get_aim_dir(&dir)) return FALSE;
4583 fire_beam(GF_SOUND, dir,
4584 damroll(15 + ((plev - 1) / 2), 10));
4586 case 23: /* (song of disruption) ¤â¤¦°ì¤Ä¤ÎÀ¤³¦ */
4588 msg_print("¼þ°Ï¤¬ÊѲ½¤·»Ï¤á¤¿¡¥¡¥¡¥");
4590 msg_print("You sing of the primeval shaping of Middle-earth...");
4594 case 24: /* Wrecking Pattern (destruction shriek) Ç˲õ¤ÎÀûΧ */
4596 msg_print("Ç˲õŪ¤Ê²Î¤¬¶Á¤¤ï¤¿¤Ã¤¿¡¥¡¥¡¥");
4598 msg_print("You weave a pattern of sounds to contort and shatter...");
4600 p_ptr->magic_num1[0] = MUSIC_QUAKE;
4602 case 25: /* ÄäÂڤβΠ*/
4604 msg_print("¤æ¤Ã¤¯¤ê¤È¤·¤¿¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4606 msg_print("You weave a very slow pattern which is almost likely to stop...");
4608 p_ptr->magic_num1[0] = MUSIC_STASIS;
4610 case 26: /* ¼é¤ê¤Î²Î */
4612 msg_print("²Î¤¬¿ÀÀ»¤Ê¾ì¤òºî¤ê½Ð¤·¤¿¡¥¡¥¡¥");
4614 msg_print("The holy power of the Music is creating sacred field...");
4618 case 27: /* ±Ñͺ¤Î»í */
4620 msg_print("±Ñͺ¤Î²Î¤ò¸ý¤º¤µ¤ó¤À¡¥¡¥¡¥");
4622 msg_print("You chant a powerful, heroic call to arms...");
4624 p_ptr->magic_num1[0] = MUSIC_SHERO;
4625 (void)hp_player(10);
4626 (void)set_afraid(0);
4628 case 28: /* ¥ä¥ô¥¡¥ó¥Ê¤Î½õ¤± */
4630 msg_print("²Î¤òÄ̤·¤ÆÂΤ˳赤¤¬Ìá¤Ã¤Æ¤¤¿¡¥¡¥¡¥");
4632 msg_print("Life flows through you as you sing the song...");
4634 p_ptr->magic_num1[0] = MUSIC_H_LIFE;
4636 case 29: /* ºÆÀ¸¤Î²Î */
4638 msg_print("°Å¹õ¤ÎÃæ¤Ë¸÷¤ÈÈþ¤ò¤Õ¤ê¤Þ¤¤¤¿¡£ÂΤ¬¸µ¤Î³èÎϤò¼è¤êÌᤷ¤¿¡£");
4640 msg_print("You strewed light and beauty in the dark as you sing. You feel refreshed.");
4642 (void)do_res_stat(A_STR);
4643 (void)do_res_stat(A_INT);
4644 (void)do_res_stat(A_WIS);
4645 (void)do_res_stat(A_DEX);
4646 (void)do_res_stat(A_CON);
4647 (void)do_res_stat(A_CHR);
4648 (void)restore_level();
4650 case 30: /* shriek of death ¥µ¥¦¥í¥ó¤ÎËâ½Ñ */
4651 if (!get_aim_dir(&dir)) return FALSE;
4652 fire_ball(GF_SOUND, dir, damroll(50 + plev, 10), 0);
4654 case 31: /* song of liberty ¥Õ¥£¥ó¥´¥ë¥Õ¥£¥ó¤ÎÄ©Àï */
4656 msg_print("¥Õ¥£¥ó¥´¥ë¥Õ¥£¥ó¤Î̽²¦¤Ø¤ÎÄ©Àï¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4658 msg_print("You recall the valor of Fingolfin's challenge to the Dark Lord...");
4660 p_ptr->magic_num1[0] = MUSIC_INVULN;
4663 p_ptr->redraw |= (PR_MAP);
4665 /* Update monsters */
4666 p_ptr->update |= (PU_MONSTERS);
4669 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4673 msg_format("̤ÃΤβÎ(%d)¤ò²Î¤Ã¤¿¡£", spell);
4675 msg_format("You sing an unknown song: %d.", spell);
4680 if (p_ptr->magic_num1[0]) set_action(ACTION_SING);
4682 /* Recalculate bonuses */
4683 p_ptr->update |= (PU_BONUS | PU_HP);
4685 /* Redraw status bar */
4686 p_ptr->redraw |= (PR_STATUS);
4694 void do_cmd_cast(void)
4696 int item, sval, spell, realm;
4711 /* Require spell ability */
4712 if (!p_ptr->realm1 && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE))
4715 msg_print("¼öʸ¤ò¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4717 msg_print("You cannot cast spells!");
4724 if (p_ptr->blind || no_lite())
4727 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡ª");
4729 msg_print("You cannot see!");
4731 if (p_ptr->pclass == CLASS_FORCETRAINER)
4738 /* Not when confused */
4739 if (p_ptr->confused)
4742 msg_print("º®Í𤷤Ƥ¤¤Æ¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4744 msg_print("You are too confused!");
4750 prayer = spell_categoly_name(mp_ptr->spell_book);
4752 /* Restrict choices to spell books */
4753 item_tester_tval = mp_ptr->spell_book;
4757 q = "¤É¤Î¼öʸ½ñ¤ò»È¤¤¤Þ¤¹¤«? ";
4759 q = "Use which book? ";
4763 s = "¼öʸ½ñ¤¬¤Ê¤¤¡ª";
4765 s = "You have no spell books!";
4768 select_spellbook=TRUE;
4769 if (p_ptr->pclass == CLASS_FORCETRAINER)
4770 select_the_force = TRUE;
4771 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))){
4772 select_spellbook = FALSE;
4773 select_the_force = FALSE;
4776 select_spellbook = FALSE;
4777 select_the_force = FALSE;
4779 if (item == 1111) { /* the_force */
4783 /* Get the item (in the pack) */
4786 o_ptr = &inventory[item];
4789 /* Get the item (on the floor) */
4792 o_ptr = &o_list[0 - item];
4795 /* Access the item's sval */
4798 if ((p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE) && (o_ptr->tval == REALM2_BOOK)) increment = 32;
4801 /* Track the object kind */
4802 object_kind_track(o_ptr->k_idx);
4804 /* Hack -- Handle stuff */
4807 if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
4808 realm = o_ptr->tval - TV_LIFE_BOOK + 1;
4809 else if (increment) realm = p_ptr->realm2;
4810 else realm = p_ptr->realm1;
4812 /* Ask for a spell */
4814 if (!get_spell(&spell,
4815 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "±Ó¾§¤¹¤ë" : (mp_ptr->spell_book == TV_MUSIC_BOOK) ? "²Î¤¦" : "¾§¤¨¤ë"),
4818 if (spell == -2) msg_format("¤½¤ÎËܤˤÏÃΤäƤ¤¤ë%s¤¬¤Ê¤¤¡£", prayer);
4822 if (!get_spell(&spell, ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "recite" : "cast"),
4826 msg_format("You don't know any %ss in that book.", prayer);
4832 use_realm = tval2realm(o_ptr->tval);
4834 if (!is_magic(use_realm))
4836 s_ptr = &technic_info[use_realm - MIN_TECHNIC - 1][spell];
4840 s_ptr = &mp_ptr->info[realm - 1][spell];
4843 /* Extract mana consumption rate */
4844 shouhimana = s_ptr->smana*(3800 - experience_of_spell(spell, realm)) + 2399;
4847 else shouhimana *= 4;
4849 if(shouhimana < 1) shouhimana = 1;
4851 /* Verify "dangerous" spells */
4852 if (shouhimana > p_ptr->csp)
4856 msg_format("¤½¤Î%s¤ò%s¤Î¤Ë½½Ê¬¤Ê¥Þ¥¸¥Ã¥¯¥Ý¥¤¥ó¥È¤¬¤Ê¤¤¡£",prayer,
4857 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "±Ó¾§¤¹¤ë" : (mp_ptr->spell_book == TV_LIFE_BOOK) ? "²Î¤¦" : "¾§¤¨¤ë"));
4859 msg_format("You do not have enough mana to %s this %s.",
4860 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "recite" : "cast"),
4865 if (!over_exert) return;
4869 if (!get_check_strict("¤½¤ì¤Ç¤âÄ©À路¤Þ¤¹¤«? ", CHECK_OKAY_CANCEL)) return;
4871 if (!get_check_strict("Attempt it anyway? ", CHECK_OKAY_CANCEL)) return;
4877 /* Spell failure chance */
4878 chance = spell_chance(spell, use_realm - 1);
4881 if (randint0(100) < chance)
4883 if (flush_failure) flush();
4886 msg_format("%s¤ò¤¦¤Þ¤¯¾§¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡ª", prayer);
4888 msg_format("You failed to get the %s off!", prayer);
4893 if (realm == REALM_LIFE)
4895 if (randint1(100) < chance)
4896 chg_virtue(V_VITALITY, -1);
4898 else if (realm == REALM_DEATH)
4900 if (randint1(100) < chance)
4901 chg_virtue(V_UNLIFE, -1);
4903 else if (realm == REALM_NATURE)
4905 if (randint1(100) < chance)
4906 chg_virtue(V_NATURE, -1);
4908 else if (realm == REALM_DAEMON)
4910 if (randint1(100) < chance)
4911 chg_virtue(V_JUSTICE, 1);
4913 if (realm == REALM_CRUSADE)
4915 if (randint1(100) < chance)
4916 chg_virtue(V_JUSTICE, -1);
4918 else if (randint1(100) < chance)
4920 chg_virtue(V_KNOWLEDGE, -1);
4923 if (realm == REALM_TRUMP)
4925 cast_trump_spell(spell, FALSE);
4927 else if ((o_ptr->tval == TV_CHAOS_BOOK) && (randint1(100) < spell))
4930 msg_print("¥«¥ª¥¹Åª¤Ê¸ú²Ì¤òȯÀ¸¤·¤¿¡ª");
4932 msg_print("You produce a chaotic effect!");
4937 else if ((o_ptr->tval == TV_DEATH_BOOK) && (randint1(100) < spell))
4939 if ((sval == 3) && one_in_(2))
4941 sanity_blast(0, TRUE);
4946 msg_print("Äˤ¤¡ª");
4948 msg_print("It hurts!");
4952 take_hit(DAMAGE_LOSELIFE, damroll(o_ptr->sval + 1, 6), "°Å¹õËâË¡¤ÎµÕή", -1);
4954 take_hit(DAMAGE_LOSELIFE, damroll(o_ptr->sval + 1, 6), "a miscast Death spell", -1);
4957 if ((spell > 15) && one_in_(6) && !p_ptr->hold_life)
4958 lose_exp(spell * 250);
4961 else if ((o_ptr->tval == TV_MUSIC_BOOK) && (randint1(200) < spell))
4964 msg_print("¤¤¤ä¤Ê²»¤¬¶Á¤¤¤¿");
4966 msg_print("An infernal sound echoed.");
4969 aggravate_monsters(0);
4971 if (randint1(100) >= chance)
4972 chg_virtue(V_CHANCE,-1);
4981 case REALM_LIFE: /* * LIFE * */
4982 cast = cast_life_spell(spell);
4984 case REALM_SORCERY: /* * SORCERY * */
4985 cast = cast_sorcery_spell(spell);
4987 case REALM_NATURE: /* * NATURE * */
4988 cast = cast_nature_spell(spell);
4990 case REALM_CHAOS: /* * CHAOS * */
4991 cast = cast_chaos_spell(spell);
4993 case REALM_DEATH: /* * DEATH * */
4994 cast = cast_death_spell(spell);
4996 case REALM_TRUMP: /* TRUMP */
4997 cast = cast_trump_spell(spell, TRUE);
4999 case REALM_ARCANE: /* ARCANE */
5000 cast = cast_arcane_spell(spell);
5002 case REALM_ENCHANT: /* ENCHANT */
5003 cast = cast_enchant_spell(spell);
5005 case REALM_DAEMON: /* DAEMON */
5006 cast = cast_daemon_spell(spell);
5008 case REALM_CRUSADE: /* CRUSADE */
5009 cast = cast_crusade_spell(spell);
5011 case REALM_MUSIC: /* MUSIC */
5012 cast = cast_music_spell(spell);
5016 msg_format("You cast a spell from an unknown realm: realm %d, spell %d.", realm, spell);
5020 /* Canceled spells cost neither a turn nor mana */
5023 if (randint1(100) < chance)
5024 chg_virtue(V_CHANCE,1);
5026 /* A spell was cast */
5028 (p_ptr->spell_worked2 & (1L << spell)) :
5029 (p_ptr->spell_worked1 & (1L << spell)))
5030 && (p_ptr->pclass != CLASS_SORCERER)
5031 && (p_ptr->pclass != CLASS_RED_MAGE))
5033 int e = s_ptr->sexp;
5035 /* The spell worked */
5036 if (realm == p_ptr->realm1)
5038 p_ptr->spell_worked1 |= (1L << spell);
5042 p_ptr->spell_worked2 |= (1L << spell);
5045 /* Gain experience */
5046 gain_exp(e * s_ptr->slevel);
5048 if (realm == REALM_LIFE)
5050 chg_virtue(V_TEMPERANCE, 1);
5051 chg_virtue(V_COMPASSION, 1);
5052 chg_virtue(V_VITALITY, 1);
5053 chg_virtue(V_DILIGENCE, 1);
5055 else if (realm == REALM_DEATH)
5057 chg_virtue(V_UNLIFE, 1);
5058 chg_virtue(V_JUSTICE, -1);
5059 chg_virtue(V_FAITH, -1);
5060 chg_virtue(V_VITALITY, -1);
5062 else if (realm == REALM_DAEMON)
5064 chg_virtue(V_JUSTICE, -1);
5065 chg_virtue(V_FAITH, -1);
5066 chg_virtue(V_HONOUR, -1);
5067 chg_virtue(V_TEMPERANCE, -1);
5069 else if (realm == REALM_CRUSADE)
5071 chg_virtue(V_FAITH, 1);
5072 chg_virtue(V_JUSTICE, 1);
5073 chg_virtue(V_SACRIFICE, 1);
5074 chg_virtue(V_HONOUR, 1);
5076 else if (realm == REALM_NATURE)
5078 chg_virtue(V_NATURE, 1);
5079 chg_virtue(V_HARMONY, 1);
5082 chg_virtue(V_KNOWLEDGE, 1);
5084 if (realm == REALM_LIFE)
5086 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_TEMPERANCE, 1);
5087 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_COMPASSION, 1);
5088 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_VITALITY, 1);
5089 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_DILIGENCE, 1);
5091 else if (realm == REALM_DEATH)
5093 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_UNLIFE, 1);
5094 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_JUSTICE, -1);
5095 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_FAITH, -1);
5096 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_VITALITY, -1);
5098 else if (realm == REALM_DAEMON)
5100 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_JUSTICE, -1);
5101 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_FAITH, -1);
5102 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_HONOUR, -1);
5103 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_TEMPERANCE, -1);
5105 else if (realm == REALM_CRUSADE)
5107 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_FAITH, 1);
5108 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_JUSTICE, 1);
5109 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_SACRIFICE, 1);
5110 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_HONOUR, 1);
5112 else if (realm == REALM_NATURE)
5114 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_NATURE, 1);
5115 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_HARMONY, 1);
5117 if (mp_ptr->spell_xtra & MAGIC_GAIN_EXP)
5119 s16b cur_exp = p_ptr->spell_exp[(increment ? 32 : 0)+spell];
5124 else if(cur_exp < 1200)
5126 if ((dun_level > 4) && ((dun_level + 10) > p_ptr->lev))
5129 else if(cur_exp < 1400)
5131 if (((dun_level + 5) > p_ptr->lev) && ((dun_level + 5) > s_ptr->slevel))
5134 else if((cur_exp < 1600) && !increment)
5136 if (((dun_level + 5) > p_ptr->lev) && (dun_level > s_ptr->slevel))
5139 p_ptr->spell_exp[(increment ? 32 : 0)+spell] += exp_gain;
5146 /* Sufficient mana */
5147 if (shouhimana <= p_ptr->csp)
5150 p_ptr->csp -= shouhimana;
5153 /* Over-exert the player */
5156 int oops = shouhimana;
5160 p_ptr->csp_frac = 0;
5164 msg_print("Àº¿À¤ò½¸Ã椷¤¹¤®¤Æµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
5166 msg_print("You faint from the effort!");
5170 /* Hack -- Bypass free action */
5171 (void)set_paralyzed(p_ptr->paralyzed + randint1(5 * oops + 1));
5173 if (realm == REALM_LIFE)
5174 chg_virtue(V_VITALITY, -10);
5175 else if (realm == REALM_DEATH)
5176 chg_virtue(V_UNLIFE, -10);
5177 else if (realm == REALM_DAEMON)
5178 chg_virtue(V_JUSTICE, 10);
5179 else if (realm == REALM_NATURE)
5180 chg_virtue(V_NATURE, -10);
5181 else if (realm == REALM_CRUSADE)
5182 chg_virtue(V_JUSTICE, -10);
5184 chg_virtue(V_KNOWLEDGE, -10);
5186 /* Damage CON (possibly permanently) */
5187 if (randint0(100) < 50)
5189 bool perm = (randint0(100) < 25);
5193 msg_print("ÂΤò°¤¯¤·¤Æ¤·¤Þ¤Ã¤¿¡ª");
5195 msg_print("You have damaged your health!");
5199 /* Reduce constitution */
5200 (void)dec_stat(A_CON, 15 + randint1(10), perm);
5205 p_ptr->redraw |= (PR_MANA);
5208 p_ptr->window |= (PW_PLAYER);
5209 p_ptr->window |= (PW_SPELL);
5214 * Pray a prayer -- Unused in Hengband
5216 void do_cmd_pray(void)
5218 msg_print("Praying is not used in Hengband. Use magic spell casting instead.");
5221 static bool ang_sort_comp_pet_dismiss(vptr u, vptr v, int a, int b)
5223 u16b *who = (u16b*)(u);
5228 monster_type *m_ptr1 = &m_list[w1];
5229 monster_type *m_ptr2 = &m_list[w2];
5230 monster_race *r_ptr1 = &r_info[m_ptr1->r_idx];
5231 monster_race *r_ptr2 = &r_info[m_ptr2->r_idx];
5233 if (w1 == p_ptr->riding) return TRUE;
5234 if (w2 == p_ptr->riding) return FALSE;
5236 if (m_ptr1->nickname && !m_ptr2->nickname) return TRUE;
5237 if (m_ptr2->nickname && !m_ptr1->nickname) return FALSE;
5239 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return TRUE;
5240 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return FALSE;
5242 if (r_ptr1->level > r_ptr2->level) return TRUE;
5243 if (r_ptr2->level > r_ptr1->level) return FALSE;
5245 if (m_ptr1->hp > m_ptr2->hp) return TRUE;
5246 if (m_ptr2->hp > m_ptr1->hp) return FALSE;
5251 int calculate_upkeep(void)
5253 s32b old_friend_align = friend_align;
5255 bool have_a_unique = FALSE;
5258 total_friend_levels = 0;
5261 for (m_idx = m_max - 1; m_idx >=1; m_idx--)
5263 monster_type *m_ptr;
5264 monster_race *r_ptr;
5266 m_ptr = &m_list[m_idx];
5267 if (!m_ptr->r_idx) continue;
5268 r_ptr = &r_info[m_ptr->r_idx];
5273 if (r_ptr->flags1 & RF1_UNIQUE)
5275 if (p_ptr->pclass == CLASS_CAVALRY)
5277 if (p_ptr->riding == m_idx)
5278 total_friend_levels += (r_ptr->level+5)*2;
5279 else if (!have_a_unique && (r_info[m_ptr->r_idx].flags7 & RF7_RIDING))
5280 total_friend_levels += (r_ptr->level+5)*7/2;
5282 total_friend_levels += (r_ptr->level+5)*10;
5283 have_a_unique = TRUE;
5286 total_friend_levels += (r_ptr->level+5)*10;
5289 total_friend_levels += r_ptr->level;
5291 /* Determine pet alignment */
5292 if (r_ptr->flags3 & RF3_GOOD)
5294 friend_align += r_ptr->level;
5296 else if (r_ptr->flags3 & RF3_EVIL)
5298 friend_align -= r_ptr->level;
5302 if (old_friend_align != friend_align) p_ptr->update |= (PU_BONUS);
5306 upkeep_factor = (total_friend_levels - (p_ptr->lev * 80 / (cp_ptr->pet_upkeep_div)));
5307 if (upkeep_factor < 0) upkeep_factor = 0;
5308 if (upkeep_factor > 1000) upkeep_factor = 1000;
5309 return upkeep_factor;
5315 void do_cmd_pet_dismiss(void)
5317 monster_type *m_ptr;
5318 bool all_pets = FALSE;
5332 /* Allocate the "who" array */
5333 C_MAKE(who, max_m_idx, u16b);
5335 /* Process the monsters (backwards) */
5336 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
5338 if (is_pet(&m_list[pet_ctr]))
5339 who[max_pet++] = pet_ctr;
5342 /* Select the sort method */
5343 ang_sort_comp = ang_sort_comp_pet_dismiss;
5344 ang_sort_swap = ang_sort_swap_hook;
5346 ang_sort(who, &dummy_why, max_pet);
5348 /* Process the monsters (backwards) */
5349 for (i = 0; i < max_pet; i++)
5352 char friend_name[80];
5356 /* Access the monster */
5358 m_ptr = &m_list[pet_ctr];
5360 delete_this = FALSE;
5361 kakunin = ((pet_ctr == p_ptr->riding) || (m_ptr->nickname));
5362 monster_desc(friend_name, m_ptr, 0x80);
5366 /* Hack -- health bar for this monster */
5367 health_track(pet_ctr);
5369 /* Hack -- handle stuff */
5373 sprintf(buf, "%s¤òÊü¤·¤Þ¤¹¤«¡© [Yes/No/Unnamed (%dɤ)]", friend_name, max_pet-i);
5375 sprintf(buf, "Dismiss %s? [Yes/No/Unnamed (%d remain)]", friend_name, max_pet-i);
5380 move_cursor_relative(m_ptr->fy, m_ptr->fx);
5386 if (ch == 'Y' || ch == 'y')
5393 sprintf(buf, "ËÜÅö¤Ë¤è¤í¤·¤¤¤Ç¤¹¤«¡© (%s) ", friend_name);
5395 sprintf(buf, "Are you sure? (%s) ", friend_name);
5397 if (!get_check(buf))
5398 delete_this = FALSE;
5403 if (ch == 'U' || ch == 'u')
5409 if (ch == ESCAPE || ch == 'N' || ch == 'n')
5416 if ((all_pets && !kakunin) || (!all_pets && delete_this))
5418 if (record_named_pet && m_ptr->nickname)
5422 monster_desc(m_name, m_ptr, 0x08);
5423 do_cmd_write_nikki(NIKKI_NAMED_PET, 2, m_name);
5426 if (pet_ctr == p_ptr->riding)
5429 msg_format("%s¤«¤é¹ß¤ê¤¿¡£", friend_name);
5431 msg_format("You have got off %s. ", friend_name);
5436 /* Update the monsters */
5437 p_ptr->update |= (PU_BONUS | PU_MONSTERS);
5438 p_ptr->redraw |= (PR_EXTRA);
5441 /* HACK : Add the line to message buffer */
5443 sprintf(buf, "%s ¤òÎ¥¤·¤¿¡£", friend_name);
5445 sprintf(buf, "Dismissed %s.", friend_name);
5448 p_ptr->window |= (PW_MESSAGE);
5451 delete_monster_idx(pet_ctr);
5460 C_KILL(who, max_m_idx, u16b);
5463 msg_format("%d ɤ¤Î¥Ú¥Ã¥È¤òÊü¤·¤Þ¤·¤¿¡£", Dismissed);
5465 msg_format("You have dismissed %d pet%s.", Dismissed,
5466 (Dismissed == 1 ? "" : "s"));
5468 if (Dismissed == 0 && all_pets)
5469 msg_print("'U'nnamed ¤Ï¡¢¾èÇϰʳ°¤Î̾Á°¤Î¤Ê¤¤¥Ú¥Ã¥È¤À¤±¤òÁ´¤Æ²òÊü¤·¤Þ¤¹¡£");
5471 p_ptr->update |= (PU_MON_LITE);
5474 bool rakuba(int dam, bool force)
5476 int i, y, x, oy, ox;
5477 int sn = 0, sy = 0, sx = 0;
5479 monster_type *m_ptr = &m_list[p_ptr->riding];
5480 monster_race *r_ptr = &r_info[m_ptr->r_idx];
5482 if (!p_ptr->riding) return FALSE;
5483 if (p_ptr->wild_mode) return FALSE;
5485 if (dam >= 0 || force)
5489 int level = r_ptr->level;
5490 if (p_ptr->riding_ryoute) level += 20;
5491 if ((dam/2 + r_ptr->level) > (p_ptr->skill_exp[GINOU_RIDING]/30+10))
5493 if((p_ptr->skill_exp[GINOU_RIDING] < s_info[p_ptr->pclass].s_max[GINOU_RIDING]) && s_info[p_ptr->pclass].s_max[GINOU_RIDING] > 1000)
5495 if (r_ptr->level*100 > (p_ptr->skill_exp[GINOU_RIDING] + 1500))
5496 p_ptr->skill_exp[GINOU_RIDING] += (1+(r_ptr->level - p_ptr->skill_exp[GINOU_RIDING]/100 - 15));
5497 else p_ptr->skill_exp[GINOU_RIDING]++;
5500 if (randint0(dam/2 + level*2) < (p_ptr->skill_exp[GINOU_RIDING]/30+10))
5502 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))
5508 /* Check around the player */
5509 for (i = 0; i < 8; i++)
5513 /* Access the location */
5514 y = py + ddy_ddd[i];
5515 x = px + ddx_ddd[i];
5517 c_ptr = &cave[y][x];
5519 /* Skip non-empty grids */
5520 if (cave_perma_grid(c_ptr)) continue;
5521 if (!cave_empty_grid2(c_ptr)) continue;
5523 if (c_ptr->m_idx) continue;
5525 /* Count "safe" grids */
5528 /* Randomize choice */
5529 if (randint0(sn) > 0) continue;
5531 /* Save the safe location */
5536 monster_desc(m_name, m_ptr, 0);
5538 msg_format("%s¤«¤é¿¶¤êÍî¤È¤µ¤ì¤½¤¦¤Ë¤Ê¤Ã¤Æ¡¢Êɤˤ֤Ĥ«¤Ã¤¿¡£",m_name);
5539 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "Êɤؤξ×ÆÍ", -1);
5541 msg_format("You have nearly fallen from %s, but bumped into wall.",m_name);
5542 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "bumping into wall", -1);
5553 /* Redraw the old spot */
5556 /* Redraw the new spot */
5559 /* Check for new panel */
5564 p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5565 p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE;
5569 p_ptr->update |= (PU_BONUS);
5572 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW);
5574 /* Update the monsters */
5575 p_ptr->update |= (PU_DISTANCE);
5578 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5580 p_ptr->redraw |= (PR_EXTRA);
5582 if (p_ptr->ffall && !force)
5584 monster_desc(m_name, m_ptr, 0);
5586 msg_format("%s¤«¤éÍî¤Á¤¿¤¬¡¢¶õÃæ¤Ç¤¦¤Þ¤¯ÂÎÀª¤òΩ¤Æľ¤·¤ÆÃåÃϤ·¤¿¡£",m_name);
5588 msg_format("You are thrown from %s, but make a good landing.",m_name);
5593 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "ÍîÇÏ", -1);
5595 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "Falling from riding", -1);
5597 p_ptr->redraw |= (PR_UHEALTH);
5602 bool do_riding(bool force)
5604 int oy, ox, x, y, dir = 0;
5606 monster_type *m_ptr;
5608 if (!get_rep_dir2(&dir)) return FALSE;
5611 c_ptr = &cave[y][x];
5615 /* Skip non-empty grids */
5616 if (!cave_empty_bold2(y, x) || c_ptr->m_idx)
5619 msg_print("¤½¤Á¤é¤Ë¤Ï¹ß¤ê¤é¤ì¤Þ¤»¤ó¡£");
5621 msg_print("You cannot go to that direction.");
5626 p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5627 p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE;
5631 if (p_ptr->confused)
5634 msg_print("º®Í𤷤Ƥ¤¤Æ¾è¤ì¤Ê¤¤¡ª");
5636 msg_print("You are too confused!");
5640 if (!(c_ptr->m_idx))
5643 msg_print("¤½¤Î¾ì½ê¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
5645 msg_print("Here is no pet.");
5651 m_ptr = &m_list[c_ptr->m_idx];
5653 if (!is_pet(m_ptr) && !force)
5656 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï¥Ú¥Ã¥È¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£");
5658 msg_print("That monster is no a pet.");
5663 if (!(r_info[m_ptr->r_idx].flags7 & RF7_RIDING))
5666 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ë¤Ï¾è¤ì¤Ê¤µ¤½¤¦¤À¡£");
5668 msg_print("This monster doesn't seem suitable for riding.");
5673 if (!(p_ptr->pass_wall) && (c_ptr->feat >= FEAT_RUBBLE) && (c_ptr->feat <= FEAT_PERM_SOLID))
5676 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤ÏÊɤÎÃæ¤Ë¤¤¤ë¡£");
5678 msg_print("This monster is in the wall.");
5683 if ((cave[py][px].feat >= FEAT_PATTERN_START) && (cave[py][px].feat <= FEAT_PATTERN_XTRA2) && ((cave[y][x].feat < FEAT_PATTERN_START) || (cave[y][x].feat > FEAT_PATTERN_XTRA2)))
5686 msg_print("¥Ñ¥¿¡¼¥ó¤Î¾å¤«¤é¤Ï¾è¤ì¤Þ¤»¤ó¡£");
5688 msg_print("You cannot ride from on Pattern.");
5696 msg_print("¤½¤Î¾ì½ê¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
5698 msg_print("Here is no monster.");
5703 if (r_info[m_ptr->r_idx].level > randint1((p_ptr->skill_exp[GINOU_RIDING]/50 + p_ptr->lev/2 +20)))
5706 msg_print("¤¦¤Þ¤¯¾è¤ì¤Ê¤«¤Ã¤¿¡£");
5708 msg_print("You failed to ride.");
5718 monster_desc(m_name, m_ptr, 0);
5721 msg_format("%s¤òµ¯¤³¤·¤¿¡£", m_name);
5723 msg_format("You have waked %s up.", m_name);
5727 p_ptr->riding = c_ptr->m_idx;
5730 /* Save the old location */
5734 /* Move the player to the safe location */
5738 /* Redraw the old spot */
5741 /* Redraw the new spot */
5744 /* Check for new panel */
5749 /* Mega-Hack -- Forget the view and lite */
5750 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
5753 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW);
5755 /* Update the monsters */
5756 p_ptr->update |= (PU_DISTANCE);
5758 /* Update the monsters */
5759 p_ptr->update |= (PU_BONUS);
5762 p_ptr->redraw |= (PR_MAP | PR_EXTRA);
5765 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5767 p_ptr->redraw |= (PR_UHEALTH);
5773 static void do_name_pet(void)
5775 monster_type *m_ptr;
5778 bool old_name = FALSE;
5779 bool old_target_pet = target_pet;
5782 if (!target_set(TARGET_KILL))
5784 target_pet = old_target_pet;
5787 target_pet = old_target_pet;
5789 if (cave[target_row][target_col].m_idx)
5791 m_ptr = &m_list[cave[target_row][target_col].m_idx];
5797 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï¥Ú¥Ã¥È¤Ç¤Ï¤Ê¤¤¡£");
5799 msg_format("This monster is not a pet.");
5803 if (r_info[m_ptr->r_idx].flags1 & RF1_UNIQUE)
5806 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Î̾Á°¤ÏÊѤ¨¤é¤ì¤Ê¤¤¡ª");
5808 msg_format("You cannot change name of this monster!");
5812 monster_desc(m_name, m_ptr, 0);
5816 msg_format("%s¤Ë̾Á°¤ò¤Ä¤±¤ë¡£", m_name);
5818 msg_format("Name %s.", m_name);
5823 /* Start with nothing */
5824 strcpy(out_val, "");
5826 /* Use old inscription */
5827 if (m_ptr->nickname)
5829 /* Start with the old inscription */
5830 strcpy(out_val, quark_str(m_ptr->nickname));
5834 /* Get a new inscription (possibly empty) */
5836 if (get_string("̾Á°: ", out_val, 15))
5838 if (get_string("Name: ", out_val, 15))
5844 /* Save the inscription */
5845 m_ptr->nickname = quark_add(out_val);
5846 if (record_named_pet)
5850 monster_desc(m_name, m_ptr, 0x08);
5851 do_cmd_write_nikki(NIKKI_NAMED_PET, 0, m_name);
5856 if (record_named_pet && old_name)
5860 monster_desc(m_name, m_ptr, 0x08);
5861 do_cmd_write_nikki(NIKKI_NAMED_PET, 1, m_name);
5863 m_ptr->nickname = 0;
5870 * Issue a pet command
5872 void do_cmd_pet(void)
5877 cptr power_desc[36];
5882 int pets = 0, pet_ctr;
5883 monster_type *m_ptr;
5890 char target_buf[160];
5894 /* Calculate pets */
5895 /* Process the monsters (backwards) */
5896 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
5898 /* Access the monster */
5899 m_ptr = &m_list[pet_ctr];
5901 if (is_pet(m_ptr)) pets++;
5905 power_desc[num] = "¥Ú¥Ã¥È¤òÊü¤¹";
5907 power_desc[num] = "dismiss pets";
5910 powers[num++] = PET_DISMISS;
5913 sprintf(target_buf,"¥Ú¥Ã¥È¤Î¥¿¡¼¥²¥Ã¥È¤ò»ØÄê (¸½ºß¡§%s)",
5914 (pet_t_m_idx ? r_name + r_info[m_list[pet_t_m_idx].r_idx].name : "»ØÄê¤Ê¤·"));
5916 sprintf(target_buf,"specify a targert of pet (now:%s)",
5917 (pet_t_m_idx ? r_name + r_info[m_list[pet_t_m_idx].r_idx].name : "nothing"));
5919 power_desc[num] = target_buf;
5921 powers[num++] = PET_TARGET;
5924 power_desc[num] = "¶á¤¯¤Ë¤¤¤í";
5926 power_desc[num] = "stay close";
5929 if (p_ptr->pet_follow_distance == PET_CLOSE_DIST) mode = num;
5930 powers[num++] = PET_STAY_CLOSE;
5933 power_desc[num] = "¤Ä¤¤¤ÆÍ褤";
5935 power_desc[num] = "follow me";
5938 if (p_ptr->pet_follow_distance == PET_FOLLOW_DIST) mode = num;
5939 powers[num++] = PET_FOLLOW_ME;
5942 power_desc[num] = "Ũ¤ò¸«¤Ä¤±¤ÆÅݤ»";
5944 power_desc[num] = "seek and destroy";
5947 if (p_ptr->pet_follow_distance == PET_DESTROY_DIST) mode = num;
5948 powers[num++] = PET_SEEK_AND_DESTROY;
5951 power_desc[num] = "¾¯¤·Î¥¤ì¤Æ¤¤¤í";
5953 power_desc[num] = "give me space";
5956 if (p_ptr->pet_follow_distance == PET_SPACE_DIST) mode = num;
5957 powers[num++] = PET_ALLOW_SPACE;
5960 power_desc[num] = "Î¥¤ì¤Æ¤¤¤í";
5962 power_desc[num] = "stay away";
5965 if (p_ptr->pet_follow_distance == PET_AWAY_DIST) mode = num;
5966 powers[num++] = PET_STAY_AWAY;
5968 if (p_ptr->pet_extra_flags & PF_OPEN_DOORS)
5971 power_desc[num] = "¥É¥¢¤ò³«¤±¤ë (¸½ºß:ON)";
5973 power_desc[num] = "pets open doors (now On)";
5980 power_desc[num] = "¥É¥¢¤ò³«¤±¤ë (¸½ºß:OFF)";
5982 power_desc[num] = "pets open doors (now Off)";
5986 powers[num++] = PET_OPEN_DOORS;
5988 if (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS)
5991 power_desc[num] = "¥¢¥¤¥Æ¥à¤ò½¦¤¦ (¸½ºß:ON)";
5993 power_desc[num] = "pets pick up items (now On)";
6000 power_desc[num] = "¥¢¥¤¥Æ¥à¤ò½¦¤¦ (¸½ºß:OFF)";
6002 power_desc[num] = "pets pick up items (now Off)";
6006 powers[num++] = PET_TAKE_ITEMS;
6008 if (p_ptr->pet_extra_flags & PF_TELEPORT)
6011 power_desc[num] = "¥Æ¥ì¥Ý¡¼¥È·ÏËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6013 power_desc[num] = "allow teleport (now On)";
6020 power_desc[num] = "¥Æ¥ì¥Ý¡¼¥È·ÏËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6022 power_desc[num] = "allow teleport (now Off)";
6026 powers[num++] = PET_TELEPORT;
6028 if (p_ptr->pet_extra_flags & PF_ATTACK_SPELL)
6031 power_desc[num] = "¹¶·âËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6033 power_desc[num] = "allow cast attack spell (now On)";
6040 power_desc[num] = "¹¶·âËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6042 power_desc[num] = "allow cast attack spell (now Off)";
6046 powers[num++] = PET_ATTACK_SPELL;
6048 if (p_ptr->pet_extra_flags & PF_SUMMON_SPELL)
6051 power_desc[num] = "¾¤´ËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6053 power_desc[num] = "allow cast summon spell (now On)";
6060 power_desc[num] = "¾¤´ËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6062 power_desc[num] = "allow cast summon spell (now Off)";
6066 powers[num++] = PET_SUMMON_SPELL;
6068 if (p_ptr->pet_extra_flags & PF_BALL_SPELL)
6071 power_desc[num] = "¥×¥ì¥¤¥ä¡¼¤ò´¬¤¹þ¤àÈÏ°ÏËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6073 power_desc[num] = "allow involve player in area spell (now On)";
6080 power_desc[num] = "¥×¥ì¥¤¥ä¡¼¤ò´¬¤¹þ¤àÈÏ°ÏËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6082 power_desc[num] = "allow involve player in area spell (now Off)";
6086 powers[num++] = PET_BALL_SPELL;
6091 power_desc[num] = "¥Ú¥Ã¥È¤«¤é¹ß¤ê¤ë";
6093 power_desc[num] = "get off a pet";
6100 power_desc[num] = "¥Ú¥Ã¥È¤Ë¾è¤ë";
6102 power_desc[num] = "ride a pet";
6106 powers[num++] = PET_RIDING;
6109 power_desc[num] = "¥Ú¥Ã¥È¤Ë̾Á°¤ò¤Ä¤±¤ë¡£";
6111 power_desc[num] = "name pets";
6114 powers[num++] = PET_NAME;
6116 if (p_ptr->riding && buki_motteruka(INVEN_RARM) && (empty_hands(FALSE) & 0x00000001) && ((inventory[INVEN_RARM].weight > 99) || (inventory[INVEN_RARM].tval == TV_POLEARM)))
6118 if (p_ptr->pet_extra_flags & PF_RYOUTE)
6121 power_desc[num] = "Éð´ï¤òÊÒ¼ê¤Ç»ý¤Ä";
6123 power_desc[num] = "use one hand to control a riding pet";
6130 power_desc[num] = "Éð´ï¤òξ¼ê¤Ç»ý¤Ä";
6132 power_desc[num] = "use both hands for a weapon.";
6137 powers[num++] = PET_RYOUTE;
6140 /* Nothing chosen yet */
6143 /* Build a prompt (accept all spells) */
6146 /* Build a prompt (accept all spells) */
6148 strnfmt(out_val, 78, "(¥³¥Þ¥ó¥É %c-%c¡¢'*'=°ìÍ÷¡¢ESC=½ªÎ») ¥³¥Þ¥ó¥É¤òÁª¤ó¤Ç¤¯¤À¤µ¤¤:",
6150 strnfmt(out_val, 78, "(Command %c-%c, *=List, ESC=exit) Select a command: ",
6153 I2A(0), I2A(num - 1));
6158 strnfmt(out_val, 78, "(¥³¥Þ¥ó¥É %c-%c¡¢'*'=°ìÍ÷¡¢ESC=½ªÎ») ¥³¥Þ¥ó¥É¤òÁª¤ó¤Ç¤¯¤À¤µ¤¤:",
6160 strnfmt(out_val, 78, "(Command %c-%c, *=List, ESC=exit) Select a command: ",
6163 I2A(0), '0' + num - 27);
6169 /* Save the screen */
6176 prt(format("%s%c) %s", (ctr == mode) ? "*" : " ", I2A(ctr), power_desc[ctr]), y + ctr, x);
6182 prt("", y + ctr, x);
6189 /* Get a command from the user */
6190 while (!flag && get_com(out_val, &choice, TRUE))
6192 /* Request redraw */
6193 if ((choice == ' ') || (choice == '*') || (choice == '?'))
6205 /* Save the screen */
6212 sprintf(buf, "%s%c) %s", (ctr == mode) ? "*" : " ", I2A(ctr), power_desc[ctr]);
6213 prt(buf, y + ctr, x);
6219 prt("", y + ctr, x);
6233 /* Restore the screen */
6241 if (isalpha(choice))
6244 ask = (isupper(choice));
6247 if (ask) choice = tolower(choice);
6249 /* Extract request */
6250 i = (islower(choice) ? A2I(choice) : -1);
6254 ask = FALSE; /* Can't uppercase digits */
6256 i = choice - '0' + 26;
6259 /* Totally Illegal */
6260 if ((i < 0) || (i >= num))
6271 strnfmt(buf, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡© ", power_desc[i]);
6273 strnfmt(buf, 78, "Use %s? ", power_desc[i]);
6277 /* Belay that order */
6278 if (!get_check(buf)) continue;
6285 /* Restore the screen */
6286 if (redraw) Term_load();
6288 /* Abort if needed */
6297 case PET_DISMISS: /* Dismiss pets */
6302 msg_print("¥Ú¥Ã¥È¤¬¤¤¤Ê¤¤¡ª");
6304 msg_print("You have no pets!");
6308 do_cmd_pet_dismiss();
6309 (void)calculate_upkeep();
6314 project_length = -1;
6315 if (!target_set(TARGET_KILL)) pet_t_m_idx = 0;
6318 cave_type *c_ptr = &cave[target_row][target_col];
6319 if (c_ptr->m_idx && (m_list[c_ptr->m_idx].ml))
6321 pet_t_m_idx = cave[target_row][target_col].m_idx;
6322 p_ptr->pet_follow_distance = PET_DESTROY_DIST;
6324 else pet_t_m_idx = 0;
6331 case PET_STAY_CLOSE:
6333 p_ptr->pet_follow_distance = PET_CLOSE_DIST;
6340 p_ptr->pet_follow_distance = PET_FOLLOW_DIST;
6344 /* "Seek and destoy" */
6345 case PET_SEEK_AND_DESTROY:
6347 p_ptr->pet_follow_distance = PET_DESTROY_DIST;
6350 /* "Give me space" */
6351 case PET_ALLOW_SPACE:
6353 p_ptr->pet_follow_distance = PET_SPACE_DIST;
6359 p_ptr->pet_follow_distance = PET_AWAY_DIST;
6362 /* flag - allow pets to open doors */
6363 case PET_OPEN_DOORS:
6365 if (p_ptr->pet_extra_flags & PF_OPEN_DOORS) p_ptr->pet_extra_flags &= ~(PF_OPEN_DOORS);
6366 else p_ptr->pet_extra_flags |= (PF_OPEN_DOORS);
6369 /* flag - allow pets to pickup items */
6370 case PET_TAKE_ITEMS:
6372 if (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS)
6374 p_ptr->pet_extra_flags &= ~(PF_PICKUP_ITEMS);
6375 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
6377 /* Access the monster */
6378 m_ptr = &m_list[pet_ctr];
6382 monster_drop_carried_objects(m_ptr);
6386 else p_ptr->pet_extra_flags |= (PF_PICKUP_ITEMS);
6390 /* flag - allow pets to teleport */
6393 if (p_ptr->pet_extra_flags & PF_TELEPORT) p_ptr->pet_extra_flags &= ~(PF_TELEPORT);
6394 else p_ptr->pet_extra_flags |= (PF_TELEPORT);
6397 /* flag - allow pets to cast attack spell */
6398 case PET_ATTACK_SPELL:
6400 if (p_ptr->pet_extra_flags & PF_ATTACK_SPELL) p_ptr->pet_extra_flags &= ~(PF_ATTACK_SPELL);
6401 else p_ptr->pet_extra_flags |= (PF_ATTACK_SPELL);
6404 /* flag - allow pets to cast attack spell */
6405 case PET_SUMMON_SPELL:
6407 if (p_ptr->pet_extra_flags & PF_SUMMON_SPELL) p_ptr->pet_extra_flags &= ~(PF_SUMMON_SPELL);
6408 else p_ptr->pet_extra_flags |= (PF_SUMMON_SPELL);
6411 /* flag - allow pets to cast attack spell */
6412 case PET_BALL_SPELL:
6414 if (p_ptr->pet_extra_flags & PF_BALL_SPELL) p_ptr->pet_extra_flags &= ~(PF_BALL_SPELL);
6415 else p_ptr->pet_extra_flags |= (PF_BALL_SPELL);
6433 if (p_ptr->pet_extra_flags & PF_RYOUTE) p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
6434 else p_ptr->pet_extra_flags |= (PF_RYOUTE);
6435 p_ptr->update |= (PU_BONUS);