4 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
6 * This software may be copied and distributed for educational, research,
7 * and not for profit purposes provided that this copyright and statement
8 * are included in all such copies. Other copyrights may also apply.
11 /* Purpose: Spell/Prayer commands */
15 #include "spellstips.h"
17 cptr spell_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_the_force=FALSE;
56 static int get_spell(int *sn, cptr prompt, int sval, bool learned, int use_realm)
64 bool flag, redraw, okay;
72 int menu_line = (use_menu ? 1 : 0);
74 #ifdef ALLOW_REPEAT /* TNB */
76 /* Get the spell, if available */
79 /* Verify the spell */
80 if (spell_okay(*sn, learned, FALSE, use_realm))
87 #endif /* ALLOW_REPEAT -- TNB */
89 p = spell_categoly_name(mp_ptr->spell_book);
92 for (spell = 0; spell < 32; spell++)
94 /* Check for this spell */
95 if ((fake_spell_flags[sval] & (1L << spell)))
97 /* Collect this spell */
98 spells[num++] = spell;
102 /* Assume no usable spells */
105 /* Assume no spells available */
108 /* Check for "okay" spells */
109 for (i = 0; i < num; i++)
111 /* Look for "okay" spells */
112 if (spell_okay(spells[i], learned, FALSE, use_realm)) okay = TRUE;
115 /* No "okay" spells */
116 if (!okay) return (FALSE);
117 if (((use_realm) != p_ptr->realm1) && ((use_realm) != p_ptr->realm2) && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE)) return FALSE;
118 if (((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE)) && !is_magic(use_realm)) return FALSE;
119 if ((p_ptr->pclass == CLASS_RED_MAGE) && ((use_realm) != REALM_ARCANE) && (sval > 1)) return FALSE;
121 /* Assume cancelled */
124 /* Nothing chosen yet */
134 p_ptr->window |= (PW_SPELL);
140 /* Build a prompt (accept all spells) */
142 jverb1( prompt, jverb_buf );
143 (void) strnfmt(out_val, 78, "(%^s:%c-%c, '*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤Î%s¤ò%^s¤Þ¤¹¤«? ",
144 p, I2A(0), I2A(num - 1), p, jverb_buf );
146 (void)strnfmt(out_val, 78, "(%^ss %c-%c, *=List, ESC=exit) %^s which %s? ",
147 p, I2A(0), I2A(num - 1), prompt, p);
150 /* Get a spell from the user */
152 choice = (always_show_list || use_menu) ? ESCAPE:1;
155 if( choice==ESCAPE ) choice = ' ';
156 else if( !get_com(out_val, &choice, TRUE) )break;
158 if (use_menu && choice != ' ')
173 menu_line += (num - 1);
195 if (menu_line > num) menu_line -= num;
196 /* Display a list of spells */
197 print_spells(menu_line, spells, num, 1, 15, use_realm);
203 if ((choice == ' ') || (choice == '*') || (choice == '?'))
211 /* Save the screen */
214 /* Display a list of spells */
215 print_spells(menu_line, spells, num, 1, 15, use_realm);
221 if (use_menu) continue;
226 /* Restore the screen */
236 ask = (isupper(choice));
239 if (ask) choice = tolower(choice);
241 /* Extract request */
242 i = (islower(choice) ? A2I(choice) : -1);
245 /* Totally Illegal */
246 if ((i < 0) || (i >= num))
252 /* Save the spell index */
255 /* Require "okay" spells */
256 if (!spell_okay(spell, learned, FALSE, use_realm))
260 msg_format("¤½¤Î%s¤ò%s¤³¤È¤Ï¤Ç¤¤Þ¤»¤ó¡£", p, prompt);
262 msg_format("You may not %s that %s.", prompt, p);
273 /* Access the spell */
274 if (!is_magic(use_realm))
276 s_ptr = &technic_info[use_realm - MIN_TECHNIC][spell];
280 s_ptr = &mp_ptr->info[use_realm - 1][spell];
283 if (use_realm == REALM_HISSATSU)
285 shouhimana = s_ptr->smana;
289 /* Extract mana consumption rate */
290 shouhimana = s_ptr->smana*(3800 - experience_of_spell(spell, use_realm)) + 2399;
293 else shouhimana *= 4;
295 if(shouhimana < 1) shouhimana = 1;
300 jverb1( prompt, jverb_buf );
301 /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½¤ËÂбþ */
302 (void) strnfmt(tmp_val, 78, "%s(MP%d, ¼ºÇÔΨ%d%%)¤ò%s¤Þ¤¹¤«? ",
303 spell_names[technic2magic(use_realm)-1][spell], shouhimana,
304 spell_chance(spell, use_realm),jverb_buf);
306 (void)strnfmt(tmp_val, 78, "%^s %s (%d mana, %d%% fail)? ",
307 prompt, spell_names[technic2magic(use_realm)-1][spell], shouhimana,
308 spell_chance(spell, use_realm));
312 /* Belay that order */
313 if (!get_check(tmp_val)) continue;
321 /* Restore the screen */
322 if (redraw) screen_load();
329 p_ptr->window |= (PW_SPELL);
336 /* Abort if needed */
337 if (!flag) return (FALSE);
339 /* Save the choice */
342 #ifdef ALLOW_REPEAT /* TNB */
346 #endif /* ALLOW_REPEAT -- TNB */
353 static bool item_tester_learn_spell(object_type *o_ptr)
355 s32b choices = realm_choices2[p_ptr->pclass];
357 if (p_ptr->pclass == CLASS_PRIEST)
359 if (is_good_realm(p_ptr->realm1))
361 choices &= ~(CH_DEATH | CH_DAEMON);
365 choices &= ~(CH_LIFE | CH_CRUSADE);
369 if ((o_ptr->tval < TV_LIFE_BOOK) || (o_ptr->tval > (TV_LIFE_BOOK + MAX_REALM - 1))) return (FALSE);
370 if ((o_ptr->tval == TV_MUSIC_BOOK) && (p_ptr->pclass == CLASS_BARD)) return (TRUE);
371 else if (!is_magic(tval2realm(o_ptr->tval))) return FALSE;
372 if ((REALM1_BOOK == o_ptr->tval) || (REALM2_BOOK == o_ptr->tval)) return (TRUE);
373 if (choices & (0x0001 << (tval2realm(o_ptr->tval) - 1))) return (TRUE);
379 * Peruse the spells/prayers in a book
381 * Note that *all* spells in the book are listed
383 * Note that browsing is allowed while confused or blind,
384 * and in the dark, primarily to allow browsing in stores.
386 void do_cmd_browse(void)
388 int item, sval, use_realm = 0, j, line;
401 /* Warriors are illiterate */
402 if (!(p_ptr->realm1 || p_ptr->realm2) && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE))
405 msg_print("ËܤòÆɤळ¤È¤¬¤Ç¤¤Ê¤¤¡ª");
407 msg_print("You cannot read books!");
413 if (p_ptr->special_defense & KATA_MUSOU)
415 set_action(ACTION_NONE);
418 /* Restrict choices to "useful" books */
419 if (p_ptr->realm2 == REALM_NONE) item_tester_tval = mp_ptr->spell_book;
420 else item_tester_hook = item_tester_learn_spell;
424 q = "¤É¤ÎËܤòÆɤߤޤ¹¤«? ";
426 q = "Browse which book? ";
430 s = "Æɤá¤ëËܤ¬¤Ê¤¤¡£";
432 s = "You have no books that you can read.";
435 if (p_ptr->pclass == CLASS_FORCETRAINER)
436 select_the_force = TRUE;
437 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))){
438 select_the_force = FALSE;
441 select_the_force = FALSE;
443 if (item == 1111) { /* the_force */
444 do_cmd_mind_browse();
447 /* Get the item (in the pack) */
450 o_ptr = &inventory[item];
453 /* Get the item (on the floor) */
456 o_ptr = &o_list[0 - item];
459 /* Access the item's sval */
462 use_realm = tval2realm(o_ptr->tval);
463 if ((p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE) && is_magic(use_realm))
465 if (o_ptr->tval == REALM2_BOOK) increment = 32;
466 else if (o_ptr->tval != REALM1_BOOK) increment = 64;
469 /* Track the object kind */
470 object_kind_track(o_ptr->k_idx);
472 /* Hack -- Handle stuff */
477 for (spell = 0; spell < 32; spell++)
479 /* Check for this spell */
480 if ((fake_spell_flags[sval] & (1L << spell)))
482 /* Collect this spell */
483 spells[num++] = spell;
488 /* Save the screen */
491 /* Clear the top line */
494 /* Keep browsing spells. Exit browsing on cancel. */
497 /* Ask for a spell, allow cancel */
499 if (!get_spell(&spell, "Æɤà", o_ptr->sval, TRUE, use_realm))
501 if (!get_spell(&spell, "browse", o_ptr->sval, TRUE, use_realm))
504 /* If cancelled, leave immediately. */
505 if (spell == -1) break;
507 /* Display a list of spells */
508 print_spells(0, spells, num, 1, 15, use_realm);
510 /* Notify that there's nothing to see, and wait. */
511 if (use_realm == REALM_HISSATSU)
513 prt("Æɤá¤ëµ»¤¬¤Ê¤¤¡£", 0, 0);
515 prt("No techniques to browse.", 0, 0);
519 prt("Æɤá¤ë¼öʸ¤¬¤Ê¤¤¡£", 0, 0);
521 prt("No spells to browse.", 0, 0);
526 /* Restore the screen */
532 /* Clear lines, position cursor (really should use strlen here) */
533 Term_erase(14, 14, 255);
534 Term_erase(14, 13, 255);
535 Term_erase(14, 12, 255);
536 Term_erase(14, 11, 255);
538 /* Access the spell */
539 if (!is_magic(use_realm))
541 s_ptr = &technic_info[use_realm - MIN_TECHNIC][spell];
545 s_ptr = &mp_ptr->info[use_realm - 1][spell];
548 roff_to_buf(spell_tips[technic2magic(use_realm)-1][spell] ,62, temp, sizeof(temp));
549 for(j=0, line = 11;temp[j];j+=(1+strlen(&temp[j])))
551 prt(&temp[j], line, 15);
556 /* Restore the screen */
561 static void change_realm2(int next_realm)
566 for (i = 0; i < 64; i++)
568 p_ptr->spell_order[j] = p_ptr->spell_order[i];
569 if(p_ptr->spell_order[i] < 32) j++;
572 p_ptr->spell_order[j] = 99;
574 for (i = 32; i < 64; i++)
576 p_ptr->spell_exp[i] = 0;
578 p_ptr->spell_learned2 = 0L;
579 p_ptr->spell_worked2 = 0L;
580 p_ptr->spell_forgotten2 = 0L;
583 sprintf(tmp,"ËâË¡¤ÎÎΰè¤ò%s¤«¤é%s¤ËÊѹ¹¤·¤¿¡£", realm_names[p_ptr->realm2], realm_names[next_realm]);
585 sprintf(tmp,"change magic realm from %s to %s.", realm_names[p_ptr->realm2], realm_names[next_realm]);
587 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
588 p_ptr->old_realm |= 1 << (p_ptr->realm2-1);
589 p_ptr->realm2 = next_realm;
591 p_ptr->notice |= (PN_REORDER);
592 p_ptr->update |= (PU_SPELLS);
598 * Study a book to gain a new spell/prayer
600 void do_cmd_study(void)
604 bool learned = FALSE;
606 /* Spells of realm2 will have an increment of +32 */
609 cptr p = spell_categoly_name(mp_ptr->spell_book);
618 msg_print("ËܤòÆɤळ¤È¤¬¤Ç¤¤Ê¤¤¡ª");
620 msg_print("You cannot read books!");
626 if (p_ptr->blind || no_lite())
629 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡ª");
631 msg_print("You cannot see!");
640 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡ª");
642 msg_print("You are too confused!");
648 if (!(p_ptr->new_spells))
651 msg_format("¿·¤·¤¤%s¤ò³Ð¤¨¤ë¤³¤È¤Ï¤Ç¤¤Ê¤¤¡ª", p);
653 msg_format("You cannot learn any new %ss!", p);
659 if (p_ptr->special_defense & KATA_MUSOU)
661 set_action(ACTION_NONE);
664 p = spell_categoly_name(mp_ptr->spell_book);
667 if( p_ptr->new_spells < 10 ){
668 msg_format("¤¢¤È %d ¤Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
670 msg_format("¤¢¤È %d ¸Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
673 msg_format("You can learn %d new %s%s.", p_ptr->new_spells, p,
674 (p_ptr->new_spells == 1?"":"s"));
680 /* Restrict choices to "useful" books */
681 if (p_ptr->realm2 == REALM_NONE) item_tester_tval = mp_ptr->spell_book;
682 else item_tester_hook = item_tester_learn_spell;
686 q = "¤É¤ÎËܤ«¤é³Ø¤Ó¤Þ¤¹¤«? ";
688 q = "Study which book? ";
692 s = "Æɤá¤ëËܤ¬¤Ê¤¤¡£";
694 s = "You have no books that you can read.";
697 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
699 /* Get the item (in the pack) */
702 o_ptr = &inventory[item];
705 /* Get the item (on the floor) */
708 o_ptr = &o_list[0 - item];
711 /* Access the item's sval */
714 if (o_ptr->tval == REALM2_BOOK) increment = 32;
715 else if (o_ptr->tval != REALM1_BOOK)
718 if (!get_check("ËÜÅö¤ËËâË¡¤ÎÎΰè¤òÊѹ¹¤·¤Þ¤¹¤«¡©")) return;
720 if (!get_check("Really, change magic realm? ")) return;
722 change_realm2(tval2realm(o_ptr->tval));
726 /* Track the object kind */
727 object_kind_track(o_ptr->k_idx);
729 /* Hack -- Handle stuff */
732 /* Mage -- Learn a selected spell */
733 if (mp_ptr->spell_book != TV_LIFE_BOOK)
735 /* Ask for a spell, allow cancel */
737 if (!get_spell(&spell, "³Ø¤Ö", sval, FALSE, o_ptr->tval - TV_LIFE_BOOK + 1)
738 && (spell == -1)) return;
740 if (!get_spell(&spell, "study", sval, FALSE, o_ptr->tval - TV_LIFE_BOOK + 1)
741 && (spell == -1)) return;
746 /* Priest -- Learn a random prayer */
754 for (spell = 0; spell < 32; spell++)
756 /* Check spells in the book */
757 if ((fake_spell_flags[sval] & (1L << spell)))
759 /* Skip non "okay" prayers */
760 if (!spell_okay(spell, FALSE, TRUE,
761 (increment ? p_ptr->realm2 : p_ptr->realm1))) continue;
763 /* Hack -- Prepare the randomizer */
766 /* Hack -- Apply the randomizer */
767 if (one_in_(k)) gift = spell;
775 /* Nothing to study */
780 msg_format("¤½¤ÎËܤˤϳؤ֤٤%s¤¬¤Ê¤¤¡£", p);
782 msg_format("You cannot learn any %ss in that book.", p);
791 if (increment) spell += increment;
793 /* Learn the spell */
796 if (p_ptr->spell_learned1 & (1L << spell)) learned = TRUE;
797 else p_ptr->spell_learned1 |= (1L << spell);
801 if (p_ptr->spell_learned2 & (1L << (spell - 32))) learned = TRUE;
802 else p_ptr->spell_learned2 |= (1L << (spell - 32));
807 int max_exp = (spell < 32) ? 1600 : 1400;
808 int old_exp = p_ptr->spell_exp[spell];
810 cptr name = spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell%32];
812 if (old_exp >= max_exp)
815 msg_format("¤½¤Î%s¤Ï´°Á´¤Ë»È¤¤¤³¤Ê¤»¤ë¤Î¤Ç³Ø¤ÖɬÍפϤʤ¤¡£", spell_categoly_name(mp_ptr->spell_book));
817 msg_format("You don't need to study this %s anymore.", spell_categoly_name(mp_ptr->spell_book));
822 if (!get_check(format("%s¤Î%s¤ò¤µ¤é¤Ë³Ø¤Ó¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©", name, spell_categoly_name(mp_ptr->spell_book))))
824 if (!get_check(format("You will study a %s of %s again. Are you sure? ", spell_categoly_name(mp_ptr->spell_book), name)))
829 else if (old_exp >= 1400)
831 p_ptr->spell_exp[spell] = 1600;
834 else if (old_exp >= 1200)
836 if (spell >= 32) p_ptr->spell_exp[spell] = 1400;
837 else p_ptr->spell_exp[spell] += 200;
840 else if (old_exp >= 900)
842 p_ptr->spell_exp[spell] = 1200+(old_exp-900)*2/3;
847 p_ptr->spell_exp[spell] = 900+(old_exp)/3;
851 msg_format("%s¤Î½ÏÎýÅÙ¤¬%s¤Ë¾å¤¬¤Ã¤¿¡£", name, shougou_moji[new_rank]);
853 msg_format("Your proficiency of %s is now %s rank.", name, shougou_moji[new_rank]);
858 /* Find the next open entry in "p_ptr->spell_order[]" */
859 for (i = 0; i < 64; i++)
861 /* Stop at the first empty space */
862 if (p_ptr->spell_order[i] == 99) break;
865 /* Add the spell to the known list */
866 p_ptr->spell_order[i++] = spell;
868 /* Mention the result */
870 /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½¤ËÂбþ */
871 if (mp_ptr->spell_book == TV_MUSIC_BOOK)
873 msg_format("%s¤ò³Ø¤ó¤À¡£",
874 spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32]);
878 msg_format("%s¤Î%s¤ò³Ø¤ó¤À¡£",
879 spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32] ,p);
882 msg_format("You have learned the %s of %s.",
883 p, spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32]);
890 if (mp_ptr->spell_book == TV_LIFE_BOOK)
891 chg_virtue(V_FAITH, 1);
892 else if (mp_ptr->spell_book == TV_DEATH_BOOK)
893 chg_virtue(V_UNLIFE, 1);
894 else if (mp_ptr->spell_book == TV_NATURE_BOOK)
895 chg_virtue(V_NATURE, 1);
897 chg_virtue(V_KNOWLEDGE, 1);
902 /* One less spell available */
903 p_ptr->learned_spells++;
905 /* Message if needed */
906 if (p_ptr->new_spells)
910 if( p_ptr->new_spells < 10 ){
911 msg_format("¤¢¤È %d ¤Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
913 msg_format("¤¢¤È %d ¸Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
916 msg_format("You can learn %d more %s%s.",
917 p_ptr->new_spells, p,
918 (p_ptr->new_spells != 1) ? "s" : "");
925 p_ptr->update |= (PU_SPELLS);
928 /* Redraw object recall */
929 p_ptr->window |= (PW_OBJECT);
933 static void wild_magic(int spell)
936 int type = SUMMON_BIZARRE1 + randint0(6);
938 if (type < SUMMON_BIZARRE1) type = SUMMON_BIZARRE1;
939 else if (type > SUMMON_BIZARRE6) type = SUMMON_BIZARRE6;
941 switch (randint1(spell) + randint1(8) + 1)
951 teleport_player(100);
955 teleport_player(200);
965 lite_area(damroll(2, 3), 2);
968 destroy_doors_touch();
973 sleep_monsters_touch();
977 trap_creation(py, px);
986 aggravate_monsters(0);
989 earthquake(py, px, 5);
993 (void)gain_random_mutation(0);
1003 fire_ball(GF_CHAOS, 0, spell + 5, 1 + (spell / 10));
1010 while (counter++ < 8)
1012 (void)summon_specific(0, py, px, (dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET));
1017 activate_hi_summon(py, px, FALSE);
1020 (void)summon_cyber(-1, py, px);
1025 (void)activate_ty_curse(FALSE, &count);
1034 static bool cast_life_spell(int spell)
1037 int plev = p_ptr->lev;
1041 case 0: /* Cure Light Wounds */
1042 (void)hp_player(damroll(2, 10));
1043 (void)set_cut(p_ptr->cut - 10);
1046 (void)set_blessed(randint1(12) + 12, FALSE);
1048 case 2: /* Make Light Wounds */
1049 if (!get_aim_dir(&dir)) return FALSE;
1050 fire_ball_hide(GF_WOUNDS, dir, damroll(3 + ((plev - 1) / 5), 4), 0);
1052 case 3: /* Call Light */
1053 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1055 case 4: /* Detect Traps + Secret Doors */
1056 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1057 (void)detect_doors(DETECT_RAD_DEFAULT);
1058 (void)detect_stairs(DETECT_RAD_DEFAULT);
1060 case 5: /* Cure Medium Wounds */
1061 (void)hp_player(damroll(4, 10));
1062 (void)set_cut((p_ptr->cut / 2) - 20);
1064 case 6: /* Cure Poison */
1065 (void)set_poisoned(0);
1067 case 7: /* Satisfy Hunger */
1068 (void)set_food(PY_FOOD_MAX - 1);
1070 case 8: /* Remove Curse */
1074 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1076 msg_print("You feel as if someone is watching over you.");
1080 case 9: /* Make Medium Wounds */
1081 if (!get_aim_dir(&dir)) return FALSE;
1082 fire_ball_hide(GF_WOUNDS, dir, damroll(8 + ((plev - 5) / 4), 8), 0);
1084 case 10: /* Cure Critical Wounds */
1085 (void)hp_player(damroll(8, 10));
1090 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1091 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1094 map_area(DETECT_RAD_MAP);
1097 (void)turn_undead();
1099 case 14: /* Healing */
1100 (void)hp_player(300);
1104 case 15: /* Glyph of Warding */
1107 case 16: /* Dispel Curse */
1108 if (remove_all_curse())
1111 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1113 msg_print("You feel as if someone is watching over you.");
1117 case 17: /* Perception */
1118 return ident_spell(FALSE);
1119 case 18: /* Dispel Undead */
1120 (void)dispel_undead(randint1(plev * 5));
1122 case 19: /* 'Day of the Dove' */
1123 charm_monsters(plev * 2);
1125 case 20: /* Make Critical Wounds */
1126 if (!get_aim_dir(&dir)) return FALSE;
1127 fire_ball_hide(GF_WOUNDS, dir, damroll(5+((plev - 5) / 3), 15), 0);
1129 case 21: /* Word of Recall */
1130 if (!word_of_recall()) return FALSE;
1132 case 22: /* Alter Reality */
1135 case 23: /* Warding True */
1140 num_repro += MAX_REPRO;
1142 case 25: /* Detection True */
1143 (void)detect_all(DETECT_RAD_DEFAULT);
1145 case 26: /* Genocide Undead */
1146 (void)mass_genocide_undead(plev+50,TRUE);
1148 case 27: /* Clairvoyance */
1151 case 28: /* Restoration */
1152 (void)do_res_stat(A_STR);
1153 (void)do_res_stat(A_INT);
1154 (void)do_res_stat(A_WIS);
1155 (void)do_res_stat(A_DEX);
1156 (void)do_res_stat(A_CON);
1157 (void)do_res_stat(A_CHR);
1158 (void)restore_level();
1160 case 29: /* Healing True */
1161 (void)hp_player(2000);
1165 case 30: /* Holy Vision */
1166 return identify_fully(FALSE);
1167 case 31: /* Ultimate resistance */
1169 int v = randint1(plev/2)+plev/2;
1170 (void)set_fast(v, FALSE);
1171 set_oppose_acid(v, FALSE);
1172 set_oppose_elec(v, FALSE);
1173 set_oppose_fire(v, FALSE);
1174 set_oppose_cold(v, FALSE);
1175 set_oppose_pois(v, FALSE);
1176 set_ultimate_res(v, FALSE);
1181 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥é¥¤¥Õ¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1183 msg_format("You cast an unknown Life spell: %d.", spell);
1194 static bool cast_sorcery_spell(int spell)
1197 int plev = p_ptr->lev;
1201 case 0: /* Detect Monsters */
1202 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1204 case 1: /* Phase Door */
1205 teleport_player(10);
1207 case 2: /* Detect Doors and Traps */
1208 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1209 (void)detect_doors(DETECT_RAD_DEFAULT);
1210 (void)detect_stairs(DETECT_RAD_DEFAULT);
1212 case 3: /* Light Area */
1213 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1215 case 4: /* Confuse Monster */
1216 if (!get_aim_dir(&dir)) return FALSE;
1218 (void)confuse_monster(dir, (plev * 3) / 2);
1220 case 5: /* Teleport */
1221 teleport_player(plev * 5);
1223 case 6: /* Sleep Monster */
1224 if (!get_aim_dir(&dir)) return FALSE;
1226 (void)sleep_monster(dir);
1228 case 7: /* Recharging */
1229 return recharge(plev * 4);
1230 case 8: /* Magic Mapping */
1231 map_area(DETECT_RAD_MAP);
1233 case 9: /* Identify */
1234 return ident_spell(FALSE);
1235 case 10: /* Slow Monster */
1236 if (!get_aim_dir(&dir)) return FALSE;
1238 (void)slow_monster(dir);
1240 case 11: /* Mass Sleep */
1241 (void)sleep_monsters();
1243 case 12: /* Teleport Away */
1244 if (!get_aim_dir(&dir)) return FALSE;
1246 (void)fire_beam(GF_AWAY_ALL, dir, plev);
1248 case 13: /* Haste Self */
1249 (void)set_fast(randint1(20 + plev) + plev, FALSE);
1251 case 14: /* Detection True */
1252 (void)detect_all(DETECT_RAD_DEFAULT);
1254 case 15: /* Identify True */
1255 return identify_fully(FALSE);
1256 case 16: /* Detect Objects and Treasure*/
1257 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
1258 (void)detect_treasure(DETECT_RAD_DEFAULT);
1259 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
1261 case 17: /* Charm Monster */
1262 if (!get_aim_dir(&dir)) return FALSE;
1264 (void)charm_monster(dir, plev);
1266 case 18: /* Sense Minds */
1267 (void)set_tim_esp(randint1(30) + 25, FALSE);
1269 case 19: /* Teleport to town */
1272 case 20: /* Self knowledge */
1273 (void)self_knowledge();
1275 case 21: /* Teleport Level */
1277 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
1279 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
1281 (void)teleport_player_level();
1283 case 22: /* Word of Recall */
1284 if (!word_of_recall()) return FALSE;
1286 case 23: /* Dimension Door */
1288 msg_print("¼¡¸µ¤ÎÈ⤬³«¤¤¤¿¡£ÌÜŪÃϤòÁª¤ó¤Ç²¼¤µ¤¤¡£");
1290 msg_print("You open a dimensional gate. Choose a destination.");
1293 return dimension_door();
1294 case 24: /* Probing */
1297 case 25: /* Explosive Rune */
1300 case 26: /* Telekinesis */
1301 if (!get_aim_dir(&dir)) return FALSE;
1303 fetch(dir, plev * 15, FALSE);
1305 case 27: /* Clairvoyance */
1306 chg_virtue(V_KNOWLEDGE, 1);
1307 chg_virtue(V_ENLIGHTEN, 1);
1310 if (!(p_ptr->telepathy))
1312 (void)set_tim_esp(randint1(30) + 25, FALSE);
1315 case 28: /* Charm Monsters */
1316 charm_monsters(plev * 2);
1318 case 29: /* Alchemy */
1320 case 30: /* Banish */
1321 banish_monsters(plev * 4);
1323 case 31: /* Globe of Invulnerability */
1324 (void)set_invuln(randint1(4) + 4, FALSE);
1328 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥½¡¼¥µ¥ê¡¼¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1330 msg_format("You cast an unknown Sorcery spell: %d.", spell);
1340 static bool cast_nature_spell(int spell)
1344 int plev = p_ptr->lev;
1345 bool no_trump = FALSE;
1347 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1348 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1349 else beam = plev / 2;
1353 case 0: /* Detect Creatures */
1354 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1356 case 1: /* Lightning Bolt */
1357 project_length = plev / 6 + 2;
1358 if (!get_aim_dir(&dir)) return FALSE;
1360 fire_beam(GF_ELEC, dir,
1361 damroll(3 + ((plev - 1) / 5), 4));
1363 case 2: /* Detect Doors & Traps */
1364 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1365 (void)detect_doors(DETECT_RAD_DEFAULT);
1366 (void)detect_stairs(DETECT_RAD_DEFAULT);
1368 case 3: /* Produce Food */
1370 object_type forge, *q_ptr = &forge;
1373 msg_print("¿©ÎÁ¤òÀ¸À®¤·¤¿¡£");
1375 msg_print("A food ration is produced.");
1378 /* Create the food ration */
1379 object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_RATION));
1381 /* Drop the object from heaven */
1382 (void)drop_near(q_ptr, -1, py, px);
1386 case 4: /* Daylight */
1387 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1388 if ((prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
1391 msg_print("Æü¤Î¸÷¤¬¤¢¤Ê¤¿¤ÎÆùÂΤò¾Ç¤¬¤·¤¿¡ª");
1393 msg_print("The daylight scorches your flesh!");
1397 take_hit(DAMAGE_NOESCAPE, damroll(2, 2), "Æü¤Î¸÷", -1);
1399 take_hit(DAMAGE_NOESCAPE, damroll(2, 2), "daylight", -1);
1404 case 5: /* Animal Taming */
1405 if (!get_aim_dir(&dir)) return FALSE;
1407 (void)charm_animal(dir, plev);
1409 case 6: /* Resist Environment */
1410 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1411 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1412 (void)set_oppose_elec(randint1(20) + 20, FALSE);
1414 case 7: /* Cure Wounds & Poison */
1415 (void)hp_player(damroll(2, 8));
1417 (void)set_poisoned(0);
1419 case 8: /* Stone to Mud */
1420 if (!get_aim_dir(&dir)) return FALSE;
1422 (void)wall_to_mud(dir);
1424 case 9: /* Frost Bolt */
1425 if (!get_aim_dir(&dir)) return FALSE;
1426 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
1427 damroll(3 + ((plev - 5) / 4), 8));
1429 case 10: /* Nature Awareness -- downgraded */
1430 map_area(DETECT_RAD_MAP);
1431 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1432 (void)detect_doors(DETECT_RAD_DEFAULT);
1433 (void)detect_stairs(DETECT_RAD_DEFAULT);
1434 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1436 case 11: /* Fire Bolt */
1437 if (!get_aim_dir(&dir)) return FALSE;
1438 fire_bolt_or_beam(beam - 10, GF_FIRE, dir,
1439 damroll(5 + ((plev - 5) / 4), 8));
1441 case 12: /* Ray of Sunlight */
1442 if (!get_aim_dir(&dir)) return FALSE;
1444 msg_print("ÂÀÍÛ¸÷Àþ¤¬¸½¤ì¤¿¡£");
1446 msg_print("A line of sunlight appears.");
1449 (void)lite_line(dir);
1451 case 13: /* Entangle */
1454 case 14: /* Summon Animals */
1455 if (!(summon_specific(-1, py, px, plev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET))))
1458 case 15: /* Herbal Healing */
1459 (void)hp_player(500);
1462 (void)set_poisoned(0);
1464 case 16: /* Stair Building */
1465 (void)stair_creation();
1467 case 17: /* Stone Skin */
1468 (void)set_shield(randint1(20) + 30, FALSE);
1470 case 18: /* Resistance True */
1471 (void)set_oppose_acid(randint1(20) + 20, FALSE);
1472 (void)set_oppose_elec(randint1(20) + 20, FALSE);
1473 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1474 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1475 (void)set_oppose_pois(randint1(20) + 20, FALSE);
1477 case 19: /* Tree Creation */
1478 (void)tree_creation();
1480 case 20: /* Animal Friendship */
1481 (void)charm_animals(plev * 2);
1483 case 21: /* Stone Tell */
1484 return identify_fully(FALSE);
1485 case 22: /* Wall of Stone */
1488 case 23: /* Protection from Corrosion */
1490 case 24: /* Earthquake */
1491 earthquake(py, px, 10);
1493 case 25: /* Whirlwind Attack */
1497 monster_type *m_ptr;
1499 for (dir = 0; dir < 8; dir++)
1501 y = py + ddy_ddd[dir];
1502 x = px + ddx_ddd[dir];
1503 c_ptr = &cave[y][x];
1505 /* Get the monster */
1506 m_ptr = &m_list[c_ptr->m_idx];
1508 /* Hack -- attack monsters */
1509 if (c_ptr->m_idx && (m_ptr->ml || cave_floor_bold(y, x)))
1514 case 26: /* Blizzard */
1515 if (!get_aim_dir(&dir)) return FALSE;
1517 fire_ball(GF_COLD, dir, 70 + plev * 3 / 2, (plev / 12) + 1);
1519 case 27: /* Lightning Storm */
1520 if (!get_aim_dir(&dir)) return FALSE;
1521 fire_ball(GF_ELEC, dir, 90 + plev * 3 / 2, (plev / 12) + 1);
1523 case 28: /* Whirlpool */
1524 if (!get_aim_dir(&dir)) return FALSE;
1525 fire_ball(GF_WATER, dir, 100 + plev * 3 / 2, (plev / 12) + 1);
1527 case 29: /* Call Sunlight */
1528 fire_ball(GF_LITE, 0, 150, 8);
1529 chg_virtue(V_KNOWLEDGE, 1);
1530 chg_virtue(V_ENLIGHTEN, 1);
1532 if ((prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
1535 msg_print("Æü¸÷¤¬¤¢¤Ê¤¿¤ÎÆùÂΤò¾Ç¤¬¤·¤¿¡ª");
1537 msg_print("The sunlight scorches your flesh!");
1541 take_hit(DAMAGE_NOESCAPE, 50, "Æü¸÷", -1);
1543 take_hit(DAMAGE_NOESCAPE, 50, "sunlight", -1);
1548 case 30: /* Elemental Branding */
1549 brand_weapon(randint0(2));
1551 case 31: /* Nature's Wrath */
1552 (void)dispel_monsters(plev * 4);
1553 earthquake(py, px, 20 + (plev / 2));
1554 project(0, 1 + plev / 12, py, px,
1555 (100 + plev) * 2, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM, -1);
1559 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥Í¥¤¥Á¥ã¡¼¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1561 msg_format("You cast an unknown Nature spell: %d.", spell);
1569 msg_print("ưʪ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
1571 msg_print("No animals arrive.");
1579 static bool cast_chaos_spell(int spell)
1582 int plev = p_ptr->lev;
1584 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1585 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1586 else beam = plev / 2;
1590 case 0: /* Magic Missile */
1591 if (!get_aim_dir(&dir)) return FALSE;
1593 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
1594 damroll(3 + ((plev - 1) / 5), 4));
1596 case 1: /* Trap / Door destruction */
1597 (void)destroy_doors_touch();
1599 case 2: /* Flash of Light == Light Area */
1600 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1602 case 3: /* Touch of Confusion */
1603 if (!(p_ptr->special_attack & ATTACK_CONFUSE))
1606 msg_print("¤¢¤Ê¤¿¤Î¼ê¤Ï¸÷¤ê»Ï¤á¤¿¡£");
1608 msg_print("Your hands start glowing.");
1611 p_ptr->special_attack |= ATTACK_CONFUSE;
1612 p_ptr->redraw |= (PR_STATUS);
1615 case 4: /* Mana Burst */
1616 if (!get_aim_dir(&dir)) return FALSE;
1618 fire_ball(GF_MISSILE, dir,
1619 (damroll(3, 5) + plev +
1620 (plev / (((p_ptr->pclass == CLASS_MAGE)
1621 || (p_ptr->pclass == CLASS_HIGH_MAGE)
1622 || (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
1623 ((plev < 30) ? 2 : 3));
1624 /* Shouldn't actually use GF_MANA, as it will destroy all
1625 * items on the floor */
1627 case 5: /* Fire Bolt */
1628 if (!get_aim_dir(&dir)) return FALSE;
1630 fire_bolt_or_beam(beam, GF_FIRE, dir,
1631 damroll(8 + ((plev - 5) / 4), 8));
1633 case 6: /* Fist of Force ("Fist of Fun") */
1634 if (!get_aim_dir(&dir)) return FALSE;
1636 fire_ball(GF_DISINTEGRATE, dir,
1637 damroll(8 + ((plev - 5) / 4), 8), 0);
1639 case 7: /* Teleport Self */
1640 teleport_player(plev * 5);
1642 case 8: /* Wonder */
1644 /* This spell should become more useful (more
1645 controlled) as the player gains experience levels.
1646 Thus, add 1/5 of the player's level to the die roll.
1647 This eliminates the worst effects later on, while
1648 keeping the results quite random. It also allows
1649 some potent effects only at high level. */
1651 int die = randint1(100) + plev / 5;
1652 int vir = virtue_number(V_CHANCE);
1655 if (p_ptr->virtues[vir - 1] > 0)
1657 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
1661 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
1666 chg_virtue(V_CHANCE, 1);
1668 if (!get_aim_dir(&dir)) return FALSE;
1671 msg_print("¤¢¤Ê¤¿¤ÏÎϤ¬¤ß¤Ê¤®¤ë¤Î¤ò´¶¤¸¤¿¡ª");
1673 msg_print("You feel a surge of power!");
1676 if (die < 8) clone_monster(dir);
1677 else if (die < 14) speed_monster(dir);
1678 else if (die < 26) heal_monster(dir, damroll(4, 6));
1679 else if (die < 31) poly_monster(dir);
1681 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
1682 damroll(3 + ((plev - 1) / 5), 4));
1683 else if (die < 41) confuse_monster(dir, plev);
1684 else if (die < 46) fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
1685 else if (die < 51) (void)lite_line(dir);
1687 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
1688 damroll(3 + ((plev - 5) / 4), 8));
1690 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
1691 damroll(5 + ((plev - 5) / 4), 8));
1693 fire_bolt_or_beam(beam, GF_ACID, dir,
1694 damroll(6 + ((plev - 5) / 4), 8));
1696 fire_bolt_or_beam(beam, GF_FIRE, dir,
1697 damroll(8 + ((plev - 5) / 4), 8));
1698 else if (die < 76) drain_life(dir, 75);
1699 else if (die < 81) fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
1700 else if (die < 86) fire_ball(GF_ACID, dir, 40 + plev, 2);
1701 else if (die < 91) fire_ball(GF_ICE, dir, 70 + plev, 3);
1702 else if (die < 96) fire_ball(GF_FIRE, dir, 80 + plev, 3);
1703 else if (die < 101) drain_life(dir, 100 + plev);
1706 earthquake(py, px, 12);
1710 destroy_area(py, px, 13+randint0(5));
1714 symbol_genocide(plev+50, TRUE);
1716 else if (die < 110) dispel_monsters(120);
1719 dispel_monsters(150);
1727 case 9: /* Chaos Bolt */
1728 if (!get_aim_dir(&dir)) return FALSE;
1730 fire_bolt_or_beam(beam, GF_CHAOS, dir,
1731 damroll(10 + ((plev - 5) / 4), 8));
1733 case 10: /* Sonic Boom */
1735 msg_print("¥É¡¼¥ó¡ªÉô²°¤¬Íɤ줿¡ª");
1737 msg_print("BOOM! Shake the room!");
1740 project(0, plev / 10 + 2, py, px,
1741 (60 + plev), GF_SOUND, PROJECT_KILL | PROJECT_ITEM, -1);
1743 case 11: /* Doom Bolt -- always beam in 2.0.7 or later */
1744 if (!get_aim_dir(&dir)) return FALSE;
1746 fire_beam(GF_MANA, dir, damroll(11 + ((plev - 5) / 4), 8));
1748 case 12: /* Fire Ball */
1749 if (!get_aim_dir(&dir)) return FALSE;
1751 fire_ball(GF_FIRE, dir, plev + 55, 2);
1753 case 13: /* Teleport Other */
1754 if (!get_aim_dir(&dir)) return FALSE;
1756 (void)fire_beam(GF_AWAY_ALL, dir, plev);
1758 case 14: /* Word of Destruction */
1759 destroy_area(py, px, 13+randint0(5));
1761 case 15: /* Invoke Logrus */
1762 if (!get_aim_dir(&dir)) return FALSE;
1764 fire_ball(GF_CHAOS, dir, plev*2 + 99, plev / 5);
1766 case 16: /* Polymorph Other */
1767 if (!get_aim_dir(&dir)) return FALSE;
1769 (void)poly_monster(dir);
1771 case 17: /* Chain Lightning */
1772 for (dir = 0; dir <= 9; dir++)
1773 fire_beam(GF_ELEC, dir, damroll(5 + (plev / 10), 8));
1775 case 18: /* Arcane Binding == Charging */
1776 return recharge(90);
1777 case 19: /* Disintegration */
1778 if (!get_aim_dir(&dir)) return FALSE;
1780 fire_ball(GF_DISINTEGRATE, dir, plev + 70, 3 + plev / 40);
1782 case 20: /* Alter Reality */
1785 case 21: /* Magic Rocket */
1786 if (!get_aim_dir(&dir)) return FALSE;
1789 msg_print("¥í¥±¥Ã¥Èȯ¼Í¡ª");
1791 msg_print("You launch a rocket!");
1794 fire_rocket(GF_ROCKET, dir, 120 + plev*2, 2);
1796 case 22: /* Chaos Branding */
1799 case 23: /* Summon monster, demon */
1802 bool pet = !one_in_(3);
1804 if (pet) mode |= PM_FORCE_PET;
1805 else mode |= PM_NO_PET;
1806 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
1808 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, SUMMON_DEMON, mode))
1811 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
1813 msg_print("The area fills with a stench of sulphur and brimstone.");
1819 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
1821 msg_print("'What is thy bidding... Master?'");
1826 msg_print("¡ÖÈܤ·¤¼Ô¤è¡¢²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª ¤ªÁ°¤Îº²¤òĺ¤¯¤¾¡ª¡×");
1828 msg_print("'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'");
1834 case 24: /* Beam of Gravity */
1835 if (!get_aim_dir(&dir)) return FALSE;
1837 fire_beam(GF_GRAVITY, dir, damroll(9 + ((plev - 5) / 4), 8));
1839 case 25: /* Meteor Swarm */
1842 int b = 10 + randint1(10);
1843 for (i = 0; i < b; i++)
1845 int count = 0, d = 0;
1850 if (count > 20) break;
1851 x = px - 8 + randint0(17);
1852 y = py - 8 + randint0(17);
1854 if (!in_bounds(y,x) || (!cave_floor_bold(y,x) && (cave[y][x].feat != FEAT_TREES)) || !player_has_los_bold(y, x)) continue;
1856 dx = (px > x) ? (px - x) : (x - px);
1857 dy = (py > y) ? (py - y) : (y - py);
1859 /* Approximate distance */
1860 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
1864 if (count > 20) continue;
1866 project(0, 2, y, x, plev * 2, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
1870 case 26: /* Flame Strike */
1871 fire_ball(GF_FIRE, 0, 300 + (3 * plev), 8);
1873 case 27: /* Call Chaos */
1876 case 28: /* Polymorph Self */
1878 if (!get_check("ÊѿȤ·¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©")) return FALSE;
1880 if (!get_check("You will polymorph yourself. Are you sure? ")) return FALSE;
1884 case 29: /* Mana Storm */
1885 if (!get_aim_dir(&dir)) return FALSE;
1887 fire_ball(GF_MANA, dir, 300 + (plev * 4), 4);
1889 case 30: /* Breathe Logrus */
1890 if (!get_aim_dir(&dir)) return FALSE;
1892 fire_ball(GF_CHAOS, dir, p_ptr->chp, 2);
1894 case 31: /* Call the Void */
1899 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥«¥ª¥¹¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1901 msg_format("You cast an unknown Chaos spell: %d.", spell);
1911 static bool cast_death_spell(int spell)
1915 int plev = p_ptr->lev;
1918 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1919 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1920 else beam = plev / 2;
1924 case 0: /* Detect Undead & Demons -> Unlife */
1925 (void)detect_monsters_nonliving(DETECT_RAD_DEFAULT);
1927 case 1: /* Malediction */
1928 if (!get_aim_dir(&dir)) return FALSE;
1929 /* A radius-0 ball may (1) be aimed at objects etc.,
1930 * and will affect them; (2) may be aimed at ANY
1931 * visible monster, unlike a 'bolt' which must travel
1932 * to the monster. */
1934 fire_ball(GF_HELL_FIRE, dir,
1935 damroll(3 + ((plev - 1) / 5), 4), 0);
1938 { /* Special effect first */
1939 dummy = randint1(1000);
1941 fire_ball_hide(GF_DEATH_RAY, dir, plev * 200, 0);
1942 else if (dummy < 500)
1943 fire_ball_hide(GF_TURN_ALL, dir, plev, 0);
1944 else if (dummy < 800)
1945 fire_ball_hide(GF_OLD_CONF, dir, plev, 0);
1947 fire_ball_hide(GF_STUN, dir, plev, 0);
1950 case 2: /* Detect Evil */
1951 (void)detect_monsters_evil(DETECT_RAD_DEFAULT);
1953 case 3: /* Stinking Cloud */
1954 if (!get_aim_dir(&dir)) return FALSE;
1956 fire_ball(GF_POIS, dir, 10 + (plev / 2), 2);
1958 case 4: /* Black Sleep */
1959 if (!get_aim_dir(&dir)) return FALSE;
1961 (void)sleep_monster(dir);
1963 case 5: /* Resist Poison */
1964 (void)set_oppose_pois(randint1(20) + 20, FALSE);
1966 case 6: /* Horrify */
1967 if (!get_aim_dir(&dir)) return FALSE;
1969 (void)fear_monster(dir, plev);
1970 (void)stun_monster(dir, plev);
1972 case 7: /* Enslave Undead */
1973 if (!get_aim_dir(&dir)) return FALSE;
1975 (void)control_one_undead(dir, plev);
1977 case 8: /* Orb of Entropy */
1978 if (!get_aim_dir(&dir)) return FALSE;
1980 fire_ball(GF_OLD_DRAIN, dir,
1981 (damroll(3, 6) + plev +
1982 (plev / (((p_ptr->pclass == CLASS_MAGE) ||
1983 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
1984 (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
1985 ((plev < 30) ? 2 : 3));
1987 case 9: /* Nether Bolt */
1988 if (!get_aim_dir(&dir)) return FALSE;
1990 fire_bolt_or_beam(beam, GF_NETHER, dir,
1991 damroll(8 + ((plev - 5) / 4), 8));
1993 case 10: /* Cloud kill */
1994 project(0, plev / 10 + 2, py, px,
1995 (30 + plev) * 2, GF_POIS, PROJECT_KILL | PROJECT_ITEM, -1);
1997 case 11: /* Genocide One */
1998 if (!get_aim_dir(&dir)) return FALSE;
2000 fire_ball_hide(GF_GENOCIDE, dir, plev + 50, 0);
2002 case 12: /* Poison Branding */
2005 case 13: /* Vampiric Drain */
2006 if (!get_aim_dir(&dir)) return FALSE;
2008 dummy = plev * 2 + randint1(plev * 2); /* Dmg */
2009 if (drain_life(dir, dummy))
2011 chg_virtue(V_SACRIFICE, -1);
2012 chg_virtue(V_VITALITY, -1);
2014 (void)hp_player(dummy);
2015 /* Gain nutritional sustenance: 150/hp drained */
2016 /* A Food ration gives 5000 food points (by contrast) */
2017 /* Don't ever get more than "Full" this way */
2018 /* But if we ARE Gorged, it won't cure us */
2019 dummy = p_ptr->food + MIN(5000, 100 * dummy);
2020 if (p_ptr->food < PY_FOOD_MAX) /* Not gorged already */
2021 (void)set_food(dummy >= PY_FOOD_MAX ? PY_FOOD_MAX - 1 : dummy);
2024 case 14: /* Animate Dead */
2025 animate_dead(0, py, px);
2027 case 15: /* Genocide */
2028 (void)symbol_genocide(plev+50, TRUE);
2030 case 16: /* Berserk */
2031 (void)set_shero(randint1(25) + 25, FALSE);
2032 (void)hp_player(30);
2033 (void)set_afraid(0);
2035 case 17: /* Invoke Spirits */
2037 int die = randint1(100) + plev / 5;
2038 int vir = virtue_number(V_CHANCE);
2041 if (p_ptr->virtues[vir - 1] > 0)
2043 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
2047 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
2051 if (!get_aim_dir(&dir)) return FALSE;
2054 msg_print("¤¢¤Ê¤¿¤Ï»à¼Ô¤¿¤Á¤ÎÎϤò¾·½¸¤·¤¿...");
2056 msg_print("You call on the power of the dead...");
2059 chg_virtue(V_CHANCE, 1);
2063 msg_print("¤¢¤Ê¤¿¤Ï¤ª¤É¤í¤ª¤É¤í¤·¤¤ÎϤΤ¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
2065 msg_print("You feel a surge of eldritch force!");
2072 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¤¢¤Ê¤¿¤Î¼þ¤ê¤ÎÃÏÌ̤«¤éµà¤Á¤¿¿Í±Æ¤¬Î©¤Á¾å¤¬¤Ã¤Æ¤¤¿¡ª");
2074 msg_print("Oh no! Mouldering forms rise from the earth around you!");
2077 (void)summon_specific(0, py, px, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
2078 chg_virtue(V_UNLIFE, 1);
2083 msg_print("̾¾õ¤·Æñ¤¤¼Ù°¤Ê¸ºß¤¬¤¢¤Ê¤¿¤Î¿´¤òÄ̤ê²á¤®¤Æ¹Ô¤Ã¤¿...");
2085 msg_print("An unnamable evil brushes against your mind...");
2088 set_afraid(p_ptr->afraid + randint1(4) + 4);
2093 msg_print("¤¢¤Ê¤¿¤ÎƬ¤ËÂçÎ̤ÎÍ©Î¤Á¤ÎÁû¡¹¤·¤¤À¼¤¬²¡¤·´ó¤»¤Æ¤¤¿...");
2095 msg_print("Your head is invaded by a horde of gibbering spectral voices...");
2098 set_confused(p_ptr->confused + randint1(4) + 4);
2106 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
2107 damroll(3 + ((plev - 1) / 5), 4));
2111 confuse_monster (dir, plev);
2115 fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
2119 (void)lite_line(dir);
2123 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
2124 damroll(3+((plev-5)/4),8));
2128 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
2129 damroll(5+((plev-5)/4),8));
2133 fire_bolt_or_beam(beam, GF_ACID, dir,
2134 damroll(6+((plev-5)/4),8));
2138 fire_bolt_or_beam(beam, GF_FIRE, dir,
2139 damroll(8+((plev-5)/4),8));
2143 drain_life(dir, 75);
2147 fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
2151 fire_ball(GF_ACID, dir, 40 + plev, 2);
2155 fire_ball(GF_ICE, dir, 70 + plev, 3);
2159 fire_ball(GF_FIRE, dir, 80 + plev, 3);
2163 drain_life(dir, 100 + plev);
2167 earthquake(py, px, 12);
2171 destroy_area(py, px, 13+randint0(5));
2175 symbol_genocide(plev+50, TRUE);
2179 dispel_monsters(120);
2183 dispel_monsters(150);
2191 msg_print("±¢±µ¤ÊÀ¼¤¬¥¯¥¹¥¯¥¹¾Ð¤¦¡£¡Ö¤â¤¦¤¹¤°¤ª¤Þ¤¨¤Ï²æ¡¹¤ÎÃç´Ö¤Ë¤Ê¤ë¤À¤í¤¦¡£¼å¤¼Ô¤è¡£¡×");
2193 msg_print("Sepulchral voices chuckle. 'Soon you will join us, mortal.'");
2198 case 18: /* Dark Bolt */
2199 if (!get_aim_dir(&dir)) return FALSE;
2201 fire_bolt_or_beam(beam, GF_DARK, dir,
2202 damroll(4 + ((plev - 5) / 4), 8));
2204 case 19: /* Battle Frenzy */
2205 (void)set_shero(randint1(25) + 25, FALSE);
2206 (void)hp_player(30);
2207 (void)set_afraid(0);
2208 (void)set_fast(randint1(20 + (plev / 2)) + (plev / 2), FALSE);
2210 case 20: /* Vampiric Branding */
2213 case 21: /* Vampirism True */
2214 if (!get_aim_dir(&dir)) return FALSE;
2216 chg_virtue(V_SACRIFICE, -1);
2217 chg_virtue(V_VITALITY, -1);
2219 for (dummy = 0; dummy < 3; dummy++)
2221 if (drain_life(dir, 100))
2225 case 22: /* Word of Death */
2226 (void)dispel_living(randint1(plev * 3));
2228 case 23: /* Darkness Storm */
2229 if (!get_aim_dir(&dir)) return FALSE;
2231 fire_ball(GF_DARK, dir, 100+plev*2, 4);
2233 case 24: /* Death Ray */
2234 if (!get_aim_dir(&dir)) return FALSE;
2236 (void)death_ray(dir, plev);
2238 case 25: /* Raise the Dead */
2241 bool pet = one_in_(3);
2244 type = (plev > 47 ? SUMMON_HI_UNDEAD : SUMMON_UNDEAD);
2246 if (!pet || (pet && (plev > 24) && one_in_(3)))
2247 mode |= PM_ALLOW_GROUP;
2249 if (pet) mode |= PM_FORCE_PET;
2250 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
2252 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, type, mode))
2255 msg_print("Î䤿¤¤É÷¤¬¤¢¤Ê¤¿¤Î¼þ¤ê¤Ë¿á¤»Ï¤á¤¿¡£¤½¤ì¤ÏÉåÇÔ½¤ò±¿¤ó¤Ç¤¤¤ë...");
2257 msg_print("Cold winds begin to blow around you, carrying with them the stench of decay...");
2263 msg_print("¸Å¤¨¤Î»à¤»¤ë¼Ô¶¦¤¬¤¢¤Ê¤¿¤Ë»Å¤¨¤ë¤¿¤áÅÚ¤«¤éᴤä¿¡ª");
2265 msg_print("Ancient, long-dead forms arise from the ground to serve you!");
2270 msg_print("»à¼Ô¤¬á´¤Ã¤¿¡£Ì²¤ê¤ò˸¤²¤ë¤¢¤Ê¤¿¤òȳ¤¹¤ë¤¿¤á¤Ë¡ª");
2272 msg_print("'The dead arise... to punish you for disturbing them!'");
2275 chg_virtue(V_UNLIFE, 1);
2280 case 26: /* Esoteria */
2281 if (randint1(50) > plev)
2282 return ident_spell(FALSE);
2284 return identify_fully(FALSE);
2286 case 27: /* Mimic vampire */
2287 (void)set_mimic(10+plev/2 + randint1(10+plev/2), MIMIC_VAMPIRE, FALSE);
2289 case 28: /* Restore Life */
2290 (void)restore_level();
2292 case 29: /* Mass Genocide */
2293 (void)mass_genocide(plev+50, TRUE);
2295 case 30: /* Hellfire */
2296 if (!get_aim_dir(&dir)) return FALSE;
2298 fire_ball(GF_HELL_FIRE, dir, 666, 3);
2300 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "ÃϹö¤Î¹å²Ð¤Î¼öʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
2302 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "the strain of casting Hellfire", -1);
2306 case 31: /* Wraithform */
2307 set_wraith_form(randint1(plev / 2) + (plev / 2), FALSE);
2310 msg_format("You cast an unknown Death spell: %d.", spell);
2318 static bool cast_trump_spell(int spell, bool success)
2322 int plev = p_ptr->lev;
2323 int summon_lev = plev * 2 / 3 + randint1(plev/2);
2325 bool no_trump = FALSE;
2326 bool unique_okay = FALSE;
2329 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
2330 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
2331 else beam = plev / 2;
2333 if (summon_lev < 1) summon_lev = 1;
2334 if (!success || (randint1(50+plev) < plev/10)) unique_okay = TRUE;
2337 case 0: /* Phase Door */
2340 teleport_player(10);
2343 case 1: /* Trump Spiders */
2345 bool pet = success; /* (randint1(5) > 2) */
2346 u32b mode = PM_ALLOW_GROUP;
2348 if (pet) mode |= PM_FORCE_PET;
2349 else mode |= PM_NO_PET;
2352 msg_print("¤¢¤Ê¤¿¤ÏÃØéá¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2354 msg_print("You concentrate on the trump of an spider...");
2357 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_SPIDER, mode))
2361 msg_print("¾¤´Ô¤µ¤ì¤¿ÃØéá¤ÏÅܤäƤ¤¤ë¡ª");
2363 msg_print("The summoned spiders get angry!");
2373 case 2: /* Shuffle */
2376 /* A limited power 'wonder' spell */
2377 int die = randint1(120);
2378 int vir = virtue_number(V_CHANCE);
2380 if ((p_ptr->pclass == CLASS_ROGUE) ||
2381 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
2382 (p_ptr->pclass == CLASS_SORCERER))
2383 die = (randint1(110)) + plev / 5;
2384 /* Card sharks and high mages get a level bonus */
2388 if (p_ptr->virtues[vir - 1] > 0)
2390 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
2394 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
2399 msg_print("¤¢¤Ê¤¿¤Ï¥«¡¼¥É¤òÀڤäưìËç°ú¤¤¤¿...");
2401 msg_print("You shuffle the deck and draw a card...");
2405 chg_virtue(V_CHANCE, 1);
2410 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡Ô»à¡Õ¤À¡ª");
2412 msg_print("Oh no! It's Death!");
2415 for (dummy = 0; dummy < randint1(3); dummy++)
2416 (void)activate_hi_summon(py, px, FALSE);
2421 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡Ô°Ëâ¡Õ¤À¡ª");
2423 msg_print("Oh no! It's the Devil!");
2426 (void)summon_specific(0, py, px, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
2432 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡ÔÄߤé¤ì¤¿ÃË¡Õ¤À¡ª");
2434 msg_print("Oh no! It's the Hanged Man.");
2437 (void)activate_ty_curse(FALSE, &count);
2442 msg_print("¡ÔÉÔĴϤηõ¡Õ¤À¡£");
2444 msg_print("It's the swords of discord.");
2447 aggravate_monsters(0);
2452 msg_print("¡Ô¶ò¼Ô¡Õ¤À¡£");
2454 msg_print("It's the Fool.");
2457 (void)do_dec_stat(A_INT);
2458 (void)do_dec_stat(A_WIS);
2463 msg_print("´ñ̯¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2465 msg_print("It's the picture of a strange monster.");
2468 if (!(summon_specific(0, py, px, (dun_level * 3) / 2, 32 + randint1(6), (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET))))
2474 msg_print("¡Ô·î¡Õ¤À¡£");
2476 msg_print("It's the Moon.");
2484 msg_print("¡Ô±¿Ì¿¤ÎÎØ¡Õ¤À¡£");
2486 msg_print("It's the Wheel of Fortune.");
2489 wild_magic(randint0(32));
2494 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2496 msg_print("It's a teleport trump card.");
2499 teleport_player(10);
2504 msg_print("¡ÔÀµµÁ¡Õ¤À¡£");
2506 msg_print("It's Justice.");
2509 set_blessed(p_ptr->lev, FALSE);
2514 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2516 msg_print("It's a teleport trump card.");
2519 teleport_player(100);
2524 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2526 msg_print("It's a teleport trump card.");
2529 teleport_player(200);
2534 msg_print("¡ÔÅã¡Õ¤À¡£");
2536 msg_print("It's the Tower.");
2544 msg_print("¡ÔÀáÀ©¡Õ¤À¡£");
2546 msg_print("It's Temperance.");
2549 sleep_monsters_touch();
2554 msg_print("¡ÔÅã¡Õ¤À¡£");
2556 msg_print("It's the Tower.");
2559 earthquake(py, px, 5);
2564 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2566 msg_print("It's the picture of a friendly monster.");
2569 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE1, PM_FORCE_PET)))
2575 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2577 msg_print("It's the picture of a friendly monster.");
2580 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE2, PM_FORCE_PET)))
2586 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2588 msg_print("It's the picture of a friendly monster.");
2591 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE4, PM_FORCE_PET)))
2597 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2599 msg_print("It's the picture of a friendly monster.");
2602 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE5, PM_FORCE_PET)))
2608 msg_print("¡ÔÎø¿Í¡Õ¤À¡£");
2610 msg_print("It's the Lovers.");
2613 if (get_aim_dir(&dir))
2614 (void)charm_monster(dir, MIN(p_ptr->lev, 20));
2619 msg_print("¡Ô±£¼Ô¡Õ¤À¡£");
2621 msg_print("It's the Hermit.");
2629 msg_print("¡Ô¿³È½¡Õ¤À¡£");
2631 msg_print("It's the Judgement.");
2634 do_cmd_rerate(FALSE);
2635 if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3)
2638 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
2640 msg_print("You are cured of all mutations.");
2643 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
2644 p_ptr->update |= PU_BONUS;
2651 msg_print("¡ÔÂÀÍÛ¡Õ¤À¡£");
2653 msg_print("It's the Sun.");
2656 chg_virtue(V_KNOWLEDGE, 1);
2657 chg_virtue(V_ENLIGHTEN, 1);
2663 msg_print("¡ÔÀ¤³¦¡Õ¤À¡£");
2665 msg_print("It's the World.");
2668 if (p_ptr->exp < PY_MAX_EXP)
2670 s32b ee = (p_ptr->exp / 25) + 1;
2671 if (ee > 5000) ee = 5000;
2673 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
2675 msg_print("You feel more experienced.");
2683 case 3: /* Reset Recall */
2686 if (!reset_recall()) return FALSE;
2689 case 4: /* Teleport Self */
2692 teleport_player(plev * 4);
2695 case 5: /* Trump Spying */
2698 (void)set_tim_esp(randint1(30) + 25, FALSE);
2701 case 6: /* Teleport Away */
2704 if (!get_aim_dir(&dir)) return FALSE;
2705 (void)fire_beam(GF_AWAY_ALL, dir, plev);
2708 case 7: /* Trump Animals */
2710 bool pet = success; /* was (randint1(5) > 2) */
2711 int type = (pet ? SUMMON_ANIMAL_RANGER : SUMMON_ANIMAL);
2714 if (pet) mode |= PM_FORCE_PET;
2715 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2718 msg_print("¤¢¤Ê¤¿¤Ïưʪ¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2720 msg_print("You concentrate on the trump of an animal...");
2724 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
2728 msg_print("¾¤´¤µ¤ì¤¿Æ°Êª¤ÏÅܤäƤ¤¤ë¡ª");
2730 msg_print("The summoned animal gets angry!");
2741 case 8: /* Trump Reach */
2744 if (!get_aim_dir(&dir)) return FALSE;
2745 fetch(dir, plev * 15, TRUE);
2748 case 9: /* Trump Kamikaze */
2753 if (!target_set(TARGET_KILL)) return FALSE;
2760 msg_print("¤¢¤Ê¤¿¤Ï¥«¥ß¥«¥¼¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2762 msg_print("You concentrate on several trumps at once...");
2766 for (dummy = 2 + randint0(plev / 7); dummy > 0; dummy--)
2768 bool pet = success; /* was (randint1(10) > 3) */
2772 if (pet) mode |= PM_FORCE_PET;
2773 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2775 if (p_ptr->pclass == CLASS_BEASTMASTER)
2777 type = SUMMON_KAMIKAZE_LIVING;
2781 type = SUMMON_KAMIKAZE;
2784 if (summon_specific((pet ? -1 : 0), y, x, summon_lev, type, mode))
2788 msg_print("¾¤´Ô¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
2790 msg_print("The summoned creatures get angry!");
2798 case 10: /* Phantasmal Servant */
2801 if (summon_specific(-1, py, px, (summon_lev * 3) / 2, SUMMON_PHANTOM, PM_FORCE_PET))
2804 msg_print("¸æÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¸æ¼ç¿ÍÍÍ¡©");
2806 msg_print("'Your wish, master?'");
2816 case 11: /* Speed Monster */
2819 bool old_target_pet = target_pet;
2821 if (!get_aim_dir(&dir))
2823 target_pet = old_target_pet;
2826 target_pet = old_target_pet;
2827 (void)speed_monster(dir);
2830 case 12: /* Teleport Level */
2834 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
2836 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
2838 (void)teleport_player_level();
2841 case 13: /* Dimension Door */
2845 msg_print("¼¡¸µ¤ÎÈ⤬³«¤¤¤¿¡£ÌÜŪÃϤòÁª¤ó¤Ç²¼¤µ¤¤¡£");
2847 msg_print("You open a dimensional gate. Choose a destination.");
2850 return dimension_door();
2853 case 14: /* Word of Recall */
2856 if (!word_of_recall()) return FALSE;
2859 case 15: /* Banish */
2862 banish_monsters(plev * 4);
2865 case 16: /* Swap Position */
2869 project_length = -1;
2870 if (!get_aim_dir(&dir))
2877 (void)teleport_swap(dir);
2881 case 17: /* Trump Undead */
2883 bool pet = success; /* (randint1(10) > 3) */
2886 if (pet) mode |= PM_FORCE_PET;
2887 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2890 msg_print("¤¢¤Ê¤¿¤Ï¥¢¥ó¥Ç¥Ã¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2892 msg_print("You concentrate on the trump of an undead creature...");
2896 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_UNDEAD, mode))
2900 msg_print("¾¤´Ô¤µ¤ì¤¿¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
2902 msg_print("The summoned undead creature gets angry!");
2913 case 18: /* Trump Reptiles */
2915 bool pet = success; /* was (randint1(5) > 2) */
2918 if (pet) mode |= PM_FORCE_PET;
2919 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2922 msg_print("¤¢¤Ê¤¿¤Ïà¨ÃîÎà¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2924 msg_print("You concentrate on the trump of a reptile...");
2928 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HYDRA, mode))
2932 msg_print("¾¤´Ô¤µ¤ì¤¿à¨ÃîÎà¤ÏÅܤäƤ¤¤ë¡ª");
2934 msg_print("The summoned reptile gets angry!");
2945 case 19: /* Trump Monsters */
2950 msg_print("¤¢¤Ê¤¿¤Ï¥â¥ó¥¹¥¿¡¼¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2952 msg_print("You concentrate on several trumps at once...");
2956 for (dummy = 0; dummy < 1 + ((plev - 15)/ 10); dummy++)
2958 bool pet = success; /* was (randint1(10) > 3) */
2962 if (pet) mode |= PM_FORCE_PET;
2963 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2965 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
2967 if (p_ptr->pclass == CLASS_BEASTMASTER)
2969 type = SUMMON_LIVING;
2976 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
2980 msg_print("¾¤´Ô¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
2982 msg_print("The summoned creatures get angry!");
2990 case 20: /* Trump Hounds */
2992 bool pet = success; /* was (randint1(5) > 2) */
2993 u32b mode = PM_ALLOW_GROUP;
2995 if (pet) mode |= PM_FORCE_PET;
2996 else mode |= PM_NO_PET;
2999 msg_print("¤¢¤Ê¤¿¤Ï¥Ï¥¦¥ó¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3001 msg_print("You concentrate on the trump of a hound...");
3005 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HOUND, mode))
3009 msg_print("¾¤´Ô¤µ¤ì¤¿¥Ï¥¦¥ó¥É¤ÏÅܤäƤ¤¤ë¡ª");
3011 msg_print("The summoned hounds get angry!");
3022 case 21: /* Trump Branding */
3028 case 22: /* Living Trump */
3032 /* Teleport control */
3035 /* Random teleportation (uncontrolled) */
3037 /* Gain the mutation */
3038 if (gain_random_mutation(dummy))
3040 msg_print("¤¢¤Ê¤¿¤ÏÀ¸¤¤Æ¤¤¤ë¥«¡¼¥É¤ËÊѤï¤Ã¤¿¡£");
3042 msg_print("You have turned into a Living Trump.");
3047 case 23: /* Trump Cyberdemon */
3049 bool pet = success; /* was (randint1(10) > 3) */
3052 if (pet) mode |= PM_FORCE_PET;
3053 else mode |= PM_NO_PET;
3056 msg_print("¤¢¤Ê¤¿¤Ï¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3058 msg_print("You concentrate on the trump of a Cyberdemon...");
3062 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_CYBER, mode))
3066 msg_print("¾¤´Ô¤µ¤ì¤¿¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3068 msg_print("The summoned Cyberdemon gets angry!");
3079 case 24: /* Trump Divination */
3082 (void)detect_all(DETECT_RAD_DEFAULT);
3085 case 25: /* Trump Lore */
3088 return identify_fully(FALSE);
3091 case 26: /* Heal Monster */
3094 bool old_target_pet = target_pet;
3096 if (!get_aim_dir(&dir))
3098 target_pet = old_target_pet;
3101 target_pet = old_target_pet;
3103 (void)heal_monster(dir, p_ptr->lev * 10 + 200);
3106 case 27: /* Trump Dragon */
3108 bool pet = success; /* was (randint1(10) > 3) */
3111 if (pet) mode |= PM_FORCE_PET;
3112 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3115 msg_print("¤¢¤Ê¤¿¤Ï¥É¥é¥´¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3117 msg_print("You concentrate on the trump of a dragon...");
3121 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DRAGON, mode))
3125 msg_print("¾¤´Ô¤µ¤ì¤¿¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3127 msg_print("The summoned dragon gets angry!");
3138 case 28: /* Trump Meteor */
3141 int x, y, dx, dy, i;
3142 int b = 10 + randint1(10);
3143 for (i = 0; i < b; i++)
3145 int count = 0, d = 0;
3150 if (count > 20) break;
3151 x = px - 8 + randint0(17);
3152 y = py - 8 + randint0(17);
3154 if (!in_bounds(y,x) || (!cave_floor_bold(y,x) && (cave[y][x].feat != FEAT_TREES)) || !player_has_los_bold(y, x)) continue;
3156 dx = (px > x) ? (px - x) : (x - px);
3157 dy = (py > y) ? (py - y) : (y - py);
3159 /* Approximate distance */
3160 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
3164 if (count > 20) continue;
3166 project(0, 2, y, x, plev * 2, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
3170 case 29: /* Trump Demon */
3172 bool pet = success; /* was (randint1(10) > 3) */
3175 if (pet) mode |= PM_FORCE_PET;
3176 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3179 msg_print("¤¢¤Ê¤¿¤Ï¥Ç¡¼¥â¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3181 msg_print("You concentrate on the trump of a demon...");
3185 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DEMON, mode))
3189 msg_print("¾¤´Ô¤µ¤ì¤¿¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3191 msg_print("The summoned demon gets angry!");
3202 case 30: /* Trump Greater Undead */
3204 bool pet = success; /* was (randint1(10) > 3) */
3207 if (pet) mode |= PM_FORCE_PET;
3208 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3210 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
3213 msg_print("¤¢¤Ê¤¿¤Ï¶¯ÎϤʥ¢¥ó¥Ç¥Ã¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3215 msg_print("You concentrate on the trump of a greater undead being...");
3219 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HI_UNDEAD, mode))
3223 msg_print("¾¤´Ô¤µ¤ì¤¿¾åµé¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
3225 msg_print("The summoned greater undead creature gets angry!");
3236 case 31: /* Trump Ancient Dragon */
3238 bool pet = success; /* was (randint1(10) > 3) */
3242 if (pet) mode |= PM_FORCE_PET;
3243 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3245 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
3247 if (p_ptr->pclass == CLASS_BEASTMASTER)
3249 type = SUMMON_HI_DRAGON_LIVING;
3253 type = SUMMON_HI_DRAGON;
3257 msg_print("¤¢¤Ê¤¿¤Ï¸ÅÂå¥É¥é¥´¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3259 msg_print("You concentrate on the trump of an ancient dragon...");
3263 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
3267 msg_print("¾¤´Ô¤µ¤ì¤¿¸ÅÂå¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3269 msg_print("The summoned ancient dragon gets angry!");
3282 msg_format("̤ÃΤΥ«¡¼¥É¤Î¼öʸ¤Ç¤¹: %d", spell);
3284 msg_format("You cast an unknown Trump spell: %d.", spell);
3293 msg_print("ï¤â¤¢¤Ê¤¿¤Î¥«¡¼¥É¤Î¸Æ¤ÓÀ¼¤ËÅú¤¨¤Ê¤¤¡£");
3295 msg_print("Nobody answers to your Trump call.");
3304 static bool cast_arcane_spell(int spell)
3308 int plev = p_ptr->lev;
3310 bool no_trump = FALSE;
3312 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3313 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3314 else beam = plev / 2;
3319 if (!get_aim_dir(&dir)) return FALSE;
3321 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
3322 damroll(3 + ((plev - 1) / 5), 3));
3324 case 1: /* Wizard Lock */
3325 if (!get_aim_dir(&dir)) return FALSE;
3327 (void)wizard_lock(dir);
3329 case 2: /* Detect Invisibility */
3330 (void)detect_monsters_invis(DETECT_RAD_DEFAULT);
3332 case 3: /* Detect Monsters */
3333 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
3336 teleport_player(10);
3338 case 5: /* Light Area */
3339 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
3341 case 6: /* Trap & Door Destruction */
3342 if (!get_aim_dir(&dir)) return FALSE;
3344 (void)destroy_door(dir);
3346 case 7: /* Cure Light Wounds */
3347 (void)hp_player(damroll(2, 8));
3348 (void)set_cut(p_ptr->cut - 10);
3350 case 8: /* Detect Doors & Traps */
3351 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
3352 (void)detect_doors(DETECT_RAD_DEFAULT);
3353 (void)detect_stairs(DETECT_RAD_DEFAULT);
3355 case 9: /* Phlogiston */
3358 case 10: /* Detect Treasure */
3359 (void)detect_treasure(DETECT_RAD_DEFAULT);
3360 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
3362 case 11: /* Detect Enchantment */
3363 (void)detect_objects_magic(DETECT_RAD_DEFAULT);
3365 case 12: /* Detect Objects */
3366 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
3368 case 13: /* Cure Poison */
3369 (void)set_poisoned(0);
3371 case 14: /* Resist Cold */
3372 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3374 case 15: /* Resist Fire */
3375 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3377 case 16: /* Resist Lightning */
3378 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3380 case 17: /* Resist Acid */
3381 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3383 case 18: /* Cure Medium Wounds */
3384 (void)hp_player(damroll(4, 8));
3385 (void)set_cut((p_ptr->cut / 2) - 50);
3387 case 19: /* Teleport */
3388 teleport_player(plev * 5);
3390 case 20: /* Identify */
3391 return ident_spell(FALSE);
3392 case 21: /* Stone to Mud */
3393 if (!get_aim_dir(&dir)) return FALSE;
3395 (void)wall_to_mud(dir);
3397 case 22: /* Ray of Light */
3398 if (!get_aim_dir(&dir)) return FALSE;
3401 msg_print("¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
3403 msg_print("A line of light appears.");
3406 (void)lite_line(dir);
3408 case 23: /* Satisfy Hunger */
3409 (void)set_food(PY_FOOD_MAX - 1);
3411 case 24: /* See Invisible */
3412 (void)set_tim_invis(randint1(24) + 24, FALSE);
3414 case 25: /* Conjure Elemental */
3415 if (!summon_specific(-1, py, px, plev, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3418 case 26: /* Teleport Level */
3420 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
3422 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
3424 (void)teleport_player_level();
3426 case 27: /* Teleport Away */
3427 if (!get_aim_dir(&dir)) return FALSE;
3429 (void)fire_beam(GF_AWAY_ALL, dir, plev);
3431 case 28: /* Elemental Ball */
3432 if (!get_aim_dir(&dir)) return FALSE;
3434 switch (randint1(4))
3436 case 1: dummy = GF_FIRE;break;
3437 case 2: dummy = GF_ELEC;break;
3438 case 3: dummy = GF_COLD;break;
3439 default: dummy = GF_ACID;break;
3441 fire_ball(dummy, dir, 75 + (plev), 2);
3443 case 29: /* Detection */
3444 (void)detect_all(DETECT_RAD_DEFAULT);
3446 case 30: /* Word of Recall */
3447 if (!word_of_recall()) return FALSE;
3449 case 31: /* Clairvoyance */
3450 chg_virtue(V_KNOWLEDGE, 1);
3451 chg_virtue(V_ENLIGHTEN, 1);
3453 if (!p_ptr->telepathy)
3455 (void)set_tim_esp(randint1(30) + 25, FALSE);
3459 msg_format("You cast an unknown Arcane spell: %d.", spell);
3465 msg_print("¥¨¥ì¥á¥ó¥¿¥ë¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3467 msg_print("No Elementals arrive.");
3474 static bool cast_enchant_spell(int spell)
3476 int plev = p_ptr->lev;
3478 bool no_trump = FALSE;
3482 case 0: /* Infravision */
3483 set_tim_infra(100 + randint1(100), FALSE);
3485 case 1: /* Regeneration */
3486 set_tim_regen(80 + randint1(80), FALSE);
3488 case 2: /* Satisfy Hunger */
3489 (void)set_food(PY_FOOD_MAX - 1);
3491 case 3: /* Resist Cold */
3492 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3494 case 4: /* Resist Fire */
3495 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3497 case 5: /* Heroism */
3498 (void)set_hero(randint1(25) + 25, FALSE);
3499 (void)hp_player(10);
3500 (void)set_afraid(0);
3502 case 6: /* Resist Lightning */
3503 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3505 case 7: /* Resist Acid */
3506 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3508 case 8: /* See Invisibility */
3509 (void)set_tim_invis(randint1(24) + 24, FALSE);
3511 case 9: /* Remove Curse */
3515 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
3517 msg_print("You feel as if someone is watching over you.");
3521 case 10: /* Resist Poison */
3522 (void)set_oppose_pois(randint1(20) + 20, FALSE);
3524 case 11: /* Berserk */
3525 (void)set_shero(randint1(25) + 25, FALSE);
3526 (void)hp_player(30);
3527 (void)set_afraid(0);
3529 case 12: /* Self Knowledge */
3530 (void)self_knowledge();
3532 case 13: /* Protection from Evil */
3533 (void)set_protevil(randint1(25) + 3 * p_ptr->lev, FALSE);
3535 case 14: /* Healing */
3541 case 15: /* Mana Branding */
3542 return choose_ele_attack();
3544 case 16: /* Telepathy */
3545 (void)set_tim_esp(randint1(30) + 25, FALSE);
3547 case 17: /* Stone Skin */
3548 (void)set_shield(randint1(20) + 30, FALSE);
3550 case 18: /* Resistance */
3551 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3552 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3553 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3554 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3555 (void)set_oppose_pois(randint1(20) + 20, FALSE);
3557 case 19: /* Haste */
3558 (void)set_fast(randint1(20 + plev) + plev, FALSE);
3560 case 20: /* Walk through Wall */
3561 (void)set_kabenuke(randint1(plev/2) + plev/2, FALSE);
3563 case 21: /* Pulish Shield */
3564 (void)pulish_shield();
3566 case 22: /* Create Golem */
3567 if (summon_specific(-1, py, px, plev, SUMMON_GOLEM, PM_FORCE_PET))
3570 msg_print("¥´¡¼¥ì¥à¤òºî¤Ã¤¿¡£");
3572 msg_print("You make a golem.");
3580 case 23: /* Magic armor */
3581 (void)set_magicdef(randint1(20) + 20, FALSE);
3583 case 24: /* Remove Enchantment */
3584 if (!mundane_spell(TRUE)) return FALSE;
3586 case 25: /* Remove All Curse */
3587 if (remove_all_curse())
3590 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
3592 msg_print("You feel as if someone is watching over you.");
3596 case 26: /* Total Knowledge */
3597 return identify_fully(FALSE);
3599 case 27: /* Enchant Weapon */
3600 return enchant_spell(randint0(4) + 1, randint0(4) + 1, 0);
3602 case 28: /* Enchant Armor */
3603 return enchant_spell(0, 0, randint0(3) + 2);
3605 case 29: /* Brand Weapon */
3606 brand_weapon(randint0(18));
3608 case 30: /* Living Trump */
3610 /* Teleport control */
3613 /* Random teleportation (uncontrolled) */
3615 /* Gain the mutation */
3616 if (gain_random_mutation(dummy))
3618 msg_print("¤¢¤Ê¤¿¤ÏÀ¸¤¤Æ¤¤¤ë¥«¡¼¥É¤ËÊѤï¤Ã¤¿¡£");
3620 msg_print("You have turned into a Living Trump.");
3623 case 31: /* Immune */
3624 return (choose_ele_immune(13 + randint1(13)));
3627 msg_format("You cast an unknown Craft spell: %d.", spell);
3633 msg_print("¤¦¤Þ¤¯¥´¡¼¥ì¥à¤òºî¤ì¤Ê¤«¤Ã¤¿¡£");
3635 msg_print("No Golems arrive.");
3643 * An "item_tester_hook" for offer
3645 static bool item_tester_offer(object_type *o_ptr)
3647 /* Flasks of oil are okay */
3648 if (o_ptr->tval != TV_CORPSE) return (FALSE);
3650 if (o_ptr->sval != SV_CORPSE) return (FALSE);
3652 if (strchr("pht", r_info[o_ptr->pval].d_char)) return (TRUE);
3654 /* Assume not okay */
3659 static bool cast_daemon_spell(int spell)
3662 int plev = p_ptr->lev;
3664 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3665 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3666 else beam = plev / 2;
3670 case 0: /* Magic Missile */
3671 if (!get_aim_dir(&dir)) return FALSE;
3673 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
3674 damroll(3 + ((plev - 1) / 5), 4));
3676 case 1: /* Detect Undead & Demons -> Unlife */
3677 (void)detect_monsters_nonliving(DETECT_RAD_DEFAULT);
3680 (void)set_blessed(randint1(12) + 12, FALSE);
3682 case 3: /* Resist Fire */
3683 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3685 case 4: /* Horrify */
3686 if (!get_aim_dir(&dir)) return FALSE;
3688 (void)fear_monster(dir, plev);
3689 (void)stun_monster(dir, plev);
3691 case 5: /* Nether Bolt */
3692 if (!get_aim_dir(&dir)) return FALSE;
3694 fire_bolt_or_beam(beam, GF_NETHER, dir,
3695 damroll(6 + ((plev - 5) / 4), 8));
3697 case 6: /* Summon monster, demon */
3698 if (!summon_specific(-1, py, px, (plev * 3) / 2, SUMMON_MANES, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3701 msg_print("¸ÅÂå¤Î»àÎî¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3703 msg_print("No Manes arrive.");
3707 case 7: /* Mini Hellfire */
3708 if (!get_aim_dir(&dir)) return FALSE;
3710 fire_ball(GF_HELL_FIRE, dir,
3711 (damroll(3, 6) + plev +
3712 (plev / (((p_ptr->pclass == CLASS_MAGE) ||
3713 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
3714 (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
3715 ((plev < 30) ? 2 : 3));
3717 case 8: /* Enslave Demon */
3718 if (!get_aim_dir(&dir)) return FALSE;
3720 (void)control_one_demon(dir, plev);
3722 case 9: /* Vision */
3723 map_area(DETECT_RAD_MAP);
3725 case 10: /* Resist Nether */
3726 (void)set_tim_res_nether(randint1(20) + 20, FALSE);
3728 case 11: /* Plasma Bolt */
3729 if (!get_aim_dir(&dir)) return FALSE;
3731 fire_bolt_or_beam(beam, GF_PLASMA, dir,
3732 damroll(11 + ((plev - 5) / 4), 8));
3734 case 12: /* Fire Ball */
3735 if (!get_aim_dir(&dir)) return FALSE;
3737 fire_ball(GF_FIRE, dir, plev + 55, 2);
3739 case 13: /* Fire Branding */
3742 case 14: /* Nether Ball */
3743 if (!get_aim_dir(&dir)) return FALSE;
3745 fire_ball(GF_NETHER, dir, plev*3/2 + 100, plev / 20+2);
3747 case 15: /* Summon monster, demon */
3749 bool pet = !one_in_(3);
3752 if (pet) mode |= PM_FORCE_PET;
3753 else mode |= PM_NO_PET;
3754 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
3756 if (summon_specific((pet ? -1 : 0), py, px, plev*2/3+randint1(plev/2), SUMMON_DEMON, mode))
3759 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
3761 msg_print("The area fills with a stench of sulphur and brimstone.");
3767 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
3769 msg_print("'What is thy bidding... Master?'");
3774 msg_print("¡ÖÈܤ·¤¼Ô¤è¡¢²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª ¤ªÁ°¤Îº²¤òĺ¤¯¤¾¡ª¡×");
3776 msg_print("'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'");
3783 msg_print("°Ëâ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3785 msg_print("No Greater Demon arrive.");
3790 case 16: /* Telepathy */
3791 (void)set_tim_esp(randint1(30) + 25, FALSE);
3793 case 17: /* Demoncloak */
3795 int dur=randint1(20) + 20;
3797 set_oppose_fire(dur, FALSE);
3798 set_oppose_cold(dur, FALSE);
3799 set_tim_sh_fire(dur, FALSE);
3803 case 18: /* Rain of Lava */
3804 fire_ball(GF_FIRE, 0, (55 + plev)*2, 3);
3805 fire_ball_hide(GF_LAVA_FLOW, 0, 2+randint1(2), 3);
3807 case 19: /* Plasma ball */
3808 if (!get_aim_dir(&dir)) return FALSE;
3810 fire_ball(GF_PLASMA, dir, plev*3/2 + 80, 2 + plev/40);
3812 case 20: /* Mimic demon */
3813 (void)set_mimic(10+plev/2 + randint1(10+plev/2), MIMIC_DEMON, FALSE);
3815 case 21: /* Nether Wave == Dispel Good */
3816 (void)dispel_monsters(randint1(plev * 2));
3817 (void)dispel_good(randint1(plev * 2));
3820 if (!get_aim_dir(&dir)) return FALSE;
3821 fire_ball(GF_NEXUS, dir, 100 + plev*2, 4);
3823 case 23: /* Hand Doom */
3824 if (!get_aim_dir(&dir)) return FALSE;
3826 else msg_print("<ÇËÌǤμê>¤òÊü¤Ã¤¿¡ª");
3828 else msg_print("You invoke the Hand of Doom!");
3831 fire_ball_hide(GF_HAND_DOOM, dir, plev * 2, 0);
3833 case 24: /* Heroism */
3834 (void)set_hero(randint1(25) + 25, FALSE);
3835 (void)hp_player(10);
3836 (void)set_afraid(0);
3838 case 25: /* Tim resist time */
3839 (void)set_tim_res_time(randint1(20)+20, FALSE);
3841 case 26: /* Circle of Madness */
3842 fire_ball(GF_CHAOS, 0, 50+plev, 3+plev/20);
3843 fire_ball(GF_CONFUSION, 0, 50+plev, 3+plev/20);
3844 fire_ball(GF_CHARM, 0, 20+plev, 3+plev/20);
3846 case 27: /* True Discharge Minion */
3849 case 28: /* Summon Greater Demon */
3856 item_tester_hook = item_tester_offer;
3858 q = "¤É¤Î»àÂΤòÊû¤²¤Þ¤¹¤«? ";
3859 s = "Êû¤²¤é¤ì¤ë»àÂΤò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
3861 q = "Sacrifice which corpse? ";
3862 s = "You have nothing to scrifice.";
3864 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return FALSE;
3866 /* Get the item (in the pack) */
3869 o_ptr = &inventory[item];
3872 /* Get the item (on the floor) */
3875 o_ptr = &o_list[0 - item];
3878 summon_lev = p_ptr->lev * 2 / 3 + r_info[o_ptr->pval].level;
3879 if (summon_specific(-1, py, px, summon_lev, SUMMON_HI_DEMON, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3882 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
3884 msg_print("The area fills with a stench of sulphur and brimstone.");
3889 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
3891 msg_print("'What is thy bidding... Master?'");
3894 /* Decrease the item (from the pack) */
3897 inven_item_increase(item, -1);
3898 inven_item_describe(item);
3899 inven_item_optimize(item);
3902 /* Decrease the item (from the floor) */
3905 floor_item_increase(0 - item, -1);
3906 floor_item_describe(0 - item);
3907 floor_item_optimize(0 - item);
3913 msg_print("°Ëâ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3915 msg_print("No Greater Demon arrive.");
3920 case 29: /* Nether Storm */
3921 if (!get_aim_dir(&dir)) return FALSE;
3923 fire_ball(GF_NETHER, dir, plev*15, plev / 5);
3925 case 30: /* Blood curse */
3927 if (!get_aim_dir(&dir)) return FALSE;
3929 fire_ball_hide(GF_BLOOD_CURSE, dir, 600, 0);
3931 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "·ì¤Î¼ö¤¤", -1);
3933 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "Blood curse", -1);
3937 case 31: /* Mimic Demon lord */
3938 (void)set_mimic(15 + randint1(15), MIMIC_DEMON_LORD, FALSE);
3941 msg_format("You cast an unknown Daemon spell: %d.", spell);
3949 static bool cast_crusade_spell(int spell)
3953 int plev = p_ptr->lev;
3955 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3956 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3957 else beam = plev / 2;
3962 if (!get_aim_dir(&dir)) return FALSE;
3964 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
3965 damroll(3 + ((plev - 1) / 5), 4));
3968 (void)detect_monsters_evil(DETECT_RAD_DEFAULT);
3970 case 2: /* Remove Fear */
3971 (void)set_afraid(0);
3974 if (!get_aim_dir(&dir)) return FALSE;
3976 (void)fear_monster(dir, plev);
3979 (void)sleep_monsters_touch();
3982 teleport_player(25+plev/2);
3985 if (!get_aim_dir(&dir)) return FALSE;
3986 fire_blast(GF_LITE, dir, 3+((plev-1)/9), 2, 10, 3);
3990 (void)set_poisoned(0);
3994 if (!get_aim_dir(&dir)) return FALSE;
3995 (void)fire_ball(GF_AWAY_EVIL, dir, MAX_SIGHT*5, 0);
3997 case 9: /* Holy Orb */
3998 if (!get_aim_dir(&dir)) return FALSE;
4000 fire_ball(GF_HOLY_FIRE, dir,
4001 (damroll(3, 6) + plev +
4002 (plev / ((p_ptr->pclass == CLASS_PRIEST ||
4003 p_ptr->pclass == CLASS_HIGH_MAGE ||
4004 p_ptr->pclass == CLASS_SORCERER) ? 2 : 4))),
4005 ((plev < 30) ? 2 : 3));
4008 case 10: /* Exorcism */
4009 (void)dispel_undead(randint1(plev));
4010 (void)dispel_demons(randint1(plev));
4011 (void)turn_evil(plev);
4013 case 11: /* Remove Curse */
4017 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
4019 msg_print("You feel as if someone is watching over you.");
4023 case 12: /* Sense Unseen */
4024 (void)set_tim_invis(randint1(24) + 24, FALSE);
4026 case 13: /* Protection from Evil */
4027 (void)set_protevil(randint1(25) + 3 * p_ptr->lev, FALSE);
4030 if (!get_aim_dir(&dir)) return FALSE;
4031 (void)fire_bolt(GF_ELEC, dir, plev*5);
4033 case 15: /* Holy Word */
4034 (void)dispel_evil(randint1(plev * 6));
4035 (void)hp_player(100);
4036 (void)set_afraid(0);
4037 (void)set_poisoned(0);
4042 if (!get_aim_dir(&dir)) return FALSE;
4044 (void)destroy_door(dir);
4047 if (!get_aim_dir(&dir)) return FALSE;
4048 (void)stasis_evil(dir);
4051 set_tim_sh_holy(randint1(20)+20, FALSE);
4053 case 19: /* Dispel Undead + Demons */
4054 (void)dispel_undead(randint1(plev * 4));
4055 (void)dispel_demons(randint1(plev * 4));
4057 case 20: /* Dispel Evil */
4058 (void)dispel_evil(randint1(plev * 4));
4063 case 22: /* Star Burst */
4064 if (!get_aim_dir(&dir)) return FALSE;
4066 fire_ball(GF_LITE, dir, 100+plev*2, 4);
4068 case 23: /* Summon monster, angel */
4070 bool pet = !one_in_(3);
4073 if (pet) mode |= PM_FORCE_PET;
4074 else mode |= PM_NO_PET;
4075 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
4077 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, SUMMON_ANGEL, mode))
4081 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
4083 msg_print("'What is thy bidding... Master?'");
4088 msg_print("¡Ö²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª °¹Ô¼Ô¤è¡¢²ù¤¤²þ¤á¤è¡ª¡×");
4090 msg_print("Mortal! Repent of thy impiousness.");
4096 case 24: /* Heroism */
4097 (void)set_hero(randint1(25) + 25, FALSE);
4098 (void)hp_player(10);
4099 (void)set_afraid(0);
4101 case 25: /* Remove All Curse */
4102 if (remove_all_curse())
4105 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
4107 msg_print("You feel as if someone is watching over you.");
4111 case 26: /* Banishment */
4112 if (banish_evil(100))
4115 msg_print("¿ÀÀ»¤ÊÎϤ¬¼Ù°¤òÂǤÁʧ¤Ã¤¿¡ª");
4117 msg_print("The holy power banishes evil!");
4122 case 27: /* Word of Destruction */
4123 destroy_area(py, px, 13+randint0(5));
4125 case 28: /* Eye for an Eye */
4126 set_tim_eyeeye(randint1(10)+10, FALSE);
4133 int b = 10 + randint1(10);
4135 if (!get_aim_dir(&dir)) return FALSE;
4137 /* Use the given direction */
4138 tx = px + 99 * ddx[dir];
4139 ty = py + 99 * ddy[dir];
4141 /* Hack -- Use an actual "target" */
4142 if ((dir == 5) && target_okay())
4153 /* Hack -- Stop at the target */
4154 if ((y == ty) && (x == tx)) break;
4158 mmove2(&ny, &nx, py, px, ty, tx);
4160 /* Stop at maximum range */
4161 if (MAX_SIGHT*2 < distance(py, px, ny, nx)) break;
4163 /* Stopped by walls/doors */
4164 if (!cave_floor_bold(ny, nx)) break;
4166 /* Stopped by monsters */
4167 if ((dir != 5) && cave[ny][nx].m_idx != 0) break;
4169 /* Save the new location */
4176 for (i = 0; i < b; i++)
4178 int count = 20, d = 0;
4184 x = tx - 5 + randint0(11);
4185 y = ty - 5 + randint0(11);
4187 dx = (tx > x) ? (tx - x) : (x - tx);
4188 dy = (ty > y) ? (ty - y) : (y - ty);
4190 /* Approximate distance */
4191 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
4192 /* Within the radius */
4196 if (count < 0) continue;
4198 /* Cannot penetrate perm walls */
4199 if (!in_bounds(y,x) ||
4200 cave_stop_disintegration(y,x) ||
4201 !in_disintegration_range(ty, tx, y, x))
4204 project(0, 2, y, x, plev * 3+25, GF_DISINTEGRATE, PROJECT_JUMP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1);
4208 case 30: /* Divine Intervention */
4209 project(0, 1, py, px, plev*11, GF_HOLY_FIRE, PROJECT_KILL, -1);
4210 dispel_monsters(plev * 4);
4212 stun_monsters(plev * 4);
4213 confuse_monsters(plev * 4);
4214 turn_monsters(plev * 4);
4215 stasis_monsters(plev * 4);
4216 (void)hp_player(100);
4222 for (i = 0; i < 12; i++)
4229 scatter(&my, &mx, py, px, 4, 0);
4231 /* Require empty grids */
4232 if (cave_empty_bold2(my, mx)) break;
4234 if (attempt < 0) continue;
4235 summon_specific(-1, my, mx, plev, SUMMON_KNIGHTS, (PM_ALLOW_GROUP | PM_FORCE_PET | PM_HASTE));
4237 (void)set_hero(randint1(25) + 25, FALSE);
4238 (void)set_blessed(randint1(25) + 25, FALSE);
4239 (void)set_fast(randint1(20 + plev) + plev, FALSE);
4240 (void)set_protevil(randint1(25) + 25, FALSE);
4241 (void)set_afraid(0);
4246 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤ÊÇ˼٤μöʸ %d ¤ò¾§¤¨¤¿¡£", spell);
4248 msg_format("You cast an unknown crusade spell: %d.", spell);
4259 void stop_singing(void)
4261 if (p_ptr->pclass != CLASS_BARD) return;
4263 if (p_ptr->magic_num1[1])
4265 p_ptr->magic_num1[1] = 0;
4268 if (!p_ptr->magic_num1[0]) return;
4270 set_action(ACTION_NONE);
4272 switch(p_ptr->magic_num1[0])
4275 if (!p_ptr->blessed)
4277 msg_print("¹â·é¤Êµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4279 msg_print("The prayer has expired.");
4286 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4288 msg_print("The heroism wears off.");
4290 /* Recalculate hitpoints */
4291 p_ptr->update |= (PU_HP);
4295 if (!p_ptr->tim_esp)
4298 msg_print("°Õ¼±¤Ï¸µ¤ËÌá¤Ã¤¿¡£");
4300 msg_print("Your consciousness contracts again.");
4302 /* Update the monsters */
4303 p_ptr->update |= (PU_MONSTERS);
4307 if (!p_ptr->tim_stealth)
4309 msg_print("»Ñ¤¬¤Ï¤Ã¤¤ê¤È¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
4311 msg_print("You are no longer hided.");
4315 if (!p_ptr->oppose_acid)
4317 msg_print("»À¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4319 msg_print("You feel less resistant to acid.");
4321 if (!p_ptr->oppose_elec)
4323 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4325 msg_print("You feel less resistant to elec.");
4327 if (!p_ptr->oppose_fire)
4329 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4331 msg_print("You feel less resistant to fire.");
4333 if (!p_ptr->oppose_cold)
4335 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4337 msg_print("You feel less resistant to cold.");
4339 if (!p_ptr->oppose_pois)
4341 msg_print("ÆǤؤÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4343 msg_print("You feel less resistant to pois.");
4349 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
4351 msg_print("You feel yourself slow down.");
4358 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4360 msg_print("The heroism wears off.");
4362 /* Recalculate hitpoints */
4363 p_ptr->update |= (PU_HP);
4368 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
4370 msg_print("You feel yourself slow down.");
4377 msg_print("̵Ũ¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£");
4379 msg_print("The invulnerability wears off.");
4382 p_ptr->redraw |= (PR_MAP);
4384 /* Update monsters */
4385 p_ptr->update |= (PU_MONSTERS);
4388 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4392 p_ptr->magic_num1[0] = MUSIC_NONE;
4393 p_ptr->magic_num2[0] = 0;
4395 /* Recalculate bonuses */
4396 p_ptr->update |= (PU_BONUS | PU_HP);
4398 /* Redraw status bar */
4399 p_ptr->redraw |= (PR_STATUS);
4403 static bool cast_music_spell(int spell)
4405 int plev = p_ptr->lev;
4408 if(p_ptr->magic_num1[0])
4413 p_ptr->magic_num2[0] = spell;
4417 case 0: /* Song of Holding ÃÙÆߤβΠ*/
4419 msg_print("¤æ¤Ã¤¯¤ê¤È¤·¤¿¥á¥í¥Ç¥£¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4421 msg_print("You start humming a slow, steady melody...");
4423 p_ptr->magic_num1[0] = MUSIC_SLOW;
4425 case 1: /* Song of Blessing ½ËÊ¡¤Î²Î */
4427 msg_print("¸·¤«¤Ê¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4429 msg_print("The holy power of the Music of the Ainur enters you...");
4431 p_ptr->magic_num1[0] = MUSIC_BLESS;
4434 case 2: /* Wrecking Note Êø²õ¤Î²»¿§ */
4435 if (!get_aim_dir(&dir)) return FALSE;
4436 fire_bolt(GF_SOUND, dir,
4437 damroll(4 + ((plev - 1) / 5), 4));
4439 case 3: /* Stun Pattern Û¯Û°¤ÎÀûΧ */
4441 msg_print("âÁÏǤµ¤»¤ë¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4443 msg_print("You weave a pattern of sounds to bewilder and daze...");
4445 p_ptr->magic_num1[0] = MUSIC_STUN;
4447 case 4: /* Flow of life À¸Ì¿¤Îή¤ì */
4449 msg_print("²Î¤òÄ̤·¤ÆÂΤ˳赤¤¬Ìá¤Ã¤Æ¤¤¿¡¥¡¥¡¥");
4451 msg_print("Life flows through you as you sing a song of healing...");
4453 p_ptr->magic_num1[0] = MUSIC_L_LIFE;
4455 case 5: /* Song of the Sun ÂÀÍۤβΠ*/
4457 msg_print("¸÷¤êµ±¤¯²Î¤¬ÊÕ¤ê¤ò¾È¤é¤·¤¿¡£");
4459 msg_print("Your uplifting song brings brightness to dark places...");
4461 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
4463 case 6: /* Song of fear ¶²ÉݤβΠ*/
4465 msg_print("¤ª¤É¤í¤ª¤É¤í¤·¤¤¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4467 msg_print("You start weaving a fearful pattern...");
4469 p_ptr->magic_num1[0] = MUSIC_FEAR;
4471 case 7: /* Heroic Ballad À襤¤Î²Î */
4473 msg_print("·ã¤·¤¤À襤¤Î²Î¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4475 msg_print("You start singing a song of intense fighting...");
4477 p_ptr->magic_num1[0] = MUSIC_HERO;
4479 case 8: /* Clairaudience ÎîŪÃγР*/
4481 msg_print("ÀŤ«¤Ê²»³Ú¤¬´¶³Ð¤ò¸¦¤®À¡¤Þ¤µ¤»¤¿¡¥¡¥¡¥");
4483 msg_print("Your quiet music sharpens your sense of hearing...");
4485 p_ptr->magic_num1[0] = MUSIC_DETECT;
4487 case 9: /* º²¤Î²Î */
4489 msg_print("Àº¿À¤òDZ¤¸¶Ê¤²¤ë²Î¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4491 msg_print("You start singing a song of soul in pain...");
4493 p_ptr->magic_num1[0] = MUSIC_PSI;
4495 case 10: /* Song of Lore Ãμ±¤Î²Î */
4497 msg_print("¤³¤ÎÀ¤³¦¤ÎÃ챤¬Î®¤ì¹þ¤ó¤Ç¤¤¿¡¥¡¥¡¥");
4499 msg_print("You recall the rich lore of the world...");
4501 p_ptr->magic_num1[0] = MUSIC_ID;
4503 case 11: /* hidding song ±£ÆۤβΠ*/
4505 msg_print("¤¢¤Ê¤¿¤Î»Ñ¤¬·Ê¿§¤Ë¤È¤±¤³¤ó¤Ç¤¤¤Ã¤¿¡¥¡¥¡¥");
4507 msg_print("Your song carries you beyond the sight of mortal eyes...");
4509 p_ptr->magic_num1[0] = MUSIC_STEALTH;
4511 case 12: /* Illusion Pattern ¸¸±Æ¤ÎÀûΧ */
4513 msg_print("ÊÕ¤ê°ìÌ̤˸¸±Æ¤¬¸½¤ì¤¿¡¥¡¥¡¥");
4515 msg_print("You weave a pattern of sounds to beguile and confuse...");
4517 p_ptr->magic_num1[0] = MUSIC_CONF;
4519 case 13: /* Doomcall (vibration song) ÇËÌǤζ«¤Ó */
4521 msg_print("¹ì²»¤¬¶Á¤¤¤¿¡¥¡¥¡¥");
4523 msg_print("The fury of the Downfall of Numenor lashes out...");
4525 p_ptr->magic_num1[0] = MUSIC_SOUND;
4527 case 14: /* Firiel's Song (song of the Undeads) ¥Õ¥£¥ê¥¨¥ë¤Î²Î */
4529 msg_print("À¸Ì¿¤ÈÉü³è¤Î¥Æ¡¼¥Þ¤òÁդǻϤ᤿¡¥¡¥¡¥");
4531 msg_print("The themes of life and revival are woven into your song...");
4533 animate_dead(0, py, px);
4535 case 15: /* Fellowship Chant (charming song) ι¤ÎÃç´Ö */
4537 msg_print("°Â¤é¤«¤Ê¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4539 msg_print("You weave a slow, soothing melody of imploration...");
4541 p_ptr->magic_num1[0] = MUSIC_CHARM;
4543 case 16: /* (wall breaking song) ʬ²ò²»ÇÈ */
4545 msg_print("Ê´ºÕ¤¹¤ë¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4547 msg_print("You weave a violent pattern of sounds to break wall.");
4549 p_ptr->magic_num1[0] = MUSIC_WALL;
4550 project(0, 0, py, px,
4551 0, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM | PROJECT_HIDE, -1);
4553 case 17: /* Finrod's Resistance (song of resistance) ¸µÁÇÂÑÀ */
4555 msg_print("¸µÁǤÎÎϤËÂФ¹¤ëǦÂѤβΤò²Î¤Ã¤¿¡£");
4557 msg_print("You sing a song of perseverance against powers...");
4559 p_ptr->magic_num1[0] = MUSIC_RESIST;
4561 case 18: /* Hobbit Melodies (song of time) ¥Û¥Ó¥Ã¥È¤Î¥á¥í¥Ç¥£ */
4563 msg_print("·Ú²÷¤Ê²Î¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4565 msg_print("You start singing joyful pop song...");
4567 p_ptr->magic_num1[0] = MUSIC_SPEED;
4569 case 19: /* World Contortion ÏĤó¤ÀÀ¤³¦ */
4571 msg_print("²Î¤¬¶õ´Ö¤òÏĤ᤿¡¥¡¥¡¥");
4573 msg_print("Reality whirls wildly as you sing a dizzying melody...");
4575 project(0, plev/15 + 1, py, px, plev * 3 + 1, GF_AWAY_ALL , PROJECT_KILL, -1);
4577 case 20: /* Â໶¤Î²Î */
4579 msg_print("ÂѤ¨¤é¤ì¤Ê¤¤ÉÔ¶¨Ï²»¤¬Å¨¤òÀÕ¤áΩ¤Æ¤¿¡¥¡¥¡¥");
4581 msg_print("You cry out in an ear-wracking voice...");
4583 p_ptr->magic_num1[0] = MUSIC_DISPEL;
4585 case 21: /* The Voice of Saruman ¥µ¥ë¥Þ¥ó¤Î´Å¸À */
4587 msg_print("Í¥¤·¤¯¡¢Ì¥ÎÏŪ¤Ê²Î¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4589 msg_print("You start humming a gentle and attractive song...");
4591 p_ptr->magic_num1[0] = MUSIC_SARUMAN;
4593 case 22: /* Song of Tempest (song of death) Íò¤Î²»¿§ */
4594 if (!get_aim_dir(&dir)) return FALSE;
4595 fire_beam(GF_SOUND, dir,
4596 damroll(15 + ((plev - 1) / 2), 10));
4598 case 23: /* (song of disruption) ¤â¤¦°ì¤Ä¤ÎÀ¤³¦ */
4600 msg_print("¼þ°Ï¤¬ÊѲ½¤·»Ï¤á¤¿¡¥¡¥¡¥");
4602 msg_print("You sing of the primeval shaping of Middle-earth...");
4606 case 24: /* Wrecking Pattern (destruction shriek) Ç˲õ¤ÎÀûΧ */
4608 msg_print("Ç˲õŪ¤Ê²Î¤¬¶Á¤¤ï¤¿¤Ã¤¿¡¥¡¥¡¥");
4610 msg_print("You weave a pattern of sounds to contort and shatter...");
4612 p_ptr->magic_num1[0] = MUSIC_QUAKE;
4614 case 25: /* ÄäÂڤβΠ*/
4616 msg_print("¤æ¤Ã¤¯¤ê¤È¤·¤¿¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4618 msg_print("You weave a very slow pattern which is almost likely to stop...");
4620 p_ptr->magic_num1[0] = MUSIC_STASIS;
4622 case 26: /* ¼é¤ê¤Î²Î */
4624 msg_print("²Î¤¬¿ÀÀ»¤Ê¾ì¤òºî¤ê½Ð¤·¤¿¡¥¡¥¡¥");
4626 msg_print("The holy power of the Music is creating sacred field...");
4630 case 27: /* ±Ñͺ¤Î»í */
4632 msg_print("±Ñͺ¤Î²Î¤ò¸ý¤º¤µ¤ó¤À¡¥¡¥¡¥");
4634 msg_print("You chant a powerful, heroic call to arms...");
4636 p_ptr->magic_num1[0] = MUSIC_SHERO;
4637 (void)hp_player(10);
4638 (void)set_afraid(0);
4640 case 28: /* ¥ä¥ô¥¡¥ó¥Ê¤Î½õ¤± */
4642 msg_print("²Î¤òÄ̤·¤ÆÂΤ˳赤¤¬Ìá¤Ã¤Æ¤¤¿¡¥¡¥¡¥");
4644 msg_print("Life flows through you as you sing the song...");
4646 p_ptr->magic_num1[0] = MUSIC_H_LIFE;
4648 case 29: /* ºÆÀ¸¤Î²Î */
4650 msg_print("°Å¹õ¤ÎÃæ¤Ë¸÷¤ÈÈþ¤ò¤Õ¤ê¤Þ¤¤¤¿¡£ÂΤ¬¸µ¤Î³èÎϤò¼è¤êÌᤷ¤¿¡£");
4652 msg_print("You strewed light and beauty in the dark as you sing. You feel refreshed.");
4654 (void)do_res_stat(A_STR);
4655 (void)do_res_stat(A_INT);
4656 (void)do_res_stat(A_WIS);
4657 (void)do_res_stat(A_DEX);
4658 (void)do_res_stat(A_CON);
4659 (void)do_res_stat(A_CHR);
4660 (void)restore_level();
4662 case 30: /* shriek of death ¥µ¥¦¥í¥ó¤ÎËâ½Ñ */
4663 if (!get_aim_dir(&dir)) return FALSE;
4664 fire_ball(GF_SOUND, dir, damroll(50 + plev, 10), 0);
4666 case 31: /* song of liberty ¥Õ¥£¥ó¥´¥ë¥Õ¥£¥ó¤ÎÄ©Àï */
4668 msg_print("¥Õ¥£¥ó¥´¥ë¥Õ¥£¥ó¤Î̽²¦¤Ø¤ÎÄ©Àï¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4670 msg_print("You recall the valor of Fingolfin's challenge to the Dark Lord...");
4672 p_ptr->magic_num1[0] = MUSIC_INVULN;
4675 p_ptr->redraw |= (PR_MAP);
4677 /* Update monsters */
4678 p_ptr->update |= (PU_MONSTERS);
4681 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4685 msg_format("̤ÃΤβÎ(%d)¤ò²Î¤Ã¤¿¡£", spell);
4687 msg_format("You sing an unknown song: %d.", spell);
4692 if (p_ptr->magic_num1[0]) set_action(ACTION_SING);
4694 /* Recalculate bonuses */
4695 p_ptr->update |= (PU_BONUS | PU_HP);
4697 /* Redraw status bar */
4698 p_ptr->redraw |= (PR_STATUS);
4706 void do_cmd_cast(void)
4708 int item, sval, spell, realm;
4723 /* Require spell ability */
4724 if (!p_ptr->realm1 && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE))
4727 msg_print("¼öʸ¤ò¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4729 msg_print("You cannot cast spells!");
4736 if (p_ptr->blind || no_lite())
4739 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡ª");
4741 msg_print("You cannot see!");
4743 if (p_ptr->pclass == CLASS_FORCETRAINER)
4750 /* Not when confused */
4751 if (p_ptr->confused)
4754 msg_print("º®Í𤷤Ƥ¤¤Æ¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4756 msg_print("You are too confused!");
4762 prayer = spell_categoly_name(mp_ptr->spell_book);
4764 /* Restrict choices to spell books */
4765 item_tester_tval = mp_ptr->spell_book;
4769 q = "¤É¤Î¼öʸ½ñ¤ò»È¤¤¤Þ¤¹¤«? ";
4771 q = "Use which book? ";
4775 s = "¼öʸ½ñ¤¬¤Ê¤¤¡ª";
4777 s = "You have no spell books!";
4780 if (p_ptr->pclass == CLASS_FORCETRAINER)
4781 select_the_force = TRUE;
4782 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))){
4783 select_the_force = FALSE;
4786 select_the_force = FALSE;
4788 if (item == 1111) { /* the_force */
4792 /* Get the item (in the pack) */
4795 o_ptr = &inventory[item];
4798 /* Get the item (on the floor) */
4801 o_ptr = &o_list[0 - item];
4804 /* Access the item's sval */
4807 if ((p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE) && (o_ptr->tval == REALM2_BOOK)) increment = 32;
4810 /* Track the object kind */
4811 object_kind_track(o_ptr->k_idx);
4813 /* Hack -- Handle stuff */
4816 if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
4817 realm = o_ptr->tval - TV_LIFE_BOOK + 1;
4818 else if (increment) realm = p_ptr->realm2;
4819 else realm = p_ptr->realm1;
4821 /* Ask for a spell */
4823 if (!get_spell(&spell,
4824 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "±Ó¾§¤¹¤ë" : (mp_ptr->spell_book == TV_MUSIC_BOOK) ? "²Î¤¦" : "¾§¤¨¤ë"),
4827 if (spell == -2) msg_format("¤½¤ÎËܤˤÏÃΤäƤ¤¤ë%s¤¬¤Ê¤¤¡£", prayer);
4831 if (!get_spell(&spell, ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "recite" : "cast"),
4835 msg_format("You don't know any %ss in that book.", prayer);
4841 use_realm = tval2realm(o_ptr->tval);
4843 if (!is_magic(use_realm))
4845 s_ptr = &technic_info[use_realm - MIN_TECHNIC][spell];
4849 s_ptr = &mp_ptr->info[realm - 1][spell];
4852 /* Extract mana consumption rate */
4853 shouhimana = s_ptr->smana*(3800 - experience_of_spell(spell, realm)) + 2399;
4856 else shouhimana *= 4;
4858 if(shouhimana < 1) shouhimana = 1;
4860 /* Verify "dangerous" spells */
4861 if (shouhimana > p_ptr->csp)
4863 if (flush_failure) flush();
4867 msg_format("¤½¤Î%s¤ò%s¤Î¤Ë½½Ê¬¤Ê¥Þ¥¸¥Ã¥¯¥Ý¥¤¥ó¥È¤¬¤Ê¤¤¡£",prayer,
4868 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "±Ó¾§¤¹¤ë" : (mp_ptr->spell_book == TV_LIFE_BOOK) ? "²Î¤¦" : "¾§¤¨¤ë"));
4870 msg_format("You do not have enough mana to %s this %s.",
4871 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "recite" : "cast"),
4876 if (!over_exert) return;
4880 if (!get_check_strict("¤½¤ì¤Ç¤âÄ©À路¤Þ¤¹¤«? ", CHECK_OKAY_CANCEL)) return;
4882 if (!get_check_strict("Attempt it anyway? ", CHECK_OKAY_CANCEL)) return;
4888 /* Spell failure chance */
4889 chance = spell_chance(spell, use_realm);
4892 if (randint0(100) < chance)
4894 if (flush_failure) flush();
4897 msg_format("%s¤ò¤¦¤Þ¤¯¾§¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡ª", prayer);
4899 msg_format("You failed to get the %s off!", prayer);
4907 if (randint1(100) < chance) chg_virtue(V_VITALITY, -1);
4910 if (randint1(100) < chance) chg_virtue(V_UNLIFE, -1);
4913 if (randint1(100) < chance) chg_virtue(V_NATURE, -1);
4916 if (randint1(100) < chance) chg_virtue(V_JUSTICE, 1);
4919 if (randint1(100) < chance) chg_virtue(V_JUSTICE, -1);
4922 if (randint1(100) < chance) chg_virtue(V_KNOWLEDGE, -1);
4926 if (realm == REALM_TRUMP)
4928 cast_trump_spell(spell, FALSE);
4930 else if ((o_ptr->tval == TV_CHAOS_BOOK) && (randint1(100) < spell))
4933 msg_print("¥«¥ª¥¹Åª¤Ê¸ú²Ì¤òȯÀ¸¤·¤¿¡ª");
4935 msg_print("You produce a chaotic effect!");
4940 else if ((o_ptr->tval == TV_DEATH_BOOK) && (randint1(100) < spell))
4942 if ((sval == 3) && one_in_(2))
4944 sanity_blast(0, TRUE);
4949 msg_print("Äˤ¤¡ª");
4951 msg_print("It hurts!");
4955 take_hit(DAMAGE_LOSELIFE, damroll(o_ptr->sval + 1, 6), "°Å¹õËâË¡¤ÎµÕή", -1);
4957 take_hit(DAMAGE_LOSELIFE, damroll(o_ptr->sval + 1, 6), "a miscast Death spell", -1);
4960 if ((spell > 15) && one_in_(6) && !p_ptr->hold_life)
4961 lose_exp(spell * 250);
4964 else if ((o_ptr->tval == TV_MUSIC_BOOK) && (randint1(200) < spell))
4967 msg_print("¤¤¤ä¤Ê²»¤¬¶Á¤¤¤¿");
4969 msg_print("An infernal sound echoed.");
4972 aggravate_monsters(0);
4974 if (randint1(100) >= chance)
4975 chg_virtue(V_CHANCE,-1);
4984 case REALM_LIFE: /* * LIFE * */
4985 cast = cast_life_spell(spell);
4987 case REALM_SORCERY: /* * SORCERY * */
4988 cast = cast_sorcery_spell(spell);
4990 case REALM_NATURE: /* * NATURE * */
4991 cast = cast_nature_spell(spell);
4993 case REALM_CHAOS: /* * CHAOS * */
4994 cast = cast_chaos_spell(spell);
4996 case REALM_DEATH: /* * DEATH * */
4997 cast = cast_death_spell(spell);
4999 case REALM_TRUMP: /* TRUMP */
5000 cast = cast_trump_spell(spell, TRUE);
5002 case REALM_ARCANE: /* ARCANE */
5003 cast = cast_arcane_spell(spell);
5005 case REALM_ENCHANT: /* ENCHANT */
5006 cast = cast_enchant_spell(spell);
5008 case REALM_DAEMON: /* DAEMON */
5009 cast = cast_daemon_spell(spell);
5011 case REALM_CRUSADE: /* CRUSADE */
5012 cast = cast_crusade_spell(spell);
5014 case REALM_MUSIC: /* MUSIC */
5015 cast = cast_music_spell(spell);
5019 msg_format("You cast a spell from an unknown realm: realm %d, spell %d.", realm, spell);
5023 /* Canceled spells cost neither a turn nor mana */
5026 if (randint1(100) < chance)
5027 chg_virtue(V_CHANCE,1);
5029 /* A spell was cast */
5031 (p_ptr->spell_worked2 & (1L << spell)) :
5032 (p_ptr->spell_worked1 & (1L << spell)))
5033 && (p_ptr->pclass != CLASS_SORCERER)
5034 && (p_ptr->pclass != CLASS_RED_MAGE))
5036 int e = s_ptr->sexp;
5038 /* The spell worked */
5039 if (realm == p_ptr->realm1)
5041 p_ptr->spell_worked1 |= (1L << spell);
5045 p_ptr->spell_worked2 |= (1L << spell);
5048 /* Gain experience */
5049 gain_exp(e * s_ptr->slevel);
5051 /* Redraw object recall */
5052 p_ptr->window |= (PW_OBJECT);
5057 chg_virtue(V_TEMPERANCE, 1);
5058 chg_virtue(V_COMPASSION, 1);
5059 chg_virtue(V_VITALITY, 1);
5060 chg_virtue(V_DILIGENCE, 1);
5063 chg_virtue(V_UNLIFE, 1);
5064 chg_virtue(V_JUSTICE, -1);
5065 chg_virtue(V_FAITH, -1);
5066 chg_virtue(V_VITALITY, -1);
5069 chg_virtue(V_JUSTICE, -1);
5070 chg_virtue(V_FAITH, -1);
5071 chg_virtue(V_HONOUR, -1);
5072 chg_virtue(V_TEMPERANCE, -1);
5075 chg_virtue(V_FAITH, 1);
5076 chg_virtue(V_JUSTICE, 1);
5077 chg_virtue(V_SACRIFICE, 1);
5078 chg_virtue(V_HONOUR, 1);
5081 chg_virtue(V_NATURE, 1);
5082 chg_virtue(V_HARMONY, 1);
5085 chg_virtue(V_KNOWLEDGE, 1);
5092 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_TEMPERANCE, 1);
5093 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_COMPASSION, 1);
5094 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_VITALITY, 1);
5095 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_DILIGENCE, 1);
5098 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_UNLIFE, 1);
5099 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_JUSTICE, -1);
5100 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_FAITH, -1);
5101 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_VITALITY, -1);
5104 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_JUSTICE, -1);
5105 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_FAITH, -1);
5106 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_HONOUR, -1);
5107 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_TEMPERANCE, -1);
5110 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_FAITH, 1);
5111 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_JUSTICE, 1);
5112 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_SACRIFICE, 1);
5113 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_HONOUR, 1);
5116 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_NATURE, 1);
5117 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_HARMONY, 1);
5120 if (mp_ptr->spell_xtra & MAGIC_GAIN_EXP)
5122 s16b cur_exp = p_ptr->spell_exp[(increment ? 32 : 0)+spell];
5127 else if(cur_exp < 1200)
5129 if ((dun_level > 4) && ((dun_level + 10) > p_ptr->lev))
5132 else if(cur_exp < 1400)
5134 if (((dun_level + 5) > p_ptr->lev) && ((dun_level + 5) > s_ptr->slevel))
5137 else if((cur_exp < 1600) && !increment)
5139 if (((dun_level + 5) > p_ptr->lev) && (dun_level > s_ptr->slevel))
5142 p_ptr->spell_exp[(increment ? 32 : 0)+spell] += exp_gain;
5149 /* Sufficient mana */
5150 if (shouhimana <= p_ptr->csp)
5153 p_ptr->csp -= shouhimana;
5156 /* Over-exert the player */
5159 int oops = shouhimana;
5163 p_ptr->csp_frac = 0;
5167 msg_print("Àº¿À¤ò½¸Ã椷¤¹¤®¤Æµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
5169 msg_print("You faint from the effort!");
5173 /* Hack -- Bypass free action */
5174 (void)set_paralyzed(p_ptr->paralyzed + randint1(5 * oops + 1));
5179 chg_virtue(V_VITALITY, -10);
5182 chg_virtue(V_UNLIFE, -10);
5185 chg_virtue(V_JUSTICE, 10);
5188 chg_virtue(V_NATURE, -10);
5191 chg_virtue(V_JUSTICE, -10);
5194 chg_virtue(V_KNOWLEDGE, -10);
5198 /* Damage CON (possibly permanently) */
5199 if (randint0(100) < 50)
5201 bool perm = (randint0(100) < 25);
5205 msg_print("ÂΤò°¤¯¤·¤Æ¤·¤Þ¤Ã¤¿¡ª");
5207 msg_print("You have damaged your health!");
5211 /* Reduce constitution */
5212 (void)dec_stat(A_CON, 15 + randint1(10), perm);
5217 p_ptr->redraw |= (PR_MANA);
5220 p_ptr->window |= (PW_PLAYER);
5221 p_ptr->window |= (PW_SPELL);
5226 * Pray a prayer -- Unused in Hengband
5228 void do_cmd_pray(void)
5230 msg_print("Praying is not used in Hengband. Use magic spell casting instead.");
5233 static bool ang_sort_comp_pet_dismiss(vptr u, vptr v, int a, int b)
5235 u16b *who = (u16b*)(u);
5240 monster_type *m_ptr1 = &m_list[w1];
5241 monster_type *m_ptr2 = &m_list[w2];
5242 monster_race *r_ptr1 = &r_info[m_ptr1->r_idx];
5243 monster_race *r_ptr2 = &r_info[m_ptr2->r_idx];
5248 if (w1 == p_ptr->riding) return TRUE;
5249 if (w2 == p_ptr->riding) return FALSE;
5251 if (m_ptr1->nickname && !m_ptr2->nickname) return TRUE;
5252 if (m_ptr2->nickname && !m_ptr1->nickname) return FALSE;
5254 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return TRUE;
5255 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return FALSE;
5257 if (r_ptr1->level > r_ptr2->level) return TRUE;
5258 if (r_ptr2->level > r_ptr1->level) return FALSE;
5260 if (m_ptr1->hp > m_ptr2->hp) return TRUE;
5261 if (m_ptr2->hp > m_ptr1->hp) return FALSE;
5266 int calculate_upkeep(void)
5268 s32b old_friend_align = friend_align;
5270 bool have_a_unique = FALSE;
5273 total_friend_levels = 0;
5276 for (m_idx = m_max - 1; m_idx >=1; m_idx--)
5278 monster_type *m_ptr;
5279 monster_race *r_ptr;
5281 m_ptr = &m_list[m_idx];
5282 if (!m_ptr->r_idx) continue;
5283 r_ptr = &r_info[m_ptr->r_idx];
5288 if (r_ptr->flags1 & RF1_UNIQUE)
5290 if (p_ptr->pclass == CLASS_CAVALRY)
5292 if (p_ptr->riding == m_idx)
5293 total_friend_levels += (r_ptr->level+5)*2;
5294 else if (!have_a_unique && (r_info[m_ptr->r_idx].flags7 & RF7_RIDING))
5295 total_friend_levels += (r_ptr->level+5)*7/2;
5297 total_friend_levels += (r_ptr->level+5)*10;
5298 have_a_unique = TRUE;
5301 total_friend_levels += (r_ptr->level+5)*10;
5304 total_friend_levels += r_ptr->level;
5306 /* Determine pet alignment */
5307 if (r_ptr->flags3 & RF3_GOOD)
5309 friend_align += r_ptr->level;
5311 else if (r_ptr->flags3 & RF3_EVIL)
5313 friend_align -= r_ptr->level;
5317 if (old_friend_align != friend_align) p_ptr->update |= (PU_BONUS);
5321 upkeep_factor = (total_friend_levels - (p_ptr->lev * 80 / (cp_ptr->pet_upkeep_div)));
5322 if (upkeep_factor < 0) upkeep_factor = 0;
5323 if (upkeep_factor > 1000) upkeep_factor = 1000;
5324 return upkeep_factor;
5330 void do_cmd_pet_dismiss(void)
5332 monster_type *m_ptr;
5333 bool all_pets = FALSE;
5347 /* Allocate the "who" array */
5348 C_MAKE(who, max_m_idx, u16b);
5350 /* Process the monsters (backwards) */
5351 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
5353 if (is_pet(&m_list[pet_ctr]))
5354 who[max_pet++] = pet_ctr;
5357 /* Select the sort method */
5358 ang_sort_comp = ang_sort_comp_pet_dismiss;
5359 ang_sort_swap = ang_sort_swap_hook;
5361 ang_sort(who, &dummy_why, max_pet);
5363 /* Process the monsters (backwards) */
5364 for (i = 0; i < max_pet; i++)
5367 char friend_name[80];
5371 /* Access the monster */
5373 m_ptr = &m_list[pet_ctr];
5375 delete_this = FALSE;
5376 kakunin = ((pet_ctr == p_ptr->riding) || (m_ptr->nickname));
5377 monster_desc(friend_name, m_ptr, 0x80);
5381 /* Hack -- health bar for this monster */
5382 health_track(pet_ctr);
5384 /* Hack -- handle stuff */
5388 sprintf(buf, "%s¤òÊü¤·¤Þ¤¹¤«¡© [Yes/No/Unnamed (%dɤ)]", friend_name, max_pet-i);
5390 sprintf(buf, "Dismiss %s? [Yes/No/Unnamed (%d remain)]", friend_name, max_pet-i);
5395 move_cursor_relative(m_ptr->fy, m_ptr->fx);
5401 if (ch == 'Y' || ch == 'y')
5408 sprintf(buf, "ËÜÅö¤Ë¤è¤í¤·¤¤¤Ç¤¹¤«¡© (%s) ", friend_name);
5410 sprintf(buf, "Are you sure? (%s) ", friend_name);
5412 if (!get_check(buf))
5413 delete_this = FALSE;
5418 if (ch == 'U' || ch == 'u')
5424 if (ch == ESCAPE || ch == 'N' || ch == 'n')
5431 if ((all_pets && !kakunin) || (!all_pets && delete_this))
5433 if (record_named_pet && m_ptr->nickname)
5437 monster_desc(m_name, m_ptr, 0x08);
5438 do_cmd_write_nikki(NIKKI_NAMED_PET, 2, m_name);
5441 if (pet_ctr == p_ptr->riding)
5444 msg_format("%s¤«¤é¹ß¤ê¤¿¡£", friend_name);
5446 msg_format("You have got off %s. ", friend_name);
5451 /* Update the monsters */
5452 p_ptr->update |= (PU_BONUS | PU_MONSTERS);
5453 p_ptr->redraw |= (PR_EXTRA);
5456 /* HACK : Add the line to message buffer */
5458 sprintf(buf, "%s ¤òÊü¤·¤¿¡£", friend_name);
5460 sprintf(buf, "Dismissed %s.", friend_name);
5463 p_ptr->window |= (PW_MESSAGE);
5466 delete_monster_idx(pet_ctr);
5475 C_KILL(who, max_m_idx, u16b);
5478 msg_format("%d ɤ¤Î¥Ú¥Ã¥È¤òÊü¤·¤Þ¤·¤¿¡£", Dismissed);
5480 msg_format("You have dismissed %d pet%s.", Dismissed,
5481 (Dismissed == 1 ? "" : "s"));
5483 if (Dismissed == 0 && all_pets)
5485 msg_print("'U'nnamed ¤Ï¡¢¾èÇϰʳ°¤Î̾Á°¤Î¤Ê¤¤¥Ú¥Ã¥È¤À¤±¤òÁ´¤Æ²òÊü¤·¤Þ¤¹¡£");
5487 msg_print("'U'nnamed means all your pets except named pets and your mount.");
5490 p_ptr->update |= (PU_MON_LITE);
5493 bool rakuba(int dam, bool force)
5495 int i, y, x, oy, ox;
5496 int sn = 0, sy = 0, sx = 0;
5498 monster_type *m_ptr = &m_list[p_ptr->riding];
5499 monster_race *r_ptr = &r_info[m_ptr->r_idx];
5501 if (!p_ptr->riding) return FALSE;
5502 if (p_ptr->wild_mode) return FALSE;
5504 if (dam >= 0 || force)
5508 int level = r_ptr->level;
5509 if (p_ptr->riding_ryoute) level += 20;
5510 if ((dam/2 + r_ptr->level) > (p_ptr->skill_exp[GINOU_RIDING]/30+10))
5512 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)
5514 if (r_ptr->level*100 > (p_ptr->skill_exp[GINOU_RIDING] + 1500))
5515 p_ptr->skill_exp[GINOU_RIDING] += (1+(r_ptr->level - p_ptr->skill_exp[GINOU_RIDING]/100 - 15));
5516 else p_ptr->skill_exp[GINOU_RIDING]++;
5519 if (randint0(dam/2 + level*2) < (p_ptr->skill_exp[GINOU_RIDING]/30+10))
5521 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))
5527 /* Check around the player */
5528 for (i = 0; i < 8; i++)
5532 /* Access the location */
5533 y = py + ddy_ddd[i];
5534 x = px + ddx_ddd[i];
5536 c_ptr = &cave[y][x];
5538 /* Skip non-empty grids */
5539 if (cave_perma_grid(c_ptr)) continue;
5540 if (!cave_empty_grid2(c_ptr)) continue;
5542 if (c_ptr->m_idx) continue;
5544 /* Count "safe" grids */
5547 /* Randomize choice */
5548 if (randint0(sn) > 0) continue;
5550 /* Save the safe location */
5555 monster_desc(m_name, m_ptr, 0);
5557 msg_format("%s¤«¤é¿¶¤êÍî¤È¤µ¤ì¤½¤¦¤Ë¤Ê¤Ã¤Æ¡¢Êɤˤ֤Ĥ«¤Ã¤¿¡£",m_name);
5558 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "Êɤؤξ×ÆÍ", -1);
5560 msg_format("You have nearly fallen from %s, but bumped into wall.",m_name);
5561 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "bumping into wall", -1);
5572 /* Redraw the old spot */
5575 /* Redraw the new spot */
5578 /* Check for new panel */
5583 p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5584 p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE;
5588 p_ptr->update |= (PU_BONUS);
5591 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW);
5593 /* Update the monsters */
5594 p_ptr->update |= (PU_DISTANCE);
5597 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5599 p_ptr->redraw |= (PR_EXTRA);
5601 /* Update health track of mount */
5602 p_ptr->redraw |= (PR_UHEALTH);
5604 if (p_ptr->ffall && !force)
5606 monster_desc(m_name, m_ptr, 0);
5608 msg_format("%s¤«¤éÍî¤Á¤¿¤¬¡¢¶õÃæ¤Ç¤¦¤Þ¤¯ÂÎÀª¤òΩ¤Æľ¤·¤ÆÃåÃϤ·¤¿¡£",m_name);
5610 msg_format("You are thrown from %s, but make a good landing.",m_name);
5615 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "ÍîÇÏ", -1);
5617 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "Falling from riding", -1);
5623 bool do_riding(bool force)
5625 int oy, ox, x, y, dir = 0;
5627 monster_type *m_ptr;
5629 if (!get_rep_dir2(&dir)) return FALSE;
5632 c_ptr = &cave[y][x];
5636 /* Skip non-empty grids */
5637 if (!cave_empty_bold2(y, x) || c_ptr->m_idx)
5640 msg_print("¤½¤Á¤é¤Ë¤Ï¹ß¤ê¤é¤ì¤Þ¤»¤ó¡£");
5642 msg_print("You cannot go to that direction.");
5647 p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5648 p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE;
5652 if (p_ptr->confused)
5655 msg_print("º®Í𤷤Ƥ¤¤Æ¾è¤ì¤Ê¤¤¡ª");
5657 msg_print("You are too confused!");
5661 if (!(c_ptr->m_idx))
5664 msg_print("¤½¤Î¾ì½ê¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
5666 msg_print("Here is no pet.");
5672 m_ptr = &m_list[c_ptr->m_idx];
5674 if (!is_pet(m_ptr) && !force)
5677 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï¥Ú¥Ã¥È¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£");
5679 msg_print("That monster is not a pet.");
5684 if (!(r_info[m_ptr->r_idx].flags7 & RF7_RIDING))
5687 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ë¤Ï¾è¤ì¤Ê¤µ¤½¤¦¤À¡£");
5689 msg_print("This monster doesn't seem suitable for riding.");
5694 if (!(p_ptr->pass_wall) && (c_ptr->feat >= FEAT_RUBBLE) && (c_ptr->feat <= FEAT_PERM_SOLID))
5697 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤ÏÊɤÎÃæ¤Ë¤¤¤ë¡£");
5699 msg_print("This monster is in the wall.");
5704 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)))
5707 msg_print("¥Ñ¥¿¡¼¥ó¤Î¾å¤«¤é¤Ï¾è¤ì¤Þ¤»¤ó¡£");
5709 msg_print("You cannot ride from on Pattern.");
5717 msg_print("¤½¤Î¾ì½ê¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
5719 msg_print("Here is no monster.");
5724 if (r_info[m_ptr->r_idx].level > randint1((p_ptr->skill_exp[GINOU_RIDING]/50 + p_ptr->lev/2 +20)))
5727 msg_print("¤¦¤Þ¤¯¾è¤ì¤Ê¤«¤Ã¤¿¡£");
5729 msg_print("You failed to ride.");
5739 monster_desc(m_name, m_ptr, 0);
5742 msg_format("%s¤òµ¯¤³¤·¤¿¡£", m_name);
5744 msg_format("You have waked %s up.", m_name);
5748 p_ptr->riding = c_ptr->m_idx;
5750 /* Hack -- remove tracked monster */
5751 if (p_ptr->riding == p_ptr->health_who) health_track(0);
5754 /* Save the old location */
5758 /* Move the player to the safe location */
5762 /* Redraw the old spot */
5765 /* Redraw the new spot */
5768 /* Check for new panel */
5773 /* Mega-Hack -- Forget the view and lite */
5774 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
5777 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW);
5779 /* Update the monsters */
5780 p_ptr->update |= (PU_DISTANCE);
5782 /* Update the monsters */
5783 p_ptr->update |= (PU_BONUS);
5786 p_ptr->redraw |= (PR_MAP | PR_EXTRA);
5789 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5791 p_ptr->redraw |= (PR_UHEALTH);
5797 static void do_name_pet(void)
5799 monster_type *m_ptr;
5802 bool old_name = FALSE;
5803 bool old_target_pet = target_pet;
5806 if (!target_set(TARGET_KILL))
5808 target_pet = old_target_pet;
5811 target_pet = old_target_pet;
5813 if (cave[target_row][target_col].m_idx)
5815 m_ptr = &m_list[cave[target_row][target_col].m_idx];
5821 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï¥Ú¥Ã¥È¤Ç¤Ï¤Ê¤¤¡£");
5823 msg_format("This monster is not a pet.");
5827 if (r_info[m_ptr->r_idx].flags1 & RF1_UNIQUE)
5830 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Î̾Á°¤ÏÊѤ¨¤é¤ì¤Ê¤¤¡ª");
5832 msg_format("You cannot change name of this monster!");
5836 monster_desc(m_name, m_ptr, 0);
5840 msg_format("%s¤Ë̾Á°¤ò¤Ä¤±¤ë¡£", m_name);
5842 msg_format("Name %s.", m_name);
5847 /* Start with nothing */
5848 strcpy(out_val, "");
5850 /* Use old inscription */
5851 if (m_ptr->nickname)
5853 /* Start with the old inscription */
5854 strcpy(out_val, quark_str(m_ptr->nickname));
5858 /* Get a new inscription (possibly empty) */
5860 if (get_string("̾Á°: ", out_val, 15))
5862 if (get_string("Name: ", out_val, 15))
5868 /* Save the inscription */
5869 m_ptr->nickname = quark_add(out_val);
5870 if (record_named_pet)
5874 monster_desc(m_name, m_ptr, 0x08);
5875 do_cmd_write_nikki(NIKKI_NAMED_PET, 0, m_name);
5880 if (record_named_pet && old_name)
5884 monster_desc(m_name, m_ptr, 0x08);
5885 do_cmd_write_nikki(NIKKI_NAMED_PET, 1, m_name);
5887 m_ptr->nickname = 0;
5894 * Issue a pet command
5896 void do_cmd_pet(void)
5901 cptr power_desc[36];
5906 int pets = 0, pet_ctr;
5907 monster_type *m_ptr;
5914 char target_buf[160];
5918 /* Calculate pets */
5919 /* Process the monsters (backwards) */
5920 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
5922 /* Access the monster */
5923 m_ptr = &m_list[pet_ctr];
5925 if (is_pet(m_ptr)) pets++;
5929 power_desc[num] = "¥Ú¥Ã¥È¤òÊü¤¹";
5931 power_desc[num] = "dismiss pets";
5934 powers[num++] = PET_DISMISS;
5937 sprintf(target_buf,"¥Ú¥Ã¥È¤Î¥¿¡¼¥²¥Ã¥È¤ò»ØÄê (¸½ºß¡§%s)",
5938 (pet_t_m_idx ? r_name + r_info[m_list[pet_t_m_idx].r_idx].name : "»ØÄê¤Ê¤·"));
5940 sprintf(target_buf,"specify a targert of pet (now:%s)",
5941 (pet_t_m_idx ? r_name + r_info[m_list[pet_t_m_idx].r_idx].name : "nothing"));
5943 power_desc[num] = target_buf;
5945 powers[num++] = PET_TARGET;
5948 power_desc[num] = "¶á¤¯¤Ë¤¤¤í";
5950 power_desc[num] = "stay close";
5953 if (p_ptr->pet_follow_distance == PET_CLOSE_DIST) mode = num;
5954 powers[num++] = PET_STAY_CLOSE;
5957 power_desc[num] = "¤Ä¤¤¤ÆÍ褤";
5959 power_desc[num] = "follow me";
5962 if (p_ptr->pet_follow_distance == PET_FOLLOW_DIST) mode = num;
5963 powers[num++] = PET_FOLLOW_ME;
5966 power_desc[num] = "Ũ¤ò¸«¤Ä¤±¤ÆÅݤ»";
5968 power_desc[num] = "seek and destroy";
5971 if (p_ptr->pet_follow_distance == PET_DESTROY_DIST) mode = num;
5972 powers[num++] = PET_SEEK_AND_DESTROY;
5975 power_desc[num] = "¾¯¤·Î¥¤ì¤Æ¤¤¤í";
5977 power_desc[num] = "give me space";
5980 if (p_ptr->pet_follow_distance == PET_SPACE_DIST) mode = num;
5981 powers[num++] = PET_ALLOW_SPACE;
5984 power_desc[num] = "Î¥¤ì¤Æ¤¤¤í";
5986 power_desc[num] = "stay away";
5989 if (p_ptr->pet_follow_distance == PET_AWAY_DIST) mode = num;
5990 powers[num++] = PET_STAY_AWAY;
5992 if (p_ptr->pet_extra_flags & PF_OPEN_DOORS)
5995 power_desc[num] = "¥É¥¢¤ò³«¤±¤ë (¸½ºß:ON)";
5997 power_desc[num] = "pets open doors (now On)";
6004 power_desc[num] = "¥É¥¢¤ò³«¤±¤ë (¸½ºß:OFF)";
6006 power_desc[num] = "pets open doors (now Off)";
6010 powers[num++] = PET_OPEN_DOORS;
6012 if (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS)
6015 power_desc[num] = "¥¢¥¤¥Æ¥à¤ò½¦¤¦ (¸½ºß:ON)";
6017 power_desc[num] = "pets pick up items (now On)";
6024 power_desc[num] = "¥¢¥¤¥Æ¥à¤ò½¦¤¦ (¸½ºß:OFF)";
6026 power_desc[num] = "pets pick up items (now Off)";
6030 powers[num++] = PET_TAKE_ITEMS;
6032 if (p_ptr->pet_extra_flags & PF_TELEPORT)
6035 power_desc[num] = "¥Æ¥ì¥Ý¡¼¥È·ÏËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6037 power_desc[num] = "allow teleport (now On)";
6044 power_desc[num] = "¥Æ¥ì¥Ý¡¼¥È·ÏËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6046 power_desc[num] = "allow teleport (now Off)";
6050 powers[num++] = PET_TELEPORT;
6052 if (p_ptr->pet_extra_flags & PF_ATTACK_SPELL)
6055 power_desc[num] = "¹¶·âËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6057 power_desc[num] = "allow cast attack spell (now On)";
6064 power_desc[num] = "¹¶·âËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6066 power_desc[num] = "allow cast attack spell (now Off)";
6070 powers[num++] = PET_ATTACK_SPELL;
6072 if (p_ptr->pet_extra_flags & PF_SUMMON_SPELL)
6075 power_desc[num] = "¾¤´ËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6077 power_desc[num] = "allow cast summon spell (now On)";
6084 power_desc[num] = "¾¤´ËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6086 power_desc[num] = "allow cast summon spell (now Off)";
6090 powers[num++] = PET_SUMMON_SPELL;
6092 if (p_ptr->pet_extra_flags & PF_BALL_SPELL)
6095 power_desc[num] = "¥×¥ì¥¤¥ä¡¼¤ò´¬¤¹þ¤àÈÏ°ÏËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6097 power_desc[num] = "allow involve player in area spell (now On)";
6104 power_desc[num] = "¥×¥ì¥¤¥ä¡¼¤ò´¬¤¹þ¤àÈÏ°ÏËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6106 power_desc[num] = "allow involve player in area spell (now Off)";
6110 powers[num++] = PET_BALL_SPELL;
6115 power_desc[num] = "¥Ú¥Ã¥È¤«¤é¹ß¤ê¤ë";
6117 power_desc[num] = "get off a pet";
6124 power_desc[num] = "¥Ú¥Ã¥È¤Ë¾è¤ë";
6126 power_desc[num] = "ride a pet";
6130 powers[num++] = PET_RIDING;
6133 power_desc[num] = "¥Ú¥Ã¥È¤Ë̾Á°¤ò¤Ä¤±¤ë¡£";
6135 power_desc[num] = "name pets";
6138 powers[num++] = PET_NAME;
6140 if (p_ptr->riding && buki_motteruka(INVEN_RARM) && (empty_hands(FALSE) & 0x00000001) && ((inventory[INVEN_RARM].weight > 99) || (inventory[INVEN_RARM].tval == TV_POLEARM)))
6142 if (p_ptr->pet_extra_flags & PF_RYOUTE)
6145 power_desc[num] = "Éð´ï¤òÊÒ¼ê¤Ç»ý¤Ä";
6147 power_desc[num] = "use one hand to control a riding pet";
6154 power_desc[num] = "Éð´ï¤òξ¼ê¤Ç»ý¤Ä";
6156 power_desc[num] = "use both hands for a weapon.";
6161 powers[num++] = PET_RYOUTE;
6164 /* Nothing chosen yet */
6167 /* Build a prompt (accept all spells) */
6170 /* Build a prompt (accept all spells) */
6172 strnfmt(out_val, 78, "(¥³¥Þ¥ó¥É %c-%c¡¢'*'=°ìÍ÷¡¢ESC=½ªÎ») ¥³¥Þ¥ó¥É¤òÁª¤ó¤Ç¤¯¤À¤µ¤¤:",
6174 strnfmt(out_val, 78, "(Command %c-%c, *=List, ESC=exit) Select a command: ",
6177 I2A(0), I2A(num - 1));
6182 strnfmt(out_val, 78, "(¥³¥Þ¥ó¥É %c-%c¡¢'*'=°ìÍ÷¡¢ESC=½ªÎ») ¥³¥Þ¥ó¥É¤òÁª¤ó¤Ç¤¯¤À¤µ¤¤:",
6184 strnfmt(out_val, 78, "(Command %c-%c, *=List, ESC=exit) Select a command: ",
6187 I2A(0), '0' + num - 27);
6193 /* Save the screen */
6200 prt(format("%s%c) %s", (ctr == mode) ? "*" : " ", I2A(ctr), power_desc[ctr]), y + ctr, x);
6206 prt("", y + ctr, x);
6213 /* Get a command from the user */
6214 while (!flag && get_com(out_val, &choice, TRUE))
6216 /* Request redraw */
6217 if ((choice == ' ') || (choice == '*') || (choice == '?'))
6229 /* Save the screen */
6236 sprintf(buf, "%s%c) %s", (ctr == mode) ? "*" : " ", I2A(ctr), power_desc[ctr]);
6237 prt(buf, y + ctr, x);
6243 prt("", y + ctr, x);
6257 /* Restore the screen */
6265 if (isalpha(choice))
6268 ask = (isupper(choice));
6271 if (ask) choice = tolower(choice);
6273 /* Extract request */
6274 i = (islower(choice) ? A2I(choice) : -1);
6278 ask = FALSE; /* Can't uppercase digits */
6280 i = choice - '0' + 26;
6283 /* Totally Illegal */
6284 if ((i < 0) || (i >= num))
6295 strnfmt(buf, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡© ", power_desc[i]);
6297 strnfmt(buf, 78, "Use %s? ", power_desc[i]);
6301 /* Belay that order */
6302 if (!get_check(buf)) continue;
6309 /* Restore the screen */
6310 if (redraw) Term_load();
6312 /* Abort if needed */
6321 case PET_DISMISS: /* Dismiss pets */
6326 msg_print("¥Ú¥Ã¥È¤¬¤¤¤Ê¤¤¡ª");
6328 msg_print("You have no pets!");
6332 do_cmd_pet_dismiss();
6333 (void)calculate_upkeep();
6338 project_length = -1;
6339 if (!target_set(TARGET_KILL)) pet_t_m_idx = 0;
6342 cave_type *c_ptr = &cave[target_row][target_col];
6343 if (c_ptr->m_idx && (m_list[c_ptr->m_idx].ml))
6345 pet_t_m_idx = cave[target_row][target_col].m_idx;
6346 p_ptr->pet_follow_distance = PET_DESTROY_DIST;
6348 else pet_t_m_idx = 0;
6355 case PET_STAY_CLOSE:
6357 p_ptr->pet_follow_distance = PET_CLOSE_DIST;
6364 p_ptr->pet_follow_distance = PET_FOLLOW_DIST;
6368 /* "Seek and destoy" */
6369 case PET_SEEK_AND_DESTROY:
6371 p_ptr->pet_follow_distance = PET_DESTROY_DIST;
6374 /* "Give me space" */
6375 case PET_ALLOW_SPACE:
6377 p_ptr->pet_follow_distance = PET_SPACE_DIST;
6383 p_ptr->pet_follow_distance = PET_AWAY_DIST;
6386 /* flag - allow pets to open doors */
6387 case PET_OPEN_DOORS:
6389 if (p_ptr->pet_extra_flags & PF_OPEN_DOORS) p_ptr->pet_extra_flags &= ~(PF_OPEN_DOORS);
6390 else p_ptr->pet_extra_flags |= (PF_OPEN_DOORS);
6393 /* flag - allow pets to pickup items */
6394 case PET_TAKE_ITEMS:
6396 if (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS)
6398 p_ptr->pet_extra_flags &= ~(PF_PICKUP_ITEMS);
6399 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
6401 /* Access the monster */
6402 m_ptr = &m_list[pet_ctr];
6406 monster_drop_carried_objects(m_ptr);
6410 else p_ptr->pet_extra_flags |= (PF_PICKUP_ITEMS);
6414 /* flag - allow pets to teleport */
6417 if (p_ptr->pet_extra_flags & PF_TELEPORT) p_ptr->pet_extra_flags &= ~(PF_TELEPORT);
6418 else p_ptr->pet_extra_flags |= (PF_TELEPORT);
6421 /* flag - allow pets to cast attack spell */
6422 case PET_ATTACK_SPELL:
6424 if (p_ptr->pet_extra_flags & PF_ATTACK_SPELL) p_ptr->pet_extra_flags &= ~(PF_ATTACK_SPELL);
6425 else p_ptr->pet_extra_flags |= (PF_ATTACK_SPELL);
6428 /* flag - allow pets to cast attack spell */
6429 case PET_SUMMON_SPELL:
6431 if (p_ptr->pet_extra_flags & PF_SUMMON_SPELL) p_ptr->pet_extra_flags &= ~(PF_SUMMON_SPELL);
6432 else p_ptr->pet_extra_flags |= (PF_SUMMON_SPELL);
6435 /* flag - allow pets to cast attack spell */
6436 case PET_BALL_SPELL:
6438 if (p_ptr->pet_extra_flags & PF_BALL_SPELL) p_ptr->pet_extra_flags &= ~(PF_BALL_SPELL);
6439 else p_ptr->pet_extra_flags |= (PF_BALL_SPELL);
6457 if (p_ptr->pet_extra_flags & PF_RYOUTE) p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
6458 else p_ptr->pet_extra_flags |= (PF_RYOUTE);
6459 p_ptr->update |= (PU_BONUS);