4 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
6 * This software may be copied and distributed for educational, research,
7 * and not for profit purposes provided that this copyright and statement
8 * are included in all such copies. Other copyrights may also apply.
11 /* Purpose: Spell/Prayer commands */
15 #include "spellstips.h"
17 cptr spell_categoly_name(int tval)
22 case TV_HISSATSU_BOOK:
31 case TV_HISSATSU_BOOK:
44 * Allow user to choose a spell/prayer from the given book.
46 * If a valid spell is chosen, saves it in '*sn' and returns TRUE
47 * If the user hits escape, returns FALSE, and set '*sn' to -1
48 * If there are no legal choices, returns FALSE, and sets '*sn' to -2
50 * The "prompt" should be "cast", "recite", or "study"
51 * The "known" should be TRUE for cast/pray, FALSE for study
54 bool select_the_force=FALSE;
56 static int get_spell(int *sn, cptr prompt, int sval, bool learned, int use_realm)
64 bool flag, redraw, okay;
72 int menu_line = (use_menu ? 1 : 0);
74 #ifdef ALLOW_REPEAT /* TNB */
76 /* Get the spell, if available */
79 /* Verify the spell */
80 if (spell_okay(*sn, learned, FALSE, use_realm))
87 #endif /* ALLOW_REPEAT -- TNB */
89 p = spell_categoly_name(mp_ptr->spell_book);
92 for (spell = 0; spell < 32; spell++)
94 /* Check for this spell */
95 if ((fake_spell_flags[sval] & (1L << spell)))
97 /* Collect this spell */
98 spells[num++] = spell;
102 /* Assume no usable spells */
105 /* Assume no spells available */
108 /* Check for "okay" spells */
109 for (i = 0; i < num; i++)
111 /* Look for "okay" spells */
112 if (spell_okay(spells[i], learned, FALSE, use_realm)) okay = TRUE;
115 /* No "okay" spells */
116 if (!okay) return (FALSE);
117 if (((use_realm) != p_ptr->realm1) && ((use_realm) != p_ptr->realm2) && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE)) return FALSE;
118 if (((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE)) && !is_magic(use_realm)) return FALSE;
119 if ((p_ptr->pclass == CLASS_RED_MAGE) && ((use_realm) != REALM_ARCANE) && (sval > 1)) return FALSE;
121 /* Assume cancelled */
124 /* Nothing chosen yet */
134 p_ptr->window |= (PW_SPELL);
140 /* Build a prompt (accept all spells) */
142 jverb1( prompt, jverb_buf );
143 (void) strnfmt(out_val, 78, "(%^s:%c-%c, '*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤Î%s¤ò%^s¤Þ¤¹¤«? ",
144 p, I2A(0), I2A(num - 1), p, jverb_buf );
146 (void)strnfmt(out_val, 78, "(%^ss %c-%c, *=List, ESC=exit) %^s which %s? ",
147 p, I2A(0), I2A(num - 1), prompt, p);
150 /* Get a spell from the user */
152 choice = (always_show_list || use_menu) ? ESCAPE : 1;
155 if (choice == ESCAPE) choice = ' ';
156 else if (!get_com(out_val, &choice, TRUE))break;
158 if (use_menu && choice != ' ')
172 menu_line += (num - 1);
194 if (menu_line > num) menu_line -= num;
195 /* Display a list of spells */
196 print_spells(menu_line, spells, num, 1, 15, use_realm);
202 if ((choice == ' ') || (choice == '*') || (choice == '?'))
210 /* Save the screen */
213 /* Display a list of spells */
214 print_spells(menu_line, spells, num, 1, 15, use_realm);
220 if (use_menu) continue;
225 /* Restore the screen */
235 ask = (isupper(choice));
238 if (ask) choice = tolower(choice);
240 /* Extract request */
241 i = (islower(choice) ? A2I(choice) : -1);
244 /* Totally Illegal */
245 if ((i < 0) || (i >= num))
251 /* Save the spell index */
254 /* Require "okay" spells */
255 if (!spell_okay(spell, learned, FALSE, use_realm))
259 msg_format("¤½¤Î%s¤ò%s¤³¤È¤Ï¤Ç¤¤Þ¤»¤ó¡£", p, prompt);
261 msg_format("You may not %s that %s.", prompt, p);
272 /* Access the spell */
273 if (!is_magic(use_realm))
275 s_ptr = &technic_info[use_realm - MIN_TECHNIC][spell];
279 s_ptr = &mp_ptr->info[use_realm - 1][spell];
282 /* Extract mana consumption rate */
283 if (use_realm == REALM_HISSATSU)
285 need_mana = s_ptr->smana;
289 need_mana = mod_need_mana(s_ptr->smana, spell, use_realm);
294 jverb1( prompt, jverb_buf );
295 /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½¤ËÂбþ */
296 (void) strnfmt(tmp_val, 78, "%s(MP%d, ¼ºÇÔΨ%d%%)¤ò%s¤Þ¤¹¤«? ",
297 spell_names[technic2magic(use_realm)-1][spell], need_mana,
298 spell_chance(spell, use_realm),jverb_buf);
300 (void)strnfmt(tmp_val, 78, "%^s %s (%d mana, %d%% fail)? ",
301 prompt, spell_names[technic2magic(use_realm)-1][spell], need_mana,
302 spell_chance(spell, use_realm));
306 /* Belay that order */
307 if (!get_check(tmp_val)) continue;
315 /* Restore the screen */
316 if (redraw) screen_load();
323 p_ptr->window |= (PW_SPELL);
330 /* Abort if needed */
331 if (!flag) return FALSE;
333 /* Save the choice */
336 #ifdef ALLOW_REPEAT /* TNB */
340 #endif /* ALLOW_REPEAT -- TNB */
347 static bool item_tester_learn_spell(object_type *o_ptr)
349 s32b choices = realm_choices2[p_ptr->pclass];
351 if (p_ptr->pclass == CLASS_PRIEST)
353 if (is_good_realm(p_ptr->realm1))
355 choices &= ~(CH_DEATH | CH_DAEMON);
359 choices &= ~(CH_LIFE | CH_CRUSADE);
363 if ((o_ptr->tval < TV_LIFE_BOOK) || (o_ptr->tval > (TV_LIFE_BOOK + MAX_REALM - 1))) return (FALSE);
364 if ((o_ptr->tval == TV_MUSIC_BOOK) && (p_ptr->pclass == CLASS_BARD)) return (TRUE);
365 else if (!is_magic(tval2realm(o_ptr->tval))) return FALSE;
366 if ((REALM1_BOOK == o_ptr->tval) || (REALM2_BOOK == o_ptr->tval)) return (TRUE);
367 if (choices & (0x0001 << (tval2realm(o_ptr->tval) - 1))) return (TRUE);
373 * Peruse the spells/prayers in a book
375 * Note that *all* spells in the book are listed
377 * Note that browsing is allowed while confused or blind,
378 * and in the dark, primarily to allow browsing in stores.
380 void do_cmd_browse(void)
382 int item, sval, use_realm = 0, j, line;
393 /* Warriors are illiterate */
394 if (!(p_ptr->realm1 || p_ptr->realm2) && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE))
397 msg_print("ËܤòÆɤळ¤È¤¬¤Ç¤¤Ê¤¤¡ª");
399 msg_print("You cannot read books!");
405 if (p_ptr->special_defense & KATA_MUSOU)
407 set_action(ACTION_NONE);
410 /* Restrict choices to "useful" books */
411 if (p_ptr->realm2 == REALM_NONE) item_tester_tval = mp_ptr->spell_book;
412 else item_tester_hook = item_tester_learn_spell;
416 q = "¤É¤ÎËܤòÆɤߤޤ¹¤«? ";
418 q = "Browse which book? ";
422 s = "Æɤá¤ëËܤ¬¤Ê¤¤¡£";
424 s = "You have no books that you can read.";
427 if (p_ptr->pclass == CLASS_FORCETRAINER)
428 select_the_force = TRUE;
429 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))){
430 select_the_force = FALSE;
433 select_the_force = FALSE;
435 if (item == INVEN_FORCE) { /* the_force */
436 do_cmd_mind_browse();
439 /* Get the item (in the pack) */
442 o_ptr = &inventory[item];
445 /* Get the item (on the floor) */
448 o_ptr = &o_list[0 - item];
451 /* Access the item's sval */
454 use_realm = tval2realm(o_ptr->tval);
456 /* Track the object kind */
457 object_kind_track(o_ptr->k_idx);
459 /* Hack -- Handle stuff */
464 for (spell = 0; spell < 32; spell++)
466 /* Check for this spell */
467 if ((fake_spell_flags[sval] & (1L << spell)))
469 /* Collect this spell */
470 spells[num++] = spell;
475 /* Save the screen */
478 /* Clear the top line */
481 /* Keep browsing spells. Exit browsing on cancel. */
484 /* Ask for a spell, allow cancel */
486 if (!get_spell(&spell, "Æɤà", o_ptr->sval, TRUE, use_realm))
488 if (!get_spell(&spell, "browse", o_ptr->sval, TRUE, use_realm))
491 /* If cancelled, leave immediately. */
492 if (spell == -1) break;
494 /* Display a list of spells */
495 print_spells(0, spells, num, 1, 15, use_realm);
497 /* Notify that there's nothing to see, and wait. */
498 if (use_realm == REALM_HISSATSU)
500 prt("Æɤá¤ëµ»¤¬¤Ê¤¤¡£", 0, 0);
502 prt("No techniques to browse.", 0, 0);
506 prt("Æɤá¤ë¼öʸ¤¬¤Ê¤¤¡£", 0, 0);
508 prt("No spells to browse.", 0, 0);
513 /* Restore the screen */
519 /* Clear lines, position cursor (really should use strlen here) */
520 Term_erase(14, 14, 255);
521 Term_erase(14, 13, 255);
522 Term_erase(14, 12, 255);
523 Term_erase(14, 11, 255);
525 roff_to_buf(spell_tips[technic2magic(use_realm) - 1][spell], 62, temp, sizeof(temp));
526 for (j = 0, line = 11; temp[j]; j += 1 + strlen(&temp[j]))
528 prt(&temp[j], line, 15);
533 /* Restore the screen */
538 static void change_realm2(int next_realm)
543 for (i = 0; i < 64; i++)
545 p_ptr->spell_order[j] = p_ptr->spell_order[i];
546 if (p_ptr->spell_order[i] < 32) j++;
549 p_ptr->spell_order[j] = 99;
551 for (i = 32; i < 64; i++)
553 p_ptr->spell_exp[i] = SPELL_EXP_UNSKILLED;
555 p_ptr->spell_learned2 = 0L;
556 p_ptr->spell_worked2 = 0L;
557 p_ptr->spell_forgotten2 = 0L;
560 sprintf(tmp,"ËâË¡¤ÎÎΰè¤ò%s¤«¤é%s¤ËÊѹ¹¤·¤¿¡£", realm_names[p_ptr->realm2], realm_names[next_realm]);
562 sprintf(tmp,"change magic realm from %s to %s.", realm_names[p_ptr->realm2], realm_names[next_realm]);
564 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
565 p_ptr->old_realm |= 1 << (p_ptr->realm2-1);
566 p_ptr->realm2 = next_realm;
568 p_ptr->notice |= (PN_REORDER);
569 p_ptr->update |= (PU_SPELLS);
575 * Study a book to gain a new spell/prayer
577 void do_cmd_study(void)
581 bool learned = FALSE;
583 /* Spells of realm2 will have an increment of +32 */
586 cptr p = spell_categoly_name(mp_ptr->spell_book);
595 msg_print("ËܤòÆɤळ¤È¤¬¤Ç¤¤Ê¤¤¡ª");
597 msg_print("You cannot read books!");
603 if (p_ptr->blind || no_lite())
606 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡ª");
608 msg_print("You cannot see!");
617 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡ª");
619 msg_print("You are too confused!");
625 if (!(p_ptr->new_spells))
628 msg_format("¿·¤·¤¤%s¤ò³Ð¤¨¤ë¤³¤È¤Ï¤Ç¤¤Ê¤¤¡ª", p);
630 msg_format("You cannot learn any new %ss!", p);
636 if (p_ptr->special_defense & KATA_MUSOU)
638 set_action(ACTION_NONE);
641 p = spell_categoly_name(mp_ptr->spell_book);
644 if( p_ptr->new_spells < 10 ){
645 msg_format("¤¢¤È %d ¤Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
647 msg_format("¤¢¤È %d ¸Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
650 msg_format("You can learn %d new %s%s.", p_ptr->new_spells, p,
651 (p_ptr->new_spells == 1?"":"s"));
657 /* Restrict choices to "useful" books */
658 if (p_ptr->realm2 == REALM_NONE) item_tester_tval = mp_ptr->spell_book;
659 else item_tester_hook = item_tester_learn_spell;
663 q = "¤É¤ÎËܤ«¤é³Ø¤Ó¤Þ¤¹¤«? ";
665 q = "Study which book? ";
669 s = "Æɤá¤ëËܤ¬¤Ê¤¤¡£";
671 s = "You have no books that you can read.";
674 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
676 /* Get the item (in the pack) */
679 o_ptr = &inventory[item];
682 /* Get the item (on the floor) */
685 o_ptr = &o_list[0 - item];
688 /* Access the item's sval */
691 if (o_ptr->tval == REALM2_BOOK) increment = 32;
692 else if (o_ptr->tval != REALM1_BOOK)
695 if (!get_check("ËÜÅö¤ËËâË¡¤ÎÎΰè¤òÊѹ¹¤·¤Þ¤¹¤«¡©")) return;
697 if (!get_check("Really, change magic realm? ")) return;
699 change_realm2(tval2realm(o_ptr->tval));
703 /* Track the object kind */
704 object_kind_track(o_ptr->k_idx);
706 /* Hack -- Handle stuff */
709 /* Mage -- Learn a selected spell */
710 if (mp_ptr->spell_book != TV_LIFE_BOOK)
712 /* Ask for a spell, allow cancel */
714 if (!get_spell(&spell, "³Ø¤Ö", sval, FALSE, o_ptr->tval - TV_LIFE_BOOK + 1)
715 && (spell == -1)) return;
717 if (!get_spell(&spell, "study", sval, FALSE, o_ptr->tval - TV_LIFE_BOOK + 1)
718 && (spell == -1)) return;
723 /* Priest -- Learn a random prayer */
731 for (spell = 0; spell < 32; spell++)
733 /* Check spells in the book */
734 if ((fake_spell_flags[sval] & (1L << spell)))
736 /* Skip non "okay" prayers */
737 if (!spell_okay(spell, FALSE, TRUE,
738 (increment ? p_ptr->realm2 : p_ptr->realm1))) continue;
740 /* Hack -- Prepare the randomizer */
743 /* Hack -- Apply the randomizer */
744 if (one_in_(k)) gift = spell;
752 /* Nothing to study */
757 msg_format("¤½¤ÎËܤˤϳؤ֤٤%s¤¬¤Ê¤¤¡£", p);
759 msg_format("You cannot learn any %ss in that book.", p);
768 if (increment) spell += increment;
770 /* Learn the spell */
773 if (p_ptr->spell_learned1 & (1L << spell)) learned = TRUE;
774 else p_ptr->spell_learned1 |= (1L << spell);
778 if (p_ptr->spell_learned2 & (1L << (spell - 32))) learned = TRUE;
779 else p_ptr->spell_learned2 |= (1L << (spell - 32));
784 int max_exp = (spell < 32) ? SPELL_EXP_MASTER : SPELL_EXP_EXPERT;
785 int old_exp = p_ptr->spell_exp[spell];
786 int new_rank = EXP_LEVEL_UNSKILLED;
787 cptr name = spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell%32];
789 if (old_exp >= max_exp)
792 msg_format("¤½¤Î%s¤Ï´°Á´¤Ë»È¤¤¤³¤Ê¤»¤ë¤Î¤Ç³Ø¤ÖɬÍפϤʤ¤¡£", spell_categoly_name(mp_ptr->spell_book));
794 msg_format("You don't need to study this %s anymore.", spell_categoly_name(mp_ptr->spell_book));
799 if (!get_check(format("%s¤Î%s¤ò¤µ¤é¤Ë³Ø¤Ó¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©", name, spell_categoly_name(mp_ptr->spell_book))))
801 if (!get_check(format("You will study a %s of %s again. Are you sure? ", spell_categoly_name(mp_ptr->spell_book), name)))
806 else if (old_exp >= SPELL_EXP_EXPERT)
808 p_ptr->spell_exp[spell] = SPELL_EXP_MASTER;
809 new_rank = EXP_LEVEL_MASTER;
811 else if (old_exp >= SPELL_EXP_SKILLED)
813 if (spell >= 32) p_ptr->spell_exp[spell] = SPELL_EXP_EXPERT;
814 else p_ptr->spell_exp[spell] += SPELL_EXP_EXPERT - SPELL_EXP_SKILLED;
815 new_rank = EXP_LEVEL_EXPERT;
817 else if (old_exp >= SPELL_EXP_BEGINNER)
819 p_ptr->spell_exp[spell] = SPELL_EXP_SKILLED + (old_exp - SPELL_EXP_BEGINNER) * 2 / 3;
820 new_rank = EXP_LEVEL_SKILLED;
824 p_ptr->spell_exp[spell] = SPELL_EXP_BEGINNER + old_exp / 3;
825 new_rank = EXP_LEVEL_BEGINNER;
828 msg_format("%s¤Î½ÏÎýÅÙ¤¬%s¤Ë¾å¤¬¤Ã¤¿¡£", name, exp_level_str[new_rank]);
830 msg_format("Your proficiency of %s is now %s rank.", name, exp_level_str[new_rank]);
835 /* Find the next open entry in "p_ptr->spell_order[]" */
836 for (i = 0; i < 64; i++)
838 /* Stop at the first empty space */
839 if (p_ptr->spell_order[i] == 99) break;
842 /* Add the spell to the known list */
843 p_ptr->spell_order[i++] = spell;
845 /* Mention the result */
847 /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½¤ËÂбþ */
848 if (mp_ptr->spell_book == TV_MUSIC_BOOK)
850 msg_format("%s¤ò³Ø¤ó¤À¡£",
851 spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32]);
855 msg_format("%s¤Î%s¤ò³Ø¤ó¤À¡£",
856 spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32] ,p);
859 msg_format("You have learned the %s of %s.",
860 p, spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32]);
867 switch (mp_ptr->spell_book)
870 chg_virtue(V_FAITH, 1);
873 chg_virtue(V_UNLIFE, 1);
876 chg_virtue(V_NATURE, 1);
879 chg_virtue(V_KNOWLEDGE, 1);
886 /* One less spell available */
887 p_ptr->learned_spells++;
889 /* Message if needed */
890 if (p_ptr->new_spells)
894 if (p_ptr->new_spells < 10) msg_format("¤¢¤È %d ¤Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
895 else msg_format("¤¢¤È %d ¸Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
897 msg_format("You can learn %d more %s%s.", p_ptr->new_spells, p,
898 (p_ptr->new_spells != 1) ? "s" : "");
904 p_ptr->update |= (PU_SPELLS);
907 /* Redraw object recall */
908 p_ptr->window |= (PW_OBJECT);
912 static void wild_magic(int spell)
915 int type = SUMMON_BIZARRE1 + randint0(6);
917 if (type < SUMMON_BIZARRE1) type = SUMMON_BIZARRE1;
918 else if (type > SUMMON_BIZARRE6) type = SUMMON_BIZARRE6;
920 switch (randint1(spell) + randint1(8) + 1)
930 teleport_player(100);
934 teleport_player(200);
944 lite_area(damroll(2, 3), 2);
947 destroy_doors_touch();
952 sleep_monsters_touch();
956 trap_creation(py, px);
965 aggravate_monsters(0);
968 earthquake(py, px, 5);
972 (void)gain_random_mutation(0);
982 fire_ball(GF_CHAOS, 0, spell + 5, 1 + (spell / 10));
989 while (counter++ < 8)
991 (void)summon_specific(0, py, px, (dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET));
996 activate_hi_summon(py, px, FALSE);
999 (void)summon_cyber(-1, py, px);
1004 (void)activate_ty_curse(FALSE, &count);
1013 static bool cast_life_spell(int spell)
1016 int plev = p_ptr->lev;
1020 case 0: /* Cure Light Wounds */
1021 (void)hp_player(damroll(2, 10));
1022 (void)set_cut(p_ptr->cut - 10);
1025 (void)set_blessed(randint1(12) + 12, FALSE);
1027 case 2: /* Make Light Wounds */
1028 if (!get_aim_dir(&dir)) return FALSE;
1029 fire_ball_hide(GF_WOUNDS, dir, damroll(3 + ((plev - 1) / 5), 4), 0);
1031 case 3: /* Call Light */
1032 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1034 case 4: /* Detect Traps + Secret Doors */
1035 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1036 (void)detect_doors(DETECT_RAD_DEFAULT);
1037 (void)detect_stairs(DETECT_RAD_DEFAULT);
1039 case 5: /* Cure Medium Wounds */
1040 (void)hp_player(damroll(4, 10));
1041 (void)set_cut((p_ptr->cut / 2) - 20);
1043 case 6: /* Cure Poison */
1044 (void)set_poisoned(0);
1046 case 7: /* Satisfy Hunger */
1047 (void)set_food(PY_FOOD_MAX - 1);
1049 case 8: /* Remove Curse */
1053 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1055 msg_print("You feel as if someone is watching over you.");
1059 case 9: /* Make Medium Wounds */
1060 if (!get_aim_dir(&dir)) return FALSE;
1061 fire_ball_hide(GF_WOUNDS, dir, damroll(8 + ((plev - 5) / 4), 8), 0);
1063 case 10: /* Cure Critical Wounds */
1064 (void)hp_player(damroll(8, 10));
1069 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1070 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1073 map_area(DETECT_RAD_MAP);
1076 (void)turn_undead();
1078 case 14: /* Healing */
1079 (void)hp_player(300);
1083 case 15: /* Glyph of Warding */
1086 case 16: /* Dispel Curse */
1087 if (remove_all_curse())
1090 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1092 msg_print("You feel as if someone is watching over you.");
1096 case 17: /* Perception */
1097 return ident_spell(FALSE);
1098 case 18: /* Dispel Undead */
1099 (void)dispel_undead(randint1(plev * 5));
1101 case 19: /* 'Day of the Dove' */
1102 charm_monsters(plev * 2);
1104 case 20: /* Make Critical Wounds */
1105 if (!get_aim_dir(&dir)) return FALSE;
1106 fire_ball_hide(GF_WOUNDS, dir, damroll(5+((plev - 5) / 3), 15), 0);
1108 case 21: /* Word of Recall */
1109 return word_of_recall();
1110 case 22: /* Alter Reality */
1113 case 23: /* Warding True */
1118 num_repro += MAX_REPRO;
1120 case 25: /* Detection True */
1121 (void)detect_all(DETECT_RAD_DEFAULT);
1123 case 26: /* Genocide Undead */
1124 (void)mass_genocide_undead(plev+50,TRUE);
1126 case 27: /* Clairvoyance */
1129 case 28: /* Restoration */
1130 (void)do_res_stat(A_STR);
1131 (void)do_res_stat(A_INT);
1132 (void)do_res_stat(A_WIS);
1133 (void)do_res_stat(A_DEX);
1134 (void)do_res_stat(A_CON);
1135 (void)do_res_stat(A_CHR);
1136 (void)restore_level();
1138 case 29: /* Healing True */
1139 (void)hp_player(2000);
1143 case 30: /* Holy Vision */
1144 return identify_fully(FALSE);
1145 case 31: /* Ultimate resistance */
1147 int v = randint1(plev/2)+plev/2;
1148 (void)set_fast(v, FALSE);
1149 set_oppose_acid(v, FALSE);
1150 set_oppose_elec(v, FALSE);
1151 set_oppose_fire(v, FALSE);
1152 set_oppose_cold(v, FALSE);
1153 set_oppose_pois(v, FALSE);
1154 set_ultimate_res(v, FALSE);
1159 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥é¥¤¥Õ¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1161 msg_format("You cast an unknown Life spell: %d.", spell);
1172 static bool cast_sorcery_spell(int spell)
1175 int plev = p_ptr->lev;
1179 case 0: /* Detect Monsters */
1180 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1182 case 1: /* Phase Door */
1183 teleport_player(10);
1185 case 2: /* Detect Doors and Traps */
1186 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1187 (void)detect_doors(DETECT_RAD_DEFAULT);
1188 (void)detect_stairs(DETECT_RAD_DEFAULT);
1190 case 3: /* Light Area */
1191 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1193 case 4: /* Confuse Monster */
1194 if (!get_aim_dir(&dir)) return FALSE;
1196 (void)confuse_monster(dir, (plev * 3) / 2);
1198 case 5: /* Teleport */
1199 teleport_player(plev * 5);
1201 case 6: /* Sleep Monster */
1202 if (!get_aim_dir(&dir)) return FALSE;
1204 (void)sleep_monster(dir);
1206 case 7: /* Recharging */
1207 return recharge(plev * 4);
1208 case 8: /* Magic Mapping */
1209 map_area(DETECT_RAD_MAP);
1211 case 9: /* Identify */
1212 return ident_spell(FALSE);
1213 case 10: /* Slow Monster */
1214 if (!get_aim_dir(&dir)) return FALSE;
1216 (void)slow_monster(dir);
1218 case 11: /* Mass Sleep */
1219 (void)sleep_monsters();
1221 case 12: /* Teleport Away */
1222 if (!get_aim_dir(&dir)) return FALSE;
1224 (void)fire_beam(GF_AWAY_ALL, dir, plev);
1226 case 13: /* Haste Self */
1227 (void)set_fast(randint1(20 + plev) + plev, FALSE);
1229 case 14: /* Detection True */
1230 (void)detect_all(DETECT_RAD_DEFAULT);
1232 case 15: /* Identify True */
1233 return identify_fully(FALSE);
1234 case 16: /* Detect Objects and Treasure*/
1235 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
1236 (void)detect_treasure(DETECT_RAD_DEFAULT);
1237 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
1239 case 17: /* Charm Monster */
1240 if (!get_aim_dir(&dir)) return FALSE;
1242 (void)charm_monster(dir, plev);
1244 case 18: /* Sense Minds */
1245 (void)set_tim_esp(randint1(30) + 25, FALSE);
1247 case 19: /* Teleport to town */
1249 case 20: /* Self knowledge */
1250 (void)self_knowledge();
1252 case 21: /* Teleport Level */
1254 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
1256 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
1258 (void)teleport_player_level();
1260 case 22: /* Word of Recall */
1261 return word_of_recall();
1262 case 23: /* Dimension Door */
1264 msg_print("¼¡¸µ¤ÎÈ⤬³«¤¤¤¿¡£ÌÜŪÃϤòÁª¤ó¤Ç²¼¤µ¤¤¡£");
1266 msg_print("You open a dimensional gate. Choose a destination.");
1269 return dimension_door();
1270 case 24: /* Probing */
1273 case 25: /* Explosive Rune */
1276 case 26: /* Telekinesis */
1277 if (!get_aim_dir(&dir)) return FALSE;
1279 fetch(dir, plev * 15, FALSE);
1281 case 27: /* Clairvoyance */
1282 chg_virtue(V_KNOWLEDGE, 1);
1283 chg_virtue(V_ENLIGHTEN, 1);
1286 if (!(p_ptr->telepathy))
1288 (void)set_tim_esp(randint1(30) + 25, FALSE);
1291 case 28: /* Charm Monsters */
1292 charm_monsters(plev * 2);
1294 case 29: /* Alchemy */
1296 case 30: /* Banish */
1297 banish_monsters(plev * 4);
1299 case 31: /* Globe of Invulnerability */
1300 (void)set_invuln(randint1(4) + 4, FALSE);
1304 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥½¡¼¥µ¥ê¡¼¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1306 msg_format("You cast an unknown Sorcery spell: %d.", spell);
1316 static bool cast_nature_spell(int spell)
1320 int plev = p_ptr->lev;
1322 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1323 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1324 else beam = plev / 2;
1328 case 0: /* Detect Creatures */
1329 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1331 case 1: /* Lightning Bolt */
1332 project_length = plev / 6 + 2;
1333 if (!get_aim_dir(&dir)) return FALSE;
1335 fire_beam(GF_ELEC, dir,
1336 damroll(3 + ((plev - 1) / 5), 4));
1338 case 2: /* Detect Doors & Traps */
1339 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1340 (void)detect_doors(DETECT_RAD_DEFAULT);
1341 (void)detect_stairs(DETECT_RAD_DEFAULT);
1343 case 3: /* Produce Food */
1345 object_type forge, *q_ptr = &forge;
1348 msg_print("¿©ÎÁ¤òÀ¸À®¤·¤¿¡£");
1350 msg_print("A food ration is produced.");
1353 /* Create the food ration */
1354 object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_RATION));
1356 /* Drop the object from heaven */
1357 (void)drop_near(q_ptr, -1, py, px);
1361 case 4: /* Daylight */
1362 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1363 if ((prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
1366 msg_print("Æü¤Î¸÷¤¬¤¢¤Ê¤¿¤ÎÆùÂΤò¾Ç¤¬¤·¤¿¡ª");
1368 msg_print("The daylight scorches your flesh!");
1372 take_hit(DAMAGE_NOESCAPE, damroll(2, 2), "Æü¤Î¸÷", -1);
1374 take_hit(DAMAGE_NOESCAPE, damroll(2, 2), "daylight", -1);
1379 case 5: /* Animal Taming */
1380 if (!get_aim_dir(&dir)) return FALSE;
1382 (void)charm_animal(dir, plev);
1384 case 6: /* Resist Environment */
1385 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1386 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1387 (void)set_oppose_elec(randint1(20) + 20, FALSE);
1389 case 7: /* Cure Wounds & Poison */
1390 (void)hp_player(damroll(2, 8));
1392 (void)set_poisoned(0);
1394 case 8: /* Stone to Mud */
1395 if (!get_aim_dir(&dir)) return FALSE;
1397 (void)wall_to_mud(dir);
1399 case 9: /* Frost Bolt */
1400 if (!get_aim_dir(&dir)) return FALSE;
1401 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
1402 damroll(3 + ((plev - 5) / 4), 8));
1404 case 10: /* Nature Awareness -- downgraded */
1405 map_area(DETECT_RAD_MAP);
1406 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1407 (void)detect_doors(DETECT_RAD_DEFAULT);
1408 (void)detect_stairs(DETECT_RAD_DEFAULT);
1409 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1411 case 11: /* Fire Bolt */
1412 if (!get_aim_dir(&dir)) return FALSE;
1413 fire_bolt_or_beam(beam - 10, GF_FIRE, dir,
1414 damroll(5 + ((plev - 5) / 4), 8));
1416 case 12: /* Ray of Sunlight */
1417 if (!get_aim_dir(&dir)) return FALSE;
1419 msg_print("ÂÀÍÛ¸÷Àþ¤¬¸½¤ì¤¿¡£");
1421 msg_print("A line of sunlight appears.");
1424 (void)lite_line(dir);
1426 case 13: /* Entangle */
1429 case 14: /* Summon Animals */
1430 if (!(summon_specific(-1, py, px, plev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET))))
1433 msg_print("ưʪ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
1435 msg_print("No animals arrive.");
1439 case 15: /* Herbal Healing */
1440 (void)hp_player(500);
1443 (void)set_poisoned(0);
1445 case 16: /* Stair Building */
1446 (void)stair_creation();
1448 case 17: /* Stone Skin */
1449 (void)set_shield(randint1(20) + 30, FALSE);
1451 case 18: /* Resistance True */
1452 (void)set_oppose_acid(randint1(20) + 20, FALSE);
1453 (void)set_oppose_elec(randint1(20) + 20, FALSE);
1454 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1455 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1456 (void)set_oppose_pois(randint1(20) + 20, FALSE);
1458 case 19: /* Tree Creation */
1459 (void)tree_creation();
1461 case 20: /* Animal Friendship */
1462 (void)charm_animals(plev * 2);
1464 case 21: /* Stone Tell */
1465 return identify_fully(FALSE);
1466 case 22: /* Wall of Stone */
1469 case 23: /* Protection from Corrosion */
1471 case 24: /* Earthquake */
1472 earthquake(py, px, 10);
1474 case 25: /* Whirlwind Attack */
1478 monster_type *m_ptr;
1480 for (dir = 0; dir < 8; dir++)
1482 y = py + ddy_ddd[dir];
1483 x = px + ddx_ddd[dir];
1484 c_ptr = &cave[y][x];
1486 /* Get the monster */
1487 m_ptr = &m_list[c_ptr->m_idx];
1489 /* Hack -- attack monsters */
1490 if (c_ptr->m_idx && (m_ptr->ml || cave_floor_bold(y, x)))
1495 case 26: /* Blizzard */
1496 if (!get_aim_dir(&dir)) return FALSE;
1498 fire_ball(GF_COLD, dir, 70 + plev * 3 / 2, (plev / 12) + 1);
1500 case 27: /* Lightning Storm */
1501 if (!get_aim_dir(&dir)) return FALSE;
1502 fire_ball(GF_ELEC, dir, 90 + plev * 3 / 2, (plev / 12) + 1);
1504 case 28: /* Whirlpool */
1505 if (!get_aim_dir(&dir)) return FALSE;
1506 fire_ball(GF_WATER, dir, 100 + plev * 3 / 2, (plev / 12) + 1);
1508 case 29: /* Call Sunlight */
1509 fire_ball(GF_LITE, 0, 150, 8);
1510 chg_virtue(V_KNOWLEDGE, 1);
1511 chg_virtue(V_ENLIGHTEN, 1);
1513 if ((prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
1516 msg_print("Æü¸÷¤¬¤¢¤Ê¤¿¤ÎÆùÂΤò¾Ç¤¬¤·¤¿¡ª");
1518 msg_print("The sunlight scorches your flesh!");
1522 take_hit(DAMAGE_NOESCAPE, 50, "Æü¸÷", -1);
1524 take_hit(DAMAGE_NOESCAPE, 50, "sunlight", -1);
1529 case 30: /* Elemental Branding */
1530 brand_weapon(randint0(2));
1532 case 31: /* Nature's Wrath */
1533 (void)dispel_monsters(plev * 4);
1534 earthquake(py, px, 20 + (plev / 2));
1535 project(0, 1 + plev / 12, py, px,
1536 (100 + plev) * 2, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM, -1);
1540 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥Í¥¤¥Á¥ã¡¼¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1542 msg_format("You cast an unknown Nature spell: %d.", spell);
1552 static bool cast_chaos_spell(int spell)
1555 int plev = p_ptr->lev;
1557 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1558 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1559 else beam = plev / 2;
1563 case 0: /* Magic Missile */
1564 if (!get_aim_dir(&dir)) return FALSE;
1566 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
1567 damroll(3 + ((plev - 1) / 5), 4));
1569 case 1: /* Trap / Door destruction */
1570 (void)destroy_doors_touch();
1572 case 2: /* Flash of Light == Light Area */
1573 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1575 case 3: /* Touch of Confusion */
1576 if (!(p_ptr->special_attack & ATTACK_CONFUSE))
1579 msg_print("¤¢¤Ê¤¿¤Î¼ê¤Ï¸÷¤ê»Ï¤á¤¿¡£");
1581 msg_print("Your hands start glowing.");
1584 p_ptr->special_attack |= ATTACK_CONFUSE;
1585 p_ptr->redraw |= (PR_STATUS);
1588 case 4: /* Mana Burst */
1589 if (!get_aim_dir(&dir)) return FALSE;
1591 fire_ball(GF_MISSILE, dir,
1592 (damroll(3, 5) + plev +
1593 (plev / (((p_ptr->pclass == CLASS_MAGE)
1594 || (p_ptr->pclass == CLASS_HIGH_MAGE)
1595 || (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
1596 ((plev < 30) ? 2 : 3));
1597 /* Shouldn't actually use GF_MANA, as it will destroy all
1598 * items on the floor */
1600 case 5: /* Fire Bolt */
1601 if (!get_aim_dir(&dir)) return FALSE;
1603 fire_bolt_or_beam(beam, GF_FIRE, dir,
1604 damroll(8 + ((plev - 5) / 4), 8));
1606 case 6: /* Fist of Force ("Fist of Fun") */
1607 if (!get_aim_dir(&dir)) return FALSE;
1609 fire_ball(GF_DISINTEGRATE, dir,
1610 damroll(8 + ((plev - 5) / 4), 8), 0);
1612 case 7: /* Teleport Self */
1613 teleport_player(plev * 5);
1615 case 8: /* Wonder */
1617 /* This spell should become more useful (more
1618 controlled) as the player gains experience levels.
1619 Thus, add 1/5 of the player's level to the die roll.
1620 This eliminates the worst effects later on, while
1621 keeping the results quite random. It also allows
1622 some potent effects only at high level. */
1624 int die = randint1(100) + plev / 5;
1625 int vir = virtue_number(V_CHANCE);
1628 if (p_ptr->virtues[vir - 1] > 0)
1630 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
1634 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
1639 chg_virtue(V_CHANCE, 1);
1641 if (!get_aim_dir(&dir)) return FALSE;
1644 msg_print("¤¢¤Ê¤¿¤ÏÎϤ¬¤ß¤Ê¤®¤ë¤Î¤ò´¶¤¸¤¿¡ª");
1646 msg_print("You feel a surge of power!");
1649 if (die < 8) clone_monster(dir);
1650 else if (die < 14) speed_monster(dir);
1651 else if (die < 26) heal_monster(dir, damroll(4, 6));
1652 else if (die < 31) poly_monster(dir);
1654 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
1655 damroll(3 + ((plev - 1) / 5), 4));
1656 else if (die < 41) confuse_monster(dir, plev);
1657 else if (die < 46) fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
1658 else if (die < 51) (void)lite_line(dir);
1660 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
1661 damroll(3 + ((plev - 5) / 4), 8));
1663 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
1664 damroll(5 + ((plev - 5) / 4), 8));
1666 fire_bolt_or_beam(beam, GF_ACID, dir,
1667 damroll(6 + ((plev - 5) / 4), 8));
1669 fire_bolt_or_beam(beam, GF_FIRE, dir,
1670 damroll(8 + ((plev - 5) / 4), 8));
1671 else if (die < 76) drain_life(dir, 75);
1672 else if (die < 81) fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
1673 else if (die < 86) fire_ball(GF_ACID, dir, 40 + plev, 2);
1674 else if (die < 91) fire_ball(GF_ICE, dir, 70 + plev, 3);
1675 else if (die < 96) fire_ball(GF_FIRE, dir, 80 + plev, 3);
1676 else if (die < 101) drain_life(dir, 100 + plev);
1679 earthquake(py, px, 12);
1683 destroy_area(py, px, 13+randint0(5));
1687 symbol_genocide(plev+50, TRUE);
1689 else if (die < 110) dispel_monsters(120);
1692 dispel_monsters(150);
1699 case 9: /* Chaos Bolt */
1700 if (!get_aim_dir(&dir)) return FALSE;
1702 fire_bolt_or_beam(beam, GF_CHAOS, dir,
1703 damroll(10 + ((plev - 5) / 4), 8));
1705 case 10: /* Sonic Boom */
1707 msg_print("¥É¡¼¥ó¡ªÉô²°¤¬Íɤ줿¡ª");
1709 msg_print("BOOM! Shake the room!");
1712 project(0, plev / 10 + 2, py, px,
1713 (60 + plev), GF_SOUND, PROJECT_KILL | PROJECT_ITEM, -1);
1715 case 11: /* Doom Bolt -- always beam in 2.0.7 or later */
1716 if (!get_aim_dir(&dir)) return FALSE;
1718 fire_beam(GF_MANA, dir, damroll(11 + ((plev - 5) / 4), 8));
1720 case 12: /* Fire Ball */
1721 if (!get_aim_dir(&dir)) return FALSE;
1723 fire_ball(GF_FIRE, dir, plev + 55, 2);
1725 case 13: /* Teleport Other */
1726 if (!get_aim_dir(&dir)) return FALSE;
1728 (void)fire_beam(GF_AWAY_ALL, dir, plev);
1730 case 14: /* Word of Destruction */
1731 destroy_area(py, px, 13+randint0(5));
1733 case 15: /* Invoke Logrus */
1734 if (!get_aim_dir(&dir)) return FALSE;
1736 fire_ball(GF_CHAOS, dir, plev*2 + 99, plev / 5);
1738 case 16: /* Polymorph Other */
1739 if (!get_aim_dir(&dir)) return FALSE;
1741 (void)poly_monster(dir);
1743 case 17: /* Chain Lightning */
1744 for (dir = 0; dir <= 9; dir++)
1745 fire_beam(GF_ELEC, dir, damroll(5 + (plev / 10), 8));
1747 case 18: /* Arcane Binding == Charging */
1748 return recharge(90);
1749 case 19: /* Disintegration */
1750 if (!get_aim_dir(&dir)) return FALSE;
1752 fire_ball(GF_DISINTEGRATE, dir, plev + 70, 3 + plev / 40);
1754 case 20: /* Alter Reality */
1757 case 21: /* Magic Rocket */
1758 if (!get_aim_dir(&dir)) return FALSE;
1761 msg_print("¥í¥±¥Ã¥Èȯ¼Í¡ª");
1763 msg_print("You launch a rocket!");
1766 fire_rocket(GF_ROCKET, dir, 120 + plev*2, 2);
1768 case 22: /* Chaos Branding */
1771 case 23: /* Summon monster, demon */
1774 bool pet = !one_in_(3);
1776 if (pet) mode |= PM_FORCE_PET;
1777 else mode |= PM_NO_PET;
1778 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
1780 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, SUMMON_DEMON, mode))
1783 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
1785 msg_print("The area fills with a stench of sulphur and brimstone.");
1791 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
1793 msg_print("'What is thy bidding... Master?'");
1798 msg_print("¡ÖÈܤ·¤¼Ô¤è¡¢²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª ¤ªÁ°¤Îº²¤òĺ¤¯¤¾¡ª¡×");
1800 msg_print("'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'");
1806 case 24: /* Beam of Gravity */
1807 if (!get_aim_dir(&dir)) return FALSE;
1809 fire_beam(GF_GRAVITY, dir, damroll(9 + ((plev - 5) / 4), 8));
1811 case 25: /* Meteor Swarm */
1814 int b = 10 + randint1(10);
1815 for (i = 0; i < b; i++)
1817 int count = 0, d = 0;
1822 if (count > 20) break;
1823 x = px - 8 + randint0(17);
1824 y = py - 8 + randint0(17);
1826 if (!in_bounds(y,x) || (!cave_floor_bold(y,x) && (cave[y][x].feat != FEAT_TREES)) || !player_has_los_bold(y, x)) continue;
1828 dx = (px > x) ? (px - x) : (x - px);
1829 dy = (py > y) ? (py - y) : (y - py);
1831 /* Approximate distance */
1832 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
1836 if (count > 20) continue;
1838 project(0, 2, y, x, plev * 2, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
1842 case 26: /* Flame Strike */
1843 fire_ball(GF_FIRE, 0, 300 + (3 * plev), 8);
1845 case 27: /* Call Chaos */
1848 case 28: /* Polymorph Self */
1850 if (!get_check("ÊѿȤ·¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©")) return FALSE;
1852 if (!get_check("You will polymorph yourself. Are you sure? ")) return FALSE;
1856 case 29: /* Mana Storm */
1857 if (!get_aim_dir(&dir)) return FALSE;
1859 fire_ball(GF_MANA, dir, 300 + (plev * 4), 4);
1861 case 30: /* Breathe Logrus */
1862 if (!get_aim_dir(&dir)) return FALSE;
1864 fire_ball(GF_CHAOS, dir, p_ptr->chp, 2);
1866 case 31: /* Call the Void */
1871 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥«¥ª¥¹¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1873 msg_format("You cast an unknown Chaos spell: %d.", spell);
1883 static bool cast_death_spell(int spell)
1887 int plev = p_ptr->lev;
1890 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1891 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1892 else beam = plev / 2;
1896 case 0: /* Detect Undead & Demons -> Unlife */
1897 (void)detect_monsters_nonliving(DETECT_RAD_DEFAULT);
1899 case 1: /* Malediction */
1900 if (!get_aim_dir(&dir)) return FALSE;
1901 /* A radius-0 ball may (1) be aimed at objects etc.,
1902 * and will affect them; (2) may be aimed at ANY
1903 * visible monster, unlike a 'bolt' which must travel
1904 * to the monster. */
1906 fire_ball(GF_HELL_FIRE, dir,
1907 damroll(3 + ((plev - 1) / 5), 4), 0);
1910 { /* Special effect first */
1911 dummy = randint1(1000);
1913 fire_ball_hide(GF_DEATH_RAY, dir, plev * 200, 0);
1914 else if (dummy < 500)
1915 fire_ball_hide(GF_TURN_ALL, dir, plev, 0);
1916 else if (dummy < 800)
1917 fire_ball_hide(GF_OLD_CONF, dir, plev, 0);
1919 fire_ball_hide(GF_STUN, dir, plev, 0);
1922 case 2: /* Detect Evil */
1923 (void)detect_monsters_evil(DETECT_RAD_DEFAULT);
1925 case 3: /* Stinking Cloud */
1926 if (!get_aim_dir(&dir)) return FALSE;
1928 fire_ball(GF_POIS, dir, 10 + (plev / 2), 2);
1930 case 4: /* Black Sleep */
1931 if (!get_aim_dir(&dir)) return FALSE;
1933 (void)sleep_monster(dir);
1935 case 5: /* Resist Poison */
1936 (void)set_oppose_pois(randint1(20) + 20, FALSE);
1938 case 6: /* Horrify */
1939 if (!get_aim_dir(&dir)) return FALSE;
1941 (void)fear_monster(dir, plev);
1942 (void)stun_monster(dir, plev);
1944 case 7: /* Enslave Undead */
1945 if (!get_aim_dir(&dir)) return FALSE;
1947 (void)control_one_undead(dir, plev);
1949 case 8: /* Orb of Entropy */
1950 if (!get_aim_dir(&dir)) return FALSE;
1952 fire_ball(GF_OLD_DRAIN, dir,
1953 (damroll(3, 6) + plev +
1954 (plev / (((p_ptr->pclass == CLASS_MAGE) ||
1955 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
1956 (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
1957 ((plev < 30) ? 2 : 3));
1959 case 9: /* Nether Bolt */
1960 if (!get_aim_dir(&dir)) return FALSE;
1962 fire_bolt_or_beam(beam, GF_NETHER, dir,
1963 damroll(8 + ((plev - 5) / 4), 8));
1965 case 10: /* Cloud kill */
1966 project(0, plev / 10 + 2, py, px,
1967 (30 + plev) * 2, GF_POIS, PROJECT_KILL | PROJECT_ITEM, -1);
1969 case 11: /* Genocide One */
1970 if (!get_aim_dir(&dir)) return FALSE;
1972 fire_ball_hide(GF_GENOCIDE, dir, plev + 50, 0);
1974 case 12: /* Poison Branding */
1977 case 13: /* Vampiric Drain */
1978 if (!get_aim_dir(&dir)) return FALSE;
1980 dummy = plev * 2 + randint1(plev * 2); /* Dmg */
1981 if (drain_life(dir, dummy))
1983 chg_virtue(V_SACRIFICE, -1);
1984 chg_virtue(V_VITALITY, -1);
1986 (void)hp_player(dummy);
1987 /* Gain nutritional sustenance: 150/hp drained */
1988 /* A Food ration gives 5000 food points (by contrast) */
1989 /* Don't ever get more than "Full" this way */
1990 /* But if we ARE Gorged, it won't cure us */
1991 dummy = p_ptr->food + MIN(5000, 100 * dummy);
1992 if (p_ptr->food < PY_FOOD_MAX) /* Not gorged already */
1993 (void)set_food(dummy >= PY_FOOD_MAX ? PY_FOOD_MAX - 1 : dummy);
1996 case 14: /* Animate Dead */
1997 animate_dead(0, py, px);
1999 case 15: /* Genocide */
2000 (void)symbol_genocide(plev+50, TRUE);
2002 case 16: /* Berserk */
2003 (void)set_shero(randint1(25) + 25, FALSE);
2004 (void)hp_player(30);
2005 (void)set_afraid(0);
2007 case 17: /* Invoke Spirits */
2009 int die = randint1(100) + plev / 5;
2010 int vir = virtue_number(V_CHANCE);
2013 if (p_ptr->virtues[vir - 1] > 0)
2015 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
2019 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
2023 if (!get_aim_dir(&dir)) return FALSE;
2026 msg_print("¤¢¤Ê¤¿¤Ï»à¼Ô¤¿¤Á¤ÎÎϤò¾·½¸¤·¤¿...");
2028 msg_print("You call on the power of the dead...");
2031 chg_virtue(V_CHANCE, 1);
2035 msg_print("¤¢¤Ê¤¿¤Ï¤ª¤É¤í¤ª¤É¤í¤·¤¤ÎϤΤ¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
2037 msg_print("You feel a surge of eldritch force!");
2044 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¤¢¤Ê¤¿¤Î¼þ¤ê¤ÎÃÏÌ̤«¤éµà¤Á¤¿¿Í±Æ¤¬Î©¤Á¾å¤¬¤Ã¤Æ¤¤¿¡ª");
2046 msg_print("Oh no! Mouldering forms rise from the earth around you!");
2049 (void)summon_specific(0, py, px, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
2050 chg_virtue(V_UNLIFE, 1);
2055 msg_print("̾¾õ¤·Æñ¤¤¼Ù°¤Ê¸ºß¤¬¤¢¤Ê¤¿¤Î¿´¤òÄ̤ê²á¤®¤Æ¹Ô¤Ã¤¿...");
2057 msg_print("An unnamable evil brushes against your mind...");
2060 set_afraid(p_ptr->afraid + randint1(4) + 4);
2065 msg_print("¤¢¤Ê¤¿¤ÎƬ¤ËÂçÎ̤ÎÍ©Î¤Á¤ÎÁû¡¹¤·¤¤À¼¤¬²¡¤·´ó¤»¤Æ¤¤¿...");
2067 msg_print("Your head is invaded by a horde of gibbering spectral voices...");
2070 set_confused(p_ptr->confused + randint1(4) + 4);
2078 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
2079 damroll(3 + ((plev - 1) / 5), 4));
2083 confuse_monster (dir, plev);
2087 fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
2091 (void)lite_line(dir);
2095 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
2096 damroll(3+((plev-5)/4),8));
2100 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
2101 damroll(5+((plev-5)/4),8));
2105 fire_bolt_or_beam(beam, GF_ACID, dir,
2106 damroll(6+((plev-5)/4),8));
2110 fire_bolt_or_beam(beam, GF_FIRE, dir,
2111 damroll(8+((plev-5)/4),8));
2115 drain_life(dir, 75);
2119 fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
2123 fire_ball(GF_ACID, dir, 40 + plev, 2);
2127 fire_ball(GF_ICE, dir, 70 + plev, 3);
2131 fire_ball(GF_FIRE, dir, 80 + plev, 3);
2135 drain_life(dir, 100 + plev);
2139 earthquake(py, px, 12);
2143 destroy_area(py, px, 13+randint0(5));
2147 symbol_genocide(plev+50, TRUE);
2151 dispel_monsters(120);
2155 dispel_monsters(150);
2163 msg_print("±¢±µ¤ÊÀ¼¤¬¥¯¥¹¥¯¥¹¾Ð¤¦¡£¡Ö¤â¤¦¤¹¤°¤ª¤Þ¤¨¤Ï²æ¡¹¤ÎÃç´Ö¤Ë¤Ê¤ë¤À¤í¤¦¡£¼å¤¼Ô¤è¡£¡×");
2165 msg_print("Sepulchral voices chuckle. 'Soon you will join us, mortal.'");
2170 case 18: /* Dark Bolt */
2171 if (!get_aim_dir(&dir)) return FALSE;
2173 fire_bolt_or_beam(beam, GF_DARK, dir,
2174 damroll(4 + ((plev - 5) / 4), 8));
2176 case 19: /* Battle Frenzy */
2177 (void)set_shero(randint1(25) + 25, FALSE);
2178 (void)hp_player(30);
2179 (void)set_afraid(0);
2180 (void)set_fast(randint1(20 + (plev / 2)) + (plev / 2), FALSE);
2182 case 20: /* Vampiric Branding */
2185 case 21: /* Vampirism True */
2186 if (!get_aim_dir(&dir)) return FALSE;
2188 chg_virtue(V_SACRIFICE, -1);
2189 chg_virtue(V_VITALITY, -1);
2191 for (dummy = 0; dummy < 3; dummy++)
2193 if (drain_life(dir, 100))
2197 case 22: /* Word of Death */
2198 (void)dispel_living(randint1(plev * 3));
2200 case 23: /* Darkness Storm */
2201 if (!get_aim_dir(&dir)) return FALSE;
2203 fire_ball(GF_DARK, dir, 100+plev*2, 4);
2205 case 24: /* Death Ray */
2206 if (!get_aim_dir(&dir)) return FALSE;
2208 (void)death_ray(dir, plev);
2210 case 25: /* Raise the Dead */
2213 bool pet = one_in_(3);
2216 type = (plev > 47 ? SUMMON_HI_UNDEAD : SUMMON_UNDEAD);
2218 if (!pet || (pet && (plev > 24) && one_in_(3)))
2219 mode |= PM_ALLOW_GROUP;
2221 if (pet) mode |= PM_FORCE_PET;
2222 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
2224 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, type, mode))
2227 msg_print("Î䤿¤¤É÷¤¬¤¢¤Ê¤¿¤Î¼þ¤ê¤Ë¿á¤»Ï¤á¤¿¡£¤½¤ì¤ÏÉåÇÔ½¤ò±¿¤ó¤Ç¤¤¤ë...");
2229 msg_print("Cold winds begin to blow around you, carrying with them the stench of decay...");
2235 msg_print("¸Å¤¨¤Î»à¤»¤ë¼Ô¶¦¤¬¤¢¤Ê¤¿¤Ë»Å¤¨¤ë¤¿¤áÅÚ¤«¤éᴤä¿¡ª");
2237 msg_print("Ancient, long-dead forms arise from the ground to serve you!");
2242 msg_print("»à¼Ô¤¬á´¤Ã¤¿¡£Ì²¤ê¤ò˸¤²¤ë¤¢¤Ê¤¿¤òȳ¤¹¤ë¤¿¤á¤Ë¡ª");
2244 msg_print("'The dead arise... to punish you for disturbing them!'");
2247 chg_virtue(V_UNLIFE, 1);
2252 case 26: /* Esoteria */
2253 if (randint1(50) > plev)
2254 return ident_spell(FALSE);
2256 return identify_fully(FALSE);
2257 case 27: /* Mimic vampire */
2258 (void)set_mimic(10+plev/2 + randint1(10+plev/2), MIMIC_VAMPIRE, FALSE);
2260 case 28: /* Restore Life */
2261 (void)restore_level();
2263 case 29: /* Mass Genocide */
2264 (void)mass_genocide(plev+50, TRUE);
2266 case 30: /* Hellfire */
2267 if (!get_aim_dir(&dir)) return FALSE;
2269 fire_ball(GF_HELL_FIRE, dir, 666, 3);
2271 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "ÃϹö¤Î¹å²Ð¤Î¼öʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
2273 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "the strain of casting Hellfire", -1);
2277 case 31: /* Wraithform */
2278 set_wraith_form(randint1(plev / 2) + (plev / 2), FALSE);
2281 msg_format("You cast an unknown Death spell: %d.", spell);
2289 static bool cast_trump_spell(int spell, bool success)
2292 int plev = p_ptr->lev;
2293 int summon_lev = plev * 2 / 3 + randint1(plev/2);
2295 bool no_trump = FALSE;
2296 bool unique_okay = FALSE;
2298 if (summon_lev < 1) summon_lev = 1;
2299 if (!success || (randint1(50+plev) < plev/10)) unique_okay = TRUE;
2302 case 0: /* Phase Door */
2305 teleport_player(10);
2308 case 1: /* Trump Spiders */
2310 bool pet = success; /* (randint1(5) > 2) */
2311 u32b mode = PM_ALLOW_GROUP;
2313 if (pet) mode |= PM_FORCE_PET;
2314 else mode |= PM_NO_PET;
2317 msg_print("¤¢¤Ê¤¿¤ÏÃØéá¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2319 msg_print("You concentrate on the trump of an spider...");
2322 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_SPIDER, mode))
2326 msg_print("¾¤´¤µ¤ì¤¿ÃØéá¤ÏÅܤäƤ¤¤ë¡ª");
2328 msg_print("The summoned spiders get angry!");
2338 case 2: /* Shuffle */
2341 /* A limited power 'wonder' spell */
2342 int die = randint1(120);
2343 int vir = virtue_number(V_CHANCE);
2345 if ((p_ptr->pclass == CLASS_ROGUE) ||
2346 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
2347 (p_ptr->pclass == CLASS_SORCERER))
2348 die = (randint1(110)) + plev / 5;
2349 /* Card sharks and high mages get a level bonus */
2353 if (p_ptr->virtues[vir - 1] > 0)
2355 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
2359 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
2364 msg_print("¤¢¤Ê¤¿¤Ï¥«¡¼¥É¤òÀڤäưìËç°ú¤¤¤¿...");
2366 msg_print("You shuffle the deck and draw a card...");
2370 chg_virtue(V_CHANCE, 1);
2375 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡Ô»à¡Õ¤À¡ª");
2377 msg_print("Oh no! It's Death!");
2380 for (dummy = 0; dummy < randint1(3); dummy++)
2381 (void)activate_hi_summon(py, px, FALSE);
2386 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡Ô°Ëâ¡Õ¤À¡ª");
2388 msg_print("Oh no! It's the Devil!");
2391 (void)summon_specific(0, py, px, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
2397 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡ÔÄߤé¤ì¤¿ÃË¡Õ¤À¡ª");
2399 msg_print("Oh no! It's the Hanged Man.");
2402 (void)activate_ty_curse(FALSE, &count);
2407 msg_print("¡ÔÉÔĴϤηõ¡Õ¤À¡£");
2409 msg_print("It's the swords of discord.");
2412 aggravate_monsters(0);
2417 msg_print("¡Ô¶ò¼Ô¡Õ¤À¡£");
2419 msg_print("It's the Fool.");
2422 (void)do_dec_stat(A_INT);
2423 (void)do_dec_stat(A_WIS);
2428 msg_print("´ñ̯¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2430 msg_print("It's the picture of a strange monster.");
2433 if (!(summon_specific(0, py, px, (dun_level * 3) / 2, 32 + randint1(6), (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET))))
2439 msg_print("¡Ô·î¡Õ¤À¡£");
2441 msg_print("It's the Moon.");
2449 msg_print("¡Ô±¿Ì¿¤ÎÎØ¡Õ¤À¡£");
2451 msg_print("It's the Wheel of Fortune.");
2454 wild_magic(randint0(32));
2459 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2461 msg_print("It's a teleport trump card.");
2464 teleport_player(10);
2469 msg_print("¡ÔÀµµÁ¡Õ¤À¡£");
2471 msg_print("It's Justice.");
2474 set_blessed(p_ptr->lev, FALSE);
2479 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2481 msg_print("It's a teleport trump card.");
2484 teleport_player(100);
2489 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2491 msg_print("It's a teleport trump card.");
2494 teleport_player(200);
2499 msg_print("¡ÔÅã¡Õ¤À¡£");
2501 msg_print("It's the Tower.");
2509 msg_print("¡ÔÀáÀ©¡Õ¤À¡£");
2511 msg_print("It's Temperance.");
2514 sleep_monsters_touch();
2519 msg_print("¡ÔÅã¡Õ¤À¡£");
2521 msg_print("It's the Tower.");
2524 earthquake(py, px, 5);
2529 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2531 msg_print("It's the picture of a friendly monster.");
2534 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE1, PM_FORCE_PET)))
2540 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2542 msg_print("It's the picture of a friendly monster.");
2545 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE2, PM_FORCE_PET)))
2551 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2553 msg_print("It's the picture of a friendly monster.");
2556 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE4, PM_FORCE_PET)))
2562 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2564 msg_print("It's the picture of a friendly monster.");
2567 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE5, PM_FORCE_PET)))
2573 msg_print("¡ÔÎø¿Í¡Õ¤À¡£");
2575 msg_print("It's the Lovers.");
2578 if (get_aim_dir(&dir))
2579 (void)charm_monster(dir, MIN(p_ptr->lev, 20));
2584 msg_print("¡Ô±£¼Ô¡Õ¤À¡£");
2586 msg_print("It's the Hermit.");
2594 msg_print("¡Ô¿³È½¡Õ¤À¡£");
2596 msg_print("It's the Judgement.");
2599 do_cmd_rerate(FALSE);
2600 if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3)
2603 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
2605 msg_print("You are cured of all mutations.");
2608 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
2609 p_ptr->update |= PU_BONUS;
2616 msg_print("¡ÔÂÀÍÛ¡Õ¤À¡£");
2618 msg_print("It's the Sun.");
2621 chg_virtue(V_KNOWLEDGE, 1);
2622 chg_virtue(V_ENLIGHTEN, 1);
2628 msg_print("¡ÔÀ¤³¦¡Õ¤À¡£");
2630 msg_print("It's the World.");
2633 if (p_ptr->exp < PY_MAX_EXP)
2635 s32b ee = (p_ptr->exp / 25) + 1;
2636 if (ee > 5000) ee = 5000;
2638 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
2640 msg_print("You feel more experienced.");
2648 case 3: /* Reset Recall */
2651 if (!reset_recall()) return FALSE;
2654 case 4: /* Teleport Self */
2657 teleport_player(plev * 4);
2660 case 5: /* Trump Spying */
2663 (void)set_tim_esp(randint1(30) + 25, FALSE);
2666 case 6: /* Teleport Away */
2669 if (!get_aim_dir(&dir)) return FALSE;
2670 (void)fire_beam(GF_AWAY_ALL, dir, plev);
2673 case 7: /* Trump Animals */
2675 bool pet = success; /* was (randint1(5) > 2) */
2676 int type = (pet ? SUMMON_ANIMAL_RANGER : SUMMON_ANIMAL);
2679 if (pet) mode |= PM_FORCE_PET;
2680 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2683 msg_print("¤¢¤Ê¤¿¤Ïưʪ¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2685 msg_print("You concentrate on the trump of an animal...");
2689 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
2693 msg_print("¾¤´¤µ¤ì¤¿Æ°Êª¤ÏÅܤäƤ¤¤ë¡ª");
2695 msg_print("The summoned animal gets angry!");
2706 case 8: /* Trump Reach */
2709 if (!get_aim_dir(&dir)) return FALSE;
2710 fetch(dir, plev * 15, TRUE);
2713 case 9: /* Trump Kamikaze */
2718 if (!target_set(TARGET_KILL)) return FALSE;
2725 msg_print("¤¢¤Ê¤¿¤Ï¥«¥ß¥«¥¼¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2727 msg_print("You concentrate on several trumps at once...");
2731 for (dummy = 2 + randint0(plev / 7); dummy > 0; dummy--)
2733 bool pet = success; /* was (randint1(10) > 3) */
2737 if (pet) mode |= PM_FORCE_PET;
2738 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2740 if (p_ptr->pclass == CLASS_BEASTMASTER)
2742 type = SUMMON_KAMIKAZE_LIVING;
2746 type = SUMMON_KAMIKAZE;
2749 if (summon_specific((pet ? -1 : 0), y, x, summon_lev, type, mode))
2753 msg_print("¾¤´¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
2755 msg_print("The summoned creatures get angry!");
2763 case 10: /* Phantasmal Servant */
2766 if (summon_specific(-1, py, px, (summon_lev * 3) / 2, SUMMON_PHANTOM, PM_FORCE_PET))
2769 msg_print("¸æÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¸æ¼ç¿ÍÍÍ¡©");
2771 msg_print("'Your wish, master?'");
2781 case 11: /* Speed Monster */
2784 bool old_target_pet = target_pet;
2786 if (!get_aim_dir(&dir))
2788 target_pet = old_target_pet;
2791 target_pet = old_target_pet;
2792 (void)speed_monster(dir);
2795 case 12: /* Teleport Level */
2799 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
2801 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
2803 (void)teleport_player_level();
2806 case 13: /* Dimension Door */
2810 msg_print("¼¡¸µ¤ÎÈ⤬³«¤¤¤¿¡£ÌÜŪÃϤòÁª¤ó¤Ç²¼¤µ¤¤¡£");
2812 msg_print("You open a dimensional gate. Choose a destination.");
2815 return dimension_door();
2818 case 14: /* Word of Recall */
2821 return word_of_recall();
2824 case 15: /* Banish */
2827 banish_monsters(plev * 4);
2830 case 16: /* Swap Position */
2834 project_length = -1;
2835 if (!get_aim_dir(&dir))
2842 (void)teleport_swap(dir);
2846 case 17: /* Trump Undead */
2848 bool pet = success; /* (randint1(10) > 3) */
2851 if (pet) mode |= PM_FORCE_PET;
2852 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2855 msg_print("¤¢¤Ê¤¿¤Ï¥¢¥ó¥Ç¥Ã¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2857 msg_print("You concentrate on the trump of an undead creature...");
2861 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_UNDEAD, mode))
2865 msg_print("¾¤´¤µ¤ì¤¿¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
2867 msg_print("The summoned undead creature gets angry!");
2878 case 18: /* Trump Reptiles */
2880 bool pet = success; /* was (randint1(5) > 2) */
2883 if (pet) mode |= PM_FORCE_PET;
2884 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2887 msg_print("¤¢¤Ê¤¿¤Ïà¨ÃîÎà¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2889 msg_print("You concentrate on the trump of a reptile...");
2893 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HYDRA, mode))
2897 msg_print("¾¤´¤µ¤ì¤¿à¨ÃîÎà¤ÏÅܤäƤ¤¤ë¡ª");
2899 msg_print("The summoned reptile gets angry!");
2910 case 19: /* Trump Monsters */
2915 msg_print("¤¢¤Ê¤¿¤Ï¥â¥ó¥¹¥¿¡¼¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2917 msg_print("You concentrate on several trumps at once...");
2921 for (dummy = 0; dummy < 1 + ((plev - 15)/ 10); dummy++)
2923 bool pet = success; /* was (randint1(10) > 3) */
2927 if (pet) mode |= PM_FORCE_PET;
2928 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2930 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
2932 if (p_ptr->pclass == CLASS_BEASTMASTER)
2934 type = SUMMON_LIVING;
2941 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
2945 msg_print("¾¤´¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
2947 msg_print("The summoned creatures get angry!");
2955 case 20: /* Trump Hounds */
2957 bool pet = success; /* was (randint1(5) > 2) */
2958 u32b mode = PM_ALLOW_GROUP;
2960 if (pet) mode |= PM_FORCE_PET;
2961 else mode |= PM_NO_PET;
2964 msg_print("¤¢¤Ê¤¿¤Ï¥Ï¥¦¥ó¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2966 msg_print("You concentrate on the trump of a hound...");
2970 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HOUND, mode))
2974 msg_print("¾¤´¤µ¤ì¤¿¥Ï¥¦¥ó¥É¤ÏÅܤäƤ¤¤ë¡ª");
2976 msg_print("The summoned hounds get angry!");
2987 case 21: /* Trump Branding */
2993 case 22: /* Living Trump */
2997 /* Teleport control */
3000 /* Random teleportation (uncontrolled) */
3002 /* Gain the mutation */
3003 if (gain_random_mutation(dummy))
3005 msg_print("¤¢¤Ê¤¿¤ÏÀ¸¤¤Æ¤¤¤ë¥«¡¼¥É¤ËÊѤï¤Ã¤¿¡£");
3007 msg_print("You have turned into a Living Trump.");
3012 case 23: /* Trump Cyberdemon */
3014 bool pet = success; /* was (randint1(10) > 3) */
3017 if (pet) mode |= PM_FORCE_PET;
3018 else mode |= PM_NO_PET;
3021 msg_print("¤¢¤Ê¤¿¤Ï¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3023 msg_print("You concentrate on the trump of a Cyberdemon...");
3027 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_CYBER, mode))
3031 msg_print("¾¤´¤µ¤ì¤¿¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3033 msg_print("The summoned Cyberdemon gets angry!");
3044 case 24: /* Trump Divination */
3047 (void)detect_all(DETECT_RAD_DEFAULT);
3050 case 25: /* Trump Lore */
3053 return identify_fully(FALSE);
3056 case 26: /* Heal Monster */
3059 bool old_target_pet = target_pet;
3061 if (!get_aim_dir(&dir))
3063 target_pet = old_target_pet;
3066 target_pet = old_target_pet;
3068 (void)heal_monster(dir, p_ptr->lev * 10 + 200);
3071 case 27: /* Trump Dragon */
3073 bool pet = success; /* was (randint1(10) > 3) */
3076 if (pet) mode |= PM_FORCE_PET;
3077 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3080 msg_print("¤¢¤Ê¤¿¤Ï¥É¥é¥´¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3082 msg_print("You concentrate on the trump of a dragon...");
3086 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DRAGON, mode))
3090 msg_print("¾¤´¤µ¤ì¤¿¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3092 msg_print("The summoned dragon gets angry!");
3103 case 28: /* Trump Meteor */
3106 int x, y, dx, dy, i;
3107 int b = 10 + randint1(10);
3108 for (i = 0; i < b; i++)
3110 int count = 0, d = 0;
3115 if (count > 20) break;
3116 x = px - 8 + randint0(17);
3117 y = py - 8 + randint0(17);
3119 if (!in_bounds(y,x) || (!cave_floor_bold(y,x) && (cave[y][x].feat != FEAT_TREES)) || !player_has_los_bold(y, x)) continue;
3121 dx = (px > x) ? (px - x) : (x - px);
3122 dy = (py > y) ? (py - y) : (y - py);
3124 /* Approximate distance */
3125 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
3129 if (count > 20) continue;
3131 project(0, 2, y, x, plev * 2, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
3135 case 29: /* Trump Demon */
3137 bool pet = success; /* was (randint1(10) > 3) */
3140 if (pet) mode |= PM_FORCE_PET;
3141 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3144 msg_print("¤¢¤Ê¤¿¤Ï¥Ç¡¼¥â¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3146 msg_print("You concentrate on the trump of a demon...");
3150 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DEMON, mode))
3154 msg_print("¾¤´¤µ¤ì¤¿¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3156 msg_print("The summoned demon gets angry!");
3167 case 30: /* Trump Greater Undead */
3169 bool pet = success; /* was (randint1(10) > 3) */
3172 if (pet) mode |= PM_FORCE_PET;
3173 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3175 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
3178 msg_print("¤¢¤Ê¤¿¤Ï¶¯ÎϤʥ¢¥ó¥Ç¥Ã¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3180 msg_print("You concentrate on the trump of a greater undead being...");
3184 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HI_UNDEAD, mode))
3188 msg_print("¾¤´¤µ¤ì¤¿¾åµé¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
3190 msg_print("The summoned greater undead creature gets angry!");
3201 case 31: /* Trump Ancient Dragon */
3203 bool pet = success; /* was (randint1(10) > 3) */
3207 if (pet) mode |= PM_FORCE_PET;
3208 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3210 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
3212 if (p_ptr->pclass == CLASS_BEASTMASTER)
3214 type = SUMMON_HI_DRAGON_LIVING;
3218 type = SUMMON_HI_DRAGON;
3222 msg_print("¤¢¤Ê¤¿¤Ï¸ÅÂå¥É¥é¥´¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3224 msg_print("You concentrate on the trump of an ancient dragon...");
3228 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
3232 msg_print("¾¤´¤µ¤ì¤¿¸ÅÂå¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3234 msg_print("The summoned ancient dragon gets angry!");
3247 msg_format("̤ÃΤΥ«¡¼¥É¤Î¼öʸ¤Ç¤¹: %d", spell);
3249 msg_format("You cast an unknown Trump spell: %d.", spell);
3258 msg_print("ï¤â¤¢¤Ê¤¿¤Î¥«¡¼¥É¤Î¸Æ¤ÓÀ¼¤ËÅú¤¨¤Ê¤¤¡£");
3260 msg_print("Nobody answers to your Trump call.");
3269 static bool cast_arcane_spell(int spell)
3273 int plev = p_ptr->lev;
3276 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3277 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3278 else beam = plev / 2;
3283 if (!get_aim_dir(&dir)) return FALSE;
3285 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
3286 damroll(3 + ((plev - 1) / 5), 3));
3288 case 1: /* Wizard Lock */
3289 if (!get_aim_dir(&dir)) return FALSE;
3291 (void)wizard_lock(dir);
3293 case 2: /* Detect Invisibility */
3294 (void)detect_monsters_invis(DETECT_RAD_DEFAULT);
3296 case 3: /* Detect Monsters */
3297 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
3300 teleport_player(10);
3302 case 5: /* Light Area */
3303 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
3305 case 6: /* Trap & Door Destruction */
3306 if (!get_aim_dir(&dir)) return FALSE;
3308 (void)destroy_door(dir);
3310 case 7: /* Cure Light Wounds */
3311 (void)hp_player(damroll(2, 8));
3312 (void)set_cut(p_ptr->cut - 10);
3314 case 8: /* Detect Doors & Traps */
3315 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
3316 (void)detect_doors(DETECT_RAD_DEFAULT);
3317 (void)detect_stairs(DETECT_RAD_DEFAULT);
3319 case 9: /* Phlogiston */
3322 case 10: /* Detect Treasure */
3323 (void)detect_treasure(DETECT_RAD_DEFAULT);
3324 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
3326 case 11: /* Detect Enchantment */
3327 (void)detect_objects_magic(DETECT_RAD_DEFAULT);
3329 case 12: /* Detect Objects */
3330 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
3332 case 13: /* Cure Poison */
3333 (void)set_poisoned(0);
3335 case 14: /* Resist Cold */
3336 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3338 case 15: /* Resist Fire */
3339 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3341 case 16: /* Resist Lightning */
3342 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3344 case 17: /* Resist Acid */
3345 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3347 case 18: /* Cure Medium Wounds */
3348 (void)hp_player(damroll(4, 8));
3349 (void)set_cut((p_ptr->cut / 2) - 50);
3351 case 19: /* Teleport */
3352 teleport_player(plev * 5);
3354 case 20: /* Identify */
3355 return ident_spell(FALSE);
3356 case 21: /* Stone to Mud */
3357 if (!get_aim_dir(&dir)) return FALSE;
3359 (void)wall_to_mud(dir);
3361 case 22: /* Ray of Light */
3362 if (!get_aim_dir(&dir)) return FALSE;
3365 msg_print("¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
3367 msg_print("A line of light appears.");
3370 (void)lite_line(dir);
3372 case 23: /* Satisfy Hunger */
3373 (void)set_food(PY_FOOD_MAX - 1);
3375 case 24: /* See Invisible */
3376 (void)set_tim_invis(randint1(24) + 24, FALSE);
3378 case 25: /* Conjure Elemental */
3379 if (!summon_specific(-1, py, px, plev, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3382 msg_print("¥¨¥ì¥á¥ó¥¿¥ë¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3384 msg_print("No Elementals arrive.");
3388 case 26: /* Teleport Level */
3390 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
3392 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
3394 (void)teleport_player_level();
3396 case 27: /* Teleport Away */
3397 if (!get_aim_dir(&dir)) return FALSE;
3399 (void)fire_beam(GF_AWAY_ALL, dir, plev);
3401 case 28: /* Elemental Ball */
3402 if (!get_aim_dir(&dir)) return FALSE;
3404 switch (randint1(4))
3406 case 1: dummy = GF_FIRE;break;
3407 case 2: dummy = GF_ELEC;break;
3408 case 3: dummy = GF_COLD;break;
3409 default: dummy = GF_ACID;break;
3411 fire_ball(dummy, dir, 75 + (plev), 2);
3413 case 29: /* Detection */
3414 (void)detect_all(DETECT_RAD_DEFAULT);
3416 case 30: /* Word of Recall */
3417 return word_of_recall();
3418 case 31: /* Clairvoyance */
3419 chg_virtue(V_KNOWLEDGE, 1);
3420 chg_virtue(V_ENLIGHTEN, 1);
3422 if (!p_ptr->telepathy)
3424 (void)set_tim_esp(randint1(30) + 25, FALSE);
3428 msg_format("You cast an unknown Arcane spell: %d.", spell);
3436 static bool cast_enchant_spell(int spell)
3438 int plev = p_ptr->lev;
3443 case 0: /* Infravision */
3444 set_tim_infra(100 + randint1(100), FALSE);
3446 case 1: /* Regeneration */
3447 set_tim_regen(80 + randint1(80), FALSE);
3449 case 2: /* Satisfy Hunger */
3450 (void)set_food(PY_FOOD_MAX - 1);
3452 case 3: /* Resist Cold */
3453 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3455 case 4: /* Resist Fire */
3456 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3458 case 5: /* Heroism */
3459 (void)set_hero(randint1(25) + 25, FALSE);
3460 (void)hp_player(10);
3461 (void)set_afraid(0);
3463 case 6: /* Resist Lightning */
3464 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3466 case 7: /* Resist Acid */
3467 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3469 case 8: /* See Invisibility */
3470 (void)set_tim_invis(randint1(24) + 24, FALSE);
3472 case 9: /* Remove Curse */
3476 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
3478 msg_print("You feel as if someone is watching over you.");
3482 case 10: /* Resist Poison */
3483 (void)set_oppose_pois(randint1(20) + 20, FALSE);
3485 case 11: /* Berserk */
3486 (void)set_shero(randint1(25) + 25, FALSE);
3487 (void)hp_player(30);
3488 (void)set_afraid(0);
3490 case 12: /* Self Knowledge */
3491 (void)self_knowledge();
3493 case 13: /* Protection from Evil */
3494 (void)set_protevil(randint1(25) + 3 * p_ptr->lev, FALSE);
3496 case 14: /* Healing */
3502 case 15: /* Mana Branding */
3503 return choose_ele_attack();
3504 case 16: /* Telepathy */
3505 (void)set_tim_esp(randint1(30) + 25, FALSE);
3507 case 17: /* Stone Skin */
3508 (void)set_shield(randint1(20) + 30, FALSE);
3510 case 18: /* Resistance */
3511 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3512 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3513 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3514 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3515 (void)set_oppose_pois(randint1(20) + 20, FALSE);
3517 case 19: /* Haste */
3518 (void)set_fast(randint1(20 + plev) + plev, FALSE);
3520 case 20: /* Walk through Wall */
3521 (void)set_kabenuke(randint1(plev/2) + plev/2, FALSE);
3523 case 21: /* Pulish Shield */
3524 (void)pulish_shield();
3526 case 22: /* Create Golem */
3527 if (summon_specific(-1, py, px, plev, SUMMON_GOLEM, PM_FORCE_PET))
3530 msg_print("¥´¡¼¥ì¥à¤òºî¤Ã¤¿¡£");
3532 msg_print("You make a golem.");
3538 msg_print("¤¦¤Þ¤¯¥´¡¼¥ì¥à¤òºî¤ì¤Ê¤«¤Ã¤¿¡£");
3540 msg_print("No Golems arrive.");
3544 case 23: /* Magic armor */
3545 (void)set_magicdef(randint1(20) + 20, FALSE);
3547 case 24: /* Remove Enchantment */
3548 if (!mundane_spell(TRUE)) return FALSE;
3550 case 25: /* Remove All Curse */
3551 if (remove_all_curse())
3554 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
3556 msg_print("You feel as if someone is watching over you.");
3560 case 26: /* Total Knowledge */
3561 return identify_fully(FALSE);
3562 case 27: /* Enchant Weapon */
3563 return enchant_spell(randint0(4) + 1, randint0(4) + 1, 0);
3564 case 28: /* Enchant Armor */
3565 return enchant_spell(0, 0, randint0(3) + 2);
3566 case 29: /* Brand Weapon */
3567 brand_weapon(randint0(18));
3569 case 30: /* Living Trump */
3571 /* Teleport control */
3574 /* Random teleportation (uncontrolled) */
3576 /* Gain the mutation */
3577 if (gain_random_mutation(dummy))
3579 msg_print("¤¢¤Ê¤¿¤ÏÀ¸¤¤Æ¤¤¤ë¥«¡¼¥É¤ËÊѤï¤Ã¤¿¡£");
3581 msg_print("You have turned into a Living Trump.");
3584 case 31: /* Immune */
3585 return choose_ele_immune(13 + randint1(13));
3587 msg_format("You cast an unknown Craft spell: %d.", spell);
3596 * An "item_tester_hook" for offer
3598 static bool item_tester_offer(object_type *o_ptr)
3600 /* Flasks of oil are okay */
3601 if (o_ptr->tval != TV_CORPSE) return (FALSE);
3603 if (o_ptr->sval != SV_CORPSE) return (FALSE);
3605 if (strchr("pht", r_info[o_ptr->pval].d_char)) return (TRUE);
3607 /* Assume not okay */
3612 static bool cast_daemon_spell(int spell)
3615 int plev = p_ptr->lev;
3617 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3618 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3619 else beam = plev / 2;
3623 case 0: /* Magic Missile */
3624 if (!get_aim_dir(&dir)) return FALSE;
3626 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
3627 damroll(3 + ((plev - 1) / 5), 4));
3629 case 1: /* Detect Undead & Demons -> Unlife */
3630 (void)detect_monsters_nonliving(DETECT_RAD_DEFAULT);
3633 (void)set_blessed(randint1(12) + 12, FALSE);
3635 case 3: /* Resist Fire */
3636 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3638 case 4: /* Horrify */
3639 if (!get_aim_dir(&dir)) return FALSE;
3641 (void)fear_monster(dir, plev);
3642 (void)stun_monster(dir, plev);
3644 case 5: /* Nether Bolt */
3645 if (!get_aim_dir(&dir)) return FALSE;
3647 fire_bolt_or_beam(beam, GF_NETHER, dir,
3648 damroll(6 + ((plev - 5) / 4), 8));
3650 case 6: /* Summon monster, demon */
3651 if (!summon_specific(-1, py, px, (plev * 3) / 2, SUMMON_MANES, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3654 msg_print("¸ÅÂå¤Î»àÎî¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3656 msg_print("No Manes arrive.");
3660 case 7: /* Mini Hellfire */
3661 if (!get_aim_dir(&dir)) return FALSE;
3663 fire_ball(GF_HELL_FIRE, dir,
3664 (damroll(3, 6) + plev +
3665 (plev / (((p_ptr->pclass == CLASS_MAGE) ||
3666 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
3667 (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
3668 ((plev < 30) ? 2 : 3));
3670 case 8: /* Enslave Demon */
3671 if (!get_aim_dir(&dir)) return FALSE;
3673 (void)control_one_demon(dir, plev);
3675 case 9: /* Vision */
3676 map_area(DETECT_RAD_MAP);
3678 case 10: /* Resist Nether */
3679 (void)set_tim_res_nether(randint1(20) + 20, FALSE);
3681 case 11: /* Plasma Bolt */
3682 if (!get_aim_dir(&dir)) return FALSE;
3684 fire_bolt_or_beam(beam, GF_PLASMA, dir,
3685 damroll(11 + ((plev - 5) / 4), 8));
3687 case 12: /* Fire Ball */
3688 if (!get_aim_dir(&dir)) return FALSE;
3690 fire_ball(GF_FIRE, dir, plev + 55, 2);
3692 case 13: /* Fire Branding */
3695 case 14: /* Nether Ball */
3696 if (!get_aim_dir(&dir)) return FALSE;
3698 fire_ball(GF_NETHER, dir, plev*3/2 + 100, plev / 20+2);
3700 case 15: /* Summon monster, demon */
3702 bool pet = !one_in_(3);
3705 if (pet) mode |= PM_FORCE_PET;
3706 else mode |= PM_NO_PET;
3707 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
3709 if (summon_specific((pet ? -1 : 0), py, px, plev*2/3+randint1(plev/2), SUMMON_DEMON, mode))
3712 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
3714 msg_print("The area fills with a stench of sulphur and brimstone.");
3720 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
3722 msg_print("'What is thy bidding... Master?'");
3727 msg_print("¡ÖÈܤ·¤¼Ô¤è¡¢²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª ¤ªÁ°¤Îº²¤òĺ¤¯¤¾¡ª¡×");
3729 msg_print("'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'");
3736 msg_print("°Ëâ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3738 msg_print("No demons arrive.");
3743 case 16: /* Telepathy */
3744 (void)set_tim_esp(randint1(30) + 25, FALSE);
3746 case 17: /* Demoncloak */
3748 int dur=randint1(20) + 20;
3750 set_oppose_fire(dur, FALSE);
3751 set_oppose_cold(dur, FALSE);
3752 set_tim_sh_fire(dur, FALSE);
3756 case 18: /* Rain of Lava */
3757 fire_ball(GF_FIRE, 0, (55 + plev)*2, 3);
3758 fire_ball_hide(GF_LAVA_FLOW, 0, 2+randint1(2), 3);
3760 case 19: /* Plasma ball */
3761 if (!get_aim_dir(&dir)) return FALSE;
3763 fire_ball(GF_PLASMA, dir, plev*3/2 + 80, 2 + plev/40);
3765 case 20: /* Mimic demon */
3766 (void)set_mimic(10+plev/2 + randint1(10+plev/2), MIMIC_DEMON, FALSE);
3768 case 21: /* Nether Wave == Dispel Good */
3769 (void)dispel_monsters(randint1(plev * 2));
3770 (void)dispel_good(randint1(plev * 2));
3773 if (!get_aim_dir(&dir)) return FALSE;
3774 fire_ball(GF_NEXUS, dir, 100 + plev*2, 4);
3776 case 23: /* Hand Doom */
3777 if (!get_aim_dir(&dir)) return FALSE;
3779 else msg_print("<ÇËÌǤμê>¤òÊü¤Ã¤¿¡ª");
3781 else msg_print("You invoke the Hand of Doom!");
3784 fire_ball_hide(GF_HAND_DOOM, dir, plev * 2, 0);
3786 case 24: /* Heroism */
3787 (void)set_hero(randint1(25) + 25, FALSE);
3788 (void)hp_player(10);
3789 (void)set_afraid(0);
3791 case 25: /* Tim resist time */
3792 (void)set_tim_res_time(randint1(20)+20, FALSE);
3794 case 26: /* Circle of Madness */
3795 fire_ball(GF_CHAOS, 0, 50+plev, 3+plev/20);
3796 fire_ball(GF_CONFUSION, 0, 50+plev, 3+plev/20);
3797 fire_ball(GF_CHARM, 0, 20+plev, 3+plev/20);
3799 case 27: /* True Discharge Minion */
3802 case 28: /* Summon Greater Demon */
3809 item_tester_hook = item_tester_offer;
3811 q = "¤É¤Î»àÂΤòÊû¤²¤Þ¤¹¤«? ";
3812 s = "Êû¤²¤é¤ì¤ë»àÂΤò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
3814 q = "Sacrifice which corpse? ";
3815 s = "You have nothing to scrifice.";
3817 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return FALSE;
3819 /* Get the item (in the pack) */
3822 o_ptr = &inventory[item];
3825 /* Get the item (on the floor) */
3828 o_ptr = &o_list[0 - item];
3831 summon_lev = p_ptr->lev * 2 / 3 + r_info[o_ptr->pval].level;
3832 if (summon_specific(-1, py, px, summon_lev, SUMMON_HI_DEMON, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3835 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
3837 msg_print("The area fills with a stench of sulphur and brimstone.");
3842 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
3844 msg_print("'What is thy bidding... Master?'");
3847 /* Decrease the item (from the pack) */
3850 inven_item_increase(item, -1);
3851 inven_item_describe(item);
3852 inven_item_optimize(item);
3855 /* Decrease the item (from the floor) */
3858 floor_item_increase(0 - item, -1);
3859 floor_item_describe(0 - item);
3860 floor_item_optimize(0 - item);
3866 msg_print("°Ëâ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3868 msg_print("No Greater Demon arrive.");
3873 case 29: /* Nether Storm */
3874 if (!get_aim_dir(&dir)) return FALSE;
3876 fire_ball(GF_NETHER, dir, plev*15, plev / 5);
3878 case 30: /* Blood curse */
3880 if (!get_aim_dir(&dir)) return FALSE;
3882 fire_ball_hide(GF_BLOOD_CURSE, dir, 600, 0);
3884 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "·ì¤Î¼ö¤¤", -1);
3886 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "Blood curse", -1);
3890 case 31: /* Mimic Demon lord */
3891 (void)set_mimic(15 + randint1(15), MIMIC_DEMON_LORD, FALSE);
3894 msg_format("You cast an unknown Daemon spell: %d.", spell);
3902 static bool cast_crusade_spell(int spell)
3906 int plev = p_ptr->lev;
3908 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3909 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3910 else beam = plev / 2;
3915 if (!get_aim_dir(&dir)) return FALSE;
3917 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
3918 damroll(3 + ((plev - 1) / 5), 4));
3921 (void)detect_monsters_evil(DETECT_RAD_DEFAULT);
3923 case 2: /* Remove Fear */
3924 (void)set_afraid(0);
3927 if (!get_aim_dir(&dir)) return FALSE;
3929 (void)fear_monster(dir, plev);
3932 (void)sleep_monsters_touch();
3935 teleport_player(25+plev/2);
3938 if (!get_aim_dir(&dir)) return FALSE;
3939 fire_blast(GF_LITE, dir, 3+((plev-1)/9), 2, 10, 3);
3943 (void)set_poisoned(0);
3947 if (!get_aim_dir(&dir)) return FALSE;
3948 (void)fire_ball(GF_AWAY_EVIL, dir, MAX_SIGHT*5, 0);
3950 case 9: /* Holy Orb */
3951 if (!get_aim_dir(&dir)) return FALSE;
3953 fire_ball(GF_HOLY_FIRE, dir,
3954 (damroll(3, 6) + plev +
3955 (plev / ((p_ptr->pclass == CLASS_PRIEST ||
3956 p_ptr->pclass == CLASS_HIGH_MAGE ||
3957 p_ptr->pclass == CLASS_SORCERER) ? 2 : 4))),
3958 ((plev < 30) ? 2 : 3));
3961 case 10: /* Exorcism */
3962 (void)dispel_undead(randint1(plev));
3963 (void)dispel_demons(randint1(plev));
3964 (void)turn_evil(plev);
3966 case 11: /* Remove Curse */
3970 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
3972 msg_print("You feel as if someone is watching over you.");
3976 case 12: /* Sense Unseen */
3977 (void)set_tim_invis(randint1(24) + 24, FALSE);
3979 case 13: /* Protection from Evil */
3980 (void)set_protevil(randint1(25) + 3 * p_ptr->lev, FALSE);
3983 if (!get_aim_dir(&dir)) return FALSE;
3984 (void)fire_bolt(GF_ELEC, dir, plev*5);
3986 case 15: /* Holy Word */
3987 (void)dispel_evil(randint1(plev * 6));
3988 (void)hp_player(100);
3989 (void)set_afraid(0);
3990 (void)set_poisoned(0);
3995 if (!get_aim_dir(&dir)) return FALSE;
3997 (void)destroy_door(dir);
4000 if (!get_aim_dir(&dir)) return FALSE;
4001 (void)stasis_evil(dir);
4004 set_tim_sh_holy(randint1(20)+20, FALSE);
4006 case 19: /* Dispel Undead + Demons */
4007 (void)dispel_undead(randint1(plev * 4));
4008 (void)dispel_demons(randint1(plev * 4));
4010 case 20: /* Dispel Evil */
4011 (void)dispel_evil(randint1(plev * 4));
4016 case 22: /* Star Burst */
4017 if (!get_aim_dir(&dir)) return FALSE;
4019 fire_ball(GF_LITE, dir, 100+plev*2, 4);
4021 case 23: /* Summon monster, angel */
4023 bool pet = !one_in_(3);
4026 if (pet) mode |= PM_FORCE_PET;
4027 else mode |= PM_NO_PET;
4028 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
4030 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, SUMMON_ANGEL, mode))
4034 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
4036 msg_print("'What is thy bidding... Master?'");
4041 msg_print("¡Ö²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª °¹Ô¼Ô¤è¡¢²ù¤¤²þ¤á¤è¡ª¡×");
4043 msg_print("Mortal! Repent of thy impiousness.");
4049 case 24: /* Heroism */
4050 (void)set_hero(randint1(25) + 25, FALSE);
4051 (void)hp_player(10);
4052 (void)set_afraid(0);
4054 case 25: /* Remove All Curse */
4055 if (remove_all_curse())
4058 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
4060 msg_print("You feel as if someone is watching over you.");
4064 case 26: /* Banishment */
4065 if (banish_evil(100))
4068 msg_print("¿ÀÀ»¤ÊÎϤ¬¼Ù°¤òÂǤÁʧ¤Ã¤¿¡ª");
4070 msg_print("The holy power banishes evil!");
4075 case 27: /* Word of Destruction */
4076 destroy_area(py, px, 13+randint0(5));
4078 case 28: /* Eye for an Eye */
4079 set_tim_eyeeye(randint1(10)+10, FALSE);
4086 int b = 10 + randint1(10);
4088 if (!get_aim_dir(&dir)) return FALSE;
4090 /* Use the given direction */
4091 tx = px + 99 * ddx[dir];
4092 ty = py + 99 * ddy[dir];
4094 /* Hack -- Use an actual "target" */
4095 if ((dir == 5) && target_okay())
4106 /* Hack -- Stop at the target */
4107 if ((y == ty) && (x == tx)) break;
4111 mmove2(&ny, &nx, py, px, ty, tx);
4113 /* Stop at maximum range */
4114 if (MAX_RANGE <= distance(py, px, ny, nx)) break;
4116 /* Stopped by walls/doors */
4117 if (!cave_floor_bold(ny, nx)) break;
4119 /* Stopped by monsters */
4120 if ((dir != 5) && cave[ny][nx].m_idx != 0) break;
4122 /* Save the new location */
4129 for (i = 0; i < b; i++)
4131 int count = 20, d = 0;
4137 x = tx - 5 + randint0(11);
4138 y = ty - 5 + randint0(11);
4140 dx = (tx > x) ? (tx - x) : (x - tx);
4141 dy = (ty > y) ? (ty - y) : (y - ty);
4143 /* Approximate distance */
4144 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
4145 /* Within the radius */
4149 if (count < 0) continue;
4151 /* Cannot penetrate perm walls */
4152 if (!in_bounds(y,x) ||
4153 cave_stop_disintegration(y,x) ||
4154 !in_disintegration_range(ty, tx, y, x))
4157 project(0, 2, y, x, plev * 3+25, GF_DISINTEGRATE, PROJECT_JUMP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1);
4161 case 30: /* Divine Intervention */
4162 project(0, 1, py, px, plev*11, GF_HOLY_FIRE, PROJECT_KILL, -1);
4163 dispel_monsters(plev * 4);
4165 stun_monsters(plev * 4);
4166 confuse_monsters(plev * 4);
4167 turn_monsters(plev * 4);
4168 stasis_monsters(plev * 4);
4169 (void)hp_player(100);
4175 for (i = 0; i < 12; i++)
4182 scatter(&my, &mx, py, px, 4, 0);
4184 /* Require empty grids */
4185 if (cave_empty_bold2(my, mx)) break;
4187 if (attempt < 0) continue;
4188 summon_specific(-1, my, mx, plev, SUMMON_KNIGHTS, (PM_ALLOW_GROUP | PM_FORCE_PET | PM_HASTE));
4190 (void)set_hero(randint1(25) + 25, FALSE);
4191 (void)set_blessed(randint1(25) + 25, FALSE);
4192 (void)set_fast(randint1(20 + plev) + plev, FALSE);
4193 (void)set_protevil(randint1(25) + 25, FALSE);
4194 (void)set_afraid(0);
4199 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤ÊÇ˼٤μöʸ %d ¤ò¾§¤¨¤¿¡£", spell);
4201 msg_format("You cast an unknown crusade spell: %d.", spell);
4212 void stop_singing(void)
4214 if (p_ptr->pclass != CLASS_BARD) return;
4216 if (p_ptr->magic_num1[1])
4218 p_ptr->magic_num1[1] = 0;
4221 if (!p_ptr->magic_num1[0]) return;
4223 set_action(ACTION_NONE);
4225 switch(p_ptr->magic_num1[0])
4228 if (!p_ptr->blessed)
4230 msg_print("¹â·é¤Êµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4232 msg_print("The prayer has expired.");
4239 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4241 msg_print("The heroism wears off.");
4243 /* Recalculate hitpoints */
4244 p_ptr->update |= (PU_HP);
4248 if (!p_ptr->tim_esp)
4251 msg_print("°Õ¼±¤Ï¸µ¤ËÌá¤Ã¤¿¡£");
4253 msg_print("Your consciousness contracts again.");
4255 /* Update the monsters */
4256 p_ptr->update |= (PU_MONSTERS);
4260 if (!p_ptr->tim_stealth)
4262 msg_print("»Ñ¤¬¤Ï¤Ã¤¤ê¤È¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
4264 msg_print("You are no longer hided.");
4268 if (!p_ptr->oppose_acid)
4270 msg_print("»À¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4272 msg_print("You feel less resistant to acid.");
4274 if (!p_ptr->oppose_elec)
4276 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4278 msg_print("You feel less resistant to elec.");
4280 if (!p_ptr->oppose_fire)
4282 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4284 msg_print("You feel less resistant to fire.");
4286 if (!p_ptr->oppose_cold)
4288 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4290 msg_print("You feel less resistant to cold.");
4292 if (!p_ptr->oppose_pois)
4294 msg_print("ÆǤؤÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4296 msg_print("You feel less resistant to pois.");
4302 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
4304 msg_print("You feel yourself slow down.");
4311 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4313 msg_print("The heroism wears off.");
4315 /* Recalculate hitpoints */
4316 p_ptr->update |= (PU_HP);
4321 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
4323 msg_print("You feel yourself slow down.");
4330 msg_print("̵Ũ¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£");
4332 msg_print("The invulnerability wears off.");
4335 p_ptr->redraw |= (PR_MAP);
4337 /* Update monsters */
4338 p_ptr->update |= (PU_MONSTERS);
4341 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4345 p_ptr->magic_num1[0] = MUSIC_NONE;
4346 p_ptr->magic_num2[0] = 0;
4348 /* Recalculate bonuses */
4349 p_ptr->update |= (PU_BONUS | PU_HP);
4351 /* Redraw status bar */
4352 p_ptr->redraw |= (PR_STATUS);
4356 static bool cast_music_spell(int spell)
4358 int plev = p_ptr->lev;
4361 if(p_ptr->magic_num1[0])
4366 p_ptr->magic_num2[0] = spell;
4370 case 0: /* Song of Holding ÃÙÆߤβΠ*/
4372 msg_print("¤æ¤Ã¤¯¤ê¤È¤·¤¿¥á¥í¥Ç¥£¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4374 msg_print("You start humming a slow, steady melody...");
4376 p_ptr->magic_num1[0] = MUSIC_SLOW;
4378 case 1: /* Song of Blessing ½ËÊ¡¤Î²Î */
4380 msg_print("¸·¤«¤Ê¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4382 msg_print("The holy power of the Music of the Ainur enters you...");
4384 p_ptr->magic_num1[0] = MUSIC_BLESS;
4387 case 2: /* Wrecking Note Êø²õ¤Î²»¿§ */
4388 if (!get_aim_dir(&dir)) return FALSE;
4389 fire_bolt(GF_SOUND, dir,
4390 damroll(4 + ((plev - 1) / 5), 4));
4392 case 3: /* Stun Pattern Û¯Û°¤ÎÀûΧ */
4394 msg_print("âÁÏǤµ¤»¤ë¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4396 msg_print("You weave a pattern of sounds to bewilder and daze...");
4398 p_ptr->magic_num1[0] = MUSIC_STUN;
4400 case 4: /* Flow of life À¸Ì¿¤Îή¤ì */
4402 msg_print("²Î¤òÄ̤·¤ÆÂΤ˳赤¤¬Ìá¤Ã¤Æ¤¤¿¡¥¡¥¡¥");
4404 msg_print("Life flows through you as you sing a song of healing...");
4406 p_ptr->magic_num1[0] = MUSIC_L_LIFE;
4408 case 5: /* Song of the Sun ÂÀÍۤβΠ*/
4410 msg_print("¸÷¤êµ±¤¯²Î¤¬ÊÕ¤ê¤ò¾È¤é¤·¤¿¡£");
4412 msg_print("Your uplifting song brings brightness to dark places...");
4414 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
4416 case 6: /* Song of fear ¶²ÉݤβΠ*/
4418 msg_print("¤ª¤É¤í¤ª¤É¤í¤·¤¤¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4420 msg_print("You start weaving a fearful pattern...");
4422 p_ptr->magic_num1[0] = MUSIC_FEAR;
4424 case 7: /* Heroic Ballad À襤¤Î²Î */
4426 msg_print("·ã¤·¤¤À襤¤Î²Î¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4428 msg_print("You start singing a song of intense fighting...");
4430 p_ptr->magic_num1[0] = MUSIC_HERO;
4432 case 8: /* Clairaudience ÎîŪÃγР*/
4434 msg_print("ÀŤ«¤Ê²»³Ú¤¬´¶³Ð¤ò¸¦¤®À¡¤Þ¤µ¤»¤¿¡¥¡¥¡¥");
4436 msg_print("Your quiet music sharpens your sense of hearing...");
4438 p_ptr->magic_num1[0] = MUSIC_DETECT;
4440 case 9: /* º²¤Î²Î */
4442 msg_print("Àº¿À¤òDZ¤¸¶Ê¤²¤ë²Î¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4444 msg_print("You start singing a song of soul in pain...");
4446 p_ptr->magic_num1[0] = MUSIC_PSI;
4448 case 10: /* Song of Lore Ãμ±¤Î²Î */
4450 msg_print("¤³¤ÎÀ¤³¦¤ÎÃ챤¬Î®¤ì¹þ¤ó¤Ç¤¤¿¡¥¡¥¡¥");
4452 msg_print("You recall the rich lore of the world...");
4454 p_ptr->magic_num1[0] = MUSIC_ID;
4456 case 11: /* hidding song ±£ÆۤβΠ*/
4458 msg_print("¤¢¤Ê¤¿¤Î»Ñ¤¬·Ê¿§¤Ë¤È¤±¤³¤ó¤Ç¤¤¤Ã¤¿¡¥¡¥¡¥");
4460 msg_print("Your song carries you beyond the sight of mortal eyes...");
4462 p_ptr->magic_num1[0] = MUSIC_STEALTH;
4464 case 12: /* Illusion Pattern ¸¸±Æ¤ÎÀûΧ */
4466 msg_print("ÊÕ¤ê°ìÌ̤˸¸±Æ¤¬¸½¤ì¤¿¡¥¡¥¡¥");
4468 msg_print("You weave a pattern of sounds to beguile and confuse...");
4470 p_ptr->magic_num1[0] = MUSIC_CONF;
4472 case 13: /* Doomcall (vibration song) ÇËÌǤζ«¤Ó */
4474 msg_print("¹ì²»¤¬¶Á¤¤¤¿¡¥¡¥¡¥");
4476 msg_print("The fury of the Downfall of Numenor lashes out...");
4478 p_ptr->magic_num1[0] = MUSIC_SOUND;
4480 case 14: /* Firiel's Song (song of the Undeads) ¥Õ¥£¥ê¥¨¥ë¤Î²Î */
4482 msg_print("À¸Ì¿¤ÈÉü³è¤Î¥Æ¡¼¥Þ¤òÁդǻϤ᤿¡¥¡¥¡¥");
4484 msg_print("The themes of life and revival are woven into your song...");
4486 animate_dead(0, py, px);
4488 case 15: /* Fellowship Chant (charming song) ι¤ÎÃç´Ö */
4490 msg_print("°Â¤é¤«¤Ê¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4492 msg_print("You weave a slow, soothing melody of imploration...");
4494 p_ptr->magic_num1[0] = MUSIC_CHARM;
4496 case 16: /* (wall breaking song) ʬ²ò²»ÇÈ */
4498 msg_print("Ê´ºÕ¤¹¤ë¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4500 msg_print("You weave a violent pattern of sounds to break wall.");
4502 p_ptr->magic_num1[0] = MUSIC_WALL;
4503 project(0, 0, py, px,
4504 0, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM | PROJECT_HIDE, -1);
4506 case 17: /* Finrod's Resistance (song of resistance) ¸µÁÇÂÑÀ */
4508 msg_print("¸µÁǤÎÎϤËÂФ¹¤ëǦÂѤβΤò²Î¤Ã¤¿¡£");
4510 msg_print("You sing a song of perseverance against powers...");
4512 p_ptr->magic_num1[0] = MUSIC_RESIST;
4514 case 18: /* Hobbit Melodies (song of time) ¥Û¥Ó¥Ã¥È¤Î¥á¥í¥Ç¥£ */
4516 msg_print("·Ú²÷¤Ê²Î¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4518 msg_print("You start singing joyful pop song...");
4520 p_ptr->magic_num1[0] = MUSIC_SPEED;
4522 case 19: /* World Contortion ÏĤó¤ÀÀ¤³¦ */
4524 msg_print("²Î¤¬¶õ´Ö¤òÏĤ᤿¡¥¡¥¡¥");
4526 msg_print("Reality whirls wildly as you sing a dizzying melody...");
4528 project(0, plev/15 + 1, py, px, plev * 3 + 1, GF_AWAY_ALL , PROJECT_KILL, -1);
4530 case 20: /* Â໶¤Î²Î */
4532 msg_print("ÂѤ¨¤é¤ì¤Ê¤¤ÉÔ¶¨Ï²»¤¬Å¨¤òÀÕ¤áΩ¤Æ¤¿¡¥¡¥¡¥");
4534 msg_print("You cry out in an ear-wracking voice...");
4536 p_ptr->magic_num1[0] = MUSIC_DISPEL;
4538 case 21: /* The Voice of Saruman ¥µ¥ë¥Þ¥ó¤Î´Å¸À */
4540 msg_print("Í¥¤·¤¯¡¢Ì¥ÎÏŪ¤Ê²Î¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4542 msg_print("You start humming a gentle and attractive song...");
4544 p_ptr->magic_num1[0] = MUSIC_SARUMAN;
4546 case 22: /* Song of Tempest (song of death) Íò¤Î²»¿§ */
4547 if (!get_aim_dir(&dir)) return FALSE;
4548 fire_beam(GF_SOUND, dir,
4549 damroll(15 + ((plev - 1) / 2), 10));
4551 case 23: /* (song of disruption) ¤â¤¦°ì¤Ä¤ÎÀ¤³¦ */
4553 msg_print("¼þ°Ï¤¬ÊѲ½¤·»Ï¤á¤¿¡¥¡¥¡¥");
4555 msg_print("You sing of the primeval shaping of Middle-earth...");
4559 case 24: /* Wrecking Pattern (destruction shriek) Ç˲õ¤ÎÀûΧ */
4561 msg_print("Ç˲õŪ¤Ê²Î¤¬¶Á¤¤ï¤¿¤Ã¤¿¡¥¡¥¡¥");
4563 msg_print("You weave a pattern of sounds to contort and shatter...");
4565 p_ptr->magic_num1[0] = MUSIC_QUAKE;
4567 case 25: /* ÄäÂڤβΠ*/
4569 msg_print("¤æ¤Ã¤¯¤ê¤È¤·¤¿¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4571 msg_print("You weave a very slow pattern which is almost likely to stop...");
4573 p_ptr->magic_num1[0] = MUSIC_STASIS;
4575 case 26: /* ¼é¤ê¤Î²Î */
4577 msg_print("²Î¤¬¿ÀÀ»¤Ê¾ì¤òºî¤ê½Ð¤·¤¿¡¥¡¥¡¥");
4579 msg_print("The holy power of the Music is creating sacred field...");
4583 case 27: /* ±Ñͺ¤Î»í */
4585 msg_print("±Ñͺ¤Î²Î¤ò¸ý¤º¤µ¤ó¤À¡¥¡¥¡¥");
4587 msg_print("You chant a powerful, heroic call to arms...");
4589 p_ptr->magic_num1[0] = MUSIC_SHERO;
4590 (void)hp_player(10);
4591 (void)set_afraid(0);
4593 case 28: /* ¥ä¥ô¥¡¥ó¥Ê¤Î½õ¤± */
4595 msg_print("²Î¤òÄ̤·¤ÆÂΤ˳赤¤¬Ìá¤Ã¤Æ¤¤¿¡¥¡¥¡¥");
4597 msg_print("Life flows through you as you sing the song...");
4599 p_ptr->magic_num1[0] = MUSIC_H_LIFE;
4601 case 29: /* ºÆÀ¸¤Î²Î */
4603 msg_print("°Å¹õ¤ÎÃæ¤Ë¸÷¤ÈÈþ¤ò¤Õ¤ê¤Þ¤¤¤¿¡£ÂΤ¬¸µ¤Î³èÎϤò¼è¤êÌᤷ¤¿¡£");
4605 msg_print("You strewed light and beauty in the dark as you sing. You feel refreshed.");
4607 (void)do_res_stat(A_STR);
4608 (void)do_res_stat(A_INT);
4609 (void)do_res_stat(A_WIS);
4610 (void)do_res_stat(A_DEX);
4611 (void)do_res_stat(A_CON);
4612 (void)do_res_stat(A_CHR);
4613 (void)restore_level();
4615 case 30: /* shriek of death ¥µ¥¦¥í¥ó¤ÎËâ½Ñ */
4616 if (!get_aim_dir(&dir)) return FALSE;
4617 fire_ball(GF_SOUND, dir, damroll(50 + plev, 10), 0);
4619 case 31: /* song of liberty ¥Õ¥£¥ó¥´¥ë¥Õ¥£¥ó¤ÎÄ©Àï */
4621 msg_print("¥Õ¥£¥ó¥´¥ë¥Õ¥£¥ó¤Î̽²¦¤Ø¤ÎÄ©Àï¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4623 msg_print("You recall the valor of Fingolfin's challenge to the Dark Lord...");
4625 p_ptr->magic_num1[0] = MUSIC_INVULN;
4628 p_ptr->redraw |= (PR_MAP);
4630 /* Update monsters */
4631 p_ptr->update |= (PU_MONSTERS);
4634 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4638 msg_format("̤ÃΤβÎ(%d)¤ò²Î¤Ã¤¿¡£", spell);
4640 msg_format("You sing an unknown song: %d.", spell);
4645 if (p_ptr->magic_num1[0]) set_action(ACTION_SING);
4647 /* Recalculate bonuses */
4648 p_ptr->update |= (PU_BONUS | PU_HP);
4650 /* Redraw status bar */
4651 p_ptr->redraw |= (PR_STATUS);
4659 void do_cmd_cast(void)
4661 int item, sval, spell, realm;
4676 /* Require spell ability */
4677 if (!p_ptr->realm1 && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE))
4680 msg_print("¼öʸ¤ò¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4682 msg_print("You cannot cast spells!");
4689 if (p_ptr->blind || no_lite())
4692 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡ª");
4694 msg_print("You cannot see!");
4696 if (p_ptr->pclass == CLASS_FORCETRAINER)
4703 /* Not when confused */
4704 if (p_ptr->confused)
4707 msg_print("º®Í𤷤Ƥ¤¤Æ¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4709 msg_print("You are too confused!");
4715 prayer = spell_categoly_name(mp_ptr->spell_book);
4717 /* Restrict choices to spell books */
4718 item_tester_tval = mp_ptr->spell_book;
4722 q = "¤É¤Î¼öʸ½ñ¤ò»È¤¤¤Þ¤¹¤«? ";
4724 q = "Use which book? ";
4728 s = "¼öʸ½ñ¤¬¤Ê¤¤¡ª";
4730 s = "You have no spell books!";
4733 if (p_ptr->pclass == CLASS_FORCETRAINER)
4734 select_the_force = TRUE;
4735 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))){
4736 select_the_force = FALSE;
4739 select_the_force = FALSE;
4741 if (item == INVEN_FORCE) { /* the_force */
4745 /* Get the item (in the pack) */
4748 o_ptr = &inventory[item];
4751 /* Get the item (on the floor) */
4754 o_ptr = &o_list[0 - item];
4757 /* Access the item's sval */
4760 if ((p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE) && (o_ptr->tval == REALM2_BOOK)) increment = 32;
4763 /* Track the object kind */
4764 object_kind_track(o_ptr->k_idx);
4766 /* Hack -- Handle stuff */
4769 if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
4770 realm = o_ptr->tval - TV_LIFE_BOOK + 1;
4771 else if (increment) realm = p_ptr->realm2;
4772 else realm = p_ptr->realm1;
4774 /* Ask for a spell */
4776 if (!get_spell(&spell,
4777 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "±Ó¾§¤¹¤ë" : (mp_ptr->spell_book == TV_MUSIC_BOOK) ? "²Î¤¦" : "¾§¤¨¤ë"),
4780 if (spell == -2) msg_format("¤½¤ÎËܤˤÏÃΤäƤ¤¤ë%s¤¬¤Ê¤¤¡£", prayer);
4784 if (!get_spell(&spell, ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "recite" : "cast"),
4788 msg_format("You don't know any %ss in that book.", prayer);
4794 use_realm = tval2realm(o_ptr->tval);
4796 if (!is_magic(use_realm))
4798 s_ptr = &technic_info[use_realm - MIN_TECHNIC][spell];
4802 s_ptr = &mp_ptr->info[realm - 1][spell];
4805 /* Extract mana consumption rate */
4806 need_mana = mod_need_mana(s_ptr->smana, spell, realm);
4808 /* Verify "dangerous" spells */
4809 if (need_mana > p_ptr->csp)
4811 if (flush_failure) flush();
4815 msg_format("¤½¤Î%s¤ò%s¤Î¤Ë½½Ê¬¤Ê¥Þ¥¸¥Ã¥¯¥Ý¥¤¥ó¥È¤¬¤Ê¤¤¡£",prayer,
4816 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "±Ó¾§¤¹¤ë" : (mp_ptr->spell_book == TV_LIFE_BOOK) ? "²Î¤¦" : "¾§¤¨¤ë"));
4818 msg_format("You do not have enough mana to %s this %s.",
4819 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "recite" : "cast"),
4824 if (!over_exert) return;
4828 if (!get_check_strict("¤½¤ì¤Ç¤âÄ©À路¤Þ¤¹¤«? ", CHECK_OKAY_CANCEL)) return;
4830 if (!get_check_strict("Attempt it anyway? ", CHECK_OKAY_CANCEL)) return;
4836 /* Spell failure chance */
4837 chance = spell_chance(spell, use_realm);
4840 if (randint0(100) < chance)
4842 if (flush_failure) flush();
4845 msg_format("%s¤ò¤¦¤Þ¤¯¾§¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡ª", prayer);
4847 msg_format("You failed to get the %s off!", prayer);
4855 if (randint1(100) < chance) chg_virtue(V_VITALITY, -1);
4858 if (randint1(100) < chance) chg_virtue(V_UNLIFE, -1);
4861 if (randint1(100) < chance) chg_virtue(V_NATURE, -1);
4864 if (randint1(100) < chance) chg_virtue(V_JUSTICE, 1);
4867 if (randint1(100) < chance) chg_virtue(V_JUSTICE, -1);
4870 if (randint1(100) < chance) chg_virtue(V_KNOWLEDGE, -1);
4874 if (realm == REALM_TRUMP)
4876 cast_trump_spell(spell, FALSE);
4878 else if ((o_ptr->tval == TV_CHAOS_BOOK) && (randint1(100) < spell))
4881 msg_print("¥«¥ª¥¹Åª¤Ê¸ú²Ì¤òȯÀ¸¤·¤¿¡ª");
4883 msg_print("You produce a chaotic effect!");
4888 else if ((o_ptr->tval == TV_DEATH_BOOK) && (randint1(100) < spell))
4890 if ((sval == 3) && one_in_(2))
4892 sanity_blast(0, TRUE);
4897 msg_print("Äˤ¤¡ª");
4899 msg_print("It hurts!");
4903 take_hit(DAMAGE_LOSELIFE, damroll(o_ptr->sval + 1, 6), "°Å¹õËâË¡¤ÎµÕή", -1);
4905 take_hit(DAMAGE_LOSELIFE, damroll(o_ptr->sval + 1, 6), "a miscast Death spell", -1);
4908 if ((spell > 15) && one_in_(6) && !p_ptr->hold_life)
4909 lose_exp(spell * 250);
4912 else if ((o_ptr->tval == TV_MUSIC_BOOK) && (randint1(200) < spell))
4915 msg_print("¤¤¤ä¤Ê²»¤¬¶Á¤¤¤¿");
4917 msg_print("An infernal sound echoed.");
4920 aggravate_monsters(0);
4922 if (randint1(100) >= chance)
4923 chg_virtue(V_CHANCE,-1);
4932 case REALM_LIFE: /* * LIFE * */
4933 cast = cast_life_spell(spell);
4935 case REALM_SORCERY: /* * SORCERY * */
4936 cast = cast_sorcery_spell(spell);
4938 case REALM_NATURE: /* * NATURE * */
4939 cast = cast_nature_spell(spell);
4941 case REALM_CHAOS: /* * CHAOS * */
4942 cast = cast_chaos_spell(spell);
4944 case REALM_DEATH: /* * DEATH * */
4945 cast = cast_death_spell(spell);
4947 case REALM_TRUMP: /* TRUMP */
4948 cast = cast_trump_spell(spell, TRUE);
4950 case REALM_ARCANE: /* ARCANE */
4951 cast = cast_arcane_spell(spell);
4953 case REALM_ENCHANT: /* ENCHANT */
4954 cast = cast_enchant_spell(spell);
4956 case REALM_DAEMON: /* DAEMON */
4957 cast = cast_daemon_spell(spell);
4959 case REALM_CRUSADE: /* CRUSADE */
4960 cast = cast_crusade_spell(spell);
4962 case REALM_MUSIC: /* MUSIC */
4963 cast = cast_music_spell(spell);
4967 msg_format("You cast a spell from an unknown realm: realm %d, spell %d.", realm, spell);
4971 /* Canceled spells cost neither a turn nor mana */
4974 if (randint1(100) < chance)
4975 chg_virtue(V_CHANCE,1);
4977 /* A spell was cast */
4979 (p_ptr->spell_worked2 & (1L << spell)) :
4980 (p_ptr->spell_worked1 & (1L << spell)))
4981 && (p_ptr->pclass != CLASS_SORCERER)
4982 && (p_ptr->pclass != CLASS_RED_MAGE))
4984 int e = s_ptr->sexp;
4986 /* The spell worked */
4987 if (realm == p_ptr->realm1)
4989 p_ptr->spell_worked1 |= (1L << spell);
4993 p_ptr->spell_worked2 |= (1L << spell);
4996 /* Gain experience */
4997 gain_exp(e * s_ptr->slevel);
4999 /* Redraw object recall */
5000 p_ptr->window |= (PW_OBJECT);
5005 chg_virtue(V_TEMPERANCE, 1);
5006 chg_virtue(V_COMPASSION, 1);
5007 chg_virtue(V_VITALITY, 1);
5008 chg_virtue(V_DILIGENCE, 1);
5011 chg_virtue(V_UNLIFE, 1);
5012 chg_virtue(V_JUSTICE, -1);
5013 chg_virtue(V_FAITH, -1);
5014 chg_virtue(V_VITALITY, -1);
5017 chg_virtue(V_JUSTICE, -1);
5018 chg_virtue(V_FAITH, -1);
5019 chg_virtue(V_HONOUR, -1);
5020 chg_virtue(V_TEMPERANCE, -1);
5023 chg_virtue(V_FAITH, 1);
5024 chg_virtue(V_JUSTICE, 1);
5025 chg_virtue(V_SACRIFICE, 1);
5026 chg_virtue(V_HONOUR, 1);
5029 chg_virtue(V_NATURE, 1);
5030 chg_virtue(V_HARMONY, 1);
5033 chg_virtue(V_KNOWLEDGE, 1);
5040 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_TEMPERANCE, 1);
5041 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_COMPASSION, 1);
5042 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_VITALITY, 1);
5043 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_DILIGENCE, 1);
5046 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_UNLIFE, 1);
5047 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_JUSTICE, -1);
5048 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_FAITH, -1);
5049 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_VITALITY, -1);
5052 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_JUSTICE, -1);
5053 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_FAITH, -1);
5054 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_HONOUR, -1);
5055 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_TEMPERANCE, -1);
5058 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_FAITH, 1);
5059 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_JUSTICE, 1);
5060 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_SACRIFICE, 1);
5061 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_HONOUR, 1);
5064 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_NATURE, 1);
5065 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_HARMONY, 1);
5068 if (mp_ptr->spell_xtra & MAGIC_GAIN_EXP)
5070 s16b cur_exp = p_ptr->spell_exp[(increment ? 32 : 0)+spell];
5073 if (cur_exp < SPELL_EXP_BEGINNER)
5075 else if (cur_exp < SPELL_EXP_SKILLED)
5077 if ((dun_level > 4) && ((dun_level + 10) > p_ptr->lev))
5080 else if (cur_exp < SPELL_EXP_EXPERT)
5082 if (((dun_level + 5) > p_ptr->lev) && ((dun_level + 5) > s_ptr->slevel))
5085 else if ((cur_exp < SPELL_EXP_MASTER) && !increment)
5087 if (((dun_level + 5) > p_ptr->lev) && (dun_level > s_ptr->slevel))
5090 p_ptr->spell_exp[(increment ? 32 : 0) + spell] += exp_gain;
5097 /* Sufficient mana */
5098 if (need_mana <= p_ptr->csp)
5101 p_ptr->csp -= need_mana;
5104 /* Over-exert the player */
5107 int oops = need_mana;
5111 p_ptr->csp_frac = 0;
5115 msg_print("Àº¿À¤ò½¸Ã椷¤¹¤®¤Æµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
5117 msg_print("You faint from the effort!");
5121 /* Hack -- Bypass free action */
5122 (void)set_paralyzed(p_ptr->paralyzed + randint1(5 * oops + 1));
5127 chg_virtue(V_VITALITY, -10);
5130 chg_virtue(V_UNLIFE, -10);
5133 chg_virtue(V_JUSTICE, 10);
5136 chg_virtue(V_NATURE, -10);
5139 chg_virtue(V_JUSTICE, -10);
5142 chg_virtue(V_KNOWLEDGE, -10);
5146 /* Damage CON (possibly permanently) */
5147 if (randint0(100) < 50)
5149 bool perm = (randint0(100) < 25);
5153 msg_print("ÂΤò°¤¯¤·¤Æ¤·¤Þ¤Ã¤¿¡ª");
5155 msg_print("You have damaged your health!");
5159 /* Reduce constitution */
5160 (void)dec_stat(A_CON, 15 + randint1(10), perm);
5165 p_ptr->redraw |= (PR_MANA);
5168 p_ptr->window |= (PW_PLAYER);
5169 p_ptr->window |= (PW_SPELL);
5174 * Pray a prayer -- Unused in Hengband
5176 void do_cmd_pray(void)
5178 msg_print("Praying is not used in Hengband. Use magic spell casting instead.");
5181 static bool ang_sort_comp_pet_dismiss(vptr u, vptr v, int a, int b)
5183 u16b *who = (u16b*)(u);
5188 monster_type *m_ptr1 = &m_list[w1];
5189 monster_type *m_ptr2 = &m_list[w2];
5190 monster_race *r_ptr1 = &r_info[m_ptr1->r_idx];
5191 monster_race *r_ptr2 = &r_info[m_ptr2->r_idx];
5196 if (w1 == p_ptr->riding) return TRUE;
5197 if (w2 == p_ptr->riding) return FALSE;
5199 if (m_ptr1->nickname && !m_ptr2->nickname) return TRUE;
5200 if (m_ptr2->nickname && !m_ptr1->nickname) return FALSE;
5202 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return TRUE;
5203 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return FALSE;
5205 if (r_ptr1->level > r_ptr2->level) return TRUE;
5206 if (r_ptr2->level > r_ptr1->level) return FALSE;
5208 if (m_ptr1->hp > m_ptr2->hp) return TRUE;
5209 if (m_ptr2->hp > m_ptr1->hp) return FALSE;
5214 int calculate_upkeep(void)
5216 s32b old_friend_align = friend_align;
5218 bool have_a_unique = FALSE;
5221 total_friend_levels = 0;
5224 for (m_idx = m_max - 1; m_idx >=1; m_idx--)
5226 monster_type *m_ptr;
5227 monster_race *r_ptr;
5229 m_ptr = &m_list[m_idx];
5230 if (!m_ptr->r_idx) continue;
5231 r_ptr = &r_info[m_ptr->r_idx];
5236 if (r_ptr->flags1 & RF1_UNIQUE)
5238 if (p_ptr->pclass == CLASS_CAVALRY)
5240 if (p_ptr->riding == m_idx)
5241 total_friend_levels += (r_ptr->level+5)*2;
5242 else if (!have_a_unique && (r_info[m_ptr->r_idx].flags7 & RF7_RIDING))
5243 total_friend_levels += (r_ptr->level+5)*7/2;
5245 total_friend_levels += (r_ptr->level+5)*10;
5246 have_a_unique = TRUE;
5249 total_friend_levels += (r_ptr->level+5)*10;
5252 total_friend_levels += r_ptr->level;
5254 /* Determine pet alignment */
5255 if (r_ptr->flags3 & RF3_GOOD)
5257 friend_align += r_ptr->level;
5259 else if (r_ptr->flags3 & RF3_EVIL)
5261 friend_align -= r_ptr->level;
5265 if (old_friend_align != friend_align) p_ptr->update |= (PU_BONUS);
5269 upkeep_factor = (total_friend_levels - (p_ptr->lev * 80 / (cp_ptr->pet_upkeep_div)));
5270 if (upkeep_factor < 0) upkeep_factor = 0;
5271 if (upkeep_factor > 1000) upkeep_factor = 1000;
5272 return upkeep_factor;
5278 void do_cmd_pet_dismiss(void)
5280 monster_type *m_ptr;
5281 bool all_pets = FALSE;
5295 /* Allocate the "who" array */
5296 C_MAKE(who, max_m_idx, u16b);
5298 /* Process the monsters (backwards) */
5299 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
5301 if (is_pet(&m_list[pet_ctr]))
5302 who[max_pet++] = pet_ctr;
5305 /* Select the sort method */
5306 ang_sort_comp = ang_sort_comp_pet_dismiss;
5307 ang_sort_swap = ang_sort_swap_hook;
5309 ang_sort(who, &dummy_why, max_pet);
5311 /* Process the monsters (backwards) */
5312 for (i = 0; i < max_pet; i++)
5315 char friend_name[80];
5319 /* Access the monster */
5321 m_ptr = &m_list[pet_ctr];
5323 delete_this = FALSE;
5324 kakunin = ((pet_ctr == p_ptr->riding) || (m_ptr->nickname));
5325 monster_desc(friend_name, m_ptr, 0x80);
5329 /* Hack -- health bar for this monster */
5330 health_track(pet_ctr);
5332 /* Hack -- handle stuff */
5336 sprintf(buf, "%s¤òÊü¤·¤Þ¤¹¤«¡© [Yes/No/Unnamed (%dɤ)]", friend_name, max_pet-i);
5338 sprintf(buf, "Dismiss %s? [Yes/No/Unnamed (%d remain)]", friend_name, max_pet-i);
5343 move_cursor_relative(m_ptr->fy, m_ptr->fx);
5349 if (ch == 'Y' || ch == 'y')
5356 sprintf(buf, "ËÜÅö¤Ë¤è¤í¤·¤¤¤Ç¤¹¤«¡© (%s) ", friend_name);
5358 sprintf(buf, "Are you sure? (%s) ", friend_name);
5360 if (!get_check(buf))
5361 delete_this = FALSE;
5366 if (ch == 'U' || ch == 'u')
5372 if (ch == ESCAPE || ch == 'N' || ch == 'n')
5379 if ((all_pets && !kakunin) || (!all_pets && delete_this))
5381 if (record_named_pet && m_ptr->nickname)
5385 monster_desc(m_name, m_ptr, 0x08);
5386 do_cmd_write_nikki(NIKKI_NAMED_PET, 2, m_name);
5389 if (pet_ctr == p_ptr->riding)
5392 msg_format("%s¤«¤é¹ß¤ê¤¿¡£", friend_name);
5394 msg_format("You have got off %s. ", friend_name);
5399 /* Update the monsters */
5400 p_ptr->update |= (PU_BONUS | PU_MONSTERS);
5401 p_ptr->redraw |= (PR_EXTRA);
5404 /* HACK : Add the line to message buffer */
5406 sprintf(buf, "%s ¤òÊü¤·¤¿¡£", friend_name);
5408 sprintf(buf, "Dismissed %s.", friend_name);
5411 p_ptr->window |= (PW_MESSAGE);
5414 delete_monster_idx(pet_ctr);
5423 C_KILL(who, max_m_idx, u16b);
5426 msg_format("%d ɤ¤Î¥Ú¥Ã¥È¤òÊü¤·¤Þ¤·¤¿¡£", Dismissed);
5428 msg_format("You have dismissed %d pet%s.", Dismissed,
5429 (Dismissed == 1 ? "" : "s"));
5431 if (Dismissed == 0 && all_pets)
5433 msg_print("'U'nnamed ¤Ï¡¢¾èÇϰʳ°¤Î̾Á°¤Î¤Ê¤¤¥Ú¥Ã¥È¤À¤±¤òÁ´¤Æ²òÊü¤·¤Þ¤¹¡£");
5435 msg_print("'U'nnamed means all your pets except named pets and your mount.");
5438 p_ptr->update |= (PU_MON_LITE);
5441 bool rakuba(int dam, bool force)
5443 int i, y, x, oy, ox;
5444 int sn = 0, sy = 0, sx = 0;
5446 monster_type *m_ptr = &m_list[p_ptr->riding];
5447 monster_race *r_ptr = &r_info[m_ptr->r_idx];
5449 if (!p_ptr->riding) return FALSE;
5450 if (p_ptr->wild_mode) return FALSE;
5452 if (dam >= 0 || force)
5456 int level = r_ptr->level;
5457 if (p_ptr->riding_ryoute) level += 20;
5458 if ((dam / 2 + r_ptr->level) > (p_ptr->skill_exp[GINOU_RIDING] / 30 + 10))
5460 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] > (RIDING_EXP_BEGINNER * 2))
5462 if (r_ptr->level * 100 > (p_ptr->skill_exp[GINOU_RIDING] + 1500))
5463 p_ptr->skill_exp[GINOU_RIDING] += (1 + (r_ptr->level - p_ptr->skill_exp[GINOU_RIDING] / 100 - 15));
5464 else p_ptr->skill_exp[GINOU_RIDING]++;
5467 if (randint0(dam / 2 + level * 2) < (p_ptr->skill_exp[GINOU_RIDING] / 30 + 10))
5469 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))
5475 /* Check around the player */
5476 for (i = 0; i < 8; i++)
5480 /* Access the location */
5481 y = py + ddy_ddd[i];
5482 x = px + ddx_ddd[i];
5484 c_ptr = &cave[y][x];
5486 /* Skip non-empty grids */
5487 if (cave_perma_grid(c_ptr)) continue;
5488 if (!cave_empty_grid2(c_ptr)) continue;
5490 if (c_ptr->m_idx) continue;
5492 /* Count "safe" grids */
5495 /* Randomize choice */
5496 if (randint0(sn) > 0) continue;
5498 /* Save the safe location */
5503 monster_desc(m_name, m_ptr, 0);
5505 msg_format("%s¤«¤é¿¶¤êÍî¤È¤µ¤ì¤½¤¦¤Ë¤Ê¤Ã¤Æ¡¢Êɤˤ֤Ĥ«¤Ã¤¿¡£",m_name);
5506 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "Êɤؤξ×ÆÍ", -1);
5508 msg_format("You have nearly fallen from %s, but bumped into wall.",m_name);
5509 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "bumping into wall", -1);
5520 /* Redraw the old spot */
5523 /* Redraw the new spot */
5526 /* Check for new panel */
5531 p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5532 p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE;
5536 p_ptr->update |= (PU_BONUS);
5539 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW);
5541 /* Update the monsters */
5542 p_ptr->update |= (PU_DISTANCE);
5545 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5547 p_ptr->redraw |= (PR_EXTRA);
5549 /* Update health track of mount */
5550 p_ptr->redraw |= (PR_UHEALTH);
5552 if (p_ptr->ffall && !force)
5554 monster_desc(m_name, m_ptr, 0);
5556 msg_format("%s¤«¤éÍî¤Á¤¿¤¬¡¢¶õÃæ¤Ç¤¦¤Þ¤¯ÂÎÀª¤òΩ¤Æľ¤·¤ÆÃåÃϤ·¤¿¡£",m_name);
5558 msg_format("You are thrown from %s, but make a good landing.",m_name);
5563 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "ÍîÇÏ", -1);
5565 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "Falling from riding", -1);
5571 bool do_riding(bool force)
5573 int oy, ox, x, y, dir = 0;
5575 monster_type *m_ptr;
5577 if (!get_rep_dir2(&dir)) return FALSE;
5580 c_ptr = &cave[y][x];
5584 /* Skip non-empty grids */
5585 if (!cave_empty_bold2(y, x) || c_ptr->m_idx)
5588 msg_print("¤½¤Á¤é¤Ë¤Ï¹ß¤ê¤é¤ì¤Þ¤»¤ó¡£");
5590 msg_print("You cannot go to that direction.");
5595 p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5596 p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE;
5600 if (p_ptr->confused)
5603 msg_print("º®Í𤷤Ƥ¤¤Æ¾è¤ì¤Ê¤¤¡ª");
5605 msg_print("You are too confused!");
5609 if (!(c_ptr->m_idx))
5612 msg_print("¤½¤Î¾ì½ê¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
5614 msg_print("Here is no pet.");
5620 m_ptr = &m_list[c_ptr->m_idx];
5622 if (!is_pet(m_ptr) && !force)
5625 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï¥Ú¥Ã¥È¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£");
5627 msg_print("That monster is not a pet.");
5632 if (!(r_info[m_ptr->r_idx].flags7 & RF7_RIDING))
5635 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ë¤Ï¾è¤ì¤Ê¤µ¤½¤¦¤À¡£");
5637 msg_print("This monster doesn't seem suitable for riding.");
5642 if (!(p_ptr->pass_wall) && (c_ptr->feat >= FEAT_RUBBLE) && (c_ptr->feat <= FEAT_PERM_SOLID))
5645 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤ÏÊɤÎÃæ¤Ë¤¤¤ë¡£");
5647 msg_print("This monster is in the wall.");
5652 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)))
5655 msg_print("¥Ñ¥¿¡¼¥ó¤Î¾å¤«¤é¤Ï¾è¤ì¤Þ¤»¤ó¡£");
5657 msg_print("You cannot ride from on Pattern.");
5665 msg_print("¤½¤Î¾ì½ê¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
5667 msg_print("Here is no monster.");
5672 if (r_info[m_ptr->r_idx].level > randint1((p_ptr->skill_exp[GINOU_RIDING] / 50 + p_ptr->lev / 2 + 20)))
5675 msg_print("¤¦¤Þ¤¯¾è¤ì¤Ê¤«¤Ã¤¿¡£");
5677 msg_print("You failed to ride.");
5687 monster_desc(m_name, m_ptr, 0);
5690 msg_format("%s¤òµ¯¤³¤·¤¿¡£", m_name);
5692 msg_format("You have waked %s up.", m_name);
5696 p_ptr->riding = c_ptr->m_idx;
5698 /* Hack -- remove tracked monster */
5699 if (p_ptr->riding == p_ptr->health_who) health_track(0);
5702 /* Save the old location */
5706 /* Move the player to the safe location */
5710 /* Redraw the old spot */
5713 /* Redraw the new spot */
5716 /* Check for new panel */
5721 /* Mega-Hack -- Forget the view and lite */
5722 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
5725 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW);
5727 /* Update the monsters */
5728 p_ptr->update |= (PU_DISTANCE);
5730 /* Update the monsters */
5731 p_ptr->update |= (PU_BONUS);
5734 p_ptr->redraw |= (PR_MAP | PR_EXTRA);
5737 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5739 p_ptr->redraw |= (PR_UHEALTH);
5745 static void do_name_pet(void)
5747 monster_type *m_ptr;
5750 bool old_name = FALSE;
5751 bool old_target_pet = target_pet;
5754 if (!target_set(TARGET_KILL))
5756 target_pet = old_target_pet;
5759 target_pet = old_target_pet;
5761 if (cave[target_row][target_col].m_idx)
5763 m_ptr = &m_list[cave[target_row][target_col].m_idx];
5769 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï¥Ú¥Ã¥È¤Ç¤Ï¤Ê¤¤¡£");
5771 msg_format("This monster is not a pet.");
5775 if (r_info[m_ptr->r_idx].flags1 & RF1_UNIQUE)
5778 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Î̾Á°¤ÏÊѤ¨¤é¤ì¤Ê¤¤¡ª");
5780 msg_format("You cannot change name of this monster!");
5784 monster_desc(m_name, m_ptr, 0);
5788 msg_format("%s¤Ë̾Á°¤ò¤Ä¤±¤ë¡£", m_name);
5790 msg_format("Name %s.", m_name);
5795 /* Start with nothing */
5796 strcpy(out_val, "");
5798 /* Use old inscription */
5799 if (m_ptr->nickname)
5801 /* Start with the old inscription */
5802 strcpy(out_val, quark_str(m_ptr->nickname));
5806 /* Get a new inscription (possibly empty) */
5808 if (get_string("̾Á°: ", out_val, 15))
5810 if (get_string("Name: ", out_val, 15))
5816 /* Save the inscription */
5817 m_ptr->nickname = quark_add(out_val);
5818 if (record_named_pet)
5822 monster_desc(m_name, m_ptr, 0x08);
5823 do_cmd_write_nikki(NIKKI_NAMED_PET, 0, m_name);
5828 if (record_named_pet && old_name)
5832 monster_desc(m_name, m_ptr, 0x08);
5833 do_cmd_write_nikki(NIKKI_NAMED_PET, 1, m_name);
5835 m_ptr->nickname = 0;
5842 * Issue a pet command
5844 void do_cmd_pet(void)
5849 cptr power_desc[36];
5854 int pets = 0, pet_ctr;
5855 monster_type *m_ptr;
5862 char target_buf[160];
5866 /* Calculate pets */
5867 /* Process the monsters (backwards) */
5868 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
5870 /* Access the monster */
5871 m_ptr = &m_list[pet_ctr];
5873 if (is_pet(m_ptr)) pets++;
5877 power_desc[num] = "¥Ú¥Ã¥È¤òÊü¤¹";
5879 power_desc[num] = "dismiss pets";
5882 powers[num++] = PET_DISMISS;
5885 sprintf(target_buf,"¥Ú¥Ã¥È¤Î¥¿¡¼¥²¥Ã¥È¤ò»ØÄê (¸½ºß¡§%s)",
5886 (pet_t_m_idx ? r_name + r_info[m_list[pet_t_m_idx].r_idx].name : "»ØÄê¤Ê¤·"));
5888 sprintf(target_buf,"specify a targert of pet (now:%s)",
5889 (pet_t_m_idx ? r_name + r_info[m_list[pet_t_m_idx].r_idx].name : "nothing"));
5891 power_desc[num] = target_buf;
5893 powers[num++] = PET_TARGET;
5896 power_desc[num] = "¶á¤¯¤Ë¤¤¤í";
5898 power_desc[num] = "stay close";
5901 if (p_ptr->pet_follow_distance == PET_CLOSE_DIST) mode = num;
5902 powers[num++] = PET_STAY_CLOSE;
5905 power_desc[num] = "¤Ä¤¤¤ÆÍ褤";
5907 power_desc[num] = "follow me";
5910 if (p_ptr->pet_follow_distance == PET_FOLLOW_DIST) mode = num;
5911 powers[num++] = PET_FOLLOW_ME;
5914 power_desc[num] = "Ũ¤ò¸«¤Ä¤±¤ÆÅݤ»";
5916 power_desc[num] = "seek and destroy";
5919 if (p_ptr->pet_follow_distance == PET_DESTROY_DIST) mode = num;
5920 powers[num++] = PET_SEEK_AND_DESTROY;
5923 power_desc[num] = "¾¯¤·Î¥¤ì¤Æ¤¤¤í";
5925 power_desc[num] = "give me space";
5928 if (p_ptr->pet_follow_distance == PET_SPACE_DIST) mode = num;
5929 powers[num++] = PET_ALLOW_SPACE;
5932 power_desc[num] = "Î¥¤ì¤Æ¤¤¤í";
5934 power_desc[num] = "stay away";
5937 if (p_ptr->pet_follow_distance == PET_AWAY_DIST) mode = num;
5938 powers[num++] = PET_STAY_AWAY;
5940 if (p_ptr->pet_extra_flags & PF_OPEN_DOORS)
5943 power_desc[num] = "¥É¥¢¤ò³«¤±¤ë (¸½ºß:ON)";
5945 power_desc[num] = "pets open doors (now On)";
5952 power_desc[num] = "¥É¥¢¤ò³«¤±¤ë (¸½ºß:OFF)";
5954 power_desc[num] = "pets open doors (now Off)";
5958 powers[num++] = PET_OPEN_DOORS;
5960 if (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS)
5963 power_desc[num] = "¥¢¥¤¥Æ¥à¤ò½¦¤¦ (¸½ºß:ON)";
5965 power_desc[num] = "pets pick up items (now On)";
5972 power_desc[num] = "¥¢¥¤¥Æ¥à¤ò½¦¤¦ (¸½ºß:OFF)";
5974 power_desc[num] = "pets pick up items (now Off)";
5978 powers[num++] = PET_TAKE_ITEMS;
5980 if (p_ptr->pet_extra_flags & PF_TELEPORT)
5983 power_desc[num] = "¥Æ¥ì¥Ý¡¼¥È·ÏËâË¡¤ò»È¤¦ (¸½ºß:ON)";
5985 power_desc[num] = "allow teleport (now On)";
5992 power_desc[num] = "¥Æ¥ì¥Ý¡¼¥È·ÏËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
5994 power_desc[num] = "allow teleport (now Off)";
5998 powers[num++] = PET_TELEPORT;
6000 if (p_ptr->pet_extra_flags & PF_ATTACK_SPELL)
6003 power_desc[num] = "¹¶·âËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6005 power_desc[num] = "allow cast attack spell (now On)";
6012 power_desc[num] = "¹¶·âËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6014 power_desc[num] = "allow cast attack spell (now Off)";
6018 powers[num++] = PET_ATTACK_SPELL;
6020 if (p_ptr->pet_extra_flags & PF_SUMMON_SPELL)
6023 power_desc[num] = "¾¤´ËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6025 power_desc[num] = "allow cast summon spell (now On)";
6032 power_desc[num] = "¾¤´ËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6034 power_desc[num] = "allow cast summon spell (now Off)";
6038 powers[num++] = PET_SUMMON_SPELL;
6040 if (p_ptr->pet_extra_flags & PF_BALL_SPELL)
6043 power_desc[num] = "¥×¥ì¥¤¥ä¡¼¤ò´¬¤¹þ¤àÈÏ°ÏËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6045 power_desc[num] = "allow involve player in area spell (now On)";
6052 power_desc[num] = "¥×¥ì¥¤¥ä¡¼¤ò´¬¤¹þ¤àÈÏ°ÏËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6054 power_desc[num] = "allow involve player in area spell (now Off)";
6058 powers[num++] = PET_BALL_SPELL;
6063 power_desc[num] = "¥Ú¥Ã¥È¤«¤é¹ß¤ê¤ë";
6065 power_desc[num] = "get off a pet";
6072 power_desc[num] = "¥Ú¥Ã¥È¤Ë¾è¤ë";
6074 power_desc[num] = "ride a pet";
6078 powers[num++] = PET_RIDING;
6081 power_desc[num] = "¥Ú¥Ã¥È¤Ë̾Á°¤ò¤Ä¤±¤ë¡£";
6083 power_desc[num] = "name pets";
6086 powers[num++] = PET_NAME;
6088 if (p_ptr->riding && buki_motteruka(INVEN_RARM) && (empty_hands(FALSE) & 0x00000001) && ((inventory[INVEN_RARM].weight > 99) || (inventory[INVEN_RARM].tval == TV_POLEARM)))
6090 if (p_ptr->pet_extra_flags & PF_RYOUTE)
6093 power_desc[num] = "Éð´ï¤òÊÒ¼ê¤Ç»ý¤Ä";
6095 power_desc[num] = "use one hand to control a riding pet";
6102 power_desc[num] = "Éð´ï¤òξ¼ê¤Ç»ý¤Ä";
6104 power_desc[num] = "use both hands for a weapon.";
6109 powers[num++] = PET_RYOUTE;
6112 /* Nothing chosen yet */
6115 /* Build a prompt (accept all spells) */
6118 /* Build a prompt (accept all spells) */
6120 strnfmt(out_val, 78, "(¥³¥Þ¥ó¥É %c-%c¡¢'*'=°ìÍ÷¡¢ESC=½ªÎ») ¥³¥Þ¥ó¥É¤òÁª¤ó¤Ç¤¯¤À¤µ¤¤:",
6122 strnfmt(out_val, 78, "(Command %c-%c, *=List, ESC=exit) Select a command: ",
6125 I2A(0), I2A(num - 1));
6130 strnfmt(out_val, 78, "(¥³¥Þ¥ó¥É %c-%c¡¢'*'=°ìÍ÷¡¢ESC=½ªÎ») ¥³¥Þ¥ó¥É¤òÁª¤ó¤Ç¤¯¤À¤µ¤¤:",
6132 strnfmt(out_val, 78, "(Command %c-%c, *=List, ESC=exit) Select a command: ",
6135 I2A(0), '0' + num - 27);
6141 /* Save the screen */
6148 prt(format("%s%c) %s", (ctr == mode) ? "*" : " ", I2A(ctr), power_desc[ctr]), y + ctr, x);
6154 prt("", y + ctr, x);
6161 /* Get a command from the user */
6162 while (!flag && get_com(out_val, &choice, TRUE))
6164 /* Request redraw */
6165 if ((choice == ' ') || (choice == '*') || (choice == '?'))
6177 /* Save the screen */
6184 sprintf(buf, "%s%c) %s", (ctr == mode) ? "*" : " ", I2A(ctr), power_desc[ctr]);
6185 prt(buf, y + ctr, x);
6191 prt("", y + ctr, x);
6205 /* Restore the screen */
6213 if (isalpha(choice))
6216 ask = (isupper(choice));
6219 if (ask) choice = tolower(choice);
6221 /* Extract request */
6222 i = (islower(choice) ? A2I(choice) : -1);
6226 ask = FALSE; /* Can't uppercase digits */
6228 i = choice - '0' + 26;
6231 /* Totally Illegal */
6232 if ((i < 0) || (i >= num))
6243 strnfmt(buf, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡© ", power_desc[i]);
6245 strnfmt(buf, 78, "Use %s? ", power_desc[i]);
6249 /* Belay that order */
6250 if (!get_check(buf)) continue;
6257 /* Restore the screen */
6258 if (redraw) Term_load();
6260 /* Abort if needed */
6269 case PET_DISMISS: /* Dismiss pets */
6274 msg_print("¥Ú¥Ã¥È¤¬¤¤¤Ê¤¤¡ª");
6276 msg_print("You have no pets!");
6280 do_cmd_pet_dismiss();
6281 (void)calculate_upkeep();
6286 project_length = -1;
6287 if (!target_set(TARGET_KILL)) pet_t_m_idx = 0;
6290 cave_type *c_ptr = &cave[target_row][target_col];
6291 if (c_ptr->m_idx && (m_list[c_ptr->m_idx].ml))
6293 pet_t_m_idx = cave[target_row][target_col].m_idx;
6294 p_ptr->pet_follow_distance = PET_DESTROY_DIST;
6296 else pet_t_m_idx = 0;
6303 case PET_STAY_CLOSE:
6305 p_ptr->pet_follow_distance = PET_CLOSE_DIST;
6312 p_ptr->pet_follow_distance = PET_FOLLOW_DIST;
6316 /* "Seek and destoy" */
6317 case PET_SEEK_AND_DESTROY:
6319 p_ptr->pet_follow_distance = PET_DESTROY_DIST;
6322 /* "Give me space" */
6323 case PET_ALLOW_SPACE:
6325 p_ptr->pet_follow_distance = PET_SPACE_DIST;
6331 p_ptr->pet_follow_distance = PET_AWAY_DIST;
6334 /* flag - allow pets to open doors */
6335 case PET_OPEN_DOORS:
6337 if (p_ptr->pet_extra_flags & PF_OPEN_DOORS) p_ptr->pet_extra_flags &= ~(PF_OPEN_DOORS);
6338 else p_ptr->pet_extra_flags |= (PF_OPEN_DOORS);
6341 /* flag - allow pets to pickup items */
6342 case PET_TAKE_ITEMS:
6344 if (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS)
6346 p_ptr->pet_extra_flags &= ~(PF_PICKUP_ITEMS);
6347 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
6349 /* Access the monster */
6350 m_ptr = &m_list[pet_ctr];
6354 monster_drop_carried_objects(m_ptr);
6358 else p_ptr->pet_extra_flags |= (PF_PICKUP_ITEMS);
6362 /* flag - allow pets to teleport */
6365 if (p_ptr->pet_extra_flags & PF_TELEPORT) p_ptr->pet_extra_flags &= ~(PF_TELEPORT);
6366 else p_ptr->pet_extra_flags |= (PF_TELEPORT);
6369 /* flag - allow pets to cast attack spell */
6370 case PET_ATTACK_SPELL:
6372 if (p_ptr->pet_extra_flags & PF_ATTACK_SPELL) p_ptr->pet_extra_flags &= ~(PF_ATTACK_SPELL);
6373 else p_ptr->pet_extra_flags |= (PF_ATTACK_SPELL);
6376 /* flag - allow pets to cast attack spell */
6377 case PET_SUMMON_SPELL:
6379 if (p_ptr->pet_extra_flags & PF_SUMMON_SPELL) p_ptr->pet_extra_flags &= ~(PF_SUMMON_SPELL);
6380 else p_ptr->pet_extra_flags |= (PF_SUMMON_SPELL);
6383 /* flag - allow pets to cast attack spell */
6384 case PET_BALL_SPELL:
6386 if (p_ptr->pet_extra_flags & PF_BALL_SPELL) p_ptr->pet_extra_flags &= ~(PF_BALL_SPELL);
6387 else p_ptr->pet_extra_flags |= (PF_BALL_SPELL);
6405 if (p_ptr->pet_extra_flags & PF_RYOUTE) p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
6406 else p_ptr->pet_extra_flags |= (PF_RYOUTE);
6407 p_ptr->update |= (PU_BONUS);