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 */
1375 (void)set_food(PY_FOOD_MAX - 1);
1377 case 4: /* Daylight */
1378 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1379 if ((prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
1382 msg_print("Æü¤Î¸÷¤¬¤¢¤Ê¤¿¤ÎÆùÂΤò¾Ç¤¬¤·¤¿¡ª");
1384 msg_print("The daylight scorches your flesh!");
1388 take_hit(DAMAGE_NOESCAPE, damroll(2, 2), "Æü¤Î¸÷", -1);
1390 take_hit(DAMAGE_NOESCAPE, damroll(2, 2), "daylight", -1);
1395 case 5: /* Animal Taming */
1396 if (!get_aim_dir(&dir)) return FALSE;
1398 (void)charm_animal(dir, plev);
1400 case 6: /* Resist Environment */
1401 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1402 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1403 (void)set_oppose_elec(randint1(20) + 20, FALSE);
1405 case 7: /* Cure Wounds & Poison */
1406 (void)hp_player(damroll(2, 8));
1408 (void)set_poisoned(0);
1410 case 8: /* Stone to Mud */
1411 if (!get_aim_dir(&dir)) return FALSE;
1413 (void)wall_to_mud(dir);
1415 case 9: /* Frost Bolt */
1416 if (!get_aim_dir(&dir)) return FALSE;
1417 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
1418 damroll(3 + ((plev - 5) / 4), 8));
1420 case 10: /* Nature Awareness -- downgraded */
1421 map_area(DETECT_RAD_MAP);
1422 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1423 (void)detect_doors(DETECT_RAD_DEFAULT);
1424 (void)detect_stairs(DETECT_RAD_DEFAULT);
1425 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1427 case 11: /* Fire Bolt */
1428 if (!get_aim_dir(&dir)) return FALSE;
1429 fire_bolt_or_beam(beam - 10, GF_FIRE, dir,
1430 damroll(5 + ((plev - 5) / 4), 8));
1432 case 12: /* Ray of Sunlight */
1433 if (!get_aim_dir(&dir)) return FALSE;
1435 msg_print("ÂÀÍÛ¸÷Àþ¤¬¸½¤ì¤¿¡£");
1437 msg_print("A line of sunlight appears.");
1440 (void)lite_line(dir);
1442 case 13: /* Entangle */
1445 case 14: /* Summon Animals */
1446 if (!(summon_specific(-1, py, px, plev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET))))
1449 case 15: /* Herbal Healing */
1450 (void)hp_player(500);
1453 (void)set_poisoned(0);
1455 case 16: /* Stair Building */
1456 (void)stair_creation();
1458 case 17: /* Stone Skin */
1459 (void)set_shield(randint1(20) + 30, FALSE);
1461 case 18: /* Resistance True */
1462 (void)set_oppose_acid(randint1(20) + 20, FALSE);
1463 (void)set_oppose_elec(randint1(20) + 20, FALSE);
1464 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1465 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1466 (void)set_oppose_pois(randint1(20) + 20, FALSE);
1468 case 19: /* Tree Creation */
1469 (void)tree_creation();
1471 case 20: /* Animal Friendship */
1472 (void)charm_animals(plev * 2);
1474 case 21: /* Stone Tell */
1475 return identify_fully(FALSE);
1476 case 22: /* Wall of Stone */
1479 case 23: /* Protection from Corrosion */
1481 case 24: /* Earthquake */
1482 earthquake(py, px, 10);
1484 case 25: /* Whirlwind Attack */
1488 monster_type *m_ptr;
1490 for (dir = 0; dir < 8; dir++)
1492 y = py + ddy_ddd[dir];
1493 x = px + ddx_ddd[dir];
1494 c_ptr = &cave[y][x];
1496 /* Get the monster */
1497 m_ptr = &m_list[c_ptr->m_idx];
1499 /* Hack -- attack monsters */
1500 if (c_ptr->m_idx && (m_ptr->ml || cave_floor_bold(y, x)))
1505 case 26: /* Blizzard */
1506 if (!get_aim_dir(&dir)) return FALSE;
1508 fire_ball(GF_COLD, dir, 70 + plev * 3 / 2, (plev / 12) + 1);
1510 case 27: /* Lightning Storm */
1511 if (!get_aim_dir(&dir)) return FALSE;
1512 fire_ball(GF_ELEC, dir, 90 + plev * 3 / 2, (plev / 12) + 1);
1514 case 28: /* Whirlpool */
1515 if (!get_aim_dir(&dir)) return FALSE;
1516 fire_ball(GF_WATER, dir, 100 + plev * 3 / 2, (plev / 12) + 1);
1518 case 29: /* Call Sunlight */
1519 fire_ball(GF_LITE, 0, 150, 8);
1520 chg_virtue(V_KNOWLEDGE, 1);
1521 chg_virtue(V_ENLIGHTEN, 1);
1522 wiz_lite(FALSE, FALSE);
1523 if ((prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
1526 msg_print("Æü¸÷¤¬¤¢¤Ê¤¿¤ÎÆùÂΤò¾Ç¤¬¤·¤¿¡ª");
1528 msg_print("The sunlight scorches your flesh!");
1532 take_hit(DAMAGE_NOESCAPE, 50, "Æü¸÷", -1);
1534 take_hit(DAMAGE_NOESCAPE, 50, "sunlight", -1);
1539 case 30: /* Elemental Branding */
1540 brand_weapon(randint0(2));
1542 case 31: /* Nature's Wrath */
1543 (void)dispel_monsters(plev * 4);
1544 earthquake(py, px, 20 + (plev / 2));
1545 project(0, 1 + plev / 12, py, px,
1546 (100 + plev) * 2, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM, -1);
1550 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥Í¥¤¥Á¥ã¡¼¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1552 msg_format("You cast an unknown Nature spell: %d.", spell);
1560 msg_print("ưʪ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
1562 msg_print("No animals arrive.");
1570 static bool cast_chaos_spell(int spell)
1573 int plev = p_ptr->lev;
1575 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1576 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1577 else beam = plev / 2;
1581 case 0: /* Magic Missile */
1582 if (!get_aim_dir(&dir)) return FALSE;
1584 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
1585 damroll(3 + ((plev - 1) / 5), 4));
1587 case 1: /* Trap / Door destruction */
1588 (void)destroy_doors_touch();
1590 case 2: /* Flash of Light == Light Area */
1591 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1593 case 3: /* Touch of Confusion */
1594 if (!(p_ptr->special_attack & ATTACK_CONFUSE))
1597 msg_print("¤¢¤Ê¤¿¤Î¼ê¤Ï¸÷¤ê»Ï¤á¤¿¡£");
1599 msg_print("Your hands start glowing.");
1602 p_ptr->special_attack |= ATTACK_CONFUSE;
1603 p_ptr->redraw |= (PR_STATUS);
1606 case 4: /* Mana Burst */
1607 if (!get_aim_dir(&dir)) return FALSE;
1609 fire_ball(GF_MISSILE, dir,
1610 (damroll(3, 5) + plev +
1611 (plev / (((p_ptr->pclass == CLASS_MAGE)
1612 || (p_ptr->pclass == CLASS_HIGH_MAGE)
1613 || (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
1614 ((plev < 30) ? 2 : 3));
1615 /* Shouldn't actually use GF_MANA, as it will destroy all
1616 * items on the floor */
1618 case 5: /* Fire Bolt */
1619 if (!get_aim_dir(&dir)) return FALSE;
1621 fire_bolt_or_beam(beam, GF_FIRE, dir,
1622 damroll(8 + ((plev - 5) / 4), 8));
1624 case 6: /* Fist of Force ("Fist of Fun") */
1625 if (!get_aim_dir(&dir)) return FALSE;
1627 fire_ball(GF_DISINTEGRATE, dir,
1628 damroll(8 + ((plev - 5) / 4), 8), 0);
1630 case 7: /* Teleport Self */
1631 teleport_player(plev * 5);
1633 case 8: /* Wonder */
1635 /* This spell should become more useful (more
1636 controlled) as the player gains experience levels.
1637 Thus, add 1/5 of the player's level to the die roll.
1638 This eliminates the worst effects later on, while
1639 keeping the results quite random. It also allows
1640 some potent effects only at high level. */
1642 int die = randint1(100) + plev / 5;
1643 int vir = virtue_number(V_CHANCE);
1646 if (p_ptr->virtues[vir - 1] > 0)
1648 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
1652 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
1657 chg_virtue(V_CHANCE, 1);
1659 if (!get_aim_dir(&dir)) return FALSE;
1662 msg_print("¤¢¤Ê¤¿¤ÏÎϤ¬¤ß¤Ê¤®¤ë¤Î¤ò´¶¤¸¤¿¡ª");
1664 msg_print("You feel a surge of power!");
1667 if (die < 8) clone_monster(dir);
1668 else if (die < 14) speed_monster(dir);
1669 else if (die < 26) heal_monster(dir, damroll(4, 6));
1670 else if (die < 31) poly_monster(dir);
1672 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
1673 damroll(3 + ((plev - 1) / 5), 4));
1674 else if (die < 41) confuse_monster(dir, plev);
1675 else if (die < 46) fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
1676 else if (die < 51) (void)lite_line(dir);
1678 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
1679 damroll(3 + ((plev - 5) / 4), 8));
1681 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
1682 damroll(5 + ((plev - 5) / 4), 8));
1684 fire_bolt_or_beam(beam, GF_ACID, dir,
1685 damroll(6 + ((plev - 5) / 4), 8));
1687 fire_bolt_or_beam(beam, GF_FIRE, dir,
1688 damroll(8 + ((plev - 5) / 4), 8));
1689 else if (die < 76) drain_life(dir, 75);
1690 else if (die < 81) fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
1691 else if (die < 86) fire_ball(GF_ACID, dir, 40 + plev, 2);
1692 else if (die < 91) fire_ball(GF_ICE, dir, 70 + plev, 3);
1693 else if (die < 96) fire_ball(GF_FIRE, dir, 80 + plev, 3);
1694 else if (die < 101) drain_life(dir, 100 + plev);
1697 earthquake(py, px, 12);
1701 destroy_area(py, px, 13+randint0(5), TRUE);
1705 symbol_genocide(plev+50, TRUE);
1707 else if (die < 110) dispel_monsters(120);
1710 dispel_monsters(150);
1718 case 9: /* Chaos Bolt */
1719 if (!get_aim_dir(&dir)) return FALSE;
1721 fire_bolt_or_beam(beam, GF_CHAOS, dir,
1722 damroll(10 + ((plev - 5) / 4), 8));
1724 case 10: /* Sonic Boom */
1726 msg_print("¥É¡¼¥ó¡ªÉô²°¤¬Íɤ줿¡ª");
1728 msg_print("BOOM! Shake the room!");
1731 project(0, plev / 10 + 2, py, px,
1732 (60 + plev), GF_SOUND, PROJECT_KILL | PROJECT_ITEM, -1);
1734 case 11: /* Doom Bolt -- always beam in 2.0.7 or later */
1735 if (!get_aim_dir(&dir)) return FALSE;
1737 fire_beam(GF_MANA, dir, damroll(11 + ((plev - 5) / 4), 8));
1739 case 12: /* Fire Ball */
1740 if (!get_aim_dir(&dir)) return FALSE;
1742 fire_ball(GF_FIRE, dir, plev + 55, 2);
1744 case 13: /* Teleport Other */
1745 if (!get_aim_dir(&dir)) return FALSE;
1747 (void)fire_beam(GF_AWAY_ALL, dir, plev);
1749 case 14: /* Word of Destruction */
1750 destroy_area(py, px, 13+randint0(5), TRUE);
1752 case 15: /* Invoke Logrus */
1753 if (!get_aim_dir(&dir)) return FALSE;
1755 fire_ball(GF_CHAOS, dir, plev*2 + 99, plev / 5);
1757 case 16: /* Polymorph Other */
1758 if (!get_aim_dir(&dir)) return FALSE;
1760 (void)poly_monster(dir);
1762 case 17: /* Chain Lightning */
1763 for (dir = 0; dir <= 9; dir++)
1764 fire_beam(GF_ELEC, dir, damroll(5 + (plev / 10), 8));
1766 case 18: /* Arcane Binding == Charging */
1767 return recharge(90);
1768 case 19: /* Disintegration */
1769 if (!get_aim_dir(&dir)) return FALSE;
1771 fire_ball(GF_DISINTEGRATE, dir, plev + 70, 3 + plev / 40);
1773 case 20: /* Alter Reality */
1776 case 21: /* Magic Rocket */
1777 if (!get_aim_dir(&dir)) return FALSE;
1780 msg_print("¥í¥±¥Ã¥Èȯ¼Í¡ª");
1782 msg_print("You launch a rocket!");
1785 fire_rocket(GF_ROCKET, dir, 120 + plev*2, 2);
1787 case 22: /* Chaos Branding */
1790 case 23: /* Summon monster, demon */
1793 bool pet = !one_in_(3);
1795 if (pet) mode |= PM_FORCE_PET;
1796 else mode |= PM_NO_PET;
1797 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
1799 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, SUMMON_DEMON, mode))
1802 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
1804 msg_print("The area fills with a stench of sulphur and brimstone.");
1810 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
1812 msg_print("'What is thy bidding... Master?'");
1817 msg_print("¡ÖÈܤ·¤¼Ô¤è¡¢²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª ¤ªÁ°¤Îº²¤òĺ¤¯¤¾¡ª¡×");
1819 msg_print("'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'");
1825 case 24: /* Beam of Gravity */
1826 if (!get_aim_dir(&dir)) return FALSE;
1828 fire_beam(GF_GRAVITY, dir, damroll(9 + ((plev - 5) / 4), 8));
1830 case 25: /* Meteor Swarm */
1833 int b = 10 + randint1(10);
1834 for (i = 0; i < b; i++)
1836 int count = 0, d = 0;
1841 if (count > 20) break;
1842 x = px - 8 + randint0(17);
1843 y = py - 8 + randint0(17);
1845 if (!in_bounds(y,x) || (!cave_floor_bold(y,x) && (cave[y][x].feat != FEAT_TREES)) || !player_has_los_bold(y, x)) continue;
1847 dx = (px > x) ? (px - x) : (x - px);
1848 dy = (py > y) ? (py - y) : (y - py);
1850 /* Approximate distance */
1851 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
1855 if (count > 20) continue;
1857 project(0, 2, y, x, plev * 2, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
1861 case 26: /* Flame Strike */
1862 fire_ball(GF_FIRE, 0, 300 + (3 * plev), 8);
1864 case 27: /* Call Chaos */
1867 case 28: /* Polymorph Self */
1869 if (!get_check("ÊѿȤ·¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©")) return FALSE;
1871 if (!get_check("You will polymorph yourself. Are you sure? ")) return FALSE;
1875 case 29: /* Mana Storm */
1876 if (!get_aim_dir(&dir)) return FALSE;
1878 fire_ball(GF_MANA, dir, 300 + (plev * 4), 4);
1880 case 30: /* Breathe Logrus */
1881 if (!get_aim_dir(&dir)) return FALSE;
1883 fire_ball(GF_CHAOS, dir, p_ptr->chp, 2);
1885 case 31: /* Call the Void */
1890 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥«¥ª¥¹¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1892 msg_format("You cast an unknown Chaos spell: %d.", spell);
1902 static bool cast_death_spell(int spell)
1906 int plev = p_ptr->lev;
1909 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1910 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1911 else beam = plev / 2;
1915 case 0: /* Detect Undead & Demons -> Unlife */
1916 (void)detect_monsters_nonliving(DETECT_RAD_DEFAULT);
1918 case 1: /* Malediction */
1919 if (!get_aim_dir(&dir)) return FALSE;
1920 /* A radius-0 ball may (1) be aimed at objects etc.,
1921 * and will affect them; (2) may be aimed at ANY
1922 * visible monster, unlike a 'bolt' which must travel
1923 * to the monster. */
1925 fire_ball(GF_HELL_FIRE, dir,
1926 damroll(3 + ((plev - 1) / 5), 4), 0);
1929 { /* Special effect first */
1930 dummy = randint1(1000);
1932 fire_ball_hide(GF_DEATH_RAY, dir, plev * 200, 0);
1933 else if (dummy < 500)
1934 fire_ball_hide(GF_TURN_ALL, dir, plev, 0);
1935 else if (dummy < 800)
1936 fire_ball_hide(GF_OLD_CONF, dir, plev, 0);
1938 fire_ball_hide(GF_STUN, dir, plev, 0);
1941 case 2: /* Detect Evil */
1942 (void)detect_monsters_evil(DETECT_RAD_DEFAULT);
1944 case 3: /* Stinking Cloud */
1945 if (!get_aim_dir(&dir)) return FALSE;
1947 fire_ball(GF_POIS, dir, 10 + (plev / 2), 2);
1949 case 4: /* Black Sleep */
1950 if (!get_aim_dir(&dir)) return FALSE;
1952 (void)sleep_monster(dir);
1954 case 5: /* Resist Poison */
1955 (void)set_oppose_pois(randint1(20) + 20, FALSE);
1957 case 6: /* Horrify */
1958 if (!get_aim_dir(&dir)) return FALSE;
1960 (void)fear_monster(dir, plev);
1961 (void)stun_monster(dir, plev);
1963 case 7: /* Enslave Undead */
1964 if (!get_aim_dir(&dir)) return FALSE;
1966 (void)control_one_undead(dir, plev);
1968 case 8: /* Orb of Entropy */
1969 if (!get_aim_dir(&dir)) return FALSE;
1971 fire_ball(GF_OLD_DRAIN, dir,
1972 (damroll(3, 6) + plev +
1973 (plev / (((p_ptr->pclass == CLASS_MAGE) ||
1974 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
1975 (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
1976 ((plev < 30) ? 2 : 3));
1978 case 9: /* Nether Bolt */
1979 if (!get_aim_dir(&dir)) return FALSE;
1981 fire_bolt_or_beam(beam, GF_NETHER, dir,
1982 damroll(8 + ((plev - 5) / 4), 8));
1984 case 10: /* Cloud kill */
1985 project(0, plev / 10 + 2, py, px,
1986 (30 + plev) * 2, GF_POIS, PROJECT_KILL | PROJECT_ITEM, -1);
1988 case 11: /* Genocide One */
1989 if (!get_aim_dir(&dir)) return FALSE;
1991 fire_ball_hide(GF_GENOCIDE, dir, plev + 50, 0);
1993 case 12: /* Poison Branding */
1996 case 13: /* Vampiric Drain */
1997 if (!get_aim_dir(&dir)) return FALSE;
1999 dummy = plev * 2 + randint1(plev * 2); /* Dmg */
2000 if (drain_life(dir, dummy))
2002 chg_virtue(V_SACRIFICE, -1);
2003 chg_virtue(V_VITALITY, -1);
2005 (void)hp_player(dummy);
2006 /* Gain nutritional sustenance: 150/hp drained */
2007 /* A Food ration gives 5000 food points (by contrast) */
2008 /* Don't ever get more than "Full" this way */
2009 /* But if we ARE Gorged, it won't cure us */
2010 dummy = p_ptr->food + MIN(5000, 100 * dummy);
2011 if (p_ptr->food < PY_FOOD_MAX) /* Not gorged already */
2012 (void)set_food(dummy >= PY_FOOD_MAX ? PY_FOOD_MAX - 1 : dummy);
2015 case 14: /* Animate Dead */
2016 animate_dead(0, py, px);
2018 case 15: /* Genocide */
2019 (void)symbol_genocide(plev+50, TRUE);
2021 case 16: /* Berserk */
2022 (void)set_shero(randint1(25) + 25, FALSE);
2023 (void)hp_player(30);
2024 (void)set_afraid(0);
2026 case 17: /* Invoke Spirits */
2028 int die = randint1(100) + plev / 5;
2029 int vir = virtue_number(V_CHANCE);
2032 if (p_ptr->virtues[vir - 1] > 0)
2034 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
2038 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
2042 if (!get_aim_dir(&dir)) return FALSE;
2045 msg_print("¤¢¤Ê¤¿¤Ï»à¼Ô¤¿¤Á¤ÎÎϤò¾·½¸¤·¤¿...");
2047 msg_print("You call on the power of the dead...");
2050 chg_virtue(V_CHANCE, 1);
2054 msg_print("¤¢¤Ê¤¿¤Ï¤ª¤É¤í¤ª¤É¤í¤·¤¤ÎϤΤ¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
2056 msg_print("You feel a surge of eldritch force!");
2063 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¤¢¤Ê¤¿¤Î¼þ¤ê¤ÎÃÏÌ̤«¤éµà¤Á¤¿¿Í±Æ¤¬Î©¤Á¾å¤¬¤Ã¤Æ¤¤¿¡ª");
2065 msg_print("Oh no! Mouldering forms rise from the earth around you!");
2068 (void)summon_specific(0, py, px, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
2069 chg_virtue(V_UNLIFE, 1);
2074 msg_print("̾¾õ¤·Æñ¤¤¼Ù°¤Ê¸ºß¤¬¤¢¤Ê¤¿¤Î¿´¤òÄ̤ê²á¤®¤Æ¹Ô¤Ã¤¿...");
2076 msg_print("An unnamable evil brushes against your mind...");
2079 set_afraid(p_ptr->afraid + randint1(4) + 4);
2084 msg_print("¤¢¤Ê¤¿¤ÎƬ¤ËÂçÎ̤ÎÍ©Î¤Á¤ÎÁû¡¹¤·¤¤À¼¤¬²¡¤·´ó¤»¤Æ¤¤¿...");
2086 msg_print("Your head is invaded by a horde of gibbering spectral voices...");
2089 set_confused(p_ptr->confused + randint1(4) + 4);
2097 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
2098 damroll(3 + ((plev - 1) / 5), 4));
2102 confuse_monster (dir, plev);
2106 fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
2110 (void)lite_line(dir);
2114 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
2115 damroll(3+((plev-5)/4),8));
2119 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
2120 damroll(5+((plev-5)/4),8));
2124 fire_bolt_or_beam(beam, GF_ACID, dir,
2125 damroll(6+((plev-5)/4),8));
2129 fire_bolt_or_beam(beam, GF_FIRE, dir,
2130 damroll(8+((plev-5)/4),8));
2134 drain_life(dir, 75);
2138 fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
2142 fire_ball(GF_ACID, dir, 40 + plev, 2);
2146 fire_ball(GF_ICE, dir, 70 + plev, 3);
2150 fire_ball(GF_FIRE, dir, 80 + plev, 3);
2154 drain_life(dir, 100 + plev);
2158 earthquake(py, px, 12);
2162 destroy_area(py, px, 13+randint0(5), TRUE);
2166 symbol_genocide(plev+50, TRUE);
2170 dispel_monsters(120);
2174 dispel_monsters(150);
2182 msg_print("±¢±µ¤ÊÀ¼¤¬¥¯¥¹¥¯¥¹¾Ð¤¦¡£¡Ö¤â¤¦¤¹¤°¤ª¤Þ¤¨¤Ï²æ¡¹¤ÎÃç´Ö¤Ë¤Ê¤ë¤À¤í¤¦¡£¼å¤¼Ô¤è¡£¡×");
2184 msg_print("Sepulchral voices chuckle. 'Soon you will join us, mortal.'");
2189 case 18: /* Dark Bolt */
2190 if (!get_aim_dir(&dir)) return FALSE;
2192 fire_bolt_or_beam(beam, GF_DARK, dir,
2193 damroll(4 + ((plev - 5) / 4), 8));
2195 case 19: /* Battle Frenzy */
2196 (void)set_shero(randint1(25) + 25, FALSE);
2197 (void)hp_player(30);
2198 (void)set_afraid(0);
2199 (void)set_fast(randint1(20 + (plev / 2)) + (plev / 2), FALSE);
2201 case 20: /* Vampiric Branding */
2204 case 21: /* Vampirism True */
2205 if (!get_aim_dir(&dir)) return FALSE;
2207 chg_virtue(V_SACRIFICE, -1);
2208 chg_virtue(V_VITALITY, -1);
2210 for (dummy = 0; dummy < 3; dummy++)
2212 if (drain_life(dir, 100))
2216 case 22: /* Word of Death */
2217 (void)dispel_living(randint1(plev * 3));
2219 case 23: /* Darkness Storm */
2220 if (!get_aim_dir(&dir)) return FALSE;
2222 fire_ball(GF_DARK, dir, 100+plev*2, 4);
2224 case 24: /* Death Ray */
2225 if (!get_aim_dir(&dir)) return FALSE;
2227 (void)death_ray(dir, plev);
2229 case 25: /* Raise the Dead */
2232 bool pet = one_in_(3);
2235 type = (plev > 47 ? SUMMON_HI_UNDEAD : SUMMON_UNDEAD);
2237 if (!pet || (pet && (plev > 24) && one_in_(3)))
2238 mode |= PM_ALLOW_GROUP;
2240 if (pet) mode |= PM_FORCE_PET;
2241 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
2243 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, type, mode))
2246 msg_print("Î䤿¤¤É÷¤¬¤¢¤Ê¤¿¤Î¼þ¤ê¤Ë¿á¤»Ï¤á¤¿¡£¤½¤ì¤ÏÉåÇÔ½¤ò±¿¤ó¤Ç¤¤¤ë...");
2248 msg_print("Cold winds begin to blow around you, carrying with them the stench of decay...");
2254 msg_print("¸Å¤¨¤Î»à¤»¤ë¼Ô¶¦¤¬¤¢¤Ê¤¿¤Ë»Å¤¨¤ë¤¿¤áÅÚ¤«¤éᴤä¿¡ª");
2256 msg_print("Ancient, long-dead forms arise from the ground to serve you!");
2261 msg_print("»à¼Ô¤¬á´¤Ã¤¿¡£Ì²¤ê¤ò˸¤²¤ë¤¢¤Ê¤¿¤òȳ¤¹¤ë¤¿¤á¤Ë¡ª");
2263 msg_print("'The dead arise... to punish you for disturbing them!'");
2266 chg_virtue(V_UNLIFE, 1);
2271 case 26: /* Esoteria */
2272 if (randint1(50) > plev)
2273 return ident_spell(FALSE);
2275 return identify_fully(FALSE);
2277 case 27: /* Mimic vampire */
2278 (void)set_mimic(10+plev/2 + randint1(10+plev/2), MIMIC_VAMPIRE, FALSE);
2280 case 28: /* Restore Life */
2281 (void)restore_level();
2283 case 29: /* Mass Genocide */
2284 (void)mass_genocide(plev+50, TRUE);
2286 case 30: /* Hellfire */
2287 if (!get_aim_dir(&dir)) return FALSE;
2289 fire_ball(GF_HELL_FIRE, dir, 666, 3);
2291 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "ÃϹö¤Î¹å²Ð¤Î¼öʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
2293 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "the strain of casting Hellfire", -1);
2297 case 31: /* Wraithform */
2298 set_wraith_form(randint1(plev / 2) + (plev / 2), FALSE);
2301 msg_format("You cast an unknown Death spell: %d.", spell);
2309 static bool cast_trump_spell(int spell, bool success)
2313 int plev = p_ptr->lev;
2314 int summon_lev = plev * 2 / 3 + randint1(plev/2);
2316 bool no_trump = FALSE;
2317 bool unique_okay = FALSE;
2320 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
2321 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
2322 else beam = plev / 2;
2324 if (summon_lev < 1) summon_lev = 1;
2325 if (!success || (randint1(50+plev) < plev/10)) unique_okay = TRUE;
2328 case 0: /* Phase Door */
2331 teleport_player(10);
2334 case 1: /* Trump Spiders */
2336 bool pet = success; /* (randint1(5) > 2) */
2337 u32b mode = PM_ALLOW_GROUP;
2339 if (pet) mode |= PM_FORCE_PET;
2340 else mode |= PM_NO_PET;
2343 msg_print("¤¢¤Ê¤¿¤ÏÃØéá¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2345 msg_print("You concentrate on the trump of an spider...");
2348 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_SPIDER, mode))
2352 msg_print("¾¤´Ô¤µ¤ì¤¿ÃØéá¤ÏÅܤäƤ¤¤ë¡ª");
2354 msg_print("The summoned spiders get angry!");
2364 case 2: /* Shuffle */
2367 /* A limited power 'wonder' spell */
2368 int die = randint1(120);
2369 int vir = virtue_number(V_CHANCE);
2371 if ((p_ptr->pclass == CLASS_ROGUE) ||
2372 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
2373 (p_ptr->pclass == CLASS_SORCERER))
2374 die = (randint1(110)) + plev / 5;
2375 /* Card sharks and high mages get a level bonus */
2379 if (p_ptr->virtues[vir - 1] > 0)
2381 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
2385 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
2390 msg_print("¤¢¤Ê¤¿¤Ï¥«¡¼¥É¤òÀڤäưìËç°ú¤¤¤¿...");
2392 msg_print("You shuffle the deck and draw a card...");
2396 chg_virtue(V_CHANCE, 1);
2401 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡Ô»à¡Õ¤À¡ª");
2403 msg_print("Oh no! It's Death!");
2406 for (dummy = 0; dummy < randint1(3); dummy++)
2407 (void)activate_hi_summon(py, px, FALSE);
2412 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡Ô°Ëâ¡Õ¤À¡ª");
2414 msg_print("Oh no! It's the Devil!");
2417 (void)summon_specific(0, py, px, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
2423 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡ÔÄߤé¤ì¤¿ÃË¡Õ¤À¡ª");
2425 msg_print("Oh no! It's the Hanged Man.");
2428 (void)activate_ty_curse(FALSE, &count);
2433 msg_print("¡ÔÉÔĴϤηõ¡Õ¤À¡£");
2435 msg_print("It's the swords of discord.");
2438 aggravate_monsters(0);
2443 msg_print("¡Ô¶ò¼Ô¡Õ¤À¡£");
2445 msg_print("It's the Fool.");
2448 (void)do_dec_stat(A_INT);
2449 (void)do_dec_stat(A_WIS);
2454 msg_print("´ñ̯¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2456 msg_print("It's the picture of a strange monster.");
2459 if (!(summon_specific(0, py, px, (dun_level * 3) / 2, 32 + randint1(6), (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET))))
2465 msg_print("¡Ô·î¡Õ¤À¡£");
2467 msg_print("It's the Moon.");
2475 msg_print("¡Ô±¿Ì¿¤ÎÎØ¡Õ¤À¡£");
2477 msg_print("It's the Wheel of Fortune.");
2480 wild_magic(randint0(32));
2485 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2487 msg_print("It's a teleport trump card.");
2490 teleport_player(10);
2495 msg_print("¡ÔÀµµÁ¡Õ¤À¡£");
2497 msg_print("It's Justice.");
2500 set_blessed(p_ptr->lev, FALSE);
2505 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2507 msg_print("It's a teleport trump card.");
2510 teleport_player(100);
2515 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2517 msg_print("It's a teleport trump card.");
2520 teleport_player(200);
2525 msg_print("¡ÔÅã¡Õ¤À¡£");
2527 msg_print("It's the Tower.");
2535 msg_print("¡ÔÀáÀ©¡Õ¤À¡£");
2537 msg_print("It's Temperance.");
2540 sleep_monsters_touch();
2545 msg_print("¡ÔÅã¡Õ¤À¡£");
2547 msg_print("It's the Tower.");
2550 earthquake(py, px, 5);
2555 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2557 msg_print("It's the picture of a friendly monster.");
2560 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE1, PM_FORCE_PET)))
2566 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2568 msg_print("It's the picture of a friendly monster.");
2571 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE2, PM_FORCE_PET)))
2577 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2579 msg_print("It's the picture of a friendly monster.");
2582 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE4, PM_FORCE_PET)))
2588 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2590 msg_print("It's the picture of a friendly monster.");
2593 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE5, PM_FORCE_PET)))
2599 msg_print("¡ÔÎø¿Í¡Õ¤À¡£");
2601 msg_print("It's the Lovers.");
2604 if (get_aim_dir(&dir))
2605 (void)charm_monster(dir, MIN(p_ptr->lev, 20));
2610 msg_print("¡Ô±£¼Ô¡Õ¤À¡£");
2612 msg_print("It's the Hermit.");
2620 msg_print("¡Ô¿³È½¡Õ¤À¡£");
2622 msg_print("It's the Judgement.");
2625 do_cmd_rerate(FALSE);
2626 if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3)
2629 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
2631 msg_print("You are cured of all mutations.");
2634 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
2635 p_ptr->update |= PU_BONUS;
2642 msg_print("¡ÔÂÀÍÛ¡Õ¤À¡£");
2644 msg_print("It's the Sun.");
2647 chg_virtue(V_KNOWLEDGE, 1);
2648 chg_virtue(V_ENLIGHTEN, 1);
2649 wiz_lite(FALSE, FALSE);
2654 msg_print("¡ÔÀ¤³¦¡Õ¤À¡£");
2656 msg_print("It's the World.");
2659 if (p_ptr->exp < PY_MAX_EXP)
2661 s32b ee = (p_ptr->exp / 25) + 1;
2662 if (ee > 5000) ee = 5000;
2664 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
2666 msg_print("You feel more experienced.");
2674 case 3: /* Reset Recall */
2677 if (!reset_recall()) return FALSE;
2680 case 4: /* Teleport Self */
2683 teleport_player(plev * 4);
2686 case 5: /* Trump Spying */
2689 (void)set_tim_esp(randint1(30) + 25, FALSE);
2692 case 6: /* Teleport Away */
2695 if (!get_aim_dir(&dir)) return FALSE;
2696 (void)fire_beam(GF_AWAY_ALL, dir, plev);
2699 case 7: /* Trump Animals */
2701 bool pet = success; /* was (randint1(5) > 2) */
2702 int type = (pet ? SUMMON_ANIMAL_RANGER : SUMMON_ANIMAL);
2705 if (pet) mode |= PM_FORCE_PET;
2706 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2709 msg_print("¤¢¤Ê¤¿¤Ïưʪ¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2711 msg_print("You concentrate on the trump of an animal...");
2715 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
2719 msg_print("¾¤´¤µ¤ì¤¿Æ°Êª¤ÏÅܤäƤ¤¤ë¡ª");
2721 msg_print("The summoned animal gets angry!");
2732 case 8: /* Trump Reach */
2735 if (!get_aim_dir(&dir)) return FALSE;
2736 fetch(dir, plev * 15, TRUE);
2739 case 9: /* Trump Kamikaze */
2744 if (!target_set(TARGET_KILL)) return FALSE;
2751 msg_print("¤¢¤Ê¤¿¤Ï¥«¥ß¥«¥¼¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2753 msg_print("You concentrate on several trumps at once...");
2757 for (dummy = 2 + randint0(plev / 7); dummy > 0; dummy--)
2759 bool pet = success; /* was (randint1(10) > 3) */
2763 if (pet) mode |= PM_FORCE_PET;
2764 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2766 if (p_ptr->pclass == CLASS_BEASTMASTER)
2768 type = SUMMON_KAMIKAZE_LIVING;
2772 type = SUMMON_KAMIKAZE;
2775 if (summon_specific((pet ? -1 : 0), y, x, summon_lev, type, mode))
2779 msg_print("¾¤´Ô¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
2781 msg_print("The summoned creatures get angry!");
2789 case 10: /* Phantasmal Servant */
2792 if (summon_specific(-1, py, px, (summon_lev * 3) / 2, SUMMON_PHANTOM, PM_FORCE_PET))
2795 msg_print("¸æÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¸æ¼ç¿ÍÍÍ¡©");
2797 msg_print("'Your wish, master?'");
2807 case 11: /* Speed Monster */
2810 bool old_target_pet = target_pet;
2812 if (!get_aim_dir(&dir))
2814 target_pet = old_target_pet;
2817 target_pet = old_target_pet;
2818 (void)speed_monster(dir);
2821 case 12: /* Teleport Level */
2825 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
2827 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
2829 (void)teleport_player_level();
2832 case 13: /* Dimension Door */
2836 msg_print("¼¡¸µ¤ÎÈ⤬³«¤¤¤¿¡£ÌÜŪÃϤòÁª¤ó¤Ç²¼¤µ¤¤¡£");
2838 msg_print("You open a dimensional gate. Choose a destination.");
2841 return dimension_door();
2844 case 14: /* Word of Recall */
2847 if (!word_of_recall()) return FALSE;
2850 case 15: /* Banish */
2853 banish_monsters(plev * 4);
2856 case 16: /* Swap Position */
2860 project_length = -1;
2861 if (!get_aim_dir(&dir))
2868 (void)teleport_swap(dir);
2872 case 17: /* Trump Undead */
2874 bool pet = success; /* (randint1(10) > 3) */
2877 if (pet) mode |= PM_FORCE_PET;
2878 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2881 msg_print("¤¢¤Ê¤¿¤Ï¥¢¥ó¥Ç¥Ã¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2883 msg_print("You concentrate on the trump of an undead creature...");
2887 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_UNDEAD, mode))
2891 msg_print("¾¤´Ô¤µ¤ì¤¿¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
2893 msg_print("The summoned undead creature gets angry!");
2904 case 18: /* Trump Reptiles */
2906 bool pet = success; /* was (randint1(5) > 2) */
2909 if (pet) mode |= PM_FORCE_PET;
2910 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2913 msg_print("¤¢¤Ê¤¿¤Ïà¨ÃîÎà¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2915 msg_print("You concentrate on the trump of a reptile...");
2919 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HYDRA, mode))
2923 msg_print("¾¤´Ô¤µ¤ì¤¿à¨ÃîÎà¤ÏÅܤäƤ¤¤ë¡ª");
2925 msg_print("The summoned reptile gets angry!");
2936 case 19: /* Trump Monsters */
2941 msg_print("¤¢¤Ê¤¿¤Ï¥â¥ó¥¹¥¿¡¼¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2943 msg_print("You concentrate on several trumps at once...");
2947 for (dummy = 0; dummy < 1 + ((plev - 15)/ 10); dummy++)
2949 bool pet = success; /* was (randint1(10) > 3) */
2953 if (pet) mode |= PM_FORCE_PET;
2954 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2956 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
2958 if (p_ptr->pclass == CLASS_BEASTMASTER)
2960 type = SUMMON_LIVING;
2967 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
2971 msg_print("¾¤´Ô¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
2973 msg_print("The summoned creatures get angry!");
2981 case 20: /* Trump Hounds */
2983 bool pet = success; /* was (randint1(5) > 2) */
2984 u32b mode = PM_ALLOW_GROUP;
2986 if (pet) mode |= PM_FORCE_PET;
2987 else mode |= PM_NO_PET;
2990 msg_print("¤¢¤Ê¤¿¤Ï¥Ï¥¦¥ó¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2992 msg_print("You concentrate on the trump of a hound...");
2996 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HOUND, mode))
3000 msg_print("¾¤´Ô¤µ¤ì¤¿¥Ï¥¦¥ó¥É¤ÏÅܤäƤ¤¤ë¡ª");
3002 msg_print("The summoned hounds get angry!");
3013 case 21: /* Trump Branding */
3019 case 22: /* Living Trump */
3023 /* Teleport control */
3026 /* Random teleportation (uncontrolled) */
3028 /* Gain the mutation */
3029 if (gain_random_mutation(dummy))
3031 msg_print("¤¢¤Ê¤¿¤ÏÀ¸¤¤Æ¤¤¤ë¥«¡¼¥É¤ËÊѤï¤Ã¤¿¡£");
3033 msg_print("You have turned into a Living Trump.");
3038 case 23: /* Trump Cyberdemon */
3040 bool pet = success; /* was (randint1(10) > 3) */
3043 if (pet) mode |= PM_FORCE_PET;
3044 else mode |= PM_NO_PET;
3047 msg_print("¤¢¤Ê¤¿¤Ï¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3049 msg_print("You concentrate on the trump of a Cyberdemon...");
3053 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_CYBER, mode))
3057 msg_print("¾¤´Ô¤µ¤ì¤¿¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3059 msg_print("The summoned Cyberdemon gets angry!");
3070 case 24: /* Trump Divination */
3073 (void)detect_all(DETECT_RAD_DEFAULT);
3076 case 25: /* Trump Lore */
3079 return identify_fully(FALSE);
3082 case 26: /* Heal Monster */
3085 bool old_target_pet = target_pet;
3087 if (!get_aim_dir(&dir))
3089 target_pet = old_target_pet;
3092 target_pet = old_target_pet;
3094 (void)heal_monster(dir, p_ptr->lev * 10 + 200);
3097 case 27: /* Trump Dragon */
3099 bool pet = success; /* was (randint1(10) > 3) */
3102 if (pet) mode |= PM_FORCE_PET;
3103 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3106 msg_print("¤¢¤Ê¤¿¤Ï¥É¥é¥´¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3108 msg_print("You concentrate on the trump of a dragon...");
3112 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DRAGON, mode))
3116 msg_print("¾¤´Ô¤µ¤ì¤¿¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3118 msg_print("The summoned dragon gets angry!");
3129 case 28: /* Trump Meteor */
3132 int x, y, dx, dy, i;
3133 int b = 10 + randint1(10);
3134 for (i = 0; i < b; i++)
3136 int count = 0, d = 0;
3141 if (count > 20) break;
3142 x = px - 8 + randint0(17);
3143 y = py - 8 + randint0(17);
3145 if (!in_bounds(y,x) || (!cave_floor_bold(y,x) && (cave[y][x].feat != FEAT_TREES)) || !player_has_los_bold(y, x)) continue;
3147 dx = (px > x) ? (px - x) : (x - px);
3148 dy = (py > y) ? (py - y) : (y - py);
3150 /* Approximate distance */
3151 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
3155 if (count > 20) continue;
3157 project(0, 2, y, x, plev * 2, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
3161 case 29: /* Trump Demon */
3163 bool pet = success; /* was (randint1(10) > 3) */
3166 if (pet) mode |= PM_FORCE_PET;
3167 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3170 msg_print("¤¢¤Ê¤¿¤Ï¥Ç¡¼¥â¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3172 msg_print("You concentrate on the trump of a demon...");
3176 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DEMON, mode))
3180 msg_print("¾¤´Ô¤µ¤ì¤¿¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3182 msg_print("The summoned demon gets angry!");
3193 case 30: /* Trump Greater Undead */
3195 bool pet = success; /* was (randint1(10) > 3) */
3198 if (pet) mode |= PM_FORCE_PET;
3199 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3201 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
3204 msg_print("¤¢¤Ê¤¿¤Ï¶¯ÎϤʥ¢¥ó¥Ç¥Ã¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3206 msg_print("You concentrate on the trump of a greater undead being...");
3210 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HI_UNDEAD, mode))
3214 msg_print("¾¤´Ô¤µ¤ì¤¿¾åµé¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
3216 msg_print("The summoned greater undead creature gets angry!");
3227 case 31: /* Trump Ancient Dragon */
3229 bool pet = success; /* was (randint1(10) > 3) */
3233 if (pet) mode |= PM_FORCE_PET;
3234 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3236 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
3238 if (p_ptr->pclass == CLASS_BEASTMASTER)
3240 type = SUMMON_HI_DRAGON_LIVING;
3244 type = SUMMON_HI_DRAGON;
3248 msg_print("¤¢¤Ê¤¿¤Ï¸ÅÂå¥É¥é¥´¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3250 msg_print("You concentrate on the trump of an ancient dragon...");
3254 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
3258 msg_print("¾¤´Ô¤µ¤ì¤¿¸ÅÂå¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3260 msg_print("The summoned ancient dragon gets angry!");
3273 msg_format("̤ÃΤΥ«¡¼¥É¤Î¼öʸ¤Ç¤¹: %d", spell);
3275 msg_format("You cast an unknown Trump spell: %d.", spell);
3284 msg_print("ï¤â¤¢¤Ê¤¿¤Î¥«¡¼¥É¤Î¸Æ¤ÓÀ¼¤ËÅú¤¨¤Ê¤¤¡£");
3286 msg_print("Nobody answers to your Trump call.");
3295 static bool cast_arcane_spell(int spell)
3299 int plev = p_ptr->lev;
3301 bool no_trump = FALSE;
3303 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3304 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3305 else beam = plev / 2;
3310 if (!get_aim_dir(&dir)) return FALSE;
3312 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
3313 damroll(3 + ((plev - 1) / 5), 3));
3315 case 1: /* Wizard Lock */
3316 if (!get_aim_dir(&dir)) return FALSE;
3318 (void)wizard_lock(dir);
3320 case 2: /* Detect Invisibility */
3321 (void)detect_monsters_invis(DETECT_RAD_DEFAULT);
3323 case 3: /* Detect Monsters */
3324 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
3327 teleport_player(10);
3329 case 5: /* Light Area */
3330 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
3332 case 6: /* Trap & Door Destruction */
3333 if (!get_aim_dir(&dir)) return FALSE;
3335 (void)destroy_door(dir);
3337 case 7: /* Cure Light Wounds */
3338 (void)hp_player(damroll(2, 8));
3339 (void)set_cut(p_ptr->cut - 10);
3341 case 8: /* Detect Doors & Traps */
3342 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
3343 (void)detect_doors(DETECT_RAD_DEFAULT);
3344 (void)detect_stairs(DETECT_RAD_DEFAULT);
3346 case 9: /* Phlogiston */
3349 case 10: /* Detect Treasure */
3350 (void)detect_treasure(DETECT_RAD_DEFAULT);
3351 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
3353 case 11: /* Detect Enchantment */
3354 (void)detect_objects_magic(DETECT_RAD_DEFAULT);
3356 case 12: /* Detect Objects */
3357 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
3359 case 13: /* Cure Poison */
3360 (void)set_poisoned(0);
3362 case 14: /* Resist Cold */
3363 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3365 case 15: /* Resist Fire */
3366 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3368 case 16: /* Resist Lightning */
3369 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3371 case 17: /* Resist Acid */
3372 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3374 case 18: /* Cure Medium Wounds */
3375 (void)hp_player(damroll(4, 8));
3376 (void)set_cut((p_ptr->cut / 2) - 50);
3378 case 19: /* Teleport */
3379 teleport_player(plev * 5);
3381 case 20: /* Identify */
3382 return ident_spell(FALSE);
3383 case 21: /* Stone to Mud */
3384 if (!get_aim_dir(&dir)) return FALSE;
3386 (void)wall_to_mud(dir);
3388 case 22: /* Ray of Light */
3389 if (!get_aim_dir(&dir)) return FALSE;
3392 msg_print("¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
3394 msg_print("A line of light appears.");
3397 (void)lite_line(dir);
3399 case 23: /* Satisfy Hunger */
3400 (void)set_food(PY_FOOD_MAX - 1);
3402 case 24: /* See Invisible */
3403 (void)set_tim_invis(randint1(24) + 24, FALSE);
3405 case 25: /* Conjure Elemental */
3406 if (!summon_specific(-1, py, px, plev, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3409 case 26: /* Teleport Level */
3411 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
3413 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
3415 (void)teleport_player_level();
3417 case 27: /* Teleport Away */
3418 if (!get_aim_dir(&dir)) return FALSE;
3420 (void)fire_beam(GF_AWAY_ALL, dir, plev);
3422 case 28: /* Elemental Ball */
3423 if (!get_aim_dir(&dir)) return FALSE;
3425 switch (randint1(4))
3427 case 1: dummy = GF_FIRE;break;
3428 case 2: dummy = GF_ELEC;break;
3429 case 3: dummy = GF_COLD;break;
3430 default: dummy = GF_ACID;break;
3432 fire_ball(dummy, dir, 75 + (plev), 2);
3434 case 29: /* Detection */
3435 (void)detect_all(DETECT_RAD_DEFAULT);
3437 case 30: /* Word of Recall */
3438 if (!word_of_recall()) return FALSE;
3440 case 31: /* Clairvoyance */
3441 chg_virtue(V_KNOWLEDGE, 1);
3442 chg_virtue(V_ENLIGHTEN, 1);
3443 wiz_lite(FALSE, FALSE);
3444 if (!p_ptr->telepathy)
3446 (void)set_tim_esp(randint1(30) + 25, FALSE);
3450 msg_format("You cast an unknown Arcane spell: %d.", spell);
3456 msg_print("¥¨¥ì¥á¥ó¥¿¥ë¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3458 msg_print("No Elementals arrive.");
3465 static bool cast_enchant_spell(int spell)
3467 int plev = p_ptr->lev;
3469 bool no_trump = FALSE;
3473 case 0: /* Infravision */
3474 set_tim_infra(100 + randint1(100), FALSE);
3476 case 1: /* Regeneration */
3477 set_tim_regen(80 + randint1(80), FALSE);
3479 case 2: /* Satisfy Hunger */
3480 (void)set_food(PY_FOOD_MAX - 1);
3482 case 3: /* Resist Cold */
3483 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3485 case 4: /* Resist Fire */
3486 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3488 case 5: /* Heroism */
3489 (void)set_hero(randint1(25) + 25, FALSE);
3490 (void)hp_player(10);
3491 (void)set_afraid(0);
3493 case 6: /* Resist Lightning */
3494 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3496 case 7: /* Resist Acid */
3497 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3499 case 8: /* See Invisibility */
3500 (void)set_tim_invis(randint1(24) + 24, FALSE);
3502 case 9: /* Remove Curse */
3506 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
3508 msg_print("You feel as if someone is watching over you.");
3512 case 10: /* Resist Poison */
3513 (void)set_oppose_pois(randint1(20) + 20, FALSE);
3515 case 11: /* Berserk */
3516 (void)set_shero(randint1(25) + 25, FALSE);
3517 (void)hp_player(30);
3518 (void)set_afraid(0);
3520 case 12: /* Self Knowledge */
3521 (void)self_knowledge();
3523 case 13: /* Protection from Evil */
3524 (void)set_protevil(randint1(25) + 3 * p_ptr->lev, FALSE);
3526 case 14: /* Healing */
3532 case 15: /* Mana Branding */
3533 return choose_ele_attack();
3535 case 16: /* Telepathy */
3536 (void)set_tim_esp(randint1(30) + 25, FALSE);
3538 case 17: /* Stone Skin */
3539 (void)set_shield(randint1(20) + 30, FALSE);
3541 case 18: /* Resistance */
3542 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3543 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3544 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3545 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3546 (void)set_oppose_pois(randint1(20) + 20, FALSE);
3548 case 19: /* Haste */
3549 (void)set_fast(randint1(20 + plev) + plev, FALSE);
3551 case 20: /* Walk through Wall */
3552 (void)set_kabenuke(randint1(plev/2) + plev/2, FALSE);
3554 case 21: /* Pulish Shield */
3555 (void)pulish_shield();
3557 case 22: /* Create Golem */
3558 if (summon_specific(-1, py, px, plev, SUMMON_GOLEM, PM_FORCE_PET))
3561 msg_print("¥´¡¼¥ì¥à¤òºî¤Ã¤¿¡£");
3563 msg_print("You make a golem.");
3571 case 23: /* Magic armor */
3572 (void)set_magicdef(randint1(20) + 20, FALSE);
3574 case 24: /* Remove Enchantment */
3575 if (!mundane_spell(TRUE)) return FALSE;
3577 case 25: /* Remove All Curse */
3578 if (remove_all_curse())
3581 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
3583 msg_print("You feel as if someone is watching over you.");
3587 case 26: /* Total Knowledge */
3588 return identify_fully(FALSE);
3590 case 27: /* Enchant Weapon */
3591 return enchant_spell(randint0(4) + 1, randint0(4) + 1, 0);
3593 case 28: /* Enchant Armor */
3594 return enchant_spell(0, 0, randint0(3) + 2);
3596 case 29: /* Brand Weapon */
3597 brand_weapon(randint0(18));
3599 case 30: /* Living Trump */
3601 /* Teleport control */
3604 /* Random teleportation (uncontrolled) */
3606 /* Gain the mutation */
3607 if (gain_random_mutation(dummy))
3609 msg_print("¤¢¤Ê¤¿¤ÏÀ¸¤¤Æ¤¤¤ë¥«¡¼¥É¤ËÊѤï¤Ã¤¿¡£");
3611 msg_print("You have turned into a Living Trump.");
3614 case 31: /* Immune */
3615 return (choose_ele_immune(13 + randint1(13)));
3618 msg_format("You cast an unknown Craft spell: %d.", spell);
3624 msg_print("¤¦¤Þ¤¯¥´¡¼¥ì¥à¤òºî¤ì¤Ê¤«¤Ã¤¿¡£");
3626 msg_print("No Golems arrive.");
3634 * An "item_tester_hook" for offer
3636 static bool item_tester_offer(object_type *o_ptr)
3638 /* Flasks of oil are okay */
3639 if (o_ptr->tval != TV_CORPSE) return (FALSE);
3641 if (o_ptr->sval != SV_CORPSE) return (FALSE);
3643 if (strchr("pht", r_info[o_ptr->pval].d_char)) return (TRUE);
3645 /* Assume not okay */
3650 static bool cast_daemon_spell(int spell)
3653 int plev = p_ptr->lev;
3655 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3656 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3657 else beam = plev / 2;
3661 case 0: /* Magic Missile */
3662 if (!get_aim_dir(&dir)) return FALSE;
3664 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
3665 damroll(3 + ((plev - 1) / 5), 4));
3667 case 1: /* Detect Undead & Demons -> Unlife */
3668 (void)detect_monsters_nonliving(DETECT_RAD_DEFAULT);
3671 (void)set_blessed(randint1(12) + 12, FALSE);
3673 case 3: /* Resist Fire */
3674 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3676 case 4: /* Horrify */
3677 if (!get_aim_dir(&dir)) return FALSE;
3679 (void)fear_monster(dir, plev);
3680 (void)stun_monster(dir, plev);
3682 case 5: /* Nether Bolt */
3683 if (!get_aim_dir(&dir)) return FALSE;
3685 fire_bolt_or_beam(beam, GF_NETHER, dir,
3686 damroll(6 + ((plev - 5) / 4), 8));
3688 case 6: /* Summon monster, demon */
3689 if (!summon_specific(-1, py, px, (plev * 3) / 2, SUMMON_MANES, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3692 msg_print("¸ÅÂå¤Î»àÎî¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3694 msg_print("No Manes arrive.");
3698 case 7: /* Mini Hellfire */
3699 if (!get_aim_dir(&dir)) return FALSE;
3701 fire_ball(GF_HELL_FIRE, dir,
3702 (damroll(3, 6) + plev +
3703 (plev / (((p_ptr->pclass == CLASS_MAGE) ||
3704 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
3705 (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
3706 ((plev < 30) ? 2 : 3));
3708 case 8: /* Enslave Demon */
3709 if (!get_aim_dir(&dir)) return FALSE;
3711 (void)control_one_demon(dir, plev);
3713 case 9: /* Vision */
3714 map_area(DETECT_RAD_MAP);
3716 case 10: /* Resist Nether */
3717 (void)set_tim_res_nether(randint1(20) + 20, FALSE);
3719 case 11: /* Plasma Bolt */
3720 if (!get_aim_dir(&dir)) return FALSE;
3722 fire_bolt_or_beam(beam, GF_PLASMA, dir,
3723 damroll(11 + ((plev - 5) / 4), 8));
3725 case 12: /* Fire Ball */
3726 if (!get_aim_dir(&dir)) return FALSE;
3728 fire_ball(GF_FIRE, dir, plev + 55, 2);
3730 case 13: /* Fire Branding */
3733 case 14: /* Nether Ball */
3734 if (!get_aim_dir(&dir)) return FALSE;
3736 fire_ball(GF_NETHER, dir, plev*3/2 + 100, plev / 20+2);
3738 case 15: /* Summon monster, demon */
3740 bool pet = !one_in_(3);
3743 if (pet) mode |= PM_FORCE_PET;
3744 else mode |= PM_NO_PET;
3745 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
3747 if (summon_specific((pet ? -1 : 0), py, px, plev*2/3+randint1(plev/2), SUMMON_DEMON, mode))
3750 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
3752 msg_print("The area fills with a stench of sulphur and brimstone.");
3758 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
3760 msg_print("'What is thy bidding... Master?'");
3765 msg_print("¡ÖÈܤ·¤¼Ô¤è¡¢²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª ¤ªÁ°¤Îº²¤òĺ¤¯¤¾¡ª¡×");
3767 msg_print("'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'");
3774 msg_print("°Ëâ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3776 msg_print("No Greater Demon arrive.");
3781 case 16: /* Telepathy */
3782 (void)set_tim_esp(randint1(30) + 25, FALSE);
3784 case 17: /* Demoncloak */
3786 int dur=randint1(20) + 20;
3788 set_oppose_fire(dur, FALSE);
3789 set_oppose_cold(dur, FALSE);
3790 set_tim_sh_fire(dur, FALSE);
3794 case 18: /* Rain of Lava */
3795 fire_ball(GF_FIRE, 0, (55 + plev)*2, 3);
3796 fire_ball_hide(GF_LAVA_FLOW, 0, 2+randint1(2), 3);
3798 case 19: /* Plasma ball */
3799 if (!get_aim_dir(&dir)) return FALSE;
3801 fire_ball(GF_PLASMA, dir, plev*3/2 + 80, 2 + plev/40);
3803 case 20: /* Mimic demon */
3804 (void)set_mimic(10+plev/2 + randint1(10+plev/2), MIMIC_DEMON, FALSE);
3806 case 21: /* Nether Wave == Dispel Good */
3807 (void)dispel_monsters(randint1(plev * 2));
3808 (void)dispel_good(randint1(plev * 2));
3811 if (!get_aim_dir(&dir)) return FALSE;
3812 fire_ball(GF_NEXUS, dir, 100 + plev*2, 4);
3814 case 23: /* Hand Doom */
3815 if (!get_aim_dir(&dir)) return FALSE;
3817 else msg_print("<ÇËÌǤμê>¤òÊü¤Ã¤¿¡ª");
3819 else msg_print("You invoke the Hand of Doom!");
3822 fire_ball_hide(GF_HAND_DOOM, dir, plev * 2, 0);
3824 case 24: /* Heroism */
3825 (void)set_hero(randint1(25) + 25, FALSE);
3826 (void)hp_player(10);
3827 (void)set_afraid(0);
3829 case 25: /* Tim resist time */
3830 (void)set_tim_res_time(randint1(20)+20, FALSE);
3832 case 26: /* Circle of Madness */
3833 fire_ball(GF_CHAOS, 0, 50+plev, 3+plev/20);
3834 fire_ball(GF_CONFUSION, 0, 50+plev, 3+plev/20);
3835 fire_ball(GF_CHARM, 0, 20+plev, 3+plev/20);
3837 case 27: /* True Discharge Minion */
3840 case 28: /* Summon Greater Demon */
3847 item_tester_hook = item_tester_offer;
3849 q = "¤É¤Î»àÂΤòÊû¤²¤Þ¤¹¤«? ";
3850 s = "Êû¤²¤é¤ì¤ë»àÂΤò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
3852 q = "Sacrifice which corpse? ";
3853 s = "You have nothing to scrifice.";
3855 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return FALSE;
3857 /* Get the item (in the pack) */
3860 o_ptr = &inventory[item];
3863 /* Get the item (on the floor) */
3866 o_ptr = &o_list[0 - item];
3869 summon_lev = p_ptr->lev * 2 / 3 + r_info[o_ptr->pval].level;
3870 if (summon_specific(-1, py, px, summon_lev, SUMMON_HI_DEMON, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3873 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
3875 msg_print("The area fills with a stench of sulphur and brimstone.");
3880 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
3882 msg_print("'What is thy bidding... Master?'");
3885 /* Decrease the item (from the pack) */
3888 inven_item_increase(item, -1);
3889 inven_item_describe(item);
3890 inven_item_optimize(item);
3893 /* Decrease the item (from the floor) */
3896 floor_item_increase(0 - item, -1);
3897 floor_item_describe(0 - item);
3898 floor_item_optimize(0 - item);
3904 msg_print("°Ëâ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3906 msg_print("No Greater Demon arrive.");
3911 case 29: /* Nether Storm */
3912 if (!get_aim_dir(&dir)) return FALSE;
3914 fire_ball(GF_NETHER, dir, plev*15, plev / 5);
3916 case 30: /* Blood curse */
3918 if (!get_aim_dir(&dir)) return FALSE;
3920 fire_ball_hide(GF_BLOOD_CURSE, dir, 600, 0);
3922 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "·ì¤Î¼ö¤¤", -1);
3924 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "Blood curse", -1);
3928 case 31: /* Mimic Demon lord */
3929 (void)set_mimic(15 + randint1(15), MIMIC_DEMON_LORD, FALSE);
3932 msg_format("You cast an unknown Daemon spell: %d.", spell);
3940 static bool cast_crusade_spell(int spell)
3944 int plev = p_ptr->lev;
3946 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3947 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3948 else beam = plev / 2;
3953 if (!get_aim_dir(&dir)) return FALSE;
3955 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
3956 damroll(3 + ((plev - 1) / 5), 4));
3959 (void)detect_monsters_evil(DETECT_RAD_DEFAULT);
3961 case 2: /* Remove Fear */
3962 (void)set_afraid(0);
3965 if (!get_aim_dir(&dir)) return FALSE;
3967 (void)fear_monster(dir, plev);
3970 (void)sleep_monsters_touch();
3973 teleport_player(25+plev/2);
3976 if (!get_aim_dir(&dir)) return FALSE;
3977 fire_blast(GF_LITE, dir, 3+((plev-1)/9), 2, 10, 3);
3981 (void)set_poisoned(0);
3985 if (!get_aim_dir(&dir)) return FALSE;
3986 (void)fire_ball(GF_AWAY_EVIL, dir, MAX_SIGHT*5, 0);
3988 case 9: /* Holy Orb */
3989 if (!get_aim_dir(&dir)) return FALSE;
3991 fire_ball(GF_HOLY_FIRE, dir,
3992 (damroll(3, 6) + plev +
3993 (plev / ((p_ptr->pclass == CLASS_PRIEST ||
3994 p_ptr->pclass == CLASS_HIGH_MAGE ||
3995 p_ptr->pclass == CLASS_SORCERER) ? 2 : 4))),
3996 ((plev < 30) ? 2 : 3));
3999 case 10: /* Exorcism */
4000 (void)dispel_undead(randint1(plev));
4001 (void)dispel_demons(randint1(plev));
4002 (void)turn_evil(plev);
4004 case 11: /* Remove Curse */
4008 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
4010 msg_print("You feel as if someone is watching over you.");
4014 case 12: /* Sense Unseen */
4015 (void)set_tim_invis(randint1(24) + 24, FALSE);
4017 case 13: /* Protection from Evil */
4018 (void)set_protevil(randint1(25) + 3 * p_ptr->lev, FALSE);
4021 if (!get_aim_dir(&dir)) return FALSE;
4022 (void)fire_bolt(GF_ELEC, dir, plev*5);
4024 case 15: /* Holy Word */
4025 (void)dispel_evil(randint1(plev * 6));
4026 (void)hp_player(100);
4027 (void)set_afraid(0);
4028 (void)set_poisoned(0);
4033 if (!get_aim_dir(&dir)) return FALSE;
4035 (void)destroy_door(dir);
4038 if (!get_aim_dir(&dir)) return FALSE;
4039 (void)stasis_evil(dir);
4042 set_tim_sh_holy(randint1(20)+20, FALSE);
4044 case 19: /* Dispel Undead + Demons */
4045 (void)dispel_undead(randint1(plev * 4));
4046 (void)dispel_demons(randint1(plev * 4));
4048 case 20: /* Dispel Evil */
4049 (void)dispel_evil(randint1(plev * 4));
4054 case 22: /* Star Burst */
4055 if (!get_aim_dir(&dir)) return FALSE;
4057 fire_ball(GF_LITE, dir, 100+plev*2, 4);
4059 case 23: /* Summon monster, angel */
4061 bool pet = !one_in_(3);
4064 if (pet) mode |= PM_FORCE_PET;
4065 else mode |= PM_NO_PET;
4066 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
4068 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, SUMMON_ANGEL, mode))
4072 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
4074 msg_print("'What is thy bidding... Master?'");
4079 msg_print("¡Ö²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª °¹Ô¼Ô¤è¡¢²ù¤¤²þ¤á¤è¡ª¡×");
4081 msg_print("Mortal! Repent of thy impiousness.");
4087 case 24: /* Heroism */
4088 (void)set_hero(randint1(25) + 25, FALSE);
4089 (void)hp_player(10);
4090 (void)set_afraid(0);
4092 case 25: /* Remove All Curse */
4093 if (remove_all_curse())
4096 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
4098 msg_print("You feel as if someone is watching over you.");
4102 case 26: /* Banishment */
4103 if (banish_evil(100))
4106 msg_print("¿ÀÀ»¤ÊÎϤ¬¼Ù°¤òÂǤÁʧ¤Ã¤¿¡ª");
4108 msg_print("The holy power banishes evil!");
4113 case 27: /* Word of Destruction */
4114 destroy_area(py, px, 13+randint0(5), TRUE);
4116 case 28: /* Eye for an Eye */
4117 set_tim_eyeeye(randint1(10)+10, FALSE);
4124 int b = 10 + randint1(10);
4126 if (!get_aim_dir(&dir)) return FALSE;
4128 /* Use the given direction */
4129 tx = px + 99 * ddx[dir];
4130 ty = py + 99 * ddy[dir];
4132 /* Hack -- Use an actual "target" */
4133 if ((dir == 5) && target_okay())
4144 /* Hack -- Stop at the target */
4145 if ((y == ty) && (x == tx)) break;
4149 mmove2(&ny, &nx, py, px, ty, tx);
4151 /* Stop at maximum range */
4152 if (MAX_SIGHT*2 < distance(py, px, ny, nx)) break;
4154 /* Stopped by walls/doors */
4155 if (!cave_floor_bold(ny, nx)) break;
4157 /* Stopped by monsters */
4158 if ((dir != 5) && cave[ny][nx].m_idx != 0) break;
4160 /* Save the new location */
4167 for (i = 0; i < b; i++)
4169 int count = 20, d = 0;
4175 x = tx - 5 + randint0(11);
4176 y = ty - 5 + randint0(11);
4178 dx = (tx > x) ? (tx - x) : (x - tx);
4179 dy = (ty > y) ? (ty - y) : (y - ty);
4181 /* Approximate distance */
4182 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
4183 /* Within the radius */
4187 if (count < 0) continue;
4189 /* Cannot penetrate perm walls */
4190 if (!in_bounds(y,x) ||
4191 cave_stop_disintegration(y,x) ||
4192 !in_disintegration_range(ty, tx, y, x))
4195 project(0, 2, y, x, plev * 3+25, GF_DISINTEGRATE, PROJECT_JUMP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1);
4199 case 30: /* Divine Intervention */
4200 project(0, 1, py, px, plev*11, GF_HOLY_FIRE, PROJECT_KILL, -1);
4201 dispel_monsters(plev * 4);
4203 stun_monsters(plev * 4);
4204 confuse_monsters(plev * 4);
4205 turn_monsters(plev * 4);
4206 stasis_monsters(plev * 4);
4207 (void)hp_player(100);
4213 for (i = 0; i < 12; i++)
4220 scatter(&my, &mx, py, px, 4, 0);
4222 /* Require empty grids */
4223 if (cave_empty_bold2(my, mx)) break;
4225 if (attempt < 0) continue;
4226 summon_specific(-1, my, mx, plev, SUMMON_KNIGHTS, (PM_ALLOW_GROUP | PM_FORCE_PET | PM_HASTE));
4228 (void)set_hero(randint1(25) + 25, FALSE);
4229 (void)set_blessed(randint1(25) + 25, FALSE);
4230 (void)set_fast(randint1(20 + plev) + plev, FALSE);
4231 (void)set_protevil(randint1(25) + 25, FALSE);
4232 (void)set_afraid(0);
4237 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤ÊÇ˼٤μöʸ %d ¤ò¾§¤¨¤¿¡£", spell);
4239 msg_format("You cast an unknown crusade spell: %d.", spell);
4250 void stop_singing(void)
4252 if (p_ptr->pclass != CLASS_BARD) return;
4254 if (p_ptr->magic_num1[1])
4256 p_ptr->magic_num1[1] = 0;
4259 if (!p_ptr->magic_num1[0]) return;
4261 set_action(ACTION_NONE);
4263 switch(p_ptr->magic_num1[0])
4266 if (!p_ptr->blessed)
4268 msg_print("¹â·é¤Êµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4270 msg_print("The prayer has expired.");
4277 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4279 msg_print("The heroism wears off.");
4281 /* Recalculate hitpoints */
4282 p_ptr->update |= (PU_HP);
4286 if (!p_ptr->tim_esp)
4289 msg_print("°Õ¼±¤Ï¸µ¤ËÌá¤Ã¤¿¡£");
4291 msg_print("Your consciousness contracts again.");
4293 /* Update the monsters */
4294 p_ptr->update |= (PU_MONSTERS);
4298 if (!p_ptr->tim_stealth)
4300 msg_print("»Ñ¤¬¤Ï¤Ã¤¤ê¤È¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
4302 msg_print("You are no longer hided.");
4306 if (!p_ptr->oppose_acid)
4308 msg_print("»À¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4310 msg_print("You feel less resistant to acid.");
4312 if (!p_ptr->oppose_elec)
4314 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4316 msg_print("You feel less resistant to elec.");
4318 if (!p_ptr->oppose_fire)
4320 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4322 msg_print("You feel less resistant to fire.");
4324 if (!p_ptr->oppose_cold)
4326 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4328 msg_print("You feel less resistant to cold.");
4330 if (!p_ptr->oppose_pois)
4332 msg_print("ÆǤؤÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4334 msg_print("You feel less resistant to pois.");
4340 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
4342 msg_print("You feel yourself slow down.");
4349 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4351 msg_print("The heroism wears off.");
4353 /* Recalculate hitpoints */
4354 p_ptr->update |= (PU_HP);
4359 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
4361 msg_print("You feel yourself slow down.");
4368 msg_print("̵Ũ¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£");
4370 msg_print("The invulnerability wears off.");
4373 p_ptr->redraw |= (PR_MAP);
4375 /* Update monsters */
4376 p_ptr->update |= (PU_MONSTERS);
4379 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4383 p_ptr->magic_num1[0] = MUSIC_NONE;
4384 p_ptr->magic_num2[0] = 0;
4386 /* Recalculate bonuses */
4387 p_ptr->update |= (PU_BONUS | PU_HP);
4389 /* Redraw status bar */
4390 p_ptr->redraw |= (PR_STATUS);
4394 static bool cast_music_spell(int spell)
4396 int plev = p_ptr->lev;
4399 if(p_ptr->magic_num1[0])
4404 p_ptr->magic_num2[0] = spell;
4408 case 0: /* Song of Holding ÃÙÆߤβΠ*/
4410 msg_print("¤æ¤Ã¤¯¤ê¤È¤·¤¿¥á¥í¥Ç¥£¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4412 msg_print("You start humming a slow, steady melody...");
4414 p_ptr->magic_num1[0] = MUSIC_SLOW;
4416 case 1: /* Song of Blessing ½ËÊ¡¤Î²Î */
4418 msg_print("¸·¤«¤Ê¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4420 msg_print("The holy power of the Music of the Ainur enters you...");
4422 p_ptr->magic_num1[0] = MUSIC_BLESS;
4425 case 2: /* Wrecking Note Êø²õ¤Î²»¿§ */
4426 if (!get_aim_dir(&dir)) return FALSE;
4427 fire_bolt(GF_SOUND, dir,
4428 damroll(4 + ((plev - 1) / 5), 4));
4430 case 3: /* Stun Pattern Û¯Û°¤ÎÀûΧ */
4432 msg_print("âÁÏǤµ¤»¤ë¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4434 msg_print("You weave a pattern of sounds to bewilder and daze...");
4436 p_ptr->magic_num1[0] = MUSIC_STUN;
4438 case 4: /* Flow of life À¸Ì¿¤Îή¤ì */
4440 msg_print("²Î¤òÄ̤·¤ÆÂΤ˳赤¤¬Ìá¤Ã¤Æ¤¤¿¡¥¡¥¡¥");
4442 msg_print("Life flows through you as you sing a song of healing...");
4444 p_ptr->magic_num1[0] = MUSIC_L_LIFE;
4446 case 5: /* Song of the Sun ÂÀÍۤβΠ*/
4448 msg_print("¸÷¤êµ±¤¯²Î¤¬ÊÕ¤ê¤ò¾È¤é¤·¤¿¡£");
4450 msg_print("Your uplifting song brings brightness to dark places...");
4452 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
4454 case 6: /* Song of fear ¶²ÉݤβΠ*/
4456 msg_print("¤ª¤É¤í¤ª¤É¤í¤·¤¤¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4458 msg_print("You start weaving a fearful pattern...");
4460 p_ptr->magic_num1[0] = MUSIC_FEAR;
4462 case 7: /* Heroic Ballad À襤¤Î²Î */
4464 msg_print("·ã¤·¤¤À襤¤Î²Î¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4466 msg_print("You start singing a song of intense fighting...");
4468 p_ptr->magic_num1[0] = MUSIC_HERO;
4470 case 8: /* Clairaudience ÎîŪÃγР*/
4472 msg_print("ÀŤ«¤Ê²»³Ú¤¬´¶³Ð¤ò¸¦¤®À¡¤Þ¤µ¤»¤¿¡¥¡¥¡¥");
4474 msg_print("Your quiet music sharpens your sense of hearing...");
4476 p_ptr->magic_num1[0] = MUSIC_DETECT;
4478 case 9: /* º²¤Î²Î */
4480 msg_print("Àº¿À¤òDZ¤¸¶Ê¤²¤ë²Î¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4482 msg_print("You start singing a song of soul in pain...");
4484 p_ptr->magic_num1[0] = MUSIC_PSI;
4486 case 10: /* Song of Lore Ãμ±¤Î²Î */
4488 msg_print("¤³¤ÎÀ¤³¦¤ÎÃ챤¬Î®¤ì¹þ¤ó¤Ç¤¤¿¡¥¡¥¡¥");
4490 msg_print("You recall the rich lore of the world...");
4492 p_ptr->magic_num1[0] = MUSIC_ID;
4494 case 11: /* hidding song ±£ÆۤβΠ*/
4496 msg_print("¤¢¤Ê¤¿¤Î»Ñ¤¬·Ê¿§¤Ë¤È¤±¤³¤ó¤Ç¤¤¤Ã¤¿¡¥¡¥¡¥");
4498 msg_print("Your song carries you beyond the sight of mortal eyes...");
4500 p_ptr->magic_num1[0] = MUSIC_STEALTH;
4502 case 12: /* Illusion Pattern ¸¸±Æ¤ÎÀûΧ */
4504 msg_print("ÊÕ¤ê°ìÌ̤˸¸±Æ¤¬¸½¤ì¤¿¡¥¡¥¡¥");
4506 msg_print("You weave a pattern of sounds to beguile and confuse...");
4508 p_ptr->magic_num1[0] = MUSIC_CONF;
4510 case 13: /* Doomcall (vibration song) ÇËÌǤζ«¤Ó */
4512 msg_print("¹ì²»¤¬¶Á¤¤¤¿¡¥¡¥¡¥");
4514 msg_print("The fury of the Downfall of Numenor lashes out...");
4516 p_ptr->magic_num1[0] = MUSIC_SOUND;
4518 case 14: /* Firiel's Song (song of the Undeads) ¥Õ¥£¥ê¥¨¥ë¤Î²Î */
4520 msg_print("À¸Ì¿¤ÈÉü³è¤Î¥Æ¡¼¥Þ¤òÁդǻϤ᤿¡¥¡¥¡¥");
4522 msg_print("The themes of life and revival are woven into your song...");
4524 animate_dead(0, py, px);
4526 case 15: /* Fellowship Chant (charming song) ι¤ÎÃç´Ö */
4528 msg_print("°Â¤é¤«¤Ê¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4530 msg_print("You weave a slow, soothing melody of imploration...");
4532 p_ptr->magic_num1[0] = MUSIC_CHARM;
4534 case 16: /* (wall breaking song) ʬ²ò²»ÇÈ */
4536 msg_print("Ê´ºÕ¤¹¤ë¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4538 msg_print("You weave a violent pattern of sounds to break wall.");
4540 p_ptr->magic_num1[0] = MUSIC_WALL;
4541 project(0, 0, py, px,
4542 0, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM | PROJECT_HIDE, -1);
4544 case 17: /* Finrod's Resistance (song of resistance) ¸µÁÇÂÑÀ */
4546 msg_print("¸µÁǤÎÎϤËÂФ¹¤ëǦÂѤβΤò²Î¤Ã¤¿¡£");
4548 msg_print("You sing a song of perseverance against powers...");
4550 p_ptr->magic_num1[0] = MUSIC_RESIST;
4552 case 18: /* Hobbit Melodies (song of time) ¥Û¥Ó¥Ã¥È¤Î¥á¥í¥Ç¥£ */
4554 msg_print("·Ú²÷¤Ê²Î¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4556 msg_print("You start singing joyful pop song...");
4558 p_ptr->magic_num1[0] = MUSIC_SPEED;
4560 case 19: /* World Contortion ÏĤó¤ÀÀ¤³¦ */
4562 msg_print("²Î¤¬¶õ´Ö¤òÏĤ᤿¡¥¡¥¡¥");
4564 msg_print("Reality whirls wildly as you sing a dizzying melody...");
4566 project(0, plev/15 + 1, py, px, plev * 3 + 1, GF_AWAY_ALL , PROJECT_KILL, -1);
4568 case 20: /* Â໶¤Î²Î */
4570 msg_print("ÂѤ¨¤é¤ì¤Ê¤¤ÉÔ¶¨Ï²»¤¬Å¨¤òÀÕ¤áΩ¤Æ¤¿¡¥¡¥¡¥");
4572 msg_print("You cry out in an ear-wracking voice...");
4574 p_ptr->magic_num1[0] = MUSIC_DISPEL;
4576 case 21: /* The Voice of Saruman ¥µ¥ë¥Þ¥ó¤Î´Å¸À */
4578 msg_print("Í¥¤·¤¯¡¢Ì¥ÎÏŪ¤Ê²Î¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4580 msg_print("You start humming a gentle and attractive song...");
4582 p_ptr->magic_num1[0] = MUSIC_SARUMAN;
4584 case 22: /* Song of Tempest (song of death) Íò¤Î²»¿§ */
4585 if (!get_aim_dir(&dir)) return FALSE;
4586 fire_beam(GF_SOUND, dir,
4587 damroll(15 + ((plev - 1) / 2), 10));
4589 case 23: /* (song of disruption) ¤â¤¦°ì¤Ä¤ÎÀ¤³¦ */
4591 msg_print("¼þ°Ï¤¬ÊѲ½¤·»Ï¤á¤¿¡¥¡¥¡¥");
4593 msg_print("You sing of the primeval shaping of Middle-earth...");
4597 case 24: /* Wrecking Pattern (destruction shriek) Ç˲õ¤ÎÀûΧ */
4599 msg_print("Ç˲õŪ¤Ê²Î¤¬¶Á¤¤ï¤¿¤Ã¤¿¡¥¡¥¡¥");
4601 msg_print("You weave a pattern of sounds to contort and shatter...");
4603 p_ptr->magic_num1[0] = MUSIC_QUAKE;
4605 case 25: /* ÄäÂڤβΠ*/
4607 msg_print("¤æ¤Ã¤¯¤ê¤È¤·¤¿¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4609 msg_print("You weave a very slow pattern which is almost likely to stop...");
4611 p_ptr->magic_num1[0] = MUSIC_STASIS;
4613 case 26: /* ¼é¤ê¤Î²Î */
4615 msg_print("²Î¤¬¿ÀÀ»¤Ê¾ì¤òºî¤ê½Ð¤·¤¿¡¥¡¥¡¥");
4617 msg_print("The holy power of the Music is creating sacred field...");
4621 case 27: /* ±Ñͺ¤Î»í */
4623 msg_print("±Ñͺ¤Î²Î¤ò¸ý¤º¤µ¤ó¤À¡¥¡¥¡¥");
4625 msg_print("You chant a powerful, heroic call to arms...");
4627 p_ptr->magic_num1[0] = MUSIC_SHERO;
4628 (void)hp_player(10);
4629 (void)set_afraid(0);
4631 case 28: /* ¥ä¥ô¥¡¥ó¥Ê¤Î½õ¤± */
4633 msg_print("²Î¤òÄ̤·¤ÆÂΤ˳赤¤¬Ìá¤Ã¤Æ¤¤¿¡¥¡¥¡¥");
4635 msg_print("Life flows through you as you sing the song...");
4637 p_ptr->magic_num1[0] = MUSIC_H_LIFE;
4639 case 29: /* ºÆÀ¸¤Î²Î */
4641 msg_print("°Å¹õ¤ÎÃæ¤Ë¸÷¤ÈÈþ¤ò¤Õ¤ê¤Þ¤¤¤¿¡£ÂΤ¬¸µ¤Î³èÎϤò¼è¤êÌᤷ¤¿¡£");
4643 msg_print("You strewed light and beauty in the dark as you sing. You feel refreshed.");
4645 (void)do_res_stat(A_STR);
4646 (void)do_res_stat(A_INT);
4647 (void)do_res_stat(A_WIS);
4648 (void)do_res_stat(A_DEX);
4649 (void)do_res_stat(A_CON);
4650 (void)do_res_stat(A_CHR);
4651 (void)restore_level();
4653 case 30: /* shriek of death ¥µ¥¦¥í¥ó¤ÎËâ½Ñ */
4654 if (!get_aim_dir(&dir)) return FALSE;
4655 fire_ball(GF_SOUND, dir, damroll(50 + plev, 10), 0);
4657 case 31: /* song of liberty ¥Õ¥£¥ó¥´¥ë¥Õ¥£¥ó¤ÎÄ©Àï */
4659 msg_print("¥Õ¥£¥ó¥´¥ë¥Õ¥£¥ó¤Î̽²¦¤Ø¤ÎÄ©Àï¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4661 msg_print("You recall the valor of Fingolfin's challenge to the Dark Lord...");
4663 p_ptr->magic_num1[0] = MUSIC_INVULN;
4666 p_ptr->redraw |= (PR_MAP);
4668 /* Update monsters */
4669 p_ptr->update |= (PU_MONSTERS);
4672 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4676 msg_format("̤ÃΤβÎ(%d)¤ò²Î¤Ã¤¿¡£", spell);
4678 msg_format("You sing an unknown song: %d.", spell);
4683 if (p_ptr->magic_num1[0]) set_action(ACTION_SING);
4685 /* Recalculate bonuses */
4686 p_ptr->update |= (PU_BONUS | PU_HP);
4688 /* Redraw status bar */
4689 p_ptr->redraw |= (PR_STATUS);
4697 void do_cmd_cast(void)
4699 int item, sval, spell, realm;
4714 /* Require spell ability */
4715 if (!p_ptr->realm1 && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE))
4718 msg_print("¼öʸ¤ò¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4720 msg_print("You cannot cast spells!");
4727 if (p_ptr->blind || no_lite())
4730 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡ª");
4732 msg_print("You cannot see!");
4734 if (p_ptr->pclass == CLASS_FORCETRAINER)
4741 /* Not when confused */
4742 if (p_ptr->confused)
4745 msg_print("º®Í𤷤Ƥ¤¤Æ¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4747 msg_print("You are too confused!");
4753 prayer = spell_categoly_name(mp_ptr->spell_book);
4755 /* Restrict choices to spell books */
4756 item_tester_tval = mp_ptr->spell_book;
4760 q = "¤É¤Î¼öʸ½ñ¤ò»È¤¤¤Þ¤¹¤«? ";
4762 q = "Use which book? ";
4766 s = "¼öʸ½ñ¤¬¤Ê¤¤¡ª";
4768 s = "You have no spell books!";
4771 select_spellbook=TRUE;
4772 if (p_ptr->pclass == CLASS_FORCETRAINER)
4773 select_the_force = TRUE;
4774 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))){
4775 select_spellbook = FALSE;
4776 select_the_force = FALSE;
4779 select_spellbook = FALSE;
4780 select_the_force = FALSE;
4782 if (item == 1111) { /* the_force */
4786 /* Get the item (in the pack) */
4789 o_ptr = &inventory[item];
4792 /* Get the item (on the floor) */
4795 o_ptr = &o_list[0 - item];
4798 /* Access the item's sval */
4801 if ((p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE) && (o_ptr->tval == REALM2_BOOK)) increment = 32;
4804 /* Track the object kind */
4805 object_kind_track(o_ptr->k_idx);
4807 /* Hack -- Handle stuff */
4810 if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
4811 realm = o_ptr->tval - TV_LIFE_BOOK + 1;
4812 else if (increment) realm = p_ptr->realm2;
4813 else realm = p_ptr->realm1;
4815 /* Ask for a spell */
4817 if (!get_spell(&spell,
4818 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "±Ó¾§¤¹¤ë" : (mp_ptr->spell_book == TV_MUSIC_BOOK) ? "²Î¤¦" : "¾§¤¨¤ë"),
4821 if (spell == -2) msg_format("¤½¤ÎËܤˤÏÃΤäƤ¤¤ë%s¤¬¤Ê¤¤¡£", prayer);
4825 if (!get_spell(&spell, ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "recite" : "cast"),
4829 msg_format("You don't know any %ss in that book.", prayer);
4835 use_realm = tval2realm(o_ptr->tval);
4837 if (!is_magic(use_realm))
4839 s_ptr = &technic_info[use_realm - MIN_TECHNIC][spell];
4843 s_ptr = &mp_ptr->info[realm - 1][spell];
4846 /* Extract mana consumption rate */
4847 shouhimana = s_ptr->smana*(3800 - experience_of_spell(spell, realm)) + 2399;
4850 else shouhimana *= 4;
4852 if(shouhimana < 1) shouhimana = 1;
4854 /* Verify "dangerous" spells */
4855 if (shouhimana > p_ptr->csp)
4857 if (flush_failure) flush();
4861 msg_format("¤½¤Î%s¤ò%s¤Î¤Ë½½Ê¬¤Ê¥Þ¥¸¥Ã¥¯¥Ý¥¤¥ó¥È¤¬¤Ê¤¤¡£",prayer,
4862 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "±Ó¾§¤¹¤ë" : (mp_ptr->spell_book == TV_LIFE_BOOK) ? "²Î¤¦" : "¾§¤¨¤ë"));
4864 msg_format("You do not have enough mana to %s this %s.",
4865 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "recite" : "cast"),
4870 if (!over_exert) return;
4874 if (!get_check_strict("¤½¤ì¤Ç¤âÄ©À路¤Þ¤¹¤«? ", CHECK_OKAY_CANCEL)) return;
4876 if (!get_check_strict("Attempt it anyway? ", CHECK_OKAY_CANCEL)) return;
4882 /* Spell failure chance */
4883 chance = spell_chance(spell, use_realm);
4886 if (randint0(100) < chance)
4888 if (flush_failure) flush();
4891 msg_format("%s¤ò¤¦¤Þ¤¯¾§¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡ª", prayer);
4893 msg_format("You failed to get the %s off!", prayer);
4898 if (realm == REALM_LIFE)
4900 if (randint1(100) < chance)
4901 chg_virtue(V_VITALITY, -1);
4903 else if (realm == REALM_DEATH)
4905 if (randint1(100) < chance)
4906 chg_virtue(V_UNLIFE, -1);
4908 else if (realm == REALM_NATURE)
4910 if (randint1(100) < chance)
4911 chg_virtue(V_NATURE, -1);
4913 else if (realm == REALM_DAEMON)
4915 if (randint1(100) < chance)
4916 chg_virtue(V_JUSTICE, 1);
4918 if (realm == REALM_CRUSADE)
4920 if (randint1(100) < chance)
4921 chg_virtue(V_JUSTICE, -1);
4923 else if (randint1(100) < chance)
4925 chg_virtue(V_KNOWLEDGE, -1);
4928 if (realm == REALM_TRUMP)
4930 cast_trump_spell(spell, FALSE);
4932 else if ((o_ptr->tval == TV_CHAOS_BOOK) && (randint1(100) < spell))
4935 msg_print("¥«¥ª¥¹Åª¤Ê¸ú²Ì¤òȯÀ¸¤·¤¿¡ª");
4937 msg_print("You produce a chaotic effect!");
4942 else if ((o_ptr->tval == TV_DEATH_BOOK) && (randint1(100) < spell))
4944 if ((sval == 3) && one_in_(2))
4946 sanity_blast(0, TRUE);
4951 msg_print("Äˤ¤¡ª");
4953 msg_print("It hurts!");
4957 take_hit(DAMAGE_LOSELIFE, damroll(o_ptr->sval + 1, 6), "°Å¹õËâË¡¤ÎµÕή", -1);
4959 take_hit(DAMAGE_LOSELIFE, damroll(o_ptr->sval + 1, 6), "a miscast Death spell", -1);
4962 if ((spell > 15) && one_in_(6) && !p_ptr->hold_life)
4963 lose_exp(spell * 250);
4966 else if ((o_ptr->tval == TV_MUSIC_BOOK) && (randint1(200) < spell))
4969 msg_print("¤¤¤ä¤Ê²»¤¬¶Á¤¤¤¿");
4971 msg_print("An infernal sound echoed.");
4974 aggravate_monsters(0);
4976 if (randint1(100) >= chance)
4977 chg_virtue(V_CHANCE,-1);
4986 case REALM_LIFE: /* * LIFE * */
4987 cast = cast_life_spell(spell);
4989 case REALM_SORCERY: /* * SORCERY * */
4990 cast = cast_sorcery_spell(spell);
4992 case REALM_NATURE: /* * NATURE * */
4993 cast = cast_nature_spell(spell);
4995 case REALM_CHAOS: /* * CHAOS * */
4996 cast = cast_chaos_spell(spell);
4998 case REALM_DEATH: /* * DEATH * */
4999 cast = cast_death_spell(spell);
5001 case REALM_TRUMP: /* TRUMP */
5002 cast = cast_trump_spell(spell, TRUE);
5004 case REALM_ARCANE: /* ARCANE */
5005 cast = cast_arcane_spell(spell);
5007 case REALM_ENCHANT: /* ENCHANT */
5008 cast = cast_enchant_spell(spell);
5010 case REALM_DAEMON: /* DAEMON */
5011 cast = cast_daemon_spell(spell);
5013 case REALM_CRUSADE: /* CRUSADE */
5014 cast = cast_crusade_spell(spell);
5016 case REALM_MUSIC: /* MUSIC */
5017 cast = cast_music_spell(spell);
5021 msg_format("You cast a spell from an unknown realm: realm %d, spell %d.", realm, spell);
5025 /* Canceled spells cost neither a turn nor mana */
5028 if (randint1(100) < chance)
5029 chg_virtue(V_CHANCE,1);
5031 /* A spell was cast */
5033 (p_ptr->spell_worked2 & (1L << spell)) :
5034 (p_ptr->spell_worked1 & (1L << spell)))
5035 && (p_ptr->pclass != CLASS_SORCERER)
5036 && (p_ptr->pclass != CLASS_RED_MAGE))
5038 int e = s_ptr->sexp;
5040 /* The spell worked */
5041 if (realm == p_ptr->realm1)
5043 p_ptr->spell_worked1 |= (1L << spell);
5047 p_ptr->spell_worked2 |= (1L << spell);
5050 /* Gain experience */
5051 gain_exp(e * s_ptr->slevel);
5053 /* Redraw object recall */
5054 p_ptr->window |= (PW_OBJECT);
5056 if (realm == REALM_LIFE)
5058 chg_virtue(V_TEMPERANCE, 1);
5059 chg_virtue(V_COMPASSION, 1);
5060 chg_virtue(V_VITALITY, 1);
5061 chg_virtue(V_DILIGENCE, 1);
5063 else if (realm == REALM_DEATH)
5065 chg_virtue(V_UNLIFE, 1);
5066 chg_virtue(V_JUSTICE, -1);
5067 chg_virtue(V_FAITH, -1);
5068 chg_virtue(V_VITALITY, -1);
5070 else if (realm == REALM_DAEMON)
5072 chg_virtue(V_JUSTICE, -1);
5073 chg_virtue(V_FAITH, -1);
5074 chg_virtue(V_HONOUR, -1);
5075 chg_virtue(V_TEMPERANCE, -1);
5077 else if (realm == REALM_CRUSADE)
5079 chg_virtue(V_FAITH, 1);
5080 chg_virtue(V_JUSTICE, 1);
5081 chg_virtue(V_SACRIFICE, 1);
5082 chg_virtue(V_HONOUR, 1);
5084 else if (realm == REALM_NATURE)
5086 chg_virtue(V_NATURE, 1);
5087 chg_virtue(V_HARMONY, 1);
5090 chg_virtue(V_KNOWLEDGE, 1);
5092 if (realm == REALM_LIFE)
5094 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_TEMPERANCE, 1);
5095 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_COMPASSION, 1);
5096 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_VITALITY, 1);
5097 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_DILIGENCE, 1);
5099 else if (realm == REALM_DEATH)
5101 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_UNLIFE, 1);
5102 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_JUSTICE, -1);
5103 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_FAITH, -1);
5104 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_VITALITY, -1);
5106 else if (realm == REALM_DAEMON)
5108 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_JUSTICE, -1);
5109 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_FAITH, -1);
5110 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_HONOUR, -1);
5111 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_TEMPERANCE, -1);
5113 else if (realm == REALM_CRUSADE)
5115 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_FAITH, 1);
5116 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_JUSTICE, 1);
5117 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_SACRIFICE, 1);
5118 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_HONOUR, 1);
5120 else if (realm == REALM_NATURE)
5122 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_NATURE, 1);
5123 if (randint1(100 + p_ptr->lev) < shouhimana) chg_virtue(V_HARMONY, 1);
5125 if (mp_ptr->spell_xtra & MAGIC_GAIN_EXP)
5127 s16b cur_exp = p_ptr->spell_exp[(increment ? 32 : 0)+spell];
5132 else if(cur_exp < 1200)
5134 if ((dun_level > 4) && ((dun_level + 10) > p_ptr->lev))
5137 else if(cur_exp < 1400)
5139 if (((dun_level + 5) > p_ptr->lev) && ((dun_level + 5) > s_ptr->slevel))
5142 else if((cur_exp < 1600) && !increment)
5144 if (((dun_level + 5) > p_ptr->lev) && (dun_level > s_ptr->slevel))
5147 p_ptr->spell_exp[(increment ? 32 : 0)+spell] += exp_gain;
5154 /* Sufficient mana */
5155 if (shouhimana <= p_ptr->csp)
5158 p_ptr->csp -= shouhimana;
5161 /* Over-exert the player */
5164 int oops = shouhimana;
5168 p_ptr->csp_frac = 0;
5172 msg_print("Àº¿À¤ò½¸Ã椷¤¹¤®¤Æµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
5174 msg_print("You faint from the effort!");
5178 /* Hack -- Bypass free action */
5179 (void)set_paralyzed(p_ptr->paralyzed + randint1(5 * oops + 1));
5181 if (realm == REALM_LIFE)
5182 chg_virtue(V_VITALITY, -10);
5183 else if (realm == REALM_DEATH)
5184 chg_virtue(V_UNLIFE, -10);
5185 else if (realm == REALM_DAEMON)
5186 chg_virtue(V_JUSTICE, 10);
5187 else if (realm == REALM_NATURE)
5188 chg_virtue(V_NATURE, -10);
5189 else if (realm == REALM_CRUSADE)
5190 chg_virtue(V_JUSTICE, -10);
5192 chg_virtue(V_KNOWLEDGE, -10);
5194 /* Damage CON (possibly permanently) */
5195 if (randint0(100) < 50)
5197 bool perm = (randint0(100) < 25);
5201 msg_print("ÂΤò°¤¯¤·¤Æ¤·¤Þ¤Ã¤¿¡ª");
5203 msg_print("You have damaged your health!");
5207 /* Reduce constitution */
5208 (void)dec_stat(A_CON, 15 + randint1(10), perm);
5213 p_ptr->redraw |= (PR_MANA);
5216 p_ptr->window |= (PW_PLAYER);
5217 p_ptr->window |= (PW_SPELL);
5222 * Pray a prayer -- Unused in Hengband
5224 void do_cmd_pray(void)
5226 msg_print("Praying is not used in Hengband. Use magic spell casting instead.");
5229 static bool ang_sort_comp_pet_dismiss(vptr u, vptr v, int a, int b)
5231 u16b *who = (u16b*)(u);
5236 monster_type *m_ptr1 = &m_list[w1];
5237 monster_type *m_ptr2 = &m_list[w2];
5238 monster_race *r_ptr1 = &r_info[m_ptr1->r_idx];
5239 monster_race *r_ptr2 = &r_info[m_ptr2->r_idx];
5241 if (w1 == p_ptr->riding) return TRUE;
5242 if (w2 == p_ptr->riding) return FALSE;
5244 if (m_ptr1->nickname && !m_ptr2->nickname) return TRUE;
5245 if (m_ptr2->nickname && !m_ptr1->nickname) return FALSE;
5247 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return TRUE;
5248 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return FALSE;
5250 if (r_ptr1->level > r_ptr2->level) return TRUE;
5251 if (r_ptr2->level > r_ptr1->level) return FALSE;
5253 if (m_ptr1->hp > m_ptr2->hp) return TRUE;
5254 if (m_ptr2->hp > m_ptr1->hp) return FALSE;
5259 int calculate_upkeep(void)
5261 s32b old_friend_align = friend_align;
5263 bool have_a_unique = FALSE;
5266 total_friend_levels = 0;
5269 for (m_idx = m_max - 1; m_idx >=1; m_idx--)
5271 monster_type *m_ptr;
5272 monster_race *r_ptr;
5274 m_ptr = &m_list[m_idx];
5275 if (!m_ptr->r_idx) continue;
5276 r_ptr = &r_info[m_ptr->r_idx];
5281 if (r_ptr->flags1 & RF1_UNIQUE)
5283 if (p_ptr->pclass == CLASS_CAVALRY)
5285 if (p_ptr->riding == m_idx)
5286 total_friend_levels += (r_ptr->level+5)*2;
5287 else if (!have_a_unique && (r_info[m_ptr->r_idx].flags7 & RF7_RIDING))
5288 total_friend_levels += (r_ptr->level+5)*7/2;
5290 total_friend_levels += (r_ptr->level+5)*10;
5291 have_a_unique = TRUE;
5294 total_friend_levels += (r_ptr->level+5)*10;
5297 total_friend_levels += r_ptr->level;
5299 /* Determine pet alignment */
5300 if (r_ptr->flags3 & RF3_GOOD)
5302 friend_align += r_ptr->level;
5304 else if (r_ptr->flags3 & RF3_EVIL)
5306 friend_align -= r_ptr->level;
5310 if (old_friend_align != friend_align) p_ptr->update |= (PU_BONUS);
5314 upkeep_factor = (total_friend_levels - (p_ptr->lev * 80 / (cp_ptr->pet_upkeep_div)));
5315 if (upkeep_factor < 0) upkeep_factor = 0;
5316 if (upkeep_factor > 1000) upkeep_factor = 1000;
5317 return upkeep_factor;
5323 void do_cmd_pet_dismiss(void)
5325 monster_type *m_ptr;
5326 bool all_pets = FALSE;
5340 /* Allocate the "who" array */
5341 C_MAKE(who, max_m_idx, u16b);
5343 /* Process the monsters (backwards) */
5344 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
5346 if (is_pet(&m_list[pet_ctr]))
5347 who[max_pet++] = pet_ctr;
5350 /* Select the sort method */
5351 ang_sort_comp = ang_sort_comp_pet_dismiss;
5352 ang_sort_swap = ang_sort_swap_hook;
5354 ang_sort(who, &dummy_why, max_pet);
5356 /* Process the monsters (backwards) */
5357 for (i = 0; i < max_pet; i++)
5360 char friend_name[80];
5364 /* Access the monster */
5366 m_ptr = &m_list[pet_ctr];
5368 delete_this = FALSE;
5369 kakunin = ((pet_ctr == p_ptr->riding) || (m_ptr->nickname));
5370 monster_desc(friend_name, m_ptr, 0x80);
5374 /* Hack -- health bar for this monster */
5375 health_track(pet_ctr);
5377 /* Hack -- handle stuff */
5381 sprintf(buf, "%s¤òÊü¤·¤Þ¤¹¤«¡© [Yes/No/Unnamed (%dɤ)]", friend_name, max_pet-i);
5383 sprintf(buf, "Dismiss %s? [Yes/No/Unnamed (%d remain)]", friend_name, max_pet-i);
5388 move_cursor_relative(m_ptr->fy, m_ptr->fx);
5394 if (ch == 'Y' || ch == 'y')
5401 sprintf(buf, "ËÜÅö¤Ë¤è¤í¤·¤¤¤Ç¤¹¤«¡© (%s) ", friend_name);
5403 sprintf(buf, "Are you sure? (%s) ", friend_name);
5405 if (!get_check(buf))
5406 delete_this = FALSE;
5411 if (ch == 'U' || ch == 'u')
5417 if (ch == ESCAPE || ch == 'N' || ch == 'n')
5424 if ((all_pets && !kakunin) || (!all_pets && delete_this))
5426 if (record_named_pet && m_ptr->nickname)
5430 monster_desc(m_name, m_ptr, 0x08);
5431 do_cmd_write_nikki(NIKKI_NAMED_PET, 2, m_name);
5434 if (pet_ctr == p_ptr->riding)
5437 msg_format("%s¤«¤é¹ß¤ê¤¿¡£", friend_name);
5439 msg_format("You have got off %s. ", friend_name);
5444 /* Update the monsters */
5445 p_ptr->update |= (PU_BONUS | PU_MONSTERS);
5446 p_ptr->redraw |= (PR_EXTRA);
5449 /* HACK : Add the line to message buffer */
5451 sprintf(buf, "%s ¤òÎ¥¤·¤¿¡£", friend_name);
5453 sprintf(buf, "Dismissed %s.", friend_name);
5456 p_ptr->window |= (PW_MESSAGE);
5459 delete_monster_idx(pet_ctr);
5468 C_KILL(who, max_m_idx, u16b);
5471 msg_format("%d ɤ¤Î¥Ú¥Ã¥È¤òÊü¤·¤Þ¤·¤¿¡£", Dismissed);
5473 msg_format("You have dismissed %d pet%s.", Dismissed,
5474 (Dismissed == 1 ? "" : "s"));
5476 if (Dismissed == 0 && all_pets)
5478 msg_print("'U'nnamed ¤Ï¡¢¾èÇϰʳ°¤Î̾Á°¤Î¤Ê¤¤¥Ú¥Ã¥È¤À¤±¤òÁ´¤Æ²òÊü¤·¤Þ¤¹¡£");
5480 msg_print("'U'nnamed means all your pets except named pets and your mount.");
5483 p_ptr->update |= (PU_MON_LITE);
5486 bool rakuba(int dam, bool force)
5488 int i, y, x, oy, ox;
5489 int sn = 0, sy = 0, sx = 0;
5491 monster_type *m_ptr = &m_list[p_ptr->riding];
5492 monster_race *r_ptr = &r_info[m_ptr->r_idx];
5494 if (!p_ptr->riding) return FALSE;
5495 if (p_ptr->wild_mode) return FALSE;
5497 if (dam >= 0 || force)
5501 int level = r_ptr->level;
5502 if (p_ptr->riding_ryoute) level += 20;
5503 if ((dam/2 + r_ptr->level) > (p_ptr->skill_exp[GINOU_RIDING]/30+10))
5505 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)
5507 if (r_ptr->level*100 > (p_ptr->skill_exp[GINOU_RIDING] + 1500))
5508 p_ptr->skill_exp[GINOU_RIDING] += (1+(r_ptr->level - p_ptr->skill_exp[GINOU_RIDING]/100 - 15));
5509 else p_ptr->skill_exp[GINOU_RIDING]++;
5512 if (randint0(dam/2 + level*2) < (p_ptr->skill_exp[GINOU_RIDING]/30+10))
5514 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))
5520 /* Check around the player */
5521 for (i = 0; i < 8; i++)
5525 /* Access the location */
5526 y = py + ddy_ddd[i];
5527 x = px + ddx_ddd[i];
5529 c_ptr = &cave[y][x];
5531 /* Skip non-empty grids */
5532 if (cave_perma_grid(c_ptr)) continue;
5533 if (!cave_empty_grid2(c_ptr)) continue;
5535 if (c_ptr->m_idx) continue;
5537 /* Count "safe" grids */
5540 /* Randomize choice */
5541 if (randint0(sn) > 0) continue;
5543 /* Save the safe location */
5548 monster_desc(m_name, m_ptr, 0);
5550 msg_format("%s¤«¤é¿¶¤êÍî¤È¤µ¤ì¤½¤¦¤Ë¤Ê¤Ã¤Æ¡¢Êɤˤ֤Ĥ«¤Ã¤¿¡£",m_name);
5551 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "Êɤؤξ×ÆÍ", -1);
5553 msg_format("You have nearly fallen from %s, but bumped into wall.",m_name);
5554 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "bumping into wall", -1);
5565 /* Redraw the old spot */
5568 /* Redraw the new spot */
5571 /* Check for new panel */
5576 p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5577 p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE;
5581 p_ptr->update |= (PU_BONUS);
5584 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW);
5586 /* Update the monsters */
5587 p_ptr->update |= (PU_DISTANCE);
5590 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5592 p_ptr->redraw |= (PR_EXTRA);
5594 if (p_ptr->ffall && !force)
5596 monster_desc(m_name, m_ptr, 0);
5598 msg_format("%s¤«¤éÍî¤Á¤¿¤¬¡¢¶õÃæ¤Ç¤¦¤Þ¤¯ÂÎÀª¤òΩ¤Æľ¤·¤ÆÃåÃϤ·¤¿¡£",m_name);
5600 msg_format("You are thrown from %s, but make a good landing.",m_name);
5605 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "ÍîÇÏ", -1);
5607 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "Falling from riding", -1);
5609 p_ptr->redraw |= (PR_UHEALTH);
5614 bool do_riding(bool force)
5616 int oy, ox, x, y, dir = 0;
5618 monster_type *m_ptr;
5620 if (!get_rep_dir2(&dir)) return FALSE;
5623 c_ptr = &cave[y][x];
5627 /* Skip non-empty grids */
5628 if (!cave_empty_bold2(y, x) || c_ptr->m_idx)
5631 msg_print("¤½¤Á¤é¤Ë¤Ï¹ß¤ê¤é¤ì¤Þ¤»¤ó¡£");
5633 msg_print("You cannot go to that direction.");
5638 p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5639 p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE;
5643 if (p_ptr->confused)
5646 msg_print("º®Í𤷤Ƥ¤¤Æ¾è¤ì¤Ê¤¤¡ª");
5648 msg_print("You are too confused!");
5652 if (!(c_ptr->m_idx))
5655 msg_print("¤½¤Î¾ì½ê¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
5657 msg_print("Here is no pet.");
5663 m_ptr = &m_list[c_ptr->m_idx];
5665 if (!is_pet(m_ptr) && !force)
5668 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï¥Ú¥Ã¥È¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£");
5670 msg_print("That monster is no a pet.");
5675 if (!(r_info[m_ptr->r_idx].flags7 & RF7_RIDING))
5678 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ë¤Ï¾è¤ì¤Ê¤µ¤½¤¦¤À¡£");
5680 msg_print("This monster doesn't seem suitable for riding.");
5685 if (!(p_ptr->pass_wall) && (c_ptr->feat >= FEAT_RUBBLE) && (c_ptr->feat <= FEAT_PERM_SOLID))
5688 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤ÏÊɤÎÃæ¤Ë¤¤¤ë¡£");
5690 msg_print("This monster is in the wall.");
5695 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)))
5698 msg_print("¥Ñ¥¿¡¼¥ó¤Î¾å¤«¤é¤Ï¾è¤ì¤Þ¤»¤ó¡£");
5700 msg_print("You cannot ride from on Pattern.");
5708 msg_print("¤½¤Î¾ì½ê¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
5710 msg_print("Here is no monster.");
5715 if (r_info[m_ptr->r_idx].level > randint1((p_ptr->skill_exp[GINOU_RIDING]/50 + p_ptr->lev/2 +20)))
5718 msg_print("¤¦¤Þ¤¯¾è¤ì¤Ê¤«¤Ã¤¿¡£");
5720 msg_print("You failed to ride.");
5730 monster_desc(m_name, m_ptr, 0);
5733 msg_format("%s¤òµ¯¤³¤·¤¿¡£", m_name);
5735 msg_format("You have waked %s up.", m_name);
5739 p_ptr->riding = c_ptr->m_idx;
5742 /* Save the old location */
5746 /* Move the player to the safe location */
5750 /* Redraw the old spot */
5753 /* Redraw the new spot */
5756 /* Check for new panel */
5761 /* Mega-Hack -- Forget the view and lite */
5762 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
5765 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW);
5767 /* Update the monsters */
5768 p_ptr->update |= (PU_DISTANCE);
5770 /* Update the monsters */
5771 p_ptr->update |= (PU_BONUS);
5774 p_ptr->redraw |= (PR_MAP | PR_EXTRA);
5777 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5779 p_ptr->redraw |= (PR_UHEALTH);
5785 static void do_name_pet(void)
5787 monster_type *m_ptr;
5790 bool old_name = FALSE;
5791 bool old_target_pet = target_pet;
5794 if (!target_set(TARGET_KILL))
5796 target_pet = old_target_pet;
5799 target_pet = old_target_pet;
5801 if (cave[target_row][target_col].m_idx)
5803 m_ptr = &m_list[cave[target_row][target_col].m_idx];
5809 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï¥Ú¥Ã¥È¤Ç¤Ï¤Ê¤¤¡£");
5811 msg_format("This monster is not a pet.");
5815 if (r_info[m_ptr->r_idx].flags1 & RF1_UNIQUE)
5818 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Î̾Á°¤ÏÊѤ¨¤é¤ì¤Ê¤¤¡ª");
5820 msg_format("You cannot change name of this monster!");
5824 monster_desc(m_name, m_ptr, 0);
5828 msg_format("%s¤Ë̾Á°¤ò¤Ä¤±¤ë¡£", m_name);
5830 msg_format("Name %s.", m_name);
5835 /* Start with nothing */
5836 strcpy(out_val, "");
5838 /* Use old inscription */
5839 if (m_ptr->nickname)
5841 /* Start with the old inscription */
5842 strcpy(out_val, quark_str(m_ptr->nickname));
5846 /* Get a new inscription (possibly empty) */
5848 if (get_string("̾Á°: ", out_val, 15))
5850 if (get_string("Name: ", out_val, 15))
5856 /* Save the inscription */
5857 m_ptr->nickname = quark_add(out_val);
5858 if (record_named_pet)
5862 monster_desc(m_name, m_ptr, 0x08);
5863 do_cmd_write_nikki(NIKKI_NAMED_PET, 0, m_name);
5868 if (record_named_pet && old_name)
5872 monster_desc(m_name, m_ptr, 0x08);
5873 do_cmd_write_nikki(NIKKI_NAMED_PET, 1, m_name);
5875 m_ptr->nickname = 0;
5882 * Issue a pet command
5884 void do_cmd_pet(void)
5889 cptr power_desc[36];
5894 int pets = 0, pet_ctr;
5895 monster_type *m_ptr;
5902 char target_buf[160];
5906 /* Calculate pets */
5907 /* Process the monsters (backwards) */
5908 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
5910 /* Access the monster */
5911 m_ptr = &m_list[pet_ctr];
5913 if (is_pet(m_ptr)) pets++;
5917 power_desc[num] = "¥Ú¥Ã¥È¤òÊü¤¹";
5919 power_desc[num] = "dismiss pets";
5922 powers[num++] = PET_DISMISS;
5925 sprintf(target_buf,"¥Ú¥Ã¥È¤Î¥¿¡¼¥²¥Ã¥È¤ò»ØÄê (¸½ºß¡§%s)",
5926 (pet_t_m_idx ? r_name + r_info[m_list[pet_t_m_idx].r_idx].name : "»ØÄê¤Ê¤·"));
5928 sprintf(target_buf,"specify a targert of pet (now:%s)",
5929 (pet_t_m_idx ? r_name + r_info[m_list[pet_t_m_idx].r_idx].name : "nothing"));
5931 power_desc[num] = target_buf;
5933 powers[num++] = PET_TARGET;
5936 power_desc[num] = "¶á¤¯¤Ë¤¤¤í";
5938 power_desc[num] = "stay close";
5941 if (p_ptr->pet_follow_distance == PET_CLOSE_DIST) mode = num;
5942 powers[num++] = PET_STAY_CLOSE;
5945 power_desc[num] = "¤Ä¤¤¤ÆÍ褤";
5947 power_desc[num] = "follow me";
5950 if (p_ptr->pet_follow_distance == PET_FOLLOW_DIST) mode = num;
5951 powers[num++] = PET_FOLLOW_ME;
5954 power_desc[num] = "Ũ¤ò¸«¤Ä¤±¤ÆÅݤ»";
5956 power_desc[num] = "seek and destroy";
5959 if (p_ptr->pet_follow_distance == PET_DESTROY_DIST) mode = num;
5960 powers[num++] = PET_SEEK_AND_DESTROY;
5963 power_desc[num] = "¾¯¤·Î¥¤ì¤Æ¤¤¤í";
5965 power_desc[num] = "give me space";
5968 if (p_ptr->pet_follow_distance == PET_SPACE_DIST) mode = num;
5969 powers[num++] = PET_ALLOW_SPACE;
5972 power_desc[num] = "Î¥¤ì¤Æ¤¤¤í";
5974 power_desc[num] = "stay away";
5977 if (p_ptr->pet_follow_distance == PET_AWAY_DIST) mode = num;
5978 powers[num++] = PET_STAY_AWAY;
5980 if (p_ptr->pet_extra_flags & PF_OPEN_DOORS)
5983 power_desc[num] = "¥É¥¢¤ò³«¤±¤ë (¸½ºß:ON)";
5985 power_desc[num] = "pets open doors (now On)";
5992 power_desc[num] = "¥É¥¢¤ò³«¤±¤ë (¸½ºß:OFF)";
5994 power_desc[num] = "pets open doors (now Off)";
5998 powers[num++] = PET_OPEN_DOORS;
6000 if (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS)
6003 power_desc[num] = "¥¢¥¤¥Æ¥à¤ò½¦¤¦ (¸½ºß:ON)";
6005 power_desc[num] = "pets pick up items (now On)";
6012 power_desc[num] = "¥¢¥¤¥Æ¥à¤ò½¦¤¦ (¸½ºß:OFF)";
6014 power_desc[num] = "pets pick up items (now Off)";
6018 powers[num++] = PET_TAKE_ITEMS;
6020 if (p_ptr->pet_extra_flags & PF_TELEPORT)
6023 power_desc[num] = "¥Æ¥ì¥Ý¡¼¥È·ÏËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6025 power_desc[num] = "allow teleport (now On)";
6032 power_desc[num] = "¥Æ¥ì¥Ý¡¼¥È·ÏËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6034 power_desc[num] = "allow teleport (now Off)";
6038 powers[num++] = PET_TELEPORT;
6040 if (p_ptr->pet_extra_flags & PF_ATTACK_SPELL)
6043 power_desc[num] = "¹¶·âËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6045 power_desc[num] = "allow cast attack spell (now On)";
6052 power_desc[num] = "¹¶·âËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6054 power_desc[num] = "allow cast attack spell (now Off)";
6058 powers[num++] = PET_ATTACK_SPELL;
6060 if (p_ptr->pet_extra_flags & PF_SUMMON_SPELL)
6063 power_desc[num] = "¾¤´ËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6065 power_desc[num] = "allow cast summon spell (now On)";
6072 power_desc[num] = "¾¤´ËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6074 power_desc[num] = "allow cast summon spell (now Off)";
6078 powers[num++] = PET_SUMMON_SPELL;
6080 if (p_ptr->pet_extra_flags & PF_BALL_SPELL)
6083 power_desc[num] = "¥×¥ì¥¤¥ä¡¼¤ò´¬¤¹þ¤àÈÏ°ÏËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6085 power_desc[num] = "allow involve player in area spell (now On)";
6092 power_desc[num] = "¥×¥ì¥¤¥ä¡¼¤ò´¬¤¹þ¤àÈÏ°ÏËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6094 power_desc[num] = "allow involve player in area spell (now Off)";
6098 powers[num++] = PET_BALL_SPELL;
6103 power_desc[num] = "¥Ú¥Ã¥È¤«¤é¹ß¤ê¤ë";
6105 power_desc[num] = "get off a pet";
6112 power_desc[num] = "¥Ú¥Ã¥È¤Ë¾è¤ë";
6114 power_desc[num] = "ride a pet";
6118 powers[num++] = PET_RIDING;
6121 power_desc[num] = "¥Ú¥Ã¥È¤Ë̾Á°¤ò¤Ä¤±¤ë¡£";
6123 power_desc[num] = "name pets";
6126 powers[num++] = PET_NAME;
6128 if (p_ptr->riding && buki_motteruka(INVEN_RARM) && (empty_hands(FALSE) & 0x00000001) && ((inventory[INVEN_RARM].weight > 99) || (inventory[INVEN_RARM].tval == TV_POLEARM)))
6130 if (p_ptr->pet_extra_flags & PF_RYOUTE)
6133 power_desc[num] = "Éð´ï¤òÊÒ¼ê¤Ç»ý¤Ä";
6135 power_desc[num] = "use one hand to control a riding pet";
6142 power_desc[num] = "Éð´ï¤òξ¼ê¤Ç»ý¤Ä";
6144 power_desc[num] = "use both hands for a weapon.";
6149 powers[num++] = PET_RYOUTE;
6152 /* Nothing chosen yet */
6155 /* Build a prompt (accept all spells) */
6158 /* Build a prompt (accept all spells) */
6160 strnfmt(out_val, 78, "(¥³¥Þ¥ó¥É %c-%c¡¢'*'=°ìÍ÷¡¢ESC=½ªÎ») ¥³¥Þ¥ó¥É¤òÁª¤ó¤Ç¤¯¤À¤µ¤¤:",
6162 strnfmt(out_val, 78, "(Command %c-%c, *=List, ESC=exit) Select a command: ",
6165 I2A(0), I2A(num - 1));
6170 strnfmt(out_val, 78, "(¥³¥Þ¥ó¥É %c-%c¡¢'*'=°ìÍ÷¡¢ESC=½ªÎ») ¥³¥Þ¥ó¥É¤òÁª¤ó¤Ç¤¯¤À¤µ¤¤:",
6172 strnfmt(out_val, 78, "(Command %c-%c, *=List, ESC=exit) Select a command: ",
6175 I2A(0), '0' + num - 27);
6181 /* Save the screen */
6188 prt(format("%s%c) %s", (ctr == mode) ? "*" : " ", I2A(ctr), power_desc[ctr]), y + ctr, x);
6194 prt("", y + ctr, x);
6201 /* Get a command from the user */
6202 while (!flag && get_com(out_val, &choice, TRUE))
6204 /* Request redraw */
6205 if ((choice == ' ') || (choice == '*') || (choice == '?'))
6217 /* Save the screen */
6224 sprintf(buf, "%s%c) %s", (ctr == mode) ? "*" : " ", I2A(ctr), power_desc[ctr]);
6225 prt(buf, y + ctr, x);
6231 prt("", y + ctr, x);
6245 /* Restore the screen */
6253 if (isalpha(choice))
6256 ask = (isupper(choice));
6259 if (ask) choice = tolower(choice);
6261 /* Extract request */
6262 i = (islower(choice) ? A2I(choice) : -1);
6266 ask = FALSE; /* Can't uppercase digits */
6268 i = choice - '0' + 26;
6271 /* Totally Illegal */
6272 if ((i < 0) || (i >= num))
6283 strnfmt(buf, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡© ", power_desc[i]);
6285 strnfmt(buf, 78, "Use %s? ", power_desc[i]);
6289 /* Belay that order */
6290 if (!get_check(buf)) continue;
6297 /* Restore the screen */
6298 if (redraw) Term_load();
6300 /* Abort if needed */
6309 case PET_DISMISS: /* Dismiss pets */
6314 msg_print("¥Ú¥Ã¥È¤¬¤¤¤Ê¤¤¡ª");
6316 msg_print("You have no pets!");
6320 do_cmd_pet_dismiss();
6321 (void)calculate_upkeep();
6326 project_length = -1;
6327 if (!target_set(TARGET_KILL)) pet_t_m_idx = 0;
6330 cave_type *c_ptr = &cave[target_row][target_col];
6331 if (c_ptr->m_idx && (m_list[c_ptr->m_idx].ml))
6333 pet_t_m_idx = cave[target_row][target_col].m_idx;
6334 p_ptr->pet_follow_distance = PET_DESTROY_DIST;
6336 else pet_t_m_idx = 0;
6343 case PET_STAY_CLOSE:
6345 p_ptr->pet_follow_distance = PET_CLOSE_DIST;
6352 p_ptr->pet_follow_distance = PET_FOLLOW_DIST;
6356 /* "Seek and destoy" */
6357 case PET_SEEK_AND_DESTROY:
6359 p_ptr->pet_follow_distance = PET_DESTROY_DIST;
6362 /* "Give me space" */
6363 case PET_ALLOW_SPACE:
6365 p_ptr->pet_follow_distance = PET_SPACE_DIST;
6371 p_ptr->pet_follow_distance = PET_AWAY_DIST;
6374 /* flag - allow pets to open doors */
6375 case PET_OPEN_DOORS:
6377 if (p_ptr->pet_extra_flags & PF_OPEN_DOORS) p_ptr->pet_extra_flags &= ~(PF_OPEN_DOORS);
6378 else p_ptr->pet_extra_flags |= (PF_OPEN_DOORS);
6381 /* flag - allow pets to pickup items */
6382 case PET_TAKE_ITEMS:
6384 if (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS)
6386 p_ptr->pet_extra_flags &= ~(PF_PICKUP_ITEMS);
6387 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
6389 /* Access the monster */
6390 m_ptr = &m_list[pet_ctr];
6394 monster_drop_carried_objects(m_ptr);
6398 else p_ptr->pet_extra_flags |= (PF_PICKUP_ITEMS);
6402 /* flag - allow pets to teleport */
6405 if (p_ptr->pet_extra_flags & PF_TELEPORT) p_ptr->pet_extra_flags &= ~(PF_TELEPORT);
6406 else p_ptr->pet_extra_flags |= (PF_TELEPORT);
6409 /* flag - allow pets to cast attack spell */
6410 case PET_ATTACK_SPELL:
6412 if (p_ptr->pet_extra_flags & PF_ATTACK_SPELL) p_ptr->pet_extra_flags &= ~(PF_ATTACK_SPELL);
6413 else p_ptr->pet_extra_flags |= (PF_ATTACK_SPELL);
6416 /* flag - allow pets to cast attack spell */
6417 case PET_SUMMON_SPELL:
6419 if (p_ptr->pet_extra_flags & PF_SUMMON_SPELL) p_ptr->pet_extra_flags &= ~(PF_SUMMON_SPELL);
6420 else p_ptr->pet_extra_flags |= (PF_SUMMON_SPELL);
6423 /* flag - allow pets to cast attack spell */
6424 case PET_BALL_SPELL:
6426 if (p_ptr->pet_extra_flags & PF_BALL_SPELL) p_ptr->pet_extra_flags &= ~(PF_BALL_SPELL);
6427 else p_ptr->pet_extra_flags |= (PF_BALL_SPELL);
6445 if (p_ptr->pet_extra_flags & PF_RYOUTE) p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
6446 else p_ptr->pet_extra_flags |= (PF_RYOUTE);
6447 p_ptr->update |= (PU_BONUS);