3 /* Purpose: Spell/Prayer commands */
6 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research, and
9 * not for profit purposes provided that this copyright and statement are
10 * included in all such copies.
15 #include "spellstips.h"
17 cptr spell_categoly_name(int tval)
22 case TV_HISSATSU_BOOK:
31 case TV_HISSATSU_BOOK:
44 * Allow user to choose a spell/prayer from the given book.
46 * If a valid spell is chosen, saves it in '*sn' and returns TRUE
47 * If the user hits escape, returns FALSE, and set '*sn' to -1
48 * If there are no legal choices, returns FALSE, and sets '*sn' to -2
50 * The "prompt" should be "cast", "recite", or "study"
51 * The "known" should be TRUE for cast/pray, FALSE for study
54 bool select_spellbook=FALSE;
55 bool select_the_force=FALSE;
57 static int get_spell(int *sn, cptr prompt, int sval, bool learned, int use_realm)
65 bool flag, redraw, okay;
73 int menu_line = (use_menu ? 1 : 0);
75 #ifdef ALLOW_REPEAT /* TNB */
77 /* Get the spell, if available */
80 /* Verify the spell */
81 if (spell_okay(*sn, learned, FALSE, use_realm))
88 #endif /* ALLOW_REPEAT -- TNB */
90 p = spell_categoly_name(mp_ptr->spell_book);
93 for (spell = 0; spell < 32; spell++)
95 /* Check for this spell */
96 if ((fake_spell_flags[sval] & (1L << spell)))
98 /* Collect this spell */
99 spells[num++] = spell;
103 /* Assume no usable spells */
106 /* Assume no spells available */
109 /* Check for "okay" spells */
110 for (i = 0; i < num; i++)
112 /* Look for "okay" spells */
113 if (spell_okay(spells[i], learned, FALSE, use_realm)) okay = TRUE;
116 /* No "okay" spells */
117 if (!okay) return (FALSE);
118 if (((use_realm) != p_ptr->realm1) && ((use_realm) != p_ptr->realm2) && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE)) return FALSE;
119 if (((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE)) && !is_magic(use_realm)) return FALSE;
120 if ((p_ptr->pclass == CLASS_RED_MAGE) && ((use_realm) != REALM_ARCANE) && (sval > 1)) return FALSE;
122 /* Assume cancelled */
125 /* Nothing chosen yet */
135 p_ptr->window |= (PW_SPELL);
141 /* Build a prompt (accept all spells) */
143 jverb1( prompt, jverb_buf );
144 (void) strnfmt(out_val, 78, "(%^s:%c-%c, '*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤Î%s¤ò%^s¤Þ¤¹¤«? ",
145 p, I2A(0), I2A(num - 1), p, jverb_buf );
147 (void)strnfmt(out_val, 78, "(%^ss %c-%c, *=List, ESC=exit) %^s which %s? ",
148 p, I2A(0), I2A(num - 1), prompt, p);
151 /* Get a spell from the user */
153 choice = (always_show_list || use_menu) ? ESCAPE:1;
156 if( choice==ESCAPE ) choice = ' ';
157 else if( !get_com(out_val, &choice, TRUE) )break;
159 if (use_menu && choice != ' ')
174 menu_line += (num - 1);
196 if (menu_line > num) menu_line -= num;
197 /* Display a list of spells */
198 print_spells(menu_line, spells, num, 1, 15, use_realm);
204 if ((choice == ' ') || (choice == '*') || (choice == '?'))
212 /* Save the screen */
215 /* Display a list of spells */
216 print_spells(menu_line, spells, num, 1, 15, use_realm);
222 if (use_menu) continue;
227 /* Restore the screen */
237 ask = (isupper(choice));
240 if (ask) choice = tolower(choice);
242 /* Extract request */
243 i = (islower(choice) ? A2I(choice) : -1);
246 /* Totally Illegal */
247 if ((i < 0) || (i >= num))
253 /* Save the spell index */
256 /* Require "okay" spells */
257 if (!spell_okay(spell, learned, FALSE, use_realm))
261 msg_format("¤½¤Î%s¤ò%s¤³¤È¤Ï¤Ç¤¤Þ¤»¤ó¡£", p, prompt);
263 msg_format("You may not %s that %s.", prompt, p);
274 /* Access the spell */
275 if (!is_magic(use_realm))
277 s_ptr = &technic_info[use_realm - MIN_TECHNIC][spell];
281 s_ptr = &mp_ptr->info[use_realm - 1][spell];
284 if (use_realm == REALM_HISSATSU)
286 shouhimana = s_ptr->smana;
290 /* Extract mana consumption rate */
291 shouhimana = s_ptr->smana*(3800 - experience_of_spell(spell, use_realm)) + 2399;
294 else shouhimana *= 4;
296 if(shouhimana < 1) shouhimana = 1;
301 jverb1( prompt, jverb_buf );
302 /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½¤ËÂбþ */
303 (void) strnfmt(tmp_val, 78, "%s(MP%d, ¼ºÇÔΨ%d%%)¤ò%s¤Þ¤¹¤«? ",
304 spell_names[technic2magic(use_realm)-1][spell], shouhimana,
305 spell_chance(spell, use_realm),jverb_buf);
307 (void)strnfmt(tmp_val, 78, "%^s %s (%d mana, %d%% fail)? ",
308 prompt, spell_names[technic2magic(use_realm)-1][spell], shouhimana,
309 spell_chance(spell, use_realm));
313 /* Belay that order */
314 if (!get_check(tmp_val)) continue;
322 /* Restore the screen */
323 if (redraw) screen_load();
330 p_ptr->window |= (PW_SPELL);
337 /* Abort if needed */
338 if (!flag) return (FALSE);
340 /* Save the choice */
343 #ifdef ALLOW_REPEAT /* TNB */
347 #endif /* ALLOW_REPEAT -- TNB */
354 static bool item_tester_learn_spell(object_type *o_ptr)
356 s32b choices = realm_choices2[p_ptr->pclass];
358 if (p_ptr->pclass == CLASS_PRIEST)
360 if (is_good_realm(p_ptr->realm1))
362 choices &= ~(CH_DEATH | CH_DAEMON);
366 choices &= ~(CH_LIFE | CH_CRUSADE);
370 if ((o_ptr->tval < TV_LIFE_BOOK) || (o_ptr->tval > (TV_LIFE_BOOK + MAX_REALM - 1))) return (FALSE);
371 if ((o_ptr->tval == TV_MUSIC_BOOK) && (p_ptr->pclass == CLASS_BARD)) return (TRUE);
372 else if (!is_magic(tval2realm(o_ptr->tval))) return FALSE;
373 if ((REALM1_BOOK == o_ptr->tval) || (REALM2_BOOK == o_ptr->tval)) return (TRUE);
374 if (choices & (0x0001 << (tval2realm(o_ptr->tval) - 1))) return (TRUE);
380 * Peruse the spells/prayers in a book
382 * Note that *all* spells in the book are listed
384 * Note that browsing is allowed while confused or blind,
385 * and in the dark, primarily to allow browsing in stores.
387 void do_cmd_browse(void)
389 int item, sval, use_realm = 0, j, line;
402 /* Warriors are illiterate */
403 if (!(p_ptr->realm1 || p_ptr->realm2) && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE))
406 msg_print("ËܤòÆɤळ¤È¤¬¤Ç¤¤Ê¤¤¡ª");
408 msg_print("You cannot read books!");
414 if (p_ptr->special_defense & KATA_MUSOU)
416 set_action(ACTION_NONE);
419 /* Restrict choices to "useful" books */
420 if (p_ptr->realm2 == REALM_NONE) item_tester_tval = mp_ptr->spell_book;
421 else item_tester_hook = item_tester_learn_spell;
425 q = "¤É¤ÎËܤòÆɤߤޤ¹¤«? ";
427 q = "Browse which book? ";
431 s = "Æɤá¤ëËܤ¬¤Ê¤¤¡£";
433 s = "You have no books that you can read.";
436 select_spellbook=TRUE;
437 if (p_ptr->pclass == CLASS_FORCETRAINER)
438 select_the_force = TRUE;
439 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))){
440 select_spellbook = FALSE;
441 select_the_force = FALSE;
444 select_spellbook = FALSE;
445 select_the_force = FALSE;
447 if (item == 1111) { /* the_force */
448 do_cmd_mind_browse();
451 /* Get the item (in the pack) */
454 o_ptr = &inventory[item];
457 /* Get the item (on the floor) */
460 o_ptr = &o_list[0 - item];
463 /* Access the item's sval */
466 use_realm = tval2realm(o_ptr->tval);
467 if ((p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE) && is_magic(use_realm))
469 if (o_ptr->tval == REALM2_BOOK) increment = 32;
470 else if (o_ptr->tval != REALM1_BOOK) increment = 64;
473 /* Track the object kind */
474 object_kind_track(o_ptr->k_idx);
476 /* Hack -- Handle stuff */
481 for (spell = 0; spell < 32; spell++)
483 /* Check for this spell */
484 if ((fake_spell_flags[sval] & (1L << spell)))
486 /* Collect this spell */
487 spells[num++] = spell;
492 /* Save the screen */
495 /* Clear the top line */
498 /* Keep browsing spells. Exit browsing on cancel. */
501 /* Ask for a spell, allow cancel */
503 if (!get_spell(&spell, "Æɤà", o_ptr->sval, TRUE, use_realm))
505 if (!get_spell(&spell, "browse", o_ptr->sval, TRUE, use_realm))
508 /* If cancelled, leave immediately. */
509 if (spell == -1) break;
511 /* Display a list of spells */
512 print_spells(0, spells, num, 1, 15, use_realm);
514 /* Notify that there's nothing to see, and wait. */
515 if (use_realm == REALM_HISSATSU)
517 prt("Æɤá¤ëµ»¤¬¤Ê¤¤¡£", 0, 0);
519 prt("No techniques to browse.", 0, 0);
523 prt("Æɤá¤ë¼öʸ¤¬¤Ê¤¤¡£", 0, 0);
525 prt("No spells to browse.", 0, 0);
530 /* Restore the screen */
536 /* Clear lines, position cursor (really should use strlen here) */
537 Term_erase(14, 14, 255);
538 Term_erase(14, 13, 255);
539 Term_erase(14, 12, 255);
540 Term_erase(14, 11, 255);
542 /* Access the spell */
543 if (!is_magic(use_realm))
545 s_ptr = &technic_info[use_realm - MIN_TECHNIC][spell];
549 s_ptr = &mp_ptr->info[use_realm - 1][spell];
552 roff_to_buf( spell_tips[technic2magic(use_realm)-1][spell] ,62,temp);
553 for(j=0, line = 11;temp[j];j+=(1+strlen(&temp[j])))
555 prt(&temp[j], line, 15);
560 /* Restore the screen */
565 static void change_realm2(int next_realm)
570 for (i = 0; i < 64; i++)
572 p_ptr->spell_order[j] = p_ptr->spell_order[i];
573 if(p_ptr->spell_order[i] < 32) j++;
576 p_ptr->spell_order[j] = 99;
578 for (i = 32; i < 64; i++)
580 p_ptr->spell_exp[i] = 0;
582 p_ptr->spell_learned2 = 0L;
583 p_ptr->spell_worked2 = 0L;
584 p_ptr->spell_forgotten2 = 0L;
587 sprintf(tmp,"ËâË¡¤ÎÎΰè¤ò%s¤«¤é%s¤ËÊѹ¹¤·¤¿¡£", realm_names[p_ptr->realm2], realm_names[next_realm]);
589 sprintf(tmp,"change magic realm from %s to %s.", realm_names[p_ptr->realm2], realm_names[next_realm]);
591 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
592 p_ptr->old_realm |= 1 << (p_ptr->realm2-1);
593 p_ptr->realm2 = next_realm;
595 p_ptr->notice |= (PN_REORDER);
596 p_ptr->update |= (PU_SPELLS);
602 * Study a book to gain a new spell/prayer
604 void do_cmd_study(void)
608 bool learned = FALSE;
610 /* Spells of realm2 will have an increment of +32 */
613 cptr p = spell_categoly_name(mp_ptr->spell_book);
622 msg_print("ËܤòÆɤळ¤È¤¬¤Ç¤¤Ê¤¤¡ª");
624 msg_print("You cannot read books!");
630 if (p_ptr->blind || no_lite())
633 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡ª");
635 msg_print("You cannot see!");
644 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡ª");
646 msg_print("You are too confused!");
652 if (!(p_ptr->new_spells))
655 msg_format("¿·¤·¤¤%s¤ò³Ð¤¨¤ë¤³¤È¤Ï¤Ç¤¤Ê¤¤¡ª", p);
657 msg_format("You cannot learn any new %ss!", p);
663 if (p_ptr->special_defense & KATA_MUSOU)
665 set_action(ACTION_NONE);
668 p = spell_categoly_name(mp_ptr->spell_book);
671 if( p_ptr->new_spells < 10 ){
672 msg_format("¤¢¤È %d ¤Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
674 msg_format("¤¢¤È %d ¸Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
677 msg_format("You can learn %d new %s%s.", p_ptr->new_spells, p,
678 (p_ptr->new_spells == 1?"":"s"));
684 /* Restrict choices to "useful" books */
685 if (p_ptr->realm2 == REALM_NONE) item_tester_tval = mp_ptr->spell_book;
686 else item_tester_hook = item_tester_learn_spell;
690 q = "¤É¤ÎËܤ«¤é³Ø¤Ó¤Þ¤¹¤«? ";
692 q = "Study which book? ";
696 s = "Æɤá¤ëËܤ¬¤Ê¤¤¡£";
698 s = "You have no books that you can read.";
701 select_spellbook=TRUE;
702 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
703 select_spellbook=FALSE;
705 /* Get the item (in the pack) */
708 o_ptr = &inventory[item];
711 /* Get the item (on the floor) */
714 o_ptr = &o_list[0 - item];
717 /* Access the item's sval */
720 if (o_ptr->tval == REALM2_BOOK) increment = 32;
721 else if (o_ptr->tval != REALM1_BOOK)
724 if (!get_check("ËÜÅö¤ËËâË¡¤ÎÎΰè¤òÊѹ¹¤·¤Þ¤¹¤«¡©")) return;
726 if (!get_check("Really, change magic realm? ")) return;
728 change_realm2(tval2realm(o_ptr->tval));
732 /* Track the object kind */
733 object_kind_track(o_ptr->k_idx);
735 /* Hack -- Handle stuff */
738 /* Mage -- Learn a selected spell */
739 if (mp_ptr->spell_book != TV_LIFE_BOOK)
741 /* Ask for a spell, allow cancel */
743 if (!get_spell(&spell, "³Ø¤Ö", sval, FALSE, o_ptr->tval - TV_LIFE_BOOK + 1)
744 && (spell == -1)) return;
746 if (!get_spell(&spell, "study", sval, FALSE, o_ptr->tval - TV_LIFE_BOOK + 1)
747 && (spell == -1)) return;
752 /* Priest -- Learn a random prayer */
760 for (spell = 0; spell < 32; spell++)
762 /* Check spells in the book */
763 if ((fake_spell_flags[sval] & (1L << spell)))
765 /* Skip non "okay" prayers */
766 if (!spell_okay(spell, FALSE, TRUE,
767 (increment ? p_ptr->realm2 : p_ptr->realm1))) continue;
769 /* Hack -- Prepare the randomizer */
772 /* Hack -- Apply the randomizer */
773 if (one_in_(k)) gift = spell;
781 /* Nothing to study */
786 msg_format("¤½¤ÎËܤˤϳؤ֤٤%s¤¬¤Ê¤¤¡£", p);
788 msg_format("You cannot learn any %ss in that book.", p);
797 if (increment) spell += increment;
799 /* Learn the spell */
802 if (p_ptr->spell_learned1 & (1L << spell)) learned = TRUE;
803 else p_ptr->spell_learned1 |= (1L << spell);
807 if (p_ptr->spell_learned2 & (1L << (spell - 32))) learned = TRUE;
808 else p_ptr->spell_learned2 |= (1L << (spell - 32));
813 int max_exp = (spell < 32) ? 1600 : 1400;
814 int old_exp = p_ptr->spell_exp[spell];
816 cptr name = spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell%32];
818 if (old_exp >= max_exp)
821 msg_format("¤½¤Î%s¤Ï´°Á´¤Ë»È¤¤¤³¤Ê¤»¤ë¤Î¤Ç³Ø¤ÖɬÍפϤʤ¤¡£", spell_categoly_name(mp_ptr->spell_book));
823 msg_format("You don't need to study this %s anymore.", spell_categoly_name(mp_ptr->spell_book));
828 if (!get_check(format("%s¤Î%s¤ò¤µ¤é¤Ë³Ø¤Ó¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©", name, spell_categoly_name(mp_ptr->spell_book))))
830 if (!get_check(format("You will study a %s of %s again. Are you sure? ", spell_categoly_name(mp_ptr->spell_book), name)))
835 else if (old_exp >= 1400)
837 p_ptr->spell_exp[spell] = 1600;
840 else if (old_exp >= 1200)
842 if (spell >= 32) p_ptr->spell_exp[spell] = 1400;
843 else p_ptr->spell_exp[spell] += 200;
846 else if (old_exp >= 900)
848 p_ptr->spell_exp[spell] = 1200+(old_exp-900)*2/3;
853 p_ptr->spell_exp[spell] = 900+(old_exp)/3;
857 msg_format("%s¤Î½ÏÎýÅÙ¤¬%s¤Ë¾å¤¬¤Ã¤¿¡£", name, shougou_moji[new_rank]);
859 msg_format("Your proficiency of %s is now %s rank.", name, shougou_moji[new_rank]);
864 /* Find the next open entry in "p_ptr->spell_order[]" */
865 for (i = 0; i < 64; i++)
867 /* Stop at the first empty space */
868 if (p_ptr->spell_order[i] == 99) break;
871 /* Add the spell to the known list */
872 p_ptr->spell_order[i++] = spell;
874 /* Mention the result */
876 /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½¤ËÂбþ */
877 if (mp_ptr->spell_book == TV_MUSIC_BOOK)
879 msg_format("%s¤ò³Ø¤ó¤À¡£",
880 spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32]);
884 msg_format("%s¤Î%s¤ò³Ø¤ó¤À¡£",
885 spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32] ,p);
888 msg_format("You have learned the %s of %s.",
889 p, spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32]);
896 if (mp_ptr->spell_book == TV_LIFE_BOOK)
897 chg_virtue(V_FAITH, 1);
898 else if (mp_ptr->spell_book == TV_DEATH_BOOK)
899 chg_virtue(V_UNLIFE, 1);
900 else if (mp_ptr->spell_book == TV_NATURE_BOOK)
901 chg_virtue(V_NATURE, 1);
903 chg_virtue(V_KNOWLEDGE, 1);
908 /* One less spell available */
909 p_ptr->learned_spells++;
911 /* Message if needed */
912 if (p_ptr->new_spells)
916 if( p_ptr->new_spells < 10 ){
917 msg_format("¤¢¤È %d ¤Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
919 msg_format("¤¢¤È %d ¸Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
922 msg_format("You can learn %d more %s%s.",
923 p_ptr->new_spells, p,
924 (p_ptr->new_spells != 1) ? "s" : "");
931 p_ptr->update |= (PU_SPELLS);
934 /* Redraw object recall */
935 p_ptr->window |= (PW_OBJECT);
939 static void wild_magic(int spell)
942 int type = SUMMON_BIZARRE1 + randint0(6);
944 if (type < SUMMON_BIZARRE1) type = SUMMON_BIZARRE1;
945 else if (type > SUMMON_BIZARRE6) type = SUMMON_BIZARRE6;
947 switch (randint1(spell) + randint1(8) + 1)
957 teleport_player(100);
961 teleport_player(200);
971 lite_area(damroll(2, 3), 2);
974 destroy_doors_touch();
979 sleep_monsters_touch();
983 trap_creation(py, px);
992 aggravate_monsters(0);
995 earthquake(py, px, 5);
999 (void)gain_random_mutation(0);
1003 apply_disenchant(1);
1009 fire_ball(GF_CHAOS, 0, spell + 5, 1 + (spell / 10));
1016 while (counter++ < 8)
1018 (void)summon_specific(0, py, px, (dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET));
1023 activate_hi_summon(py, px, FALSE);
1026 (void)summon_cyber(-1, py, px);
1031 (void)activate_ty_curse(FALSE, &count);
1040 static bool cast_life_spell(int spell)
1043 int plev = p_ptr->lev;
1047 case 0: /* Cure Light Wounds */
1048 (void)hp_player(damroll(2, 10));
1049 (void)set_cut(p_ptr->cut - 10);
1052 (void)set_blessed(randint1(12) + 12, FALSE);
1054 case 2: /* Make Light Wounds */
1055 if (!get_aim_dir(&dir)) return FALSE;
1056 fire_ball_hide(GF_WOUNDS, dir, damroll(3 + ((plev - 1) / 5), 4), 0);
1058 case 3: /* Call Light */
1059 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1061 case 4: /* Detect Traps + Secret Doors */
1062 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1063 (void)detect_doors(DETECT_RAD_DEFAULT);
1064 (void)detect_stairs(DETECT_RAD_DEFAULT);
1066 case 5: /* Cure Medium Wounds */
1067 (void)hp_player(damroll(4, 10));
1068 (void)set_cut((p_ptr->cut / 2) - 20);
1070 case 6: /* Cure Poison */
1071 (void)set_poisoned(0);
1073 case 7: /* Satisfy Hunger */
1074 (void)set_food(PY_FOOD_MAX - 1);
1076 case 8: /* Remove Curse */
1080 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1082 msg_print("You feel as if someone is watching over you.");
1086 case 9: /* Make Medium Wounds */
1087 if (!get_aim_dir(&dir)) return FALSE;
1088 fire_ball_hide(GF_WOUNDS, dir, damroll(8 + ((plev - 5) / 4), 8), 0);
1090 case 10: /* Cure Critical Wounds */
1091 (void)hp_player(damroll(8, 10));
1096 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1097 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1100 map_area(DETECT_RAD_MAP);
1103 (void)turn_undead();
1105 case 14: /* Healing */
1106 (void)hp_player(300);
1110 case 15: /* Glyph of Warding */
1113 case 16: /* Dispel Curse */
1114 if (remove_all_curse())
1117 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1119 msg_print("You feel as if someone is watching over you.");
1123 case 17: /* Perception */
1124 return ident_spell(FALSE);
1125 case 18: /* Dispel Undead */
1126 (void)dispel_undead(randint1(plev * 5));
1128 case 19: /* 'Day of the Dove' */
1129 charm_monsters(plev * 2);
1131 case 20: /* Make Critical Wounds */
1132 if (!get_aim_dir(&dir)) return FALSE;
1133 fire_ball_hide(GF_WOUNDS, dir, damroll(5+((plev - 5) / 3), 15), 0);
1135 case 21: /* Word of Recall */
1136 if (!word_of_recall()) return FALSE;
1138 case 22: /* Alter Reality */
1141 case 23: /* Warding True */
1146 num_repro += MAX_REPRO;
1148 case 25: /* Detection True */
1149 (void)detect_all(DETECT_RAD_DEFAULT);
1151 case 26: /* Genocide Undead */
1152 (void)mass_genocide_undead(plev+50,TRUE);
1154 case 27: /* Clairvoyance */
1155 wiz_lite(FALSE, FALSE);
1157 case 28: /* Restoration */
1158 (void)do_res_stat(A_STR);
1159 (void)do_res_stat(A_INT);
1160 (void)do_res_stat(A_WIS);
1161 (void)do_res_stat(A_DEX);
1162 (void)do_res_stat(A_CON);
1163 (void)do_res_stat(A_CHR);
1164 (void)restore_level();
1166 case 29: /* Healing True */
1167 (void)hp_player(2000);
1171 case 30: /* Holy Vision */
1172 return identify_fully(FALSE);
1173 case 31: /* Ultimate resistance */
1175 int v = randint1(plev/2)+plev/2;
1176 (void)set_fast(v, FALSE);
1177 set_oppose_acid(v, FALSE);
1178 set_oppose_elec(v, FALSE);
1179 set_oppose_fire(v, FALSE);
1180 set_oppose_cold(v, FALSE);
1181 set_oppose_pois(v, FALSE);
1182 set_ultimate_res(v, FALSE);
1187 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥é¥¤¥Õ¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1189 msg_format("You cast an unknown Life spell: %d.", spell);
1200 static bool cast_sorcery_spell(int spell)
1203 int plev = p_ptr->lev;
1207 case 0: /* Detect Monsters */
1208 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1210 case 1: /* Phase Door */
1211 teleport_player(10);
1213 case 2: /* Detect Doors and Traps */
1214 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1215 (void)detect_doors(DETECT_RAD_DEFAULT);
1216 (void)detect_stairs(DETECT_RAD_DEFAULT);
1218 case 3: /* Light Area */
1219 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1221 case 4: /* Confuse Monster */
1222 if (!get_aim_dir(&dir)) return FALSE;
1224 (void)confuse_monster(dir, (plev * 3) / 2);
1226 case 5: /* Teleport */
1227 teleport_player(plev * 5);
1229 case 6: /* Sleep Monster */
1230 if (!get_aim_dir(&dir)) return FALSE;
1232 (void)sleep_monster(dir);
1234 case 7: /* Recharging */
1235 return recharge(plev * 4);
1236 case 8: /* Magic Mapping */
1237 map_area(DETECT_RAD_MAP);
1239 case 9: /* Identify */
1240 return ident_spell(FALSE);
1241 case 10: /* Slow Monster */
1242 if (!get_aim_dir(&dir)) return FALSE;
1244 (void)slow_monster(dir);
1246 case 11: /* Mass Sleep */
1247 (void)sleep_monsters();
1249 case 12: /* Teleport Away */
1250 if (!get_aim_dir(&dir)) return FALSE;
1252 (void)fire_beam(GF_AWAY_ALL, dir, plev);
1254 case 13: /* Haste Self */
1255 (void)set_fast(randint1(20 + plev) + plev, FALSE);
1257 case 14: /* Detection True */
1258 (void)detect_all(DETECT_RAD_DEFAULT);
1260 case 15: /* Identify True */
1261 return identify_fully(FALSE);
1262 case 16: /* Detect Objects and Treasure*/
1263 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
1264 (void)detect_treasure(DETECT_RAD_DEFAULT);
1265 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
1267 case 17: /* Charm Monster */
1268 if (!get_aim_dir(&dir)) return FALSE;
1270 (void)charm_monster(dir, plev);
1272 case 18: /* Sense Minds */
1273 (void)set_tim_esp(randint1(30) + 25, FALSE);
1275 case 19: /* Teleport to town */
1278 case 20: /* Self knowledge */
1279 (void)self_knowledge();
1281 case 21: /* Teleport Level */
1283 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
1285 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
1287 (void)teleport_player_level();
1289 case 22: /* Word of Recall */
1290 if (!word_of_recall()) return FALSE;
1292 case 23: /* Dimension Door */
1294 msg_print("¼¡¸µ¤ÎÈ⤬³«¤¤¤¿¡£ÌÜŪÃϤòÁª¤ó¤Ç²¼¤µ¤¤¡£");
1296 msg_print("You open a dimensional gate. Choose a destination.");
1299 return dimension_door();
1300 case 24: /* Probing */
1303 case 25: /* Explosive Rune */
1306 case 26: /* Telekinesis */
1307 if (!get_aim_dir(&dir)) return FALSE;
1309 fetch(dir, plev * 15, FALSE);
1311 case 27: /* Clairvoyance */
1312 chg_virtue(V_KNOWLEDGE, 1);
1313 chg_virtue(V_ENLIGHTEN, 1);
1315 wiz_lite(FALSE, FALSE);
1316 if (!(p_ptr->telepathy))
1318 (void)set_tim_esp(randint1(30) + 25, FALSE);
1321 case 28: /* Charm Monsters */
1322 charm_monsters(plev * 2);
1324 case 29: /* Alchemy */
1326 case 30: /* Banish */
1327 banish_monsters(plev * 4);
1329 case 31: /* Globe of Invulnerability */
1330 (void)set_invuln(randint1(4) + 4, FALSE);
1334 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥½¡¼¥µ¥ê¡¼¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1336 msg_format("You cast an unknown Sorcery spell: %d.", spell);
1346 static bool cast_nature_spell(int spell)
1350 int plev = p_ptr->lev;
1351 bool no_trump = FALSE;
1353 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1354 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1355 else beam = plev / 2;
1359 case 0: /* Detect Creatures */
1360 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1362 case 1: /* Lightning Bolt */
1363 project_length = plev / 6 + 2;
1364 if (!get_aim_dir(&dir)) return FALSE;
1366 fire_beam(GF_ELEC, dir,
1367 damroll(3 + ((plev - 1) / 5), 4));
1369 case 2: /* Detect Doors & Traps */
1370 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1371 (void)detect_doors(DETECT_RAD_DEFAULT);
1372 (void)detect_stairs(DETECT_RAD_DEFAULT);
1374 case 3: /* Produce Food */
1376 object_type forge, *q_ptr = &forge;
1379 msg_print("¿©ÎÁ¤òÀ¸À®¤·¤¿¡£");
1381 msg_print("A food ration is produced.");
1384 /* Create the food ration */
1385 object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_RATION));
1387 /* Drop the object from heaven */
1388 (void)drop_near(q_ptr, -1, py, px);
1392 case 4: /* Daylight */
1393 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1394 if ((prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
1397 msg_print("Æü¤Î¸÷¤¬¤¢¤Ê¤¿¤ÎÆùÂΤò¾Ç¤¬¤·¤¿¡ª");
1399 msg_print("The daylight scorches your flesh!");
1403 take_hit(DAMAGE_NOESCAPE, damroll(2, 2), "Æü¤Î¸÷", -1);
1405 take_hit(DAMAGE_NOESCAPE, damroll(2, 2), "daylight", -1);
1410 case 5: /* Animal Taming */
1411 if (!get_aim_dir(&dir)) return FALSE;
1413 (void)charm_animal(dir, plev);
1415 case 6: /* Resist Environment */
1416 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1417 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1418 (void)set_oppose_elec(randint1(20) + 20, FALSE);
1420 case 7: /* Cure Wounds & Poison */
1421 (void)hp_player(damroll(2, 8));
1423 (void)set_poisoned(0);
1425 case 8: /* Stone to Mud */
1426 if (!get_aim_dir(&dir)) return FALSE;
1428 (void)wall_to_mud(dir);
1430 case 9: /* Frost Bolt */
1431 if (!get_aim_dir(&dir)) return FALSE;
1432 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
1433 damroll(3 + ((plev - 5) / 4), 8));
1435 case 10: /* Nature Awareness -- downgraded */
1436 map_area(DETECT_RAD_MAP);
1437 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1438 (void)detect_doors(DETECT_RAD_DEFAULT);
1439 (void)detect_stairs(DETECT_RAD_DEFAULT);
1440 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1442 case 11: /* Fire Bolt */
1443 if (!get_aim_dir(&dir)) return FALSE;
1444 fire_bolt_or_beam(beam - 10, GF_FIRE, dir,
1445 damroll(5 + ((plev - 5) / 4), 8));
1447 case 12: /* Ray of Sunlight */
1448 if (!get_aim_dir(&dir)) return FALSE;
1450 msg_print("ÂÀÍÛ¸÷Àþ¤¬¸½¤ì¤¿¡£");
1452 msg_print("A line of sunlight appears.");
1455 (void)lite_line(dir);
1457 case 13: /* Entangle */
1460 case 14: /* Summon Animals */
1461 if (!(summon_specific(-1, py, px, plev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET))))
1464 case 15: /* Herbal Healing */
1465 (void)hp_player(500);
1468 (void)set_poisoned(0);
1470 case 16: /* Stair Building */
1471 (void)stair_creation();
1473 case 17: /* Stone Skin */
1474 (void)set_shield(randint1(20) + 30, FALSE);
1476 case 18: /* Resistance True */
1477 (void)set_oppose_acid(randint1(20) + 20, FALSE);
1478 (void)set_oppose_elec(randint1(20) + 20, FALSE);
1479 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1480 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1481 (void)set_oppose_pois(randint1(20) + 20, FALSE);
1483 case 19: /* Tree Creation */
1484 (void)tree_creation();
1486 case 20: /* Animal Friendship */
1487 (void)charm_animals(plev * 2);
1489 case 21: /* Stone Tell */
1490 return identify_fully(FALSE);
1491 case 22: /* Wall of Stone */
1494 case 23: /* Protection from Corrosion */
1496 case 24: /* Earthquake */
1497 earthquake(py, px, 10);
1499 case 25: /* Whirlwind Attack */
1503 monster_type *m_ptr;
1505 for (dir = 0; dir < 8; dir++)
1507 y = py + ddy_ddd[dir];
1508 x = px + ddx_ddd[dir];
1509 c_ptr = &cave[y][x];
1511 /* Get the monster */
1512 m_ptr = &m_list[c_ptr->m_idx];
1514 /* Hack -- attack monsters */
1515 if (c_ptr->m_idx && (m_ptr->ml || cave_floor_bold(y, x)))
1520 case 26: /* Blizzard */
1521 if (!get_aim_dir(&dir)) return FALSE;
1523 fire_ball(GF_COLD, dir, 70 + plev * 3 / 2, (plev / 12) + 1);
1525 case 27: /* Lightning Storm */
1526 if (!get_aim_dir(&dir)) return FALSE;
1527 fire_ball(GF_ELEC, dir, 90 + plev * 3 / 2, (plev / 12) + 1);
1529 case 28: /* Whirlpool */
1530 if (!get_aim_dir(&dir)) return FALSE;
1531 fire_ball(GF_WATER, dir, 100 + plev * 3 / 2, (plev / 12) + 1);
1533 case 29: /* Call Sunlight */
1534 fire_ball(GF_LITE, 0, 150, 8);
1535 chg_virtue(V_KNOWLEDGE, 1);
1536 chg_virtue(V_ENLIGHTEN, 1);
1537 wiz_lite(FALSE, FALSE);
1538 if ((prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
1541 msg_print("Æü¸÷¤¬¤¢¤Ê¤¿¤ÎÆùÂΤò¾Ç¤¬¤·¤¿¡ª");
1543 msg_print("The sunlight scorches your flesh!");
1547 take_hit(DAMAGE_NOESCAPE, 50, "Æü¸÷", -1);
1549 take_hit(DAMAGE_NOESCAPE, 50, "sunlight", -1);
1554 case 30: /* Elemental Branding */
1555 brand_weapon(randint0(2));
1557 case 31: /* Nature's Wrath */
1558 (void)dispel_monsters(plev * 4);
1559 earthquake(py, px, 20 + (plev / 2));
1560 project(0, 1 + plev / 12, py, px,
1561 (100 + plev) * 2, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM, -1);
1565 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥Í¥¤¥Á¥ã¡¼¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1567 msg_format("You cast an unknown Nature spell: %d.", spell);
1575 msg_print("ưʪ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
1577 msg_print("No animals arrive.");
1585 static bool cast_chaos_spell(int spell)
1588 int plev = p_ptr->lev;
1590 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1591 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1592 else beam = plev / 2;
1596 case 0: /* Magic Missile */
1597 if (!get_aim_dir(&dir)) return FALSE;
1599 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
1600 damroll(3 + ((plev - 1) / 5), 4));
1602 case 1: /* Trap / Door destruction */
1603 (void)destroy_doors_touch();
1605 case 2: /* Flash of Light == Light Area */
1606 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1608 case 3: /* Touch of Confusion */
1609 if (!(p_ptr->special_attack & ATTACK_CONFUSE))
1612 msg_print("¤¢¤Ê¤¿¤Î¼ê¤Ï¸÷¤ê»Ï¤á¤¿¡£");
1614 msg_print("Your hands start glowing.");
1617 p_ptr->special_attack |= ATTACK_CONFUSE;
1618 p_ptr->redraw |= (PR_STATUS);
1621 case 4: /* Mana Burst */
1622 if (!get_aim_dir(&dir)) return FALSE;
1624 fire_ball(GF_MISSILE, dir,
1625 (damroll(3, 5) + plev +
1626 (plev / (((p_ptr->pclass == CLASS_MAGE)
1627 || (p_ptr->pclass == CLASS_HIGH_MAGE)
1628 || (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
1629 ((plev < 30) ? 2 : 3));
1630 /* Shouldn't actually use GF_MANA, as it will destroy all
1631 * items on the floor */
1633 case 5: /* Fire Bolt */
1634 if (!get_aim_dir(&dir)) return FALSE;
1636 fire_bolt_or_beam(beam, GF_FIRE, dir,
1637 damroll(8 + ((plev - 5) / 4), 8));
1639 case 6: /* Fist of Force ("Fist of Fun") */
1640 if (!get_aim_dir(&dir)) return FALSE;
1642 fire_ball(GF_DISINTEGRATE, dir,
1643 damroll(8 + ((plev - 5) / 4), 8), 0);
1645 case 7: /* Teleport Self */
1646 teleport_player(plev * 5);
1648 case 8: /* Wonder */
1650 /* This spell should become more useful (more
1651 controlled) as the player gains experience levels.
1652 Thus, add 1/5 of the player's level to the die roll.
1653 This eliminates the worst effects later on, while
1654 keeping the results quite random. It also allows
1655 some potent effects only at high level. */
1657 int die = randint1(100) + plev / 5;
1658 int vir = virtue_number(V_CHANCE);
1661 if (p_ptr->virtues[vir - 1] > 0)
1663 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
1667 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
1672 chg_virtue(V_CHANCE, 1);
1674 if (!get_aim_dir(&dir)) return FALSE;
1677 msg_print("¤¢¤Ê¤¿¤ÏÎϤ¬¤ß¤Ê¤®¤ë¤Î¤ò´¶¤¸¤¿¡ª");
1679 msg_print("You feel a surge of power!");
1682 if (die < 8) clone_monster(dir);
1683 else if (die < 14) speed_monster(dir);
1684 else if (die < 26) heal_monster(dir, damroll(4, 6));
1685 else if (die < 31) poly_monster(dir);
1687 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
1688 damroll(3 + ((plev - 1) / 5), 4));
1689 else if (die < 41) confuse_monster(dir, plev);
1690 else if (die < 46) fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
1691 else if (die < 51) (void)lite_line(dir);
1693 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
1694 damroll(3 + ((plev - 5) / 4), 8));
1696 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
1697 damroll(5 + ((plev - 5) / 4), 8));
1699 fire_bolt_or_beam(beam, GF_ACID, dir,
1700 damroll(6 + ((plev - 5) / 4), 8));
1702 fire_bolt_or_beam(beam, GF_FIRE, dir,
1703 damroll(8 + ((plev - 5) / 4), 8));
1704 else if (die < 76) drain_life(dir, 75);
1705 else if (die < 81) fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
1706 else if (die < 86) fire_ball(GF_ACID, dir, 40 + plev, 2);
1707 else if (die < 91) fire_ball(GF_ICE, dir, 70 + plev, 3);
1708 else if (die < 96) fire_ball(GF_FIRE, dir, 80 + plev, 3);
1709 else if (die < 101) drain_life(dir, 100 + plev);
1712 earthquake(py, px, 12);
1716 destroy_area(py, px, 13+randint0(5), TRUE);
1720 symbol_genocide(plev+50, TRUE);
1722 else if (die < 110) dispel_monsters(120);
1725 dispel_monsters(150);
1733 case 9: /* Chaos Bolt */
1734 if (!get_aim_dir(&dir)) return FALSE;
1736 fire_bolt_or_beam(beam, GF_CHAOS, dir,
1737 damroll(10 + ((plev - 5) / 4), 8));
1739 case 10: /* Sonic Boom */
1741 msg_print("¥É¡¼¥ó¡ªÉô²°¤¬Íɤ줿¡ª");
1743 msg_print("BOOM! Shake the room!");
1746 project(0, plev / 10 + 2, py, px,
1747 (60 + plev), GF_SOUND, PROJECT_KILL | PROJECT_ITEM, -1);
1749 case 11: /* Doom Bolt -- always beam in 2.0.7 or later */
1750 if (!get_aim_dir(&dir)) return FALSE;
1752 fire_beam(GF_MANA, dir, damroll(11 + ((plev - 5) / 4), 8));
1754 case 12: /* Fire Ball */
1755 if (!get_aim_dir(&dir)) return FALSE;
1757 fire_ball(GF_FIRE, dir, plev + 55, 2);
1759 case 13: /* Teleport Other */
1760 if (!get_aim_dir(&dir)) return FALSE;
1762 (void)fire_beam(GF_AWAY_ALL, dir, plev);
1764 case 14: /* Word of Destruction */
1765 destroy_area(py, px, 13+randint0(5), TRUE);
1767 case 15: /* Invoke Logrus */
1768 if (!get_aim_dir(&dir)) return FALSE;
1770 fire_ball(GF_CHAOS, dir, plev*2 + 99, plev / 5);
1772 case 16: /* Polymorph Other */
1773 if (!get_aim_dir(&dir)) return FALSE;
1775 (void)poly_monster(dir);
1777 case 17: /* Chain Lightning */
1778 for (dir = 0; dir <= 9; dir++)
1779 fire_beam(GF_ELEC, dir, damroll(5 + (plev / 10), 8));
1781 case 18: /* Arcane Binding == Charging */
1782 return recharge(90);
1783 case 19: /* Disintegration */
1784 if (!get_aim_dir(&dir)) return FALSE;
1786 fire_ball(GF_DISINTEGRATE, dir, plev + 70, 3 + plev / 40);
1788 case 20: /* Alter Reality */
1791 case 21: /* Magic Rocket */
1792 if (!get_aim_dir(&dir)) return FALSE;
1795 msg_print("¥í¥±¥Ã¥Èȯ¼Í¡ª");
1797 msg_print("You launch a rocket!");
1800 fire_rocket(GF_ROCKET, dir, 120 + plev*2, 2);
1802 case 22: /* Chaos Branding */
1805 case 23: /* Summon monster, demon */
1808 bool pet = !one_in_(3);
1810 if (pet) mode |= PM_FORCE_PET;
1811 else mode |= PM_NO_PET;
1812 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
1814 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, SUMMON_DEMON, mode))
1817 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
1819 msg_print("The area fills with a stench of sulphur and brimstone.");
1825 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
1827 msg_print("'What is thy bidding... Master?'");
1832 msg_print("¡ÖÈܤ·¤¼Ô¤è¡¢²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª ¤ªÁ°¤Îº²¤òĺ¤¯¤¾¡ª¡×");
1834 msg_print("'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'");
1840 case 24: /* Beam of Gravity */
1841 if (!get_aim_dir(&dir)) return FALSE;
1843 fire_beam(GF_GRAVITY, dir, damroll(9 + ((plev - 5) / 4), 8));
1845 case 25: /* Meteor Swarm */
1848 int b = 10 + randint1(10);
1849 for (i = 0; i < b; i++)
1851 int count = 0, d = 0;
1856 if (count > 20) break;
1857 x = px - 8 + randint0(17);
1858 y = py - 8 + randint0(17);
1860 if (!in_bounds(y,x) || (!cave_floor_bold(y,x) && (cave[y][x].feat != FEAT_TREES)) || !player_has_los_bold(y, x)) continue;
1862 dx = (px > x) ? (px - x) : (x - px);
1863 dy = (py > y) ? (py - y) : (y - py);
1865 /* Approximate distance */
1866 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
1870 if (count > 20) continue;
1872 project(0, 2, y, x, plev * 2, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
1876 case 26: /* Flame Strike */
1877 fire_ball(GF_FIRE, 0, 300 + (3 * plev), 8);
1879 case 27: /* Call Chaos */
1882 case 28: /* Polymorph Self */
1884 if (!get_check("ÊѿȤ·¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©")) return FALSE;
1886 if (!get_check("You will polymorph yourself. Are you sure? ")) return FALSE;
1890 case 29: /* Mana Storm */
1891 if (!get_aim_dir(&dir)) return FALSE;
1893 fire_ball(GF_MANA, dir, 300 + (plev * 4), 4);
1895 case 30: /* Breathe Logrus */
1896 if (!get_aim_dir(&dir)) return FALSE;
1898 fire_ball(GF_CHAOS, dir, p_ptr->chp, 2);
1900 case 31: /* Call the Void */
1905 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥«¥ª¥¹¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1907 msg_format("You cast an unknown Chaos spell: %d.", spell);
1917 static bool cast_death_spell(int spell)
1921 int plev = p_ptr->lev;
1924 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1925 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1926 else beam = plev / 2;
1930 case 0: /* Detect Undead & Demons -> Unlife */
1931 (void)detect_monsters_nonliving(DETECT_RAD_DEFAULT);
1933 case 1: /* Malediction */
1934 if (!get_aim_dir(&dir)) return FALSE;
1935 /* A radius-0 ball may (1) be aimed at objects etc.,
1936 * and will affect them; (2) may be aimed at ANY
1937 * visible monster, unlike a 'bolt' which must travel
1938 * to the monster. */
1940 fire_ball(GF_HELL_FIRE, dir,
1941 damroll(3 + ((plev - 1) / 5), 4), 0);
1944 { /* Special effect first */
1945 dummy = randint1(1000);
1947 fire_ball_hide(GF_DEATH_RAY, dir, plev * 200, 0);
1948 else if (dummy < 500)
1949 fire_ball_hide(GF_TURN_ALL, dir, plev, 0);
1950 else if (dummy < 800)
1951 fire_ball_hide(GF_OLD_CONF, dir, plev, 0);
1953 fire_ball_hide(GF_STUN, dir, plev, 0);
1956 case 2: /* Detect Evil */
1957 (void)detect_monsters_evil(DETECT_RAD_DEFAULT);
1959 case 3: /* Stinking Cloud */
1960 if (!get_aim_dir(&dir)) return FALSE;
1962 fire_ball(GF_POIS, dir, 10 + (plev / 2), 2);
1964 case 4: /* Black Sleep */
1965 if (!get_aim_dir(&dir)) return FALSE;
1967 (void)sleep_monster(dir);
1969 case 5: /* Resist Poison */
1970 (void)set_oppose_pois(randint1(20) + 20, FALSE);
1972 case 6: /* Horrify */
1973 if (!get_aim_dir(&dir)) return FALSE;
1975 (void)fear_monster(dir, plev);
1976 (void)stun_monster(dir, plev);
1978 case 7: /* Enslave Undead */
1979 if (!get_aim_dir(&dir)) return FALSE;
1981 (void)control_one_undead(dir, plev);
1983 case 8: /* Orb of Entropy */
1984 if (!get_aim_dir(&dir)) return FALSE;
1986 fire_ball(GF_OLD_DRAIN, dir,
1987 (damroll(3, 6) + plev +
1988 (plev / (((p_ptr->pclass == CLASS_MAGE) ||
1989 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
1990 (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
1991 ((plev < 30) ? 2 : 3));
1993 case 9: /* Nether Bolt */
1994 if (!get_aim_dir(&dir)) return FALSE;
1996 fire_bolt_or_beam(beam, GF_NETHER, dir,
1997 damroll(8 + ((plev - 5) / 4), 8));
1999 case 10: /* Cloud kill */
2000 project(0, plev / 10 + 2, py, px,
2001 (30 + plev) * 2, GF_POIS, PROJECT_KILL | PROJECT_ITEM, -1);
2003 case 11: /* Genocide One */
2004 if (!get_aim_dir(&dir)) return FALSE;
2006 fire_ball_hide(GF_GENOCIDE, dir, plev + 50, 0);
2008 case 12: /* Poison Branding */
2011 case 13: /* Vampiric Drain */
2012 if (!get_aim_dir(&dir)) return FALSE;
2014 dummy = plev * 2 + randint1(plev * 2); /* Dmg */
2015 if (drain_life(dir, dummy))
2017 chg_virtue(V_SACRIFICE, -1);
2018 chg_virtue(V_VITALITY, -1);
2020 (void)hp_player(dummy);
2021 /* Gain nutritional sustenance: 150/hp drained */
2022 /* A Food ration gives 5000 food points (by contrast) */
2023 /* Don't ever get more than "Full" this way */
2024 /* But if we ARE Gorged, it won't cure us */
2025 dummy = p_ptr->food + MIN(5000, 100 * dummy);
2026 if (p_ptr->food < PY_FOOD_MAX) /* Not gorged already */
2027 (void)set_food(dummy >= PY_FOOD_MAX ? PY_FOOD_MAX - 1 : dummy);
2030 case 14: /* Animate Dead */
2031 animate_dead(0, py, px);
2033 case 15: /* Genocide */
2034 (void)symbol_genocide(plev+50, TRUE);
2036 case 16: /* Berserk */
2037 (void)set_shero(randint1(25) + 25, FALSE);
2038 (void)hp_player(30);
2039 (void)set_afraid(0);
2041 case 17: /* Invoke Spirits */
2043 int die = randint1(100) + plev / 5;
2044 int vir = virtue_number(V_CHANCE);
2047 if (p_ptr->virtues[vir - 1] > 0)
2049 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
2053 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
2057 if (!get_aim_dir(&dir)) return FALSE;
2060 msg_print("¤¢¤Ê¤¿¤Ï»à¼Ô¤¿¤Á¤ÎÎϤò¾·½¸¤·¤¿...");
2062 msg_print("You call on the power of the dead...");
2065 chg_virtue(V_CHANCE, 1);
2069 msg_print("¤¢¤Ê¤¿¤Ï¤ª¤É¤í¤ª¤É¤í¤·¤¤ÎϤΤ¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
2071 msg_print("You feel a surge of eldritch force!");
2078 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¤¢¤Ê¤¿¤Î¼þ¤ê¤ÎÃÏÌ̤«¤éµà¤Á¤¿¿Í±Æ¤¬Î©¤Á¾å¤¬¤Ã¤Æ¤¤¿¡ª");
2080 msg_print("Oh no! Mouldering forms rise from the earth around you!");
2083 (void)summon_specific(0, py, px, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
2084 chg_virtue(V_UNLIFE, 1);
2089 msg_print("̾¾õ¤·Æñ¤¤¼Ù°¤Ê¸ºß¤¬¤¢¤Ê¤¿¤Î¿´¤òÄ̤ê²á¤®¤Æ¹Ô¤Ã¤¿...");
2091 msg_print("An unnamable evil brushes against your mind...");
2094 set_afraid(p_ptr->afraid + randint1(4) + 4);
2099 msg_print("¤¢¤Ê¤¿¤ÎƬ¤ËÂçÎ̤ÎÍ©Î¤Á¤ÎÁû¡¹¤·¤¤À¼¤¬²¡¤·´ó¤»¤Æ¤¤¿...");
2101 msg_print("Your head is invaded by a horde of gibbering spectral voices...");
2104 set_confused(p_ptr->confused + randint1(4) + 4);
2112 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
2113 damroll(3 + ((plev - 1) / 5), 4));
2117 confuse_monster (dir, plev);
2121 fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
2125 (void)lite_line(dir);
2129 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
2130 damroll(3+((plev-5)/4),8));
2134 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
2135 damroll(5+((plev-5)/4),8));
2139 fire_bolt_or_beam(beam, GF_ACID, dir,
2140 damroll(6+((plev-5)/4),8));
2144 fire_bolt_or_beam(beam, GF_FIRE, dir,
2145 damroll(8+((plev-5)/4),8));
2149 drain_life(dir, 75);
2153 fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
2157 fire_ball(GF_ACID, dir, 40 + plev, 2);
2161 fire_ball(GF_ICE, dir, 70 + plev, 3);
2165 fire_ball(GF_FIRE, dir, 80 + plev, 3);
2169 drain_life(dir, 100 + plev);
2173 earthquake(py, px, 12);
2177 destroy_area(py, px, 13+randint0(5), TRUE);
2181 symbol_genocide(plev+50, TRUE);
2185 dispel_monsters(120);
2189 dispel_monsters(150);
2197 msg_print("±¢±µ¤ÊÀ¼¤¬¥¯¥¹¥¯¥¹¾Ð¤¦¡£¡Ö¤â¤¦¤¹¤°¤ª¤Þ¤¨¤Ï²æ¡¹¤ÎÃç´Ö¤Ë¤Ê¤ë¤À¤í¤¦¡£¼å¤¼Ô¤è¡£¡×");
2199 msg_print("Sepulchral voices chuckle. 'Soon you will join us, mortal.'");
2204 case 18: /* Dark Bolt */
2205 if (!get_aim_dir(&dir)) return FALSE;
2207 fire_bolt_or_beam(beam, GF_DARK, dir,
2208 damroll(4 + ((plev - 5) / 4), 8));
2210 case 19: /* Battle Frenzy */
2211 (void)set_shero(randint1(25) + 25, FALSE);
2212 (void)hp_player(30);
2213 (void)set_afraid(0);
2214 (void)set_fast(randint1(20 + (plev / 2)) + (plev / 2), FALSE);
2216 case 20: /* Vampiric Branding */
2219 case 21: /* Vampirism True */
2220 if (!get_aim_dir(&dir)) return FALSE;
2222 chg_virtue(V_SACRIFICE, -1);
2223 chg_virtue(V_VITALITY, -1);
2225 for (dummy = 0; dummy < 3; dummy++)
2227 if (drain_life(dir, 100))
2231 case 22: /* Word of Death */
2232 (void)dispel_living(randint1(plev * 3));
2234 case 23: /* Darkness Storm */
2235 if (!get_aim_dir(&dir)) return FALSE;
2237 fire_ball(GF_DARK, dir, 100+plev*2, 4);
2239 case 24: /* Death Ray */
2240 if (!get_aim_dir(&dir)) return FALSE;
2242 (void)death_ray(dir, plev);
2244 case 25: /* Raise the Dead */
2247 bool pet = one_in_(3);
2250 type = (plev > 47 ? SUMMON_HI_UNDEAD : SUMMON_UNDEAD);
2252 if (!pet || (pet && (plev > 24) && one_in_(3)))
2253 mode |= PM_ALLOW_GROUP;
2255 if (pet) mode |= PM_FORCE_PET;
2256 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
2258 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, type, mode))
2261 msg_print("Î䤿¤¤É÷¤¬¤¢¤Ê¤¿¤Î¼þ¤ê¤Ë¿á¤»Ï¤á¤¿¡£¤½¤ì¤ÏÉåÇÔ½¤ò±¿¤ó¤Ç¤¤¤ë...");
2263 msg_print("Cold winds begin to blow around you, carrying with them the stench of decay...");
2269 msg_print("¸Å¤¨¤Î»à¤»¤ë¼Ô¶¦¤¬¤¢¤Ê¤¿¤Ë»Å¤¨¤ë¤¿¤áÅÚ¤«¤éᴤä¿¡ª");
2271 msg_print("Ancient, long-dead forms arise from the ground to serve you!");
2276 msg_print("»à¼Ô¤¬á´¤Ã¤¿¡£Ì²¤ê¤ò˸¤²¤ë¤¢¤Ê¤¿¤òȳ¤¹¤ë¤¿¤á¤Ë¡ª");
2278 msg_print("'The dead arise... to punish you for disturbing them!'");
2281 chg_virtue(V_UNLIFE, 1);
2286 case 26: /* Esoteria */
2287 if (randint1(50) > plev)
2288 return ident_spell(FALSE);
2290 return identify_fully(FALSE);
2292 case 27: /* Mimic vampire */
2293 (void)set_mimic(10+plev/2 + randint1(10+plev/2), MIMIC_VAMPIRE, FALSE);
2295 case 28: /* Restore Life */
2296 (void)restore_level();
2298 case 29: /* Mass Genocide */
2299 (void)mass_genocide(plev+50, TRUE);
2301 case 30: /* Hellfire */
2302 if (!get_aim_dir(&dir)) return FALSE;
2304 fire_ball(GF_HELL_FIRE, dir, 666, 3);
2306 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "ÃϹö¤Î¹å²Ð¤Î¼öʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
2308 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "the strain of casting Hellfire", -1);
2312 case 31: /* Wraithform */
2313 set_wraith_form(randint1(plev / 2) + (plev / 2), FALSE);
2316 msg_format("You cast an unknown Death spell: %d.", spell);
2324 static bool cast_trump_spell(int spell, bool success)
2328 int plev = p_ptr->lev;
2329 int summon_lev = plev * 2 / 3 + randint1(plev/2);
2331 bool no_trump = FALSE;
2332 bool unique_okay = FALSE;
2335 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
2336 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
2337 else beam = plev / 2;
2339 if (summon_lev < 1) summon_lev = 1;
2340 if (!success || (randint1(50+plev) < plev/10)) unique_okay = TRUE;
2343 case 0: /* Phase Door */
2346 teleport_player(10);
2349 case 1: /* Trump Spiders */
2351 bool pet = success; /* (randint1(5) > 2) */
2352 u32b mode = PM_ALLOW_GROUP;
2354 if (pet) mode |= PM_FORCE_PET;
2355 else mode |= PM_NO_PET;
2358 msg_print("¤¢¤Ê¤¿¤ÏÃØéá¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2360 msg_print("You concentrate on the trump of an spider...");
2363 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_SPIDER, mode))
2367 msg_print("¾¤´Ô¤µ¤ì¤¿ÃØéá¤ÏÅܤäƤ¤¤ë¡ª");
2369 msg_print("The summoned spiders get angry!");
2379 case 2: /* Shuffle */
2382 /* A limited power 'wonder' spell */
2383 int die = randint1(120);
2384 int vir = virtue_number(V_CHANCE);
2386 if ((p_ptr->pclass == CLASS_ROGUE) ||
2387 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
2388 (p_ptr->pclass == CLASS_SORCERER))
2389 die = (randint1(110)) + plev / 5;
2390 /* Card sharks and high mages get a level bonus */
2394 if (p_ptr->virtues[vir - 1] > 0)
2396 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
2400 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
2405 msg_print("¤¢¤Ê¤¿¤Ï¥«¡¼¥É¤òÀڤäưìËç°ú¤¤¤¿...");
2407 msg_print("You shuffle the deck and draw a card...");
2411 chg_virtue(V_CHANCE, 1);
2416 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡Ô»à¡Õ¤À¡ª");
2418 msg_print("Oh no! It's Death!");
2421 for (dummy = 0; dummy < randint1(3); dummy++)
2422 (void)activate_hi_summon(py, px, FALSE);
2427 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡Ô°Ëâ¡Õ¤À¡ª");
2429 msg_print("Oh no! It's the Devil!");
2432 (void)summon_specific(0, py, px, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
2438 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡ÔÄߤé¤ì¤¿ÃË¡Õ¤À¡ª");
2440 msg_print("Oh no! It's the Hanged Man.");
2443 (void)activate_ty_curse(FALSE, &count);
2448 msg_print("¡ÔÉÔĴϤηõ¡Õ¤À¡£");
2450 msg_print("It's the swords of discord.");
2453 aggravate_monsters(0);
2458 msg_print("¡Ô¶ò¼Ô¡Õ¤À¡£");
2460 msg_print("It's the Fool.");
2463 (void)do_dec_stat(A_INT);
2464 (void)do_dec_stat(A_WIS);
2469 msg_print("´ñ̯¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2471 msg_print("It's the picture of a strange monster.");
2474 if (!(summon_specific(0, py, px, (dun_level * 3) / 2, 32 + randint1(6), (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET))))
2480 msg_print("¡Ô·î¡Õ¤À¡£");
2482 msg_print("It's the Moon.");
2490 msg_print("¡Ô±¿Ì¿¤ÎÎØ¡Õ¤À¡£");
2492 msg_print("It's the Wheel of Fortune.");
2495 wild_magic(randint0(32));
2500 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2502 msg_print("It's a teleport trump card.");
2505 teleport_player(10);
2510 msg_print("¡ÔÀµµÁ¡Õ¤À¡£");
2512 msg_print("It's Justice.");
2515 set_blessed(p_ptr->lev, FALSE);
2520 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2522 msg_print("It's a teleport trump card.");
2525 teleport_player(100);
2530 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2532 msg_print("It's a teleport trump card.");
2535 teleport_player(200);
2540 msg_print("¡ÔÅã¡Õ¤À¡£");
2542 msg_print("It's the Tower.");
2550 msg_print("¡ÔÀáÀ©¡Õ¤À¡£");
2552 msg_print("It's Temperance.");
2555 sleep_monsters_touch();
2560 msg_print("¡ÔÅã¡Õ¤À¡£");
2562 msg_print("It's the Tower.");
2565 earthquake(py, px, 5);
2570 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2572 msg_print("It's the picture of a friendly monster.");
2575 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE1, PM_FORCE_PET)))
2581 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2583 msg_print("It's the picture of a friendly monster.");
2586 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE2, PM_FORCE_PET)))
2592 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2594 msg_print("It's the picture of a friendly monster.");
2597 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE4, PM_FORCE_PET)))
2603 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2605 msg_print("It's the picture of a friendly monster.");
2608 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE5, PM_FORCE_PET)))
2614 msg_print("¡ÔÎø¿Í¡Õ¤À¡£");
2616 msg_print("It's the Lovers.");
2619 if (get_aim_dir(&dir))
2620 (void)charm_monster(dir, MIN(p_ptr->lev, 20));
2625 msg_print("¡Ô±£¼Ô¡Õ¤À¡£");
2627 msg_print("It's the Hermit.");
2635 msg_print("¡Ô¿³È½¡Õ¤À¡£");
2637 msg_print("It's the Judgement.");
2640 do_cmd_rerate(FALSE);
2641 if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3)
2644 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
2646 msg_print("You are cured of all mutations.");
2649 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
2650 p_ptr->update |= PU_BONUS;
2657 msg_print("¡ÔÂÀÍÛ¡Õ¤À¡£");
2659 msg_print("It's the Sun.");
2662 chg_virtue(V_KNOWLEDGE, 1);
2663 chg_virtue(V_ENLIGHTEN, 1);
2664 wiz_lite(FALSE, FALSE);
2669 msg_print("¡ÔÀ¤³¦¡Õ¤À¡£");
2671 msg_print("It's the World.");
2674 if (p_ptr->exp < PY_MAX_EXP)
2676 s32b ee = (p_ptr->exp / 25) + 1;
2677 if (ee > 5000) ee = 5000;
2679 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
2681 msg_print("You feel more experienced.");
2689 case 3: /* Reset Recall */
2692 if (!reset_recall()) return FALSE;
2695 case 4: /* Teleport Self */
2698 teleport_player(plev * 4);
2701 case 5: /* Trump Spying */
2704 (void)set_tim_esp(randint1(30) + 25, FALSE);
2707 case 6: /* Teleport Away */
2710 if (!get_aim_dir(&dir)) return FALSE;
2711 (void)fire_beam(GF_AWAY_ALL, dir, plev);
2714 case 7: /* Trump Animals */
2716 bool pet = success; /* was (randint1(5) > 2) */
2717 int type = (pet ? SUMMON_ANIMAL_RANGER : SUMMON_ANIMAL);
2720 if (pet) mode |= PM_FORCE_PET;
2721 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2724 msg_print("¤¢¤Ê¤¿¤Ïưʪ¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2726 msg_print("You concentrate on the trump of an animal...");
2730 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
2734 msg_print("¾¤´¤µ¤ì¤¿Æ°Êª¤ÏÅܤäƤ¤¤ë¡ª");
2736 msg_print("The summoned animal gets angry!");
2747 case 8: /* Trump Reach */
2750 if (!get_aim_dir(&dir)) return FALSE;
2751 fetch(dir, plev * 15, TRUE);
2754 case 9: /* Trump Kamikaze */
2759 if (!target_set(TARGET_KILL)) return FALSE;
2766 msg_print("¤¢¤Ê¤¿¤Ï¥«¥ß¥«¥¼¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2768 msg_print("You concentrate on several trumps at once...");
2772 for (dummy = 2 + randint0(plev / 7); dummy > 0; dummy--)
2774 bool pet = success; /* was (randint1(10) > 3) */
2778 if (pet) mode |= PM_FORCE_PET;
2779 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2781 if (p_ptr->pclass == CLASS_BEASTMASTER)
2783 type = SUMMON_KAMIKAZE_LIVING;
2787 type = SUMMON_KAMIKAZE;
2790 if (summon_specific((pet ? -1 : 0), y, x, summon_lev, type, mode))
2794 msg_print("¾¤´Ô¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
2796 msg_print("The summoned creatures get angry!");
2804 case 10: /* Phantasmal Servant */
2807 if (summon_specific(-1, py, px, (summon_lev * 3) / 2, SUMMON_PHANTOM, PM_FORCE_PET))
2810 msg_print("¸æÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¸æ¼ç¿ÍÍÍ¡©");
2812 msg_print("'Your wish, master?'");
2822 case 11: /* Speed Monster */
2825 bool old_target_pet = target_pet;
2827 if (!get_aim_dir(&dir))
2829 target_pet = old_target_pet;
2832 target_pet = old_target_pet;
2833 (void)speed_monster(dir);
2836 case 12: /* Teleport Level */
2840 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
2842 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
2844 (void)teleport_player_level();
2847 case 13: /* Dimension Door */
2851 msg_print("¼¡¸µ¤ÎÈ⤬³«¤¤¤¿¡£ÌÜŪÃϤòÁª¤ó¤Ç²¼¤µ¤¤¡£");
2853 msg_print("You open a dimensional gate. Choose a destination.");
2856 return dimension_door();
2859 case 14: /* Word of Recall */
2862 if (!word_of_recall()) return FALSE;
2865 case 15: /* Banish */
2868 banish_monsters(plev * 4);
2871 case 16: /* Swap Position */
2875 project_length = -1;
2876 if (!get_aim_dir(&dir))
2883 (void)teleport_swap(dir);
2887 case 17: /* Trump Undead */
2889 bool pet = success; /* (randint1(10) > 3) */
2892 if (pet) mode |= PM_FORCE_PET;
2893 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2896 msg_print("¤¢¤Ê¤¿¤Ï¥¢¥ó¥Ç¥Ã¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2898 msg_print("You concentrate on the trump of an undead creature...");
2902 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_UNDEAD, mode))
2906 msg_print("¾¤´Ô¤µ¤ì¤¿¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
2908 msg_print("The summoned undead creature gets angry!");
2919 case 18: /* Trump Reptiles */
2921 bool pet = success; /* was (randint1(5) > 2) */
2924 if (pet) mode |= PM_FORCE_PET;
2925 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2928 msg_print("¤¢¤Ê¤¿¤Ïà¨ÃîÎà¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2930 msg_print("You concentrate on the trump of a reptile...");
2934 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HYDRA, mode))
2938 msg_print("¾¤´Ô¤µ¤ì¤¿à¨ÃîÎà¤ÏÅܤäƤ¤¤ë¡ª");
2940 msg_print("The summoned reptile gets angry!");
2951 case 19: /* Trump Monsters */
2956 msg_print("¤¢¤Ê¤¿¤Ï¥â¥ó¥¹¥¿¡¼¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2958 msg_print("You concentrate on several trumps at once...");
2962 for (dummy = 0; dummy < 1 + ((plev - 15)/ 10); dummy++)
2964 bool pet = success; /* was (randint1(10) > 3) */
2968 if (pet) mode |= PM_FORCE_PET;
2969 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2971 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
2973 if (p_ptr->pclass == CLASS_BEASTMASTER)
2975 type = SUMMON_LIVING;
2982 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
2986 msg_print("¾¤´Ô¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
2988 msg_print("The summoned creatures get angry!");
2996 case 20: /* Trump Hounds */
2998 bool pet = success; /* was (randint1(5) > 2) */
2999 u32b mode = PM_ALLOW_GROUP;
3001 if (pet) mode |= PM_FORCE_PET;
3002 else mode |= PM_NO_PET;
3005 msg_print("¤¢¤Ê¤¿¤Ï¥Ï¥¦¥ó¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3007 msg_print("You concentrate on the trump of a hound...");
3011 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HOUND, mode))
3015 msg_print("¾¤´Ô¤µ¤ì¤¿¥Ï¥¦¥ó¥É¤ÏÅܤäƤ¤¤ë¡ª");
3017 msg_print("The summoned hounds get angry!");
3028 case 21: /* Trump Branding */
3034 case 22: /* Living Trump */
3038 /* Teleport control */
3041 /* Random teleportation (uncontrolled) */
3043 /* Gain the mutation */
3044 if (gain_random_mutation(dummy))
3046 msg_print("¤¢¤Ê¤¿¤ÏÀ¸¤¤Æ¤¤¤ë¥«¡¼¥É¤ËÊѤï¤Ã¤¿¡£");
3048 msg_print("You have turned into a Living Trump.");
3053 case 23: /* Trump Cyberdemon */
3055 bool pet = success; /* was (randint1(10) > 3) */
3058 if (pet) mode |= PM_FORCE_PET;
3059 else mode |= PM_NO_PET;
3062 msg_print("¤¢¤Ê¤¿¤Ï¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3064 msg_print("You concentrate on the trump of a Cyberdemon...");
3068 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_CYBER, mode))
3072 msg_print("¾¤´Ô¤µ¤ì¤¿¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3074 msg_print("The summoned Cyberdemon gets angry!");
3085 case 24: /* Trump Divination */
3088 (void)detect_all(DETECT_RAD_DEFAULT);
3091 case 25: /* Trump Lore */
3094 return identify_fully(FALSE);
3097 case 26: /* Heal Monster */
3100 bool old_target_pet = target_pet;
3102 if (!get_aim_dir(&dir))
3104 target_pet = old_target_pet;
3107 target_pet = old_target_pet;
3109 (void)heal_monster(dir, p_ptr->lev * 10 + 200);
3112 case 27: /* Trump Dragon */
3114 bool pet = success; /* was (randint1(10) > 3) */
3117 if (pet) mode |= PM_FORCE_PET;
3118 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3121 msg_print("¤¢¤Ê¤¿¤Ï¥É¥é¥´¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3123 msg_print("You concentrate on the trump of a dragon...");
3127 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DRAGON, mode))
3131 msg_print("¾¤´Ô¤µ¤ì¤¿¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3133 msg_print("The summoned dragon gets angry!");
3144 case 28: /* Trump Meteor */
3147 int x, y, dx, dy, i;
3148 int b = 10 + randint1(10);
3149 for (i = 0; i < b; i++)
3151 int count = 0, d = 0;
3156 if (count > 20) break;
3157 x = px - 8 + randint0(17);
3158 y = py - 8 + randint0(17);
3160 if (!in_bounds(y,x) || (!cave_floor_bold(y,x) && (cave[y][x].feat != FEAT_TREES)) || !player_has_los_bold(y, x)) continue;
3162 dx = (px > x) ? (px - x) : (x - px);
3163 dy = (py > y) ? (py - y) : (y - py);
3165 /* Approximate distance */
3166 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
3170 if (count > 20) continue;
3172 project(0, 2, y, x, plev * 2, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
3176 case 29: /* Trump Demon */
3178 bool pet = success; /* was (randint1(10) > 3) */
3181 if (pet) mode |= PM_FORCE_PET;
3182 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3185 msg_print("¤¢¤Ê¤¿¤Ï¥Ç¡¼¥â¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3187 msg_print("You concentrate on the trump of a demon...");
3191 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DEMON, mode))
3195 msg_print("¾¤´Ô¤µ¤ì¤¿¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3197 msg_print("The summoned demon gets angry!");
3208 case 30: /* Trump Greater Undead */
3210 bool pet = success; /* was (randint1(10) > 3) */
3213 if (pet) mode |= PM_FORCE_PET;
3214 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3216 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
3219 msg_print("¤¢¤Ê¤¿¤Ï¶¯ÎϤʥ¢¥ó¥Ç¥Ã¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3221 msg_print("You concentrate on the trump of a greater undead being...");
3225 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HI_UNDEAD, mode))
3229 msg_print("¾¤´Ô¤µ¤ì¤¿¾åµé¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
3231 msg_print("The summoned greater undead creature gets angry!");
3242 case 31: /* Trump Ancient Dragon */
3244 bool pet = success; /* was (randint1(10) > 3) */
3248 if (pet) mode |= PM_FORCE_PET;
3249 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3251 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
3253 if (p_ptr->pclass == CLASS_BEASTMASTER)
3255 type = SUMMON_HI_DRAGON_LIVING;
3259 type = SUMMON_HI_DRAGON;
3263 msg_print("¤¢¤Ê¤¿¤Ï¸ÅÂå¥É¥é¥´¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3265 msg_print("You concentrate on the trump of an ancient dragon...");
3269 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
3273 msg_print("¾¤´Ô¤µ¤ì¤¿¸ÅÂå¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3275 msg_print("The summoned ancient dragon gets angry!");
3288 msg_format("̤ÃΤΥ«¡¼¥É¤Î¼öʸ¤Ç¤¹: %d", spell);
3290 msg_format("You cast an unknown Trump spell: %d.", spell);
3299 msg_print("ï¤â¤¢¤Ê¤¿¤Î¥«¡¼¥É¤Î¸Æ¤ÓÀ¼¤ËÅú¤¨¤Ê¤¤¡£");
3301 msg_print("Nobody answers to your Trump call.");
3310 static bool cast_arcane_spell(int spell)
3314 int plev = p_ptr->lev;
3316 bool no_trump = FALSE;
3318 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3319 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3320 else beam = plev / 2;
3325 if (!get_aim_dir(&dir)) return FALSE;
3327 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
3328 damroll(3 + ((plev - 1) / 5), 3));
3330 case 1: /* Wizard Lock */
3331 if (!get_aim_dir(&dir)) return FALSE;
3333 (void)wizard_lock(dir);
3335 case 2: /* Detect Invisibility */
3336 (void)detect_monsters_invis(DETECT_RAD_DEFAULT);
3338 case 3: /* Detect Monsters */
3339 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
3342 teleport_player(10);
3344 case 5: /* Light Area */
3345 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
3347 case 6: /* Trap & Door Destruction */
3348 if (!get_aim_dir(&dir)) return FALSE;
3350 (void)destroy_door(dir);
3352 case 7: /* Cure Light Wounds */
3353 (void)hp_player(damroll(2, 8));
3354 (void)set_cut(p_ptr->cut - 10);
3356 case 8: /* Detect Doors & Traps */
3357 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
3358 (void)detect_doors(DETECT_RAD_DEFAULT);
3359 (void)detect_stairs(DETECT_RAD_DEFAULT);
3361 case 9: /* Phlogiston */
3364 case 10: /* Detect Treasure */
3365 (void)detect_treasure(DETECT_RAD_DEFAULT);
3366 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
3368 case 11: /* Detect Enchantment */
3369 (void)detect_objects_magic(DETECT_RAD_DEFAULT);
3371 case 12: /* Detect Objects */
3372 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
3374 case 13: /* Cure Poison */
3375 (void)set_poisoned(0);
3377 case 14: /* Resist Cold */
3378 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3380 case 15: /* Resist Fire */
3381 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3383 case 16: /* Resist Lightning */
3384 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3386 case 17: /* Resist Acid */
3387 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3389 case 18: /* Cure Medium Wounds */
3390 (void)hp_player(damroll(4, 8));
3391 (void)set_cut((p_ptr->cut / 2) - 50);
3393 case 19: /* Teleport */
3394 teleport_player(plev * 5);
3396 case 20: /* Identify */
3397 return ident_spell(FALSE);
3398 case 21: /* Stone to Mud */
3399 if (!get_aim_dir(&dir)) return FALSE;
3401 (void)wall_to_mud(dir);
3403 case 22: /* Ray of Light */
3404 if (!get_aim_dir(&dir)) return FALSE;
3407 msg_print("¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
3409 msg_print("A line of light appears.");
3412 (void)lite_line(dir);
3414 case 23: /* Satisfy Hunger */
3415 (void)set_food(PY_FOOD_MAX - 1);
3417 case 24: /* See Invisible */
3418 (void)set_tim_invis(randint1(24) + 24, FALSE);
3420 case 25: /* Conjure Elemental */
3421 if (!summon_specific(-1, py, px, plev, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3424 case 26: /* Teleport Level */
3426 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
3428 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
3430 (void)teleport_player_level();
3432 case 27: /* Teleport Away */
3433 if (!get_aim_dir(&dir)) return FALSE;
3435 (void)fire_beam(GF_AWAY_ALL, dir, plev);
3437 case 28: /* Elemental Ball */
3438 if (!get_aim_dir(&dir)) return FALSE;
3440 switch (randint1(4))
3442 case 1: dummy = GF_FIRE;break;
3443 case 2: dummy = GF_ELEC;break;
3444 case 3: dummy = GF_COLD;break;
3445 default: dummy = GF_ACID;break;
3447 fire_ball(dummy, dir, 75 + (plev), 2);
3449 case 29: /* Detection */
3450 (void)detect_all(DETECT_RAD_DEFAULT);
3452 case 30: /* Word of Recall */
3453 if (!word_of_recall()) return FALSE;
3455 case 31: /* Clairvoyance */
3456 chg_virtue(V_KNOWLEDGE, 1);
3457 chg_virtue(V_ENLIGHTEN, 1);
3458 wiz_lite(FALSE, FALSE);
3459 if (!p_ptr->telepathy)
3461 (void)set_tim_esp(randint1(30) + 25, FALSE);
3465 msg_format("You cast an unknown Arcane spell: %d.", spell);
3471 msg_print("¥¨¥ì¥á¥ó¥¿¥ë¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3473 msg_print("No Elementals arrive.");
3480 static bool cast_enchant_spell(int spell)
3482 int plev = p_ptr->lev;
3484 bool no_trump = FALSE;
3488 case 0: /* Infravision */
3489 set_tim_infra(100 + randint1(100), FALSE);
3491 case 1: /* Regeneration */
3492 set_tim_regen(80 + randint1(80), FALSE);
3494 case 2: /* Satisfy Hunger */
3495 (void)set_food(PY_FOOD_MAX - 1);
3497 case 3: /* Resist Cold */
3498 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3500 case 4: /* Resist Fire */
3501 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3503 case 5: /* Heroism */
3504 (void)set_hero(randint1(25) + 25, FALSE);
3505 (void)hp_player(10);
3506 (void)set_afraid(0);
3508 case 6: /* Resist Lightning */
3509 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3511 case 7: /* Resist Acid */
3512 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3514 case 8: /* See Invisibility */
3515 (void)set_tim_invis(randint1(24) + 24, FALSE);
3517 case 9: /* Remove Curse */
3521 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
3523 msg_print("You feel as if someone is watching over you.");
3527 case 10: /* Resist Poison */
3528 (void)set_oppose_pois(randint1(20) + 20, FALSE);
3530 case 11: /* Berserk */
3531 (void)set_shero(randint1(25) + 25, FALSE);
3532 (void)hp_player(30);
3533 (void)set_afraid(0);
3535 case 12: /* Self Knowledge */
3536 (void)self_knowledge();
3538 case 13: /* Protection from Evil */
3539 (void)set_protevil(randint1(25) + 3 * p_ptr->lev, FALSE);
3541 case 14: /* Healing */
3547 case 15: /* Mana Branding */
3548 return choose_ele_attack();
3550 case 16: /* Telepathy */
3551 (void)set_tim_esp(randint1(30) + 25, FALSE);
3553 case 17: /* Stone Skin */
3554 (void)set_shield(randint1(20) + 30, FALSE);
3556 case 18: /* Resistance */
3557 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3558 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3559 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3560 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3561 (void)set_oppose_pois(randint1(20) + 20, FALSE);
3563 case 19: /* Haste */
3564 (void)set_fast(randint1(20 + plev) + plev, FALSE);
3566 case 20: /* Walk through Wall */
3567 (void)set_kabenuke(randint1(plev/2) + plev/2, FALSE);
3569 case 21: /* Pulish Shield */
3570 (void)pulish_shield();
3572 case 22: /* Create Golem */
3573 if (summon_specific(-1, py, px, plev, SUMMON_GOLEM, PM_FORCE_PET))
3576 msg_print("¥´¡¼¥ì¥à¤òºî¤Ã¤¿¡£");
3578 msg_print("You make a golem.");
3586 case 23: /* Magic armor */
3587 (void)set_magicdef(randint1(20) + 20, FALSE);
3589 case 24: /* Remove Enchantment */
3590 if (!mundane_spell(TRUE)) return FALSE;
3592 case 25: /* Remove All Curse */
3593 if (remove_all_curse())
3596 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
3598 msg_print("You feel as if someone is watching over you.");
3602 case 26: /* Total Knowledge */
3603 return identify_fully(FALSE);
3605 case 27: /* Enchant Weapon */
3606 return enchant_spell(randint0(4) + 1, randint0(4) + 1, 0);
3608 case 28: /* Enchant Armor */
3609 return enchant_spell(0, 0, randint0(3) + 2);
3611 case 29: /* Brand Weapon */
3612 brand_weapon(randint0(18));
3614 case 30: /* Living Trump */
3616 /* Teleport control */
3619 /* Random teleportation (uncontrolled) */
3621 /* Gain the mutation */
3622 if (gain_random_mutation(dummy))
3624 msg_print("¤¢¤Ê¤¿¤ÏÀ¸¤¤Æ¤¤¤ë¥«¡¼¥É¤ËÊѤï¤Ã¤¿¡£");
3626 msg_print("You have turned into a Living Trump.");
3629 case 31: /* Immune */
3630 return (choose_ele_immune(13 + randint1(13)));
3633 msg_format("You cast an unknown Craft spell: %d.", spell);
3639 msg_print("¤¦¤Þ¤¯¥´¡¼¥ì¥à¤òºî¤ì¤Ê¤«¤Ã¤¿¡£");
3641 msg_print("No Golems arrive.");
3649 * An "item_tester_hook" for offer
3651 static bool item_tester_offer(object_type *o_ptr)
3653 /* Flasks of oil are okay */
3654 if (o_ptr->tval != TV_CORPSE) return (FALSE);
3656 if (o_ptr->sval != SV_CORPSE) return (FALSE);
3658 if (strchr("pht", r_info[o_ptr->pval].d_char)) return (TRUE);
3660 /* Assume not okay */
3665 static bool cast_daemon_spell(int spell)
3668 int plev = p_ptr->lev;
3670 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3671 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3672 else beam = plev / 2;
3676 case 0: /* Magic Missile */
3677 if (!get_aim_dir(&dir)) return FALSE;
3679 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
3680 damroll(3 + ((plev - 1) / 5), 4));
3682 case 1: /* Detect Undead & Demons -> Unlife */
3683 (void)detect_monsters_nonliving(DETECT_RAD_DEFAULT);
3686 (void)set_blessed(randint1(12) + 12, FALSE);
3688 case 3: /* Resist Fire */
3689 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3691 case 4: /* Horrify */
3692 if (!get_aim_dir(&dir)) return FALSE;
3694 (void)fear_monster(dir, plev);
3695 (void)stun_monster(dir, plev);
3697 case 5: /* Nether Bolt */
3698 if (!get_aim_dir(&dir)) return FALSE;
3700 fire_bolt_or_beam(beam, GF_NETHER, dir,
3701 damroll(6 + ((plev - 5) / 4), 8));
3703 case 6: /* Summon monster, demon */
3704 if (!summon_specific(-1, py, px, (plev * 3) / 2, SUMMON_MANES, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3707 msg_print("¸ÅÂå¤Î»àÎî¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3709 msg_print("No Manes arrive.");
3713 case 7: /* Mini Hellfire */
3714 if (!get_aim_dir(&dir)) return FALSE;
3716 fire_ball(GF_HELL_FIRE, dir,
3717 (damroll(3, 6) + plev +
3718 (plev / (((p_ptr->pclass == CLASS_MAGE) ||
3719 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
3720 (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
3721 ((plev < 30) ? 2 : 3));
3723 case 8: /* Enslave Demon */
3724 if (!get_aim_dir(&dir)) return FALSE;
3726 (void)control_one_demon(dir, plev);
3728 case 9: /* Vision */
3729 map_area(DETECT_RAD_MAP);
3731 case 10: /* Resist Nether */
3732 (void)set_tim_res_nether(randint1(20) + 20, FALSE);
3734 case 11: /* Plasma Bolt */
3735 if (!get_aim_dir(&dir)) return FALSE;
3737 fire_bolt_or_beam(beam, GF_PLASMA, dir,
3738 damroll(11 + ((plev - 5) / 4), 8));
3740 case 12: /* Fire Ball */
3741 if (!get_aim_dir(&dir)) return FALSE;
3743 fire_ball(GF_FIRE, dir, plev + 55, 2);
3745 case 13: /* Fire Branding */
3748 case 14: /* Nether Ball */
3749 if (!get_aim_dir(&dir)) return FALSE;
3751 fire_ball(GF_NETHER, dir, plev*3/2 + 100, plev / 20+2);
3753 case 15: /* Summon monster, demon */
3755 bool pet = !one_in_(3);
3758 if (pet) mode |= PM_FORCE_PET;
3759 else mode |= PM_NO_PET;
3760 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
3762 if (summon_specific((pet ? -1 : 0), py, px, plev*2/3+randint1(plev/2), SUMMON_DEMON, mode))
3765 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
3767 msg_print("The area fills with a stench of sulphur and brimstone.");
3773 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
3775 msg_print("'What is thy bidding... Master?'");
3780 msg_print("¡ÖÈܤ·¤¼Ô¤è¡¢²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª ¤ªÁ°¤Îº²¤òĺ¤¯¤¾¡ª¡×");
3782 msg_print("'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'");
3789 msg_print("°Ëâ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3791 msg_print("No Greater Demon arrive.");
3796 case 16: /* Telepathy */
3797 (void)set_tim_esp(randint1(30) + 25, FALSE);
3799 case 17: /* Demoncloak */
3801 int dur=randint1(20) + 20;
3803 set_oppose_fire(dur, FALSE);
3804 set_oppose_cold(dur, FALSE);
3805 set_tim_sh_fire(dur, FALSE);
3809 case 18: /* Rain of Lava */
3810 fire_ball(GF_FIRE, 0, (55 + plev)*2, 3);
3811 fire_ball_hide(GF_LAVA_FLOW, 0, 2+randint1(2), 3);
3813 case 19: /* Plasma ball */
3814 if (!get_aim_dir(&dir)) return FALSE;
3816 fire_ball(GF_PLASMA, dir, plev*3/2 + 80, 2 + plev/40);
3818 case 20: /* Mimic demon */
3819 (void)set_mimic(10+plev/2 + randint1(10+plev/2), MIMIC_DEMON, FALSE);
3821 case 21: /* Nether Wave == Dispel Good */
3822 (void)dispel_monsters(randint1(plev * 2));
3823 (void)dispel_good(randint1(plev * 2));
3826 if (!get_aim_dir(&dir)) return FALSE;
3827 fire_ball(GF_NEXUS, dir, 100 + plev*2, 4);
3829 case 23: /* Hand Doom */
3830 if (!get_aim_dir(&dir)) return FALSE;
3832 else msg_print("<ÇËÌǤμê>¤òÊü¤Ã¤¿¡ª");
3834 else msg_print("You invoke the Hand of Doom!");
3837 fire_ball_hide(GF_HAND_DOOM, dir, plev * 2, 0);
3839 case 24: /* Heroism */
3840 (void)set_hero(randint1(25) + 25, FALSE);
3841 (void)hp_player(10);
3842 (void)set_afraid(0);
3844 case 25: /* Tim resist time */
3845 (void)set_tim_res_time(randint1(20)+20, FALSE);
3847 case 26: /* Circle of Madness */
3848 fire_ball(GF_CHAOS, 0, 50+plev, 3+plev/20);
3849 fire_ball(GF_CONFUSION, 0, 50+plev, 3+plev/20);
3850 fire_ball(GF_CHARM, 0, 20+plev, 3+plev/20);
3852 case 27: /* True Discharge Minion */
3855 case 28: /* Summon Greater Demon */
3862 item_tester_hook = item_tester_offer;
3864 q = "¤É¤Î»àÂΤòÊû¤²¤Þ¤¹¤«? ";
3865 s = "Êû¤²¤é¤ì¤ë»àÂΤò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
3867 q = "Sacrifice which corpse? ";
3868 s = "You have nothing to scrifice.";
3870 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return FALSE;
3872 /* Get the item (in the pack) */
3875 o_ptr = &inventory[item];
3878 /* Get the item (on the floor) */
3881 o_ptr = &o_list[0 - item];
3884 summon_lev = p_ptr->lev * 2 / 3 + r_info[o_ptr->pval].level;
3885 if (summon_specific(-1, py, px, summon_lev, SUMMON_HI_DEMON, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3888 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
3890 msg_print("The area fills with a stench of sulphur and brimstone.");
3895 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
3897 msg_print("'What is thy bidding... Master?'");
3900 /* Decrease the item (from the pack) */
3903 inven_item_increase(item, -1);
3904 inven_item_describe(item);
3905 inven_item_optimize(item);
3908 /* Decrease the item (from the floor) */
3911 floor_item_increase(0 - item, -1);
3912 floor_item_describe(0 - item);
3913 floor_item_optimize(0 - item);
3919 msg_print("°Ëâ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3921 msg_print("No Greater Demon arrive.");
3926 case 29: /* Nether Storm */
3927 if (!get_aim_dir(&dir)) return FALSE;
3929 fire_ball(GF_NETHER, dir, plev*15, plev / 5);
3931 case 30: /* Blood curse */
3933 if (!get_aim_dir(&dir)) return FALSE;
3935 fire_ball_hide(GF_BLOOD_CURSE, dir, 600, 0);
3937 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "·ì¤Î¼ö¤¤", -1);
3939 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "Blood curse", -1);
3943 case 31: /* Mimic Demon lord */
3944 (void)set_mimic(15 + randint1(15), MIMIC_DEMON_LORD, FALSE);
3947 msg_format("You cast an unknown Daemon spell: %d.", spell);
3955 static bool cast_crusade_spell(int spell)
3959 int plev = p_ptr->lev;
3961 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3962 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3963 else beam = plev / 2;
3968 if (!get_aim_dir(&dir)) return FALSE;
3970 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
3971 damroll(3 + ((plev - 1) / 5), 4));
3974 (void)detect_monsters_evil(DETECT_RAD_DEFAULT);
3976 case 2: /* Remove Fear */
3977 (void)set_afraid(0);
3980 if (!get_aim_dir(&dir)) return FALSE;
3982 (void)fear_monster(dir, plev);
3985 (void)sleep_monsters_touch();
3988 teleport_player(25+plev/2);
3991 if (!get_aim_dir(&dir)) return FALSE;
3992 fire_blast(GF_LITE, dir, 3+((plev-1)/9), 2, 10, 3);
3996 (void)set_poisoned(0);
4000 if (!get_aim_dir(&dir)) return FALSE;
4001 (void)fire_ball(GF_AWAY_EVIL, dir, MAX_SIGHT*5, 0);
4003 case 9: /* Holy Orb */
4004 if (!get_aim_dir(&dir)) return FALSE;
4006 fire_ball(GF_HOLY_FIRE, dir,
4007 (damroll(3, 6) + plev +
4008 (plev / ((p_ptr->pclass == CLASS_PRIEST ||
4009 p_ptr->pclass == CLASS_HIGH_MAGE ||
4010 p_ptr->pclass == CLASS_SORCERER) ? 2 : 4))),
4011 ((plev < 30) ? 2 : 3));
4014 case 10: /* Exorcism */
4015 (void)dispel_undead(randint1(plev));
4016 (void)dispel_demons(randint1(plev));
4017 (void)turn_evil(plev);
4019 case 11: /* Remove Curse */
4023 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
4025 msg_print("You feel as if someone is watching over you.");
4029 case 12: /* Sense Unseen */
4030 (void)set_tim_invis(randint1(24) + 24, FALSE);
4032 case 13: /* Protection from Evil */
4033 (void)set_protevil(randint1(25) + 3 * p_ptr->lev, FALSE);
4036 if (!get_aim_dir(&dir)) return FALSE;
4037 (void)fire_bolt(GF_ELEC, dir, plev*5);
4039 case 15: /* Holy Word */
4040 (void)dispel_evil(randint1(plev * 6));
4041 (void)hp_player(100);
4042 (void)set_afraid(0);
4043 (void)set_poisoned(0);
4048 if (!get_aim_dir(&dir)) return FALSE;
4050 (void)destroy_door(dir);
4053 if (!get_aim_dir(&dir)) return FALSE;
4054 (void)stasis_evil(dir);
4057 set_tim_sh_holy(randint1(20)+20, FALSE);
4059 case 19: /* Dispel Undead + Demons */
4060 (void)dispel_undead(randint1(plev * 4));
4061 (void)dispel_demons(randint1(plev * 4));
4063 case 20: /* Dispel Evil */
4064 (void)dispel_evil(randint1(plev * 4));
4069 case 22: /* Star Burst */
4070 if (!get_aim_dir(&dir)) return FALSE;
4072 fire_ball(GF_LITE, dir, 100+plev*2, 4);
4074 case 23: /* Summon monster, angel */
4076 bool pet = !one_in_(3);
4079 if (pet) mode |= PM_FORCE_PET;
4080 else mode |= PM_NO_PET;
4081 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
4083 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, SUMMON_ANGEL, mode))
4087 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
4089 msg_print("'What is thy bidding... Master?'");
4094 msg_print("¡Ö²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª °¹Ô¼Ô¤è¡¢²ù¤¤²þ¤á¤è¡ª¡×");
4096 msg_print("Mortal! Repent of thy impiousness.");
4102 case 24: /* Heroism */
4103 (void)set_hero(randint1(25) + 25, FALSE);
4104 (void)hp_player(10);
4105 (void)set_afraid(0);
4107 case 25: /* Remove All Curse */
4108 if (remove_all_curse())
4111 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
4113 msg_print("You feel as if someone is watching over you.");
4117 case 26: /* Banishment */
4118 if (banish_evil(100))
4121 msg_print("¿ÀÀ»¤ÊÎϤ¬¼Ù°¤òÂǤÁʧ¤Ã¤¿¡ª");
4123 msg_print("The holy power banishes evil!");
4128 case 27: /* Word of Destruction */
4129 destroy_area(py, px, 13+randint0(5), TRUE);
4131 case 28: /* Eye for an Eye */
4132 set_tim_eyeeye(randint1(10)+10, FALSE);
4139 int b = 10 + randint1(10);
4141 if (!get_aim_dir(&dir)) return FALSE;
4143 /* Use the given direction */
4144 tx = px + 99 * ddx[dir];
4145 ty = py + 99 * ddy[dir];
4147 /* Hack -- Use an actual "target" */
4148 if ((dir == 5) && target_okay())
4159 /* Hack -- Stop at the target */
4160 if ((y == ty) && (x == tx)) break;
4164 mmove2(&ny, &nx, py, px, ty, tx);
4166 /* Stop at maximum range */
4167 if (MAX_SIGHT*2 < distance(py, px, ny, nx)) break;
4169 /* Stopped by walls/doors */
4170 if (!cave_floor_bold(ny, nx)) break;
4172 /* Stopped by monsters */
4173 if ((dir != 5) && cave[ny][nx].m_idx != 0) break;
4175 /* Save the new location */
4182 for (i = 0; i < b; i++)
4184 int count = 20, d = 0;
4190 x = tx - 5 + randint0(11);
4191 y = ty - 5 + randint0(11);
4193 dx = (tx > x) ? (tx - x) : (x - tx);
4194 dy = (ty > y) ? (ty - y) : (y - ty);
4196 /* Approximate distance */
4197 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
4198 /* Within the radius */
4202 if (count < 0) continue;
4204 /* Cannot penetrate perm walls */
4205 if (!in_bounds(y,x) ||
4206 cave_stop_disintegration(y,x) ||
4207 !in_disintegration_range(ty, tx, y, x))
4210 project(0, 2, y, x, plev * 3+25, GF_DISINTEGRATE, PROJECT_JUMP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1);
4214 case 30: /* Divine Intervention */
4215 project(0, 1, py, px, plev*11, GF_HOLY_FIRE, PROJECT_KILL, -1);
4216 dispel_monsters(plev * 4);
4218 stun_monsters(plev * 4);
4219 confuse_monsters(plev * 4);
4220 turn_monsters(plev * 4);
4221 stasis_monsters(plev * 4);
4222 (void)hp_player(100);
4228 for (i = 0; i < 12; i++)
4235 scatter(&my, &mx, py, px, 4, 0);
4237 /* Require empty grids */
4238 if (cave_empty_bold2(my, mx)) break;
4240 if (attempt < 0) continue;
4241 summon_specific(-1, my, mx, plev, SUMMON_KNIGHTS, (PM_ALLOW_GROUP | PM_FORCE_PET | PM_HASTE));
4243 (void)set_hero(randint1(25) + 25, FALSE);
4244 (void)set_blessed(randint1(25) + 25, FALSE);
4245 (void)set_fast(randint1(20 + plev) + plev, FALSE);
4246 (void)set_protevil(randint1(25) + 25, FALSE);
4247 (void)set_afraid(0);
4252 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤ÊÇ˼٤μöʸ %d ¤ò¾§¤¨¤¿¡£", spell);
4254 msg_format("You cast an unknown crusade spell: %d.", spell);
4265 void stop_singing(void)
4267 if (p_ptr->pclass != CLASS_BARD) return;
4269 if (p_ptr->magic_num1[1])
4271 p_ptr->magic_num1[1] = 0;
4274 if (!p_ptr->magic_num1[0]) return;
4276 set_action(ACTION_NONE);
4278 switch(p_ptr->magic_num1[0])
4281 if (!p_ptr->blessed)
4283 msg_print("¹â·é¤Êµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4285 msg_print("The prayer has expired.");
4292 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4294 msg_print("The heroism wears off.");
4296 /* Recalculate hitpoints */
4297 p_ptr->update |= (PU_HP);
4301 if (!p_ptr->tim_esp)
4304 msg_print("°Õ¼±¤Ï¸µ¤ËÌá¤Ã¤¿¡£");
4306 msg_print("Your consciousness contracts again.");
4308 /* Update the monsters */
4309 p_ptr->update |= (PU_MONSTERS);
4313 if (!p_ptr->tim_stealth)
4315 msg_print("»Ñ¤¬¤Ï¤Ã¤¤ê¤È¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
4317 msg_print("You are no longer hided.");
4321 if (!p_ptr->oppose_acid)
4323 msg_print("»À¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4325 msg_print("You feel less resistant to acid.");
4327 if (!p_ptr->oppose_elec)
4329 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4331 msg_print("You feel less resistant to elec.");
4333 if (!p_ptr->oppose_fire)
4335 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4337 msg_print("You feel less resistant to fire.");
4339 if (!p_ptr->oppose_cold)
4341 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4343 msg_print("You feel less resistant to cold.");
4345 if (!p_ptr->oppose_pois)
4347 msg_print("ÆǤؤÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4349 msg_print("You feel less resistant to pois.");
4355 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
4357 msg_print("You feel yourself slow down.");
4364 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4366 msg_print("The heroism wears off.");
4368 /* Recalculate hitpoints */
4369 p_ptr->update |= (PU_HP);
4374 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
4376 msg_print("You feel yourself slow down.");
4383 msg_print("̵Ũ¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£");
4385 msg_print("The invulnerability wears off.");
4388 p_ptr->redraw |= (PR_MAP);
4390 /* Update monsters */
4391 p_ptr->update |= (PU_MONSTERS);
4394 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4398 p_ptr->magic_num1[0] = MUSIC_NONE;
4399 p_ptr->magic_num2[0] = 0;
4401 /* Recalculate bonuses */
4402 p_ptr->update |= (PU_BONUS | PU_HP);
4404 /* Redraw status bar */
4405 p_ptr->redraw |= (PR_STATUS);
4409 static bool cast_music_spell(int spell)
4411 int plev = p_ptr->lev;
4414 if(p_ptr->magic_num1[0])
4419 p_ptr->magic_num2[0] = spell;
4423 case 0: /* Song of Holding ÃÙÆߤβΠ*/
4425 msg_print("¤æ¤Ã¤¯¤ê¤È¤·¤¿¥á¥í¥Ç¥£¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4427 msg_print("You start humming a slow, steady melody...");
4429 p_ptr->magic_num1[0] = MUSIC_SLOW;
4431 case 1: /* Song of Blessing ½ËÊ¡¤Î²Î */
4433 msg_print("¸·¤«¤Ê¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4435 msg_print("The holy power of the Music of the Ainur enters you...");
4437 p_ptr->magic_num1[0] = MUSIC_BLESS;
4440 case 2: /* Wrecking Note Êø²õ¤Î²»¿§ */
4441 if (!get_aim_dir(&dir)) return FALSE;
4442 fire_bolt(GF_SOUND, dir,
4443 damroll(4 + ((plev - 1) / 5), 4));
4445 case 3: /* Stun Pattern Û¯Û°¤ÎÀûΧ */
4447 msg_print("âÁÏǤµ¤»¤ë¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4449 msg_print("You weave a pattern of sounds to bewilder and daze...");
4451 p_ptr->magic_num1[0] = MUSIC_STUN;
4453 case 4: /* Flow of life À¸Ì¿¤Îή¤ì */
4455 msg_print("²Î¤òÄ̤·¤ÆÂΤ˳赤¤¬Ìá¤Ã¤Æ¤¤¿¡¥¡¥¡¥");
4457 msg_print("Life flows through you as you sing a song of healing...");
4459 p_ptr->magic_num1[0] = MUSIC_L_LIFE;
4461 case 5: /* Song of the Sun ÂÀÍۤβΠ*/
4463 msg_print("¸÷¤êµ±¤¯²Î¤¬ÊÕ¤ê¤ò¾È¤é¤·¤¿¡£");
4465 msg_print("Your uplifting song brings brightness to dark places...");
4467 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
4469 case 6: /* Song of fear ¶²ÉݤβΠ*/
4471 msg_print("¤ª¤É¤í¤ª¤É¤í¤·¤¤¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4473 msg_print("You start weaving a fearful pattern...");
4475 p_ptr->magic_num1[0] = MUSIC_FEAR;
4477 case 7: /* Heroic Ballad À襤¤Î²Î */
4479 msg_print("·ã¤·¤¤À襤¤Î²Î¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4481 msg_print("You start singing a song of intense fighting...");
4483 p_ptr->magic_num1[0] = MUSIC_HERO;
4485 case 8: /* Clairaudience ÎîŪÃγР*/
4487 msg_print("ÀŤ«¤Ê²»³Ú¤¬´¶³Ð¤ò¸¦¤®À¡¤Þ¤µ¤»¤¿¡¥¡¥¡¥");
4489 msg_print("Your quiet music sharpens your sense of hearing...");
4491 p_ptr->magic_num1[0] = MUSIC_DETECT;
4493 case 9: /* º²¤Î²Î */
4495 msg_print("Àº¿À¤òDZ¤¸¶Ê¤²¤ë²Î¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4497 msg_print("You start singing a song of soul in pain...");
4499 p_ptr->magic_num1[0] = MUSIC_PSI;
4501 case 10: /* Song of Lore Ãμ±¤Î²Î */
4503 msg_print("¤³¤ÎÀ¤³¦¤ÎÃ챤¬Î®¤ì¹þ¤ó¤Ç¤¤¿¡¥¡¥¡¥");
4505 msg_print("You recall the rich lore of the world...");
4507 p_ptr->magic_num1[0] = MUSIC_ID;
4509 case 11: /* hidding song ±£ÆۤβΠ*/
4511 msg_print("¤¢¤Ê¤¿¤Î»Ñ¤¬·Ê¿§¤Ë¤È¤±¤³¤ó¤Ç¤¤¤Ã¤¿¡¥¡¥¡¥");
4513 msg_print("Your song carries you beyond the sight of mortal eyes...");
4515 p_ptr->magic_num1[0] = MUSIC_STEALTH;
4517 case 12: /* Illusion Pattern ¸¸±Æ¤ÎÀûΧ */
4519 msg_print("ÊÕ¤ê°ìÌ̤˸¸±Æ¤¬¸½¤ì¤¿¡¥¡¥¡¥");
4521 msg_print("You weave a pattern of sounds to beguile and confuse...");
4523 p_ptr->magic_num1[0] = MUSIC_CONF;
4525 case 13: /* Doomcall (vibration song) ÇËÌǤζ«¤Ó */
4527 msg_print("¹ì²»¤¬¶Á¤¤¤¿¡¥¡¥¡¥");
4529 msg_print("The fury of the Downfall of Numenor lashes out...");
4531 p_ptr->magic_num1[0] = MUSIC_SOUND;
4533 case 14: /* Firiel's Song (song of the Undeads) ¥Õ¥£¥ê¥¨¥ë¤Î²Î */
4535 msg_print("À¸Ì¿¤ÈÉü³è¤Î¥Æ¡¼¥Þ¤òÁդǻϤ᤿¡¥¡¥¡¥");
4537 msg_print("The themes of life and revival are woven into your song...");
4539 animate_dead(0, py, px);
4541 case 15: /* Fellowship Chant (charming song) ι¤ÎÃç´Ö */
4543 msg_print("°Â¤é¤«¤Ê¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4545 msg_print("You weave a slow, soothing melody of imploration...");
4547 p_ptr->magic_num1[0] = MUSIC_CHARM;
4549 case 16: /* (wall breaking song) ʬ²ò²»ÇÈ */
4551 msg_print("Ê´ºÕ¤¹¤ë¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4553 msg_print("You weave a violent pattern of sounds to break wall.");
4555 p_ptr->magic_num1[0] = MUSIC_WALL;
4556 project(0, 0, py, px,
4557 0, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM | PROJECT_HIDE, -1);
4559 case 17: /* Finrod's Resistance (song of resistance) ¸µÁÇÂÑÀ */
4561 msg_print("¸µÁǤÎÎϤËÂФ¹¤ëǦÂѤβΤò²Î¤Ã¤¿¡£");
4563 msg_print("You sing a song of perseverance against powers...");
4565 p_ptr->magic_num1[0] = MUSIC_RESIST;
4567 case 18: /* Hobbit Melodies (song of time) ¥Û¥Ó¥Ã¥È¤Î¥á¥í¥Ç¥£ */
4569 msg_print("·Ú²÷¤Ê²Î¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4571 msg_print("You start singing joyful pop song...");
4573 p_ptr->magic_num1[0] = MUSIC_SPEED;
4575 case 19: /* World Contortion ÏĤó¤ÀÀ¤³¦ */
4577 msg_print("²Î¤¬¶õ´Ö¤òÏĤ᤿¡¥¡¥¡¥");
4579 msg_print("Reality whirls wildly as you sing a dizzying melody...");
4581 project(0, plev/15 + 1, py, px, plev * 3 + 1, GF_AWAY_ALL , PROJECT_KILL, -1);
4583 case 20: /* Â໶¤Î²Î */
4585 msg_print("ÂѤ¨¤é¤ì¤Ê¤¤ÉÔ¶¨Ï²»¤¬Å¨¤òÀÕ¤áΩ¤Æ¤¿¡¥¡¥¡¥");
4587 msg_print("You cry out in an ear-wracking voice...");
4589 p_ptr->magic_num1[0] = MUSIC_DISPEL;
4591 case 21: /* The Voice of Saruman ¥µ¥ë¥Þ¥ó¤Î´Å¸À */
4593 msg_print("Í¥¤·¤¯¡¢Ì¥ÎÏŪ¤Ê²Î¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4595 msg_print("You start humming a gentle and attractive song...");
4597 p_ptr->magic_num1[0] = MUSIC_SARUMAN;
4599 case 22: /* Song of Tempest (song of death) Íò¤Î²»¿§ */
4600 if (!get_aim_dir(&dir)) return FALSE;
4601 fire_beam(GF_SOUND, dir,
4602 damroll(15 + ((plev - 1) / 2), 10));
4604 case 23: /* (song of disruption) ¤â¤¦°ì¤Ä¤ÎÀ¤³¦ */
4606 msg_print("¼þ°Ï¤¬ÊѲ½¤·»Ï¤á¤¿¡¥¡¥¡¥");
4608 msg_print("You sing of the primeval shaping of Middle-earth...");
4612 case 24: /* Wrecking Pattern (destruction shriek) Ç˲õ¤ÎÀûΧ */
4614 msg_print("Ç˲õŪ¤Ê²Î¤¬¶Á¤¤ï¤¿¤Ã¤¿¡¥¡¥¡¥");
4616 msg_print("You weave a pattern of sounds to contort and shatter...");
4618 p_ptr->magic_num1[0] = MUSIC_QUAKE;
4620 case 25: /* ÄäÂڤβΠ*/
4622 msg_print("¤æ¤Ã¤¯¤ê¤È¤·¤¿¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4624 msg_print("You weave a very slow pattern which is almost likely to stop...");
4626 p_ptr->magic_num1[0] = MUSIC_STASIS;
4628 case 26: /* ¼é¤ê¤Î²Î */
4630 msg_print("²Î¤¬¿ÀÀ»¤Ê¾ì¤òºî¤ê½Ð¤·¤¿¡¥¡¥¡¥");
4632 msg_print("The holy power of the Music is creating sacred field...");
4636 case 27: /* ±Ñͺ¤Î»í */
4638 msg_print("±Ñͺ¤Î²Î¤ò¸ý¤º¤µ¤ó¤À¡¥¡¥¡¥");
4640 msg_print("You chant a powerful, heroic call to arms...");
4642 p_ptr->magic_num1[0] = MUSIC_SHERO;
4643 (void)hp_player(10);
4644 (void)set_afraid(0);
4646 case 28: /* ¥ä¥ô¥¡¥ó¥Ê¤Î½õ¤± */
4648 msg_print("²Î¤òÄ̤·¤ÆÂΤ˳赤¤¬Ìá¤Ã¤Æ¤¤¿¡¥¡¥¡¥");
4650 msg_print("Life flows through you as you sing the song...");
4652 p_ptr->magic_num1[0] = MUSIC_H_LIFE;
4654 case 29: /* ºÆÀ¸¤Î²Î */
4656 msg_print("°Å¹õ¤ÎÃæ¤Ë¸÷¤ÈÈþ¤ò¤Õ¤ê¤Þ¤¤¤¿¡£ÂΤ¬¸µ¤Î³èÎϤò¼è¤êÌᤷ¤¿¡£");
4658 msg_print("You strewed light and beauty in the dark as you sing. You feel refreshed.");
4660 (void)do_res_stat(A_STR);
4661 (void)do_res_stat(A_INT);
4662 (void)do_res_stat(A_WIS);
4663 (void)do_res_stat(A_DEX);
4664 (void)do_res_stat(A_CON);
4665 (void)do_res_stat(A_CHR);
4666 (void)restore_level();
4668 case 30: /* shriek of death ¥µ¥¦¥í¥ó¤ÎËâ½Ñ */
4669 if (!get_aim_dir(&dir)) return FALSE;
4670 fire_ball(GF_SOUND, dir, damroll(50 + plev, 10), 0);
4672 case 31: /* song of liberty ¥Õ¥£¥ó¥´¥ë¥Õ¥£¥ó¤ÎÄ©Àï */
4674 msg_print("¥Õ¥£¥ó¥´¥ë¥Õ¥£¥ó¤Î̽²¦¤Ø¤ÎÄ©Àï¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4676 msg_print("You recall the valor of Fingolfin's challenge to the Dark Lord...");
4678 p_ptr->magic_num1[0] = MUSIC_INVULN;
4681 p_ptr->redraw |= (PR_MAP);
4683 /* Update monsters */
4684 p_ptr->update |= (PU_MONSTERS);
4687 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4691 msg_format("̤ÃΤβÎ(%d)¤ò²Î¤Ã¤¿¡£", spell);
4693 msg_format("You sing an unknown song: %d.", spell);
4698 if (p_ptr->magic_num1[0]) set_action(ACTION_SING);
4700 /* Recalculate bonuses */
4701 p_ptr->update |= (PU_BONUS | PU_HP);
4703 /* Redraw status bar */
4704 p_ptr->redraw |= (PR_STATUS);
4712 void do_cmd_cast(void)
4714 int item, sval, spell, realm;
4729 /* Require spell ability */
4730 if (!p_ptr->realm1 && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE))
4733 msg_print("¼öʸ¤ò¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4735 msg_print("You cannot cast spells!");
4742 if (p_ptr->blind || no_lite())
4745 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡ª");
4747 msg_print("You cannot see!");
4749 if (p_ptr->pclass == CLASS_FORCETRAINER)
4756 /* Not when confused */
4757 if (p_ptr->confused)
4760 msg_print("º®Í𤷤Ƥ¤¤Æ¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4762 msg_print("You are too confused!");
4768 prayer = spell_categoly_name(mp_ptr->spell_book);
4770 /* Restrict choices to spell books */
4771 item_tester_tval = mp_ptr->spell_book;
4775 q = "¤É¤Î¼öʸ½ñ¤ò»È¤¤¤Þ¤¹¤«? ";
4777 q = "Use which book? ";
4781 s = "¼öʸ½ñ¤¬¤Ê¤¤¡ª";
4783 s = "You have no spell books!";
4786 select_spellbook=TRUE;
4787 if (p_ptr->pclass == CLASS_FORCETRAINER)
4788 select_the_force = TRUE;
4789 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))){
4790 select_spellbook = FALSE;
4791 select_the_force = FALSE;
4794 select_spellbook = FALSE;
4795 select_the_force = FALSE;
4797 if (item == 1111) { /* the_force */
4801 /* Get the item (in the pack) */
4804 o_ptr = &inventory[item];
4807 /* Get the item (on the floor) */
4810 o_ptr = &o_list[0 - item];
4813 /* Access the item's sval */
4816 if ((p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE) && (o_ptr->tval == REALM2_BOOK)) increment = 32;
4819 /* Track the object kind */
4820 object_kind_track(o_ptr->k_idx);
4822 /* Hack -- Handle stuff */
4825 if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
4826 realm = o_ptr->tval - TV_LIFE_BOOK + 1;
4827 else if (increment) realm = p_ptr->realm2;
4828 else realm = p_ptr->realm1;
4830 /* Ask for a spell */
4832 if (!get_spell(&spell,
4833 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "±Ó¾§¤¹¤ë" : (mp_ptr->spell_book == TV_MUSIC_BOOK) ? "²Î¤¦" : "¾§¤¨¤ë"),
4836 if (spell == -2) msg_format("¤½¤ÎËܤˤÏÃΤäƤ¤¤ë%s¤¬¤Ê¤¤¡£", prayer);
4840 if (!get_spell(&spell, ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "recite" : "cast"),
4844 msg_format("You don't know any %ss in that book.", prayer);
4850 use_realm = tval2realm(o_ptr->tval);
4852 if (!is_magic(use_realm))
4854 s_ptr = &technic_info[use_realm - MIN_TECHNIC][spell];
4858 s_ptr = &mp_ptr->info[realm - 1][spell];
4861 /* Extract mana consumption rate */
4862 shouhimana = s_ptr->smana*(3800 - experience_of_spell(spell, realm)) + 2399;
4865 else shouhimana *= 4;
4867 if(shouhimana < 1) shouhimana = 1;
4869 /* Verify "dangerous" spells */
4870 if (shouhimana > p_ptr->csp)
4872 if (flush_failure) flush();
4876 msg_format("¤½¤Î%s¤ò%s¤Î¤Ë½½Ê¬¤Ê¥Þ¥¸¥Ã¥¯¥Ý¥¤¥ó¥È¤¬¤Ê¤¤¡£",prayer,
4877 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "±Ó¾§¤¹¤ë" : (mp_ptr->spell_book == TV_LIFE_BOOK) ? "²Î¤¦" : "¾§¤¨¤ë"));
4879 msg_format("You do not have enough mana to %s this %s.",
4880 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "recite" : "cast"),
4885 if (!over_exert) return;
4889 if (!get_check_strict("¤½¤ì¤Ç¤âÄ©À路¤Þ¤¹¤«? ", CHECK_OKAY_CANCEL)) return;
4891 if (!get_check_strict("Attempt it anyway? ", CHECK_OKAY_CANCEL)) return;
4897 /* Spell failure chance */
4898 chance = spell_chance(spell, use_realm);
4901 if (randint0(100) < chance)
4903 if (flush_failure) flush();
4906 msg_format("%s¤ò¤¦¤Þ¤¯¾§¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡ª", prayer);
4908 msg_format("You failed to get the %s off!", prayer);
4913 if (realm == REALM_LIFE)
4915 if (randint1(100) < chance)
4916 chg_virtue(V_VITALITY, -1);
4918 else if (realm == REALM_DEATH)
4920 if (randint1(100) < chance)
4921 chg_virtue(V_UNLIFE, -1);
4923 else if (realm == REALM_NATURE)
4925 if (randint1(100) < chance)
4926 chg_virtue(V_NATURE, -1);
4928 else if (realm == REALM_DAEMON)
4930 if (randint1(100) < chance)
4931 chg_virtue(V_JUSTICE, 1);
4933 if (realm == REALM_CRUSADE)
4935 if (randint1(100) < chance)
4936 chg_virtue(V_JUSTICE, -1);
4938 else if (randint1(100) < chance)
4940 chg_virtue(V_KNOWLEDGE, -1);
4943 if (realm == REALM_TRUMP)
4945 cast_trump_spell(spell, FALSE);
4947 else if ((o_ptr->tval == TV_CHAOS_BOOK) && (randint1(100) < spell))
4950 msg_print("¥«¥ª¥¹Åª¤Ê¸ú²Ì¤òȯÀ¸¤·¤¿¡ª");
4952 msg_print("You produce a chaotic effect!");
4957 else if ((o_ptr->tval == TV_DEATH_BOOK) && (randint1(100) < spell))
4959 if ((sval == 3) && one_in_(2))
4961 sanity_blast(0, TRUE);
4966 msg_print("Äˤ¤¡ª");
4968 msg_print("It hurts!");
4972 take_hit(DAMAGE_LOSELIFE, damroll(o_ptr->sval + 1, 6), "°Å¹õËâË¡¤ÎµÕή", -1);
4974 take_hit(DAMAGE_LOSELIFE, damroll(o_ptr->sval + 1, 6), "a miscast Death spell", -1);
4977 if ((spell > 15) && one_in_(6) && !p_ptr->hold_life)
4978 lose_exp(spell * 250);
4981 else if ((o_ptr->tval == TV_MUSIC_BOOK) && (randint1(200) < spell))
4984 msg_print("¤¤¤ä¤Ê²»¤¬¶Á¤¤¤¿");
4986 msg_print("An infernal sound echoed.");
4989 aggravate_monsters(0);
4991 if (randint1(100) >= chance)
4992 chg_virtue(V_CHANCE,-1);
5001 case REALM_LIFE: /* * LIFE * */
5002 cast = cast_life_spell(spell);
5004 case REALM_SORCERY: /* * SORCERY * */
5005 cast = cast_sorcery_spell(spell);
5007 case REALM_NATURE: /* * NATURE * */
5008 cast = cast_nature_spell(spell);
5010 case REALM_CHAOS: /* * CHAOS * */
5011 cast = cast_chaos_spell(spell);
5013 case REALM_DEATH: /* * DEATH * */
5014 cast = cast_death_spell(spell);
5016 case REALM_TRUMP: /* TRUMP */
5017 cast = cast_trump_spell(spell, TRUE);
5019 case REALM_ARCANE: /* ARCANE */
5020 cast = cast_arcane_spell(spell);
5022 case REALM_ENCHANT: /* ENCHANT */
5023 cast = cast_enchant_spell(spell);
5025 case REALM_DAEMON: /* DAEMON */
5026 cast = cast_daemon_spell(spell);
5028 case REALM_CRUSADE: /* CRUSADE */
5029 cast = cast_crusade_spell(spell);
5031 case REALM_MUSIC: /* MUSIC */
5032 cast = cast_music_spell(spell);
5036 msg_format("You cast a spell from an unknown realm: realm %d, spell %d.", realm, spell);
5040 /* Canceled spells cost neither a turn nor mana */
5043 if (randint1(100) < chance)
5044 chg_virtue(V_CHANCE,1);
5046 /* A spell was cast */
5048 (p_ptr->spell_worked2 & (1L << spell)) :
5049 (p_ptr->spell_worked1 & (1L << spell)))
5050 && (p_ptr->pclass != CLASS_SORCERER)
5051 && (p_ptr->pclass != CLASS_RED_MAGE))
5053 int e = s_ptr->sexp;
5055 /* The spell worked */
5056 if (realm == p_ptr->realm1)
5058 p_ptr->spell_worked1 |= (1L << spell);
5062 p_ptr->spell_worked2 |= (1L << spell);
5065 /* Gain experience */
5066 gain_exp(e * s_ptr->slevel);
5068 /* Redraw object recall */
5069 p_ptr->window |= (PW_OBJECT);
5071 if (realm == REALM_LIFE)
5073 chg_virtue(V_TEMPERANCE, 1);
5074 chg_virtue(V_COMPASSION, 1);
5075 chg_virtue(V_VITALITY, 1);
5076 chg_virtue(V_DILIGENCE, 1);
5078 else if (realm == REALM_DEATH)
5080 chg_virtue(V_UNLIFE, 1);
5081 chg_virtue(V_JUSTICE, -1);
5082 chg_virtue(V_FAITH, -1);
5083 chg_virtue(V_VITALITY, -1);
5085 else if (realm == REALM_DAEMON)
5087 chg_virtue(V_JUSTICE, -1);
5088 chg_virtue(V_FAITH, -1);
5089 chg_virtue(V_HONOUR, -1);
5090 chg_virtue(V_TEMPERANCE, -1);
5092 else if (realm == REALM_CRUSADE)
5094 chg_virtue(V_FAITH, 1);
5095 chg_virtue(V_JUSTICE, 1);
5096 chg_virtue(V_SACRIFICE, 1);
5097 chg_virtue(V_HONOUR, 1);
5099 else if (realm == REALM_NATURE)
5101 chg_virtue(V_NATURE, 1);
5102 chg_virtue(V_HARMONY, 1);
5105 chg_virtue(V_KNOWLEDGE, 1);
5107 if (realm == REALM_LIFE)
5109 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_TEMPERANCE, 1);
5110 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_COMPASSION, 1);
5111 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_VITALITY, 1);
5112 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_DILIGENCE, 1);
5114 else if (realm == REALM_DEATH)
5116 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_UNLIFE, 1);
5117 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_JUSTICE, -1);
5118 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_FAITH, -1);
5119 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_VITALITY, -1);
5121 else if (realm == REALM_DAEMON)
5123 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_JUSTICE, -1);
5124 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_FAITH, -1);
5125 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_HONOUR, -1);
5126 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_TEMPERANCE, -1);
5128 else if (realm == REALM_CRUSADE)
5130 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_FAITH, 1);
5131 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_JUSTICE, 1);
5132 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_SACRIFICE, 1);
5133 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_HONOUR, 1);
5135 else if (realm == REALM_NATURE)
5137 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_NATURE, 1);
5138 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_HARMONY, 1);
5140 if (mp_ptr->spell_xtra & MAGIC_GAIN_EXP)
5142 s16b cur_exp = p_ptr->spell_exp[(increment ? 32 : 0)+spell];
5147 else if(cur_exp < 1200)
5149 if ((dun_level > 4) && ((dun_level + 10) > p_ptr->lev))
5152 else if(cur_exp < 1400)
5154 if (((dun_level + 5) > p_ptr->lev) && ((dun_level + 5) > s_ptr->slevel))
5157 else if((cur_exp < 1600) && !increment)
5159 if (((dun_level + 5) > p_ptr->lev) && (dun_level > s_ptr->slevel))
5162 p_ptr->spell_exp[(increment ? 32 : 0)+spell] += exp_gain;
5169 /* Sufficient mana */
5170 if (shouhimana <= p_ptr->csp)
5173 p_ptr->csp -= shouhimana;
5176 /* Over-exert the player */
5179 int oops = shouhimana;
5183 p_ptr->csp_frac = 0;
5187 msg_print("Àº¿À¤ò½¸Ã椷¤¹¤®¤Æµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
5189 msg_print("You faint from the effort!");
5193 /* Hack -- Bypass free action */
5194 (void)set_paralyzed(p_ptr->paralyzed + randint1(5 * oops + 1));
5196 if (realm == REALM_LIFE)
5197 chg_virtue(V_VITALITY, -10);
5198 else if (realm == REALM_DEATH)
5199 chg_virtue(V_UNLIFE, -10);
5200 else if (realm == REALM_DAEMON)
5201 chg_virtue(V_JUSTICE, 10);
5202 else if (realm == REALM_NATURE)
5203 chg_virtue(V_NATURE, -10);
5204 else if (realm == REALM_CRUSADE)
5205 chg_virtue(V_JUSTICE, -10);
5207 chg_virtue(V_KNOWLEDGE, -10);
5209 /* Damage CON (possibly permanently) */
5210 if (randint0(100) < 50)
5212 bool perm = (randint0(100) < 25);
5216 msg_print("ÂΤò°¤¯¤·¤Æ¤·¤Þ¤Ã¤¿¡ª");
5218 msg_print("You have damaged your health!");
5222 /* Reduce constitution */
5223 (void)dec_stat(A_CON, 15 + randint1(10), perm);
5228 p_ptr->redraw |= (PR_MANA);
5231 p_ptr->window |= (PW_PLAYER);
5232 p_ptr->window |= (PW_SPELL);
5237 * Pray a prayer -- Unused in Hengband
5239 void do_cmd_pray(void)
5241 msg_print("Praying is not used in Hengband. Use magic spell casting instead.");
5244 static bool ang_sort_comp_pet_dismiss(vptr u, vptr v, int a, int b)
5246 u16b *who = (u16b*)(u);
5251 monster_type *m_ptr1 = &m_list[w1];
5252 monster_type *m_ptr2 = &m_list[w2];
5253 monster_race *r_ptr1 = &r_info[m_ptr1->r_idx];
5254 monster_race *r_ptr2 = &r_info[m_ptr2->r_idx];
5256 if (w1 == p_ptr->riding) return TRUE;
5257 if (w2 == p_ptr->riding) return FALSE;
5259 if (m_ptr1->nickname && !m_ptr2->nickname) return TRUE;
5260 if (m_ptr2->nickname && !m_ptr1->nickname) return FALSE;
5262 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return TRUE;
5263 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return FALSE;
5265 if (r_ptr1->level > r_ptr2->level) return TRUE;
5266 if (r_ptr2->level > r_ptr1->level) return FALSE;
5268 if (m_ptr1->hp > m_ptr2->hp) return TRUE;
5269 if (m_ptr2->hp > m_ptr1->hp) return FALSE;
5274 int calculate_upkeep(void)
5276 s32b old_friend_align = friend_align;
5278 bool have_a_unique = FALSE;
5281 total_friend_levels = 0;
5284 for (m_idx = m_max - 1; m_idx >=1; m_idx--)
5286 monster_type *m_ptr;
5287 monster_race *r_ptr;
5289 m_ptr = &m_list[m_idx];
5290 if (!m_ptr->r_idx) continue;
5291 r_ptr = &r_info[m_ptr->r_idx];
5296 if (r_ptr->flags1 & RF1_UNIQUE)
5298 if (p_ptr->pclass == CLASS_CAVALRY)
5300 if (p_ptr->riding == m_idx)
5301 total_friend_levels += (r_ptr->level+5)*2;
5302 else if (!have_a_unique && (r_info[m_ptr->r_idx].flags7 & RF7_RIDING))
5303 total_friend_levels += (r_ptr->level+5)*7/2;
5305 total_friend_levels += (r_ptr->level+5)*10;
5306 have_a_unique = TRUE;
5309 total_friend_levels += (r_ptr->level+5)*10;
5312 total_friend_levels += r_ptr->level;
5314 /* Determine pet alignment */
5315 if (r_ptr->flags3 & RF3_GOOD)
5317 friend_align += r_ptr->level;
5319 else if (r_ptr->flags3 & RF3_EVIL)
5321 friend_align -= r_ptr->level;
5325 if (old_friend_align != friend_align) p_ptr->update |= (PU_BONUS);
5329 upkeep_factor = (total_friend_levels - (p_ptr->lev * 80 / (cp_ptr->pet_upkeep_div)));
5330 if (upkeep_factor < 0) upkeep_factor = 0;
5331 if (upkeep_factor > 1000) upkeep_factor = 1000;
5332 return upkeep_factor;
5338 void do_cmd_pet_dismiss(void)
5340 monster_type *m_ptr;
5341 bool all_pets = FALSE;
5355 /* Allocate the "who" array */
5356 C_MAKE(who, max_m_idx, u16b);
5358 /* Process the monsters (backwards) */
5359 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
5361 if (is_pet(&m_list[pet_ctr]))
5362 who[max_pet++] = pet_ctr;
5365 /* Select the sort method */
5366 ang_sort_comp = ang_sort_comp_pet_dismiss;
5367 ang_sort_swap = ang_sort_swap_hook;
5369 ang_sort(who, &dummy_why, max_pet);
5371 /* Process the monsters (backwards) */
5372 for (i = 0; i < max_pet; i++)
5375 char friend_name[80];
5379 /* Access the monster */
5381 m_ptr = &m_list[pet_ctr];
5383 delete_this = FALSE;
5384 kakunin = ((pet_ctr == p_ptr->riding) || (m_ptr->nickname));
5385 monster_desc(friend_name, m_ptr, 0x80);
5389 /* Hack -- health bar for this monster */
5390 health_track(pet_ctr);
5392 /* Hack -- handle stuff */
5396 sprintf(buf, "%s¤òÊü¤·¤Þ¤¹¤«¡© [Yes/No/Unnamed (%dɤ)]", friend_name, max_pet-i);
5398 sprintf(buf, "Dismiss %s? [Yes/No/Unnamed (%d remain)]", friend_name, max_pet-i);
5403 move_cursor_relative(m_ptr->fy, m_ptr->fx);
5409 if (ch == 'Y' || ch == 'y')
5416 sprintf(buf, "ËÜÅö¤Ë¤è¤í¤·¤¤¤Ç¤¹¤«¡© (%s) ", friend_name);
5418 sprintf(buf, "Are you sure? (%s) ", friend_name);
5420 if (!get_check(buf))
5421 delete_this = FALSE;
5426 if (ch == 'U' || ch == 'u')
5432 if (ch == ESCAPE || ch == 'N' || ch == 'n')
5439 if ((all_pets && !kakunin) || (!all_pets && delete_this))
5441 if (record_named_pet && m_ptr->nickname)
5445 monster_desc(m_name, m_ptr, 0x08);
5446 do_cmd_write_nikki(NIKKI_NAMED_PET, 2, m_name);
5449 if (pet_ctr == p_ptr->riding)
5452 msg_format("%s¤«¤é¹ß¤ê¤¿¡£", friend_name);
5454 msg_format("You have got off %s. ", friend_name);
5459 /* Update the monsters */
5460 p_ptr->update |= (PU_BONUS | PU_MONSTERS);
5461 p_ptr->redraw |= (PR_EXTRA);
5464 /* HACK : Add the line to message buffer */
5466 sprintf(buf, "%s ¤òÊü¤·¤¿¡£", friend_name);
5468 sprintf(buf, "Dismissed %s.", friend_name);
5471 p_ptr->window |= (PW_MESSAGE);
5474 delete_monster_idx(pet_ctr);
5483 C_KILL(who, max_m_idx, u16b);
5486 msg_format("%d ɤ¤Î¥Ú¥Ã¥È¤òÊü¤·¤Þ¤·¤¿¡£", Dismissed);
5488 msg_format("You have dismissed %d pet%s.", Dismissed,
5489 (Dismissed == 1 ? "" : "s"));
5491 if (Dismissed == 0 && all_pets)
5493 msg_print("'U'nnamed ¤Ï¡¢¾èÇϰʳ°¤Î̾Á°¤Î¤Ê¤¤¥Ú¥Ã¥È¤À¤±¤òÁ´¤Æ²òÊü¤·¤Þ¤¹¡£");
5495 msg_print("'U'nnamed means all your pets except named pets and your mount.");
5498 p_ptr->update |= (PU_MON_LITE);
5501 bool rakuba(int dam, bool force)
5503 int i, y, x, oy, ox;
5504 int sn = 0, sy = 0, sx = 0;
5506 monster_type *m_ptr = &m_list[p_ptr->riding];
5507 monster_race *r_ptr = &r_info[m_ptr->r_idx];
5509 if (!p_ptr->riding) return FALSE;
5510 if (p_ptr->wild_mode) return FALSE;
5512 if (dam >= 0 || force)
5516 int level = r_ptr->level;
5517 if (p_ptr->riding_ryoute) level += 20;
5518 if ((dam/2 + r_ptr->level) > (p_ptr->skill_exp[GINOU_RIDING]/30+10))
5520 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)
5522 if (r_ptr->level*100 > (p_ptr->skill_exp[GINOU_RIDING] + 1500))
5523 p_ptr->skill_exp[GINOU_RIDING] += (1+(r_ptr->level - p_ptr->skill_exp[GINOU_RIDING]/100 - 15));
5524 else p_ptr->skill_exp[GINOU_RIDING]++;
5527 if (randint0(dam/2 + level*2) < (p_ptr->skill_exp[GINOU_RIDING]/30+10))
5529 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))
5535 /* Check around the player */
5536 for (i = 0; i < 8; i++)
5540 /* Access the location */
5541 y = py + ddy_ddd[i];
5542 x = px + ddx_ddd[i];
5544 c_ptr = &cave[y][x];
5546 /* Skip non-empty grids */
5547 if (cave_perma_grid(c_ptr)) continue;
5548 if (!cave_empty_grid2(c_ptr)) continue;
5550 if (c_ptr->m_idx) continue;
5552 /* Count "safe" grids */
5555 /* Randomize choice */
5556 if (randint0(sn) > 0) continue;
5558 /* Save the safe location */
5563 monster_desc(m_name, m_ptr, 0);
5565 msg_format("%s¤«¤é¿¶¤êÍî¤È¤µ¤ì¤½¤¦¤Ë¤Ê¤Ã¤Æ¡¢Êɤˤ֤Ĥ«¤Ã¤¿¡£",m_name);
5566 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "Êɤؤξ×ÆÍ", -1);
5568 msg_format("You have nearly fallen from %s, but bumped into wall.",m_name);
5569 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "bumping into wall", -1);
5580 /* Redraw the old spot */
5583 /* Redraw the new spot */
5586 /* Check for new panel */
5591 p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5592 p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE;
5596 p_ptr->update |= (PU_BONUS);
5599 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW);
5601 /* Update the monsters */
5602 p_ptr->update |= (PU_DISTANCE);
5605 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5607 p_ptr->redraw |= (PR_EXTRA);
5609 /* Update health track of mount */
5610 p_ptr->redraw |= (PR_UHEALTH);
5612 if (p_ptr->ffall && !force)
5614 monster_desc(m_name, m_ptr, 0);
5616 msg_format("%s¤«¤éÍî¤Á¤¿¤¬¡¢¶õÃæ¤Ç¤¦¤Þ¤¯ÂÎÀª¤òΩ¤Æľ¤·¤ÆÃåÃϤ·¤¿¡£",m_name);
5618 msg_format("You are thrown from %s, but make a good landing.",m_name);
5623 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "ÍîÇÏ", -1);
5625 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "Falling from riding", -1);
5631 bool do_riding(bool force)
5633 int oy, ox, x, y, dir = 0;
5635 monster_type *m_ptr;
5637 if (!get_rep_dir2(&dir)) return FALSE;
5640 c_ptr = &cave[y][x];
5644 /* Skip non-empty grids */
5645 if (!cave_empty_bold2(y, x) || c_ptr->m_idx)
5648 msg_print("¤½¤Á¤é¤Ë¤Ï¹ß¤ê¤é¤ì¤Þ¤»¤ó¡£");
5650 msg_print("You cannot go to that direction.");
5655 p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5656 p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE;
5660 if (p_ptr->confused)
5663 msg_print("º®Í𤷤Ƥ¤¤Æ¾è¤ì¤Ê¤¤¡ª");
5665 msg_print("You are too confused!");
5669 if (!(c_ptr->m_idx))
5672 msg_print("¤½¤Î¾ì½ê¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
5674 msg_print("Here is no pet.");
5680 m_ptr = &m_list[c_ptr->m_idx];
5682 if (!is_pet(m_ptr) && !force)
5685 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï¥Ú¥Ã¥È¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£");
5687 msg_print("That monster is no a pet.");
5692 if (!(r_info[m_ptr->r_idx].flags7 & RF7_RIDING))
5695 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ë¤Ï¾è¤ì¤Ê¤µ¤½¤¦¤À¡£");
5697 msg_print("This monster doesn't seem suitable for riding.");
5702 if (!(p_ptr->pass_wall) && (c_ptr->feat >= FEAT_RUBBLE) && (c_ptr->feat <= FEAT_PERM_SOLID))
5705 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤ÏÊɤÎÃæ¤Ë¤¤¤ë¡£");
5707 msg_print("This monster is in the wall.");
5712 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)))
5715 msg_print("¥Ñ¥¿¡¼¥ó¤Î¾å¤«¤é¤Ï¾è¤ì¤Þ¤»¤ó¡£");
5717 msg_print("You cannot ride from on Pattern.");
5725 msg_print("¤½¤Î¾ì½ê¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
5727 msg_print("Here is no monster.");
5732 if (r_info[m_ptr->r_idx].level > randint1((p_ptr->skill_exp[GINOU_RIDING]/50 + p_ptr->lev/2 +20)))
5735 msg_print("¤¦¤Þ¤¯¾è¤ì¤Ê¤«¤Ã¤¿¡£");
5737 msg_print("You failed to ride.");
5747 monster_desc(m_name, m_ptr, 0);
5750 msg_format("%s¤òµ¯¤³¤·¤¿¡£", m_name);
5752 msg_format("You have waked %s up.", m_name);
5756 p_ptr->riding = c_ptr->m_idx;
5758 /* Hack -- remove tracked monster */
5759 if (p_ptr->riding == p_ptr->health_who) health_track(0);
5762 /* Save the old location */
5766 /* Move the player to the safe location */
5770 /* Redraw the old spot */
5773 /* Redraw the new spot */
5776 /* Check for new panel */
5781 /* Mega-Hack -- Forget the view and lite */
5782 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
5785 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW);
5787 /* Update the monsters */
5788 p_ptr->update |= (PU_DISTANCE);
5790 /* Update the monsters */
5791 p_ptr->update |= (PU_BONUS);
5794 p_ptr->redraw |= (PR_MAP | PR_EXTRA);
5797 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5799 p_ptr->redraw |= (PR_UHEALTH);
5805 static void do_name_pet(void)
5807 monster_type *m_ptr;
5810 bool old_name = FALSE;
5811 bool old_target_pet = target_pet;
5814 if (!target_set(TARGET_KILL))
5816 target_pet = old_target_pet;
5819 target_pet = old_target_pet;
5821 if (cave[target_row][target_col].m_idx)
5823 m_ptr = &m_list[cave[target_row][target_col].m_idx];
5829 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï¥Ú¥Ã¥È¤Ç¤Ï¤Ê¤¤¡£");
5831 msg_format("This monster is not a pet.");
5835 if (r_info[m_ptr->r_idx].flags1 & RF1_UNIQUE)
5838 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Î̾Á°¤ÏÊѤ¨¤é¤ì¤Ê¤¤¡ª");
5840 msg_format("You cannot change name of this monster!");
5844 monster_desc(m_name, m_ptr, 0);
5848 msg_format("%s¤Ë̾Á°¤ò¤Ä¤±¤ë¡£", m_name);
5850 msg_format("Name %s.", m_name);
5855 /* Start with nothing */
5856 strcpy(out_val, "");
5858 /* Use old inscription */
5859 if (m_ptr->nickname)
5861 /* Start with the old inscription */
5862 strcpy(out_val, quark_str(m_ptr->nickname));
5866 /* Get a new inscription (possibly empty) */
5868 if (get_string("̾Á°: ", out_val, 15))
5870 if (get_string("Name: ", out_val, 15))
5876 /* Save the inscription */
5877 m_ptr->nickname = quark_add(out_val);
5878 if (record_named_pet)
5882 monster_desc(m_name, m_ptr, 0x08);
5883 do_cmd_write_nikki(NIKKI_NAMED_PET, 0, m_name);
5888 if (record_named_pet && old_name)
5892 monster_desc(m_name, m_ptr, 0x08);
5893 do_cmd_write_nikki(NIKKI_NAMED_PET, 1, m_name);
5895 m_ptr->nickname = 0;
5902 * Issue a pet command
5904 void do_cmd_pet(void)
5909 cptr power_desc[36];
5914 int pets = 0, pet_ctr;
5915 monster_type *m_ptr;
5922 char target_buf[160];
5926 /* Calculate pets */
5927 /* Process the monsters (backwards) */
5928 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
5930 /* Access the monster */
5931 m_ptr = &m_list[pet_ctr];
5933 if (is_pet(m_ptr)) pets++;
5937 power_desc[num] = "¥Ú¥Ã¥È¤òÊü¤¹";
5939 power_desc[num] = "dismiss pets";
5942 powers[num++] = PET_DISMISS;
5945 sprintf(target_buf,"¥Ú¥Ã¥È¤Î¥¿¡¼¥²¥Ã¥È¤ò»ØÄê (¸½ºß¡§%s)",
5946 (pet_t_m_idx ? r_name + r_info[m_list[pet_t_m_idx].r_idx].name : "»ØÄê¤Ê¤·"));
5948 sprintf(target_buf,"specify a targert of pet (now:%s)",
5949 (pet_t_m_idx ? r_name + r_info[m_list[pet_t_m_idx].r_idx].name : "nothing"));
5951 power_desc[num] = target_buf;
5953 powers[num++] = PET_TARGET;
5956 power_desc[num] = "¶á¤¯¤Ë¤¤¤í";
5958 power_desc[num] = "stay close";
5961 if (p_ptr->pet_follow_distance == PET_CLOSE_DIST) mode = num;
5962 powers[num++] = PET_STAY_CLOSE;
5965 power_desc[num] = "¤Ä¤¤¤ÆÍ褤";
5967 power_desc[num] = "follow me";
5970 if (p_ptr->pet_follow_distance == PET_FOLLOW_DIST) mode = num;
5971 powers[num++] = PET_FOLLOW_ME;
5974 power_desc[num] = "Ũ¤ò¸«¤Ä¤±¤ÆÅݤ»";
5976 power_desc[num] = "seek and destroy";
5979 if (p_ptr->pet_follow_distance == PET_DESTROY_DIST) mode = num;
5980 powers[num++] = PET_SEEK_AND_DESTROY;
5983 power_desc[num] = "¾¯¤·Î¥¤ì¤Æ¤¤¤í";
5985 power_desc[num] = "give me space";
5988 if (p_ptr->pet_follow_distance == PET_SPACE_DIST) mode = num;
5989 powers[num++] = PET_ALLOW_SPACE;
5992 power_desc[num] = "Î¥¤ì¤Æ¤¤¤í";
5994 power_desc[num] = "stay away";
5997 if (p_ptr->pet_follow_distance == PET_AWAY_DIST) mode = num;
5998 powers[num++] = PET_STAY_AWAY;
6000 if (p_ptr->pet_extra_flags & PF_OPEN_DOORS)
6003 power_desc[num] = "¥É¥¢¤ò³«¤±¤ë (¸½ºß:ON)";
6005 power_desc[num] = "pets open doors (now On)";
6012 power_desc[num] = "¥É¥¢¤ò³«¤±¤ë (¸½ºß:OFF)";
6014 power_desc[num] = "pets open doors (now Off)";
6018 powers[num++] = PET_OPEN_DOORS;
6020 if (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS)
6023 power_desc[num] = "¥¢¥¤¥Æ¥à¤ò½¦¤¦ (¸½ºß:ON)";
6025 power_desc[num] = "pets pick up items (now On)";
6032 power_desc[num] = "¥¢¥¤¥Æ¥à¤ò½¦¤¦ (¸½ºß:OFF)";
6034 power_desc[num] = "pets pick up items (now Off)";
6038 powers[num++] = PET_TAKE_ITEMS;
6040 if (p_ptr->pet_extra_flags & PF_TELEPORT)
6043 power_desc[num] = "¥Æ¥ì¥Ý¡¼¥È·ÏËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6045 power_desc[num] = "allow teleport (now On)";
6052 power_desc[num] = "¥Æ¥ì¥Ý¡¼¥È·ÏËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6054 power_desc[num] = "allow teleport (now Off)";
6058 powers[num++] = PET_TELEPORT;
6060 if (p_ptr->pet_extra_flags & PF_ATTACK_SPELL)
6063 power_desc[num] = "¹¶·âËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6065 power_desc[num] = "allow cast attack spell (now On)";
6072 power_desc[num] = "¹¶·âËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6074 power_desc[num] = "allow cast attack spell (now Off)";
6078 powers[num++] = PET_ATTACK_SPELL;
6080 if (p_ptr->pet_extra_flags & PF_SUMMON_SPELL)
6083 power_desc[num] = "¾¤´ËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6085 power_desc[num] = "allow cast summon spell (now On)";
6092 power_desc[num] = "¾¤´ËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6094 power_desc[num] = "allow cast summon spell (now Off)";
6098 powers[num++] = PET_SUMMON_SPELL;
6100 if (p_ptr->pet_extra_flags & PF_BALL_SPELL)
6103 power_desc[num] = "¥×¥ì¥¤¥ä¡¼¤ò´¬¤¹þ¤àÈÏ°ÏËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6105 power_desc[num] = "allow involve player in area spell (now On)";
6112 power_desc[num] = "¥×¥ì¥¤¥ä¡¼¤ò´¬¤¹þ¤àÈÏ°ÏËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6114 power_desc[num] = "allow involve player in area spell (now Off)";
6118 powers[num++] = PET_BALL_SPELL;
6123 power_desc[num] = "¥Ú¥Ã¥È¤«¤é¹ß¤ê¤ë";
6125 power_desc[num] = "get off a pet";
6132 power_desc[num] = "¥Ú¥Ã¥È¤Ë¾è¤ë";
6134 power_desc[num] = "ride a pet";
6138 powers[num++] = PET_RIDING;
6141 power_desc[num] = "¥Ú¥Ã¥È¤Ë̾Á°¤ò¤Ä¤±¤ë¡£";
6143 power_desc[num] = "name pets";
6146 powers[num++] = PET_NAME;
6148 if (p_ptr->riding && buki_motteruka(INVEN_RARM) && (empty_hands(FALSE) & 0x00000001) && ((inventory[INVEN_RARM].weight > 99) || (inventory[INVEN_RARM].tval == TV_POLEARM)))
6150 if (p_ptr->pet_extra_flags & PF_RYOUTE)
6153 power_desc[num] = "Éð´ï¤òÊÒ¼ê¤Ç»ý¤Ä";
6155 power_desc[num] = "use one hand to control a riding pet";
6162 power_desc[num] = "Éð´ï¤òξ¼ê¤Ç»ý¤Ä";
6164 power_desc[num] = "use both hands for a weapon.";
6169 powers[num++] = PET_RYOUTE;
6172 /* Nothing chosen yet */
6175 /* Build a prompt (accept all spells) */
6178 /* Build a prompt (accept all spells) */
6180 strnfmt(out_val, 78, "(¥³¥Þ¥ó¥É %c-%c¡¢'*'=°ìÍ÷¡¢ESC=½ªÎ») ¥³¥Þ¥ó¥É¤òÁª¤ó¤Ç¤¯¤À¤µ¤¤:",
6182 strnfmt(out_val, 78, "(Command %c-%c, *=List, ESC=exit) Select a command: ",
6185 I2A(0), I2A(num - 1));
6190 strnfmt(out_val, 78, "(¥³¥Þ¥ó¥É %c-%c¡¢'*'=°ìÍ÷¡¢ESC=½ªÎ») ¥³¥Þ¥ó¥É¤òÁª¤ó¤Ç¤¯¤À¤µ¤¤:",
6192 strnfmt(out_val, 78, "(Command %c-%c, *=List, ESC=exit) Select a command: ",
6195 I2A(0), '0' + num - 27);
6201 /* Save the screen */
6208 prt(format("%s%c) %s", (ctr == mode) ? "*" : " ", I2A(ctr), power_desc[ctr]), y + ctr, x);
6214 prt("", y + ctr, x);
6221 /* Get a command from the user */
6222 while (!flag && get_com(out_val, &choice, TRUE))
6224 /* Request redraw */
6225 if ((choice == ' ') || (choice == '*') || (choice == '?'))
6237 /* Save the screen */
6244 sprintf(buf, "%s%c) %s", (ctr == mode) ? "*" : " ", I2A(ctr), power_desc[ctr]);
6245 prt(buf, y + ctr, x);
6251 prt("", y + ctr, x);
6265 /* Restore the screen */
6273 if (isalpha(choice))
6276 ask = (isupper(choice));
6279 if (ask) choice = tolower(choice);
6281 /* Extract request */
6282 i = (islower(choice) ? A2I(choice) : -1);
6286 ask = FALSE; /* Can't uppercase digits */
6288 i = choice - '0' + 26;
6291 /* Totally Illegal */
6292 if ((i < 0) || (i >= num))
6303 strnfmt(buf, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡© ", power_desc[i]);
6305 strnfmt(buf, 78, "Use %s? ", power_desc[i]);
6309 /* Belay that order */
6310 if (!get_check(buf)) continue;
6317 /* Restore the screen */
6318 if (redraw) Term_load();
6320 /* Abort if needed */
6329 case PET_DISMISS: /* Dismiss pets */
6334 msg_print("¥Ú¥Ã¥È¤¬¤¤¤Ê¤¤¡ª");
6336 msg_print("You have no pets!");
6340 do_cmd_pet_dismiss();
6341 (void)calculate_upkeep();
6346 project_length = -1;
6347 if (!target_set(TARGET_KILL)) pet_t_m_idx = 0;
6350 cave_type *c_ptr = &cave[target_row][target_col];
6351 if (c_ptr->m_idx && (m_list[c_ptr->m_idx].ml))
6353 pet_t_m_idx = cave[target_row][target_col].m_idx;
6354 p_ptr->pet_follow_distance = PET_DESTROY_DIST;
6356 else pet_t_m_idx = 0;
6363 case PET_STAY_CLOSE:
6365 p_ptr->pet_follow_distance = PET_CLOSE_DIST;
6372 p_ptr->pet_follow_distance = PET_FOLLOW_DIST;
6376 /* "Seek and destoy" */
6377 case PET_SEEK_AND_DESTROY:
6379 p_ptr->pet_follow_distance = PET_DESTROY_DIST;
6382 /* "Give me space" */
6383 case PET_ALLOW_SPACE:
6385 p_ptr->pet_follow_distance = PET_SPACE_DIST;
6391 p_ptr->pet_follow_distance = PET_AWAY_DIST;
6394 /* flag - allow pets to open doors */
6395 case PET_OPEN_DOORS:
6397 if (p_ptr->pet_extra_flags & PF_OPEN_DOORS) p_ptr->pet_extra_flags &= ~(PF_OPEN_DOORS);
6398 else p_ptr->pet_extra_flags |= (PF_OPEN_DOORS);
6401 /* flag - allow pets to pickup items */
6402 case PET_TAKE_ITEMS:
6404 if (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS)
6406 p_ptr->pet_extra_flags &= ~(PF_PICKUP_ITEMS);
6407 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
6409 /* Access the monster */
6410 m_ptr = &m_list[pet_ctr];
6414 monster_drop_carried_objects(m_ptr);
6418 else p_ptr->pet_extra_flags |= (PF_PICKUP_ITEMS);
6422 /* flag - allow pets to teleport */
6425 if (p_ptr->pet_extra_flags & PF_TELEPORT) p_ptr->pet_extra_flags &= ~(PF_TELEPORT);
6426 else p_ptr->pet_extra_flags |= (PF_TELEPORT);
6429 /* flag - allow pets to cast attack spell */
6430 case PET_ATTACK_SPELL:
6432 if (p_ptr->pet_extra_flags & PF_ATTACK_SPELL) p_ptr->pet_extra_flags &= ~(PF_ATTACK_SPELL);
6433 else p_ptr->pet_extra_flags |= (PF_ATTACK_SPELL);
6436 /* flag - allow pets to cast attack spell */
6437 case PET_SUMMON_SPELL:
6439 if (p_ptr->pet_extra_flags & PF_SUMMON_SPELL) p_ptr->pet_extra_flags &= ~(PF_SUMMON_SPELL);
6440 else p_ptr->pet_extra_flags |= (PF_SUMMON_SPELL);
6443 /* flag - allow pets to cast attack spell */
6444 case PET_BALL_SPELL:
6446 if (p_ptr->pet_extra_flags & PF_BALL_SPELL) p_ptr->pet_extra_flags &= ~(PF_BALL_SPELL);
6447 else p_ptr->pet_extra_flags |= (PF_BALL_SPELL);
6465 if (p_ptr->pet_extra_flags & PF_RYOUTE) p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
6466 else p_ptr->pet_extra_flags |= (PF_RYOUTE);
6467 p_ptr->update |= (PU_BONUS);