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_category_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_category_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_category_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);
642 if( p_ptr->new_spells < 10 ){
643 msg_format("¤¢¤È %d ¤Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
645 msg_format("¤¢¤È %d ¸Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
648 msg_format("You can learn %d new %s%s.", p_ptr->new_spells, p,
649 (p_ptr->new_spells == 1?"":"s"));
655 /* Restrict choices to "useful" books */
656 if (p_ptr->realm2 == REALM_NONE) item_tester_tval = mp_ptr->spell_book;
657 else item_tester_hook = item_tester_learn_spell;
661 q = "¤É¤ÎËܤ«¤é³Ø¤Ó¤Þ¤¹¤«? ";
663 q = "Study which book? ";
667 s = "Æɤá¤ëËܤ¬¤Ê¤¤¡£";
669 s = "You have no books that you can read.";
672 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
674 /* Get the item (in the pack) */
677 o_ptr = &inventory[item];
680 /* Get the item (on the floor) */
683 o_ptr = &o_list[0 - item];
686 /* Access the item's sval */
689 if (o_ptr->tval == REALM2_BOOK) increment = 32;
690 else if (o_ptr->tval != REALM1_BOOK)
693 if (!get_check("ËÜÅö¤ËËâË¡¤ÎÎΰè¤òÊѹ¹¤·¤Þ¤¹¤«¡©")) return;
695 if (!get_check("Really, change magic realm? ")) return;
697 change_realm2(tval2realm(o_ptr->tval));
701 /* Track the object kind */
702 object_kind_track(o_ptr->k_idx);
704 /* Hack -- Handle stuff */
707 /* Mage -- Learn a selected spell */
708 if (mp_ptr->spell_book != TV_LIFE_BOOK)
710 /* Ask for a spell, allow cancel */
712 if (!get_spell(&spell, "³Ø¤Ö", sval, FALSE, o_ptr->tval - TV_LIFE_BOOK + 1)
713 && (spell == -1)) return;
715 if (!get_spell(&spell, "study", sval, FALSE, o_ptr->tval - TV_LIFE_BOOK + 1)
716 && (spell == -1)) return;
721 /* Priest -- Learn a random prayer */
729 for (spell = 0; spell < 32; spell++)
731 /* Check spells in the book */
732 if ((fake_spell_flags[sval] & (1L << spell)))
734 /* Skip non "okay" prayers */
735 if (!spell_okay(spell, FALSE, TRUE,
736 (increment ? p_ptr->realm2 : p_ptr->realm1))) continue;
738 /* Hack -- Prepare the randomizer */
741 /* Hack -- Apply the randomizer */
742 if (one_in_(k)) gift = spell;
750 /* Nothing to study */
755 msg_format("¤½¤ÎËܤˤϳؤ֤٤%s¤¬¤Ê¤¤¡£", p);
757 msg_format("You cannot learn any %ss in that book.", p);
766 if (increment) spell += increment;
768 /* Learn the spell */
771 if (p_ptr->spell_learned1 & (1L << spell)) learned = TRUE;
772 else p_ptr->spell_learned1 |= (1L << spell);
776 if (p_ptr->spell_learned2 & (1L << (spell - 32))) learned = TRUE;
777 else p_ptr->spell_learned2 |= (1L << (spell - 32));
782 int max_exp = (spell < 32) ? SPELL_EXP_MASTER : SPELL_EXP_EXPERT;
783 int old_exp = p_ptr->spell_exp[spell];
784 int new_rank = EXP_LEVEL_UNSKILLED;
785 cptr name = spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell%32];
787 if (old_exp >= max_exp)
790 msg_format("¤½¤Î%s¤Ï´°Á´¤Ë»È¤¤¤³¤Ê¤»¤ë¤Î¤Ç³Ø¤ÖɬÍפϤʤ¤¡£", p);
792 msg_format("You don't need to study this %s anymore.", p);
797 if (!get_check(format("%s¤Î%s¤ò¤µ¤é¤Ë³Ø¤Ó¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©", name, p)))
799 if (!get_check(format("You will study a %s of %s again. Are you sure? ", p, name)))
804 else if (old_exp >= SPELL_EXP_EXPERT)
806 p_ptr->spell_exp[spell] = SPELL_EXP_MASTER;
807 new_rank = EXP_LEVEL_MASTER;
809 else if (old_exp >= SPELL_EXP_SKILLED)
811 if (spell >= 32) p_ptr->spell_exp[spell] = SPELL_EXP_EXPERT;
812 else p_ptr->spell_exp[spell] += SPELL_EXP_EXPERT - SPELL_EXP_SKILLED;
813 new_rank = EXP_LEVEL_EXPERT;
815 else if (old_exp >= SPELL_EXP_BEGINNER)
817 p_ptr->spell_exp[spell] = SPELL_EXP_SKILLED + (old_exp - SPELL_EXP_BEGINNER) * 2 / 3;
818 new_rank = EXP_LEVEL_SKILLED;
822 p_ptr->spell_exp[spell] = SPELL_EXP_BEGINNER + old_exp / 3;
823 new_rank = EXP_LEVEL_BEGINNER;
826 msg_format("%s¤Î½ÏÎýÅÙ¤¬%s¤Ë¾å¤¬¤Ã¤¿¡£", name, exp_level_str[new_rank]);
828 msg_format("Your proficiency of %s is now %s rank.", name, exp_level_str[new_rank]);
833 /* Find the next open entry in "p_ptr->spell_order[]" */
834 for (i = 0; i < 64; i++)
836 /* Stop at the first empty space */
837 if (p_ptr->spell_order[i] == 99) break;
840 /* Add the spell to the known list */
841 p_ptr->spell_order[i++] = spell;
843 /* Mention the result */
845 /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½¤ËÂбþ */
846 if (mp_ptr->spell_book == TV_MUSIC_BOOK)
848 msg_format("%s¤ò³Ø¤ó¤À¡£",
849 spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32]);
853 msg_format("%s¤Î%s¤ò³Ø¤ó¤À¡£",
854 spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32] ,p);
857 msg_format("You have learned the %s of %s.",
858 p, spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32]);
865 switch (mp_ptr->spell_book)
868 chg_virtue(V_FAITH, 1);
871 chg_virtue(V_UNLIFE, 1);
874 chg_virtue(V_NATURE, 1);
877 chg_virtue(V_KNOWLEDGE, 1);
884 /* One less spell available */
885 p_ptr->learned_spells++;
887 /* Message if needed */
888 if (p_ptr->new_spells)
892 if (p_ptr->new_spells < 10) msg_format("¤¢¤È %d ¤Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
893 else msg_format("¤¢¤È %d ¸Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
895 msg_format("You can learn %d more %s%s.", p_ptr->new_spells, p,
896 (p_ptr->new_spells != 1) ? "s" : "");
902 p_ptr->update |= (PU_SPELLS);
905 /* Redraw object recall */
906 p_ptr->window |= (PW_OBJECT);
910 static void wild_magic(int spell)
913 int type = SUMMON_BIZARRE1 + randint0(6);
915 if (type < SUMMON_BIZARRE1) type = SUMMON_BIZARRE1;
916 else if (type > SUMMON_BIZARRE6) type = SUMMON_BIZARRE6;
918 switch (randint1(spell) + randint1(8) + 1)
928 teleport_player(100);
932 teleport_player(200);
942 lite_area(damroll(2, 3), 2);
945 destroy_doors_touch();
950 sleep_monsters_touch();
954 trap_creation(py, px);
963 aggravate_monsters(0);
966 earthquake(py, px, 5);
970 (void)gain_random_mutation(0);
980 fire_ball(GF_CHAOS, 0, spell + 5, 1 + (spell / 10));
987 while (counter++ < 8)
989 (void)summon_specific(0, py, px, (dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET));
994 activate_hi_summon(py, px, FALSE);
997 (void)summon_cyber(-1, py, px);
1002 (void)activate_ty_curse(FALSE, &count);
1011 static bool cast_life_spell(int spell)
1014 int plev = p_ptr->lev;
1018 case 0: /* Cure Light Wounds */
1019 (void)hp_player(damroll(2, 10));
1020 (void)set_cut(p_ptr->cut - 10);
1023 (void)set_blessed(randint1(12) + 12, FALSE);
1025 case 2: /* Make Light Wounds */
1026 if (!get_aim_dir(&dir)) return FALSE;
1027 fire_ball_hide(GF_WOUNDS, dir, damroll(3 + ((plev - 1) / 5), 4), 0);
1029 case 3: /* Call Light */
1030 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1032 case 4: /* Detect Traps + Secret Doors */
1033 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1034 (void)detect_doors(DETECT_RAD_DEFAULT);
1035 (void)detect_stairs(DETECT_RAD_DEFAULT);
1037 case 5: /* Cure Medium Wounds */
1038 (void)hp_player(damroll(4, 10));
1039 (void)set_cut((p_ptr->cut / 2) - 20);
1041 case 6: /* Cure Poison */
1042 (void)set_poisoned(0);
1044 case 7: /* Satisfy Hunger */
1045 (void)set_food(PY_FOOD_MAX - 1);
1047 case 8: /* Remove Curse */
1051 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1053 msg_print("You feel as if someone is watching over you.");
1057 case 9: /* Make Medium Wounds */
1058 if (!get_aim_dir(&dir)) return FALSE;
1059 fire_ball_hide(GF_WOUNDS, dir, damroll(8 + ((plev - 5) / 4), 8), 0);
1061 case 10: /* Cure Critical Wounds */
1062 (void)hp_player(damroll(8, 10));
1067 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1068 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1071 map_area(DETECT_RAD_MAP);
1074 (void)turn_undead();
1076 case 14: /* Healing */
1077 (void)hp_player(300);
1081 case 15: /* Glyph of Warding */
1084 case 16: /* Dispel Curse */
1085 if (remove_all_curse())
1088 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1090 msg_print("You feel as if someone is watching over you.");
1094 case 17: /* Perception */
1095 return ident_spell(FALSE);
1096 case 18: /* Dispel Undead */
1097 (void)dispel_undead(randint1(plev * 5));
1099 case 19: /* 'Day of the Dove' */
1100 charm_monsters(plev * 2);
1102 case 20: /* Make Critical Wounds */
1103 if (!get_aim_dir(&dir)) return FALSE;
1104 fire_ball_hide(GF_WOUNDS, dir, damroll(5+((plev - 5) / 3), 15), 0);
1106 case 21: /* Word of Recall */
1107 return word_of_recall();
1108 case 22: /* Alter Reality */
1111 case 23: /* Warding True */
1116 num_repro += MAX_REPRO;
1118 case 25: /* Detection True */
1119 (void)detect_all(DETECT_RAD_DEFAULT);
1121 case 26: /* Genocide Undead */
1122 (void)mass_genocide_undead(plev+50,TRUE);
1124 case 27: /* Clairvoyance */
1127 case 28: /* Restoration */
1128 (void)do_res_stat(A_STR);
1129 (void)do_res_stat(A_INT);
1130 (void)do_res_stat(A_WIS);
1131 (void)do_res_stat(A_DEX);
1132 (void)do_res_stat(A_CON);
1133 (void)do_res_stat(A_CHR);
1134 (void)restore_level();
1136 case 29: /* Healing True */
1137 (void)hp_player(2000);
1141 case 30: /* Holy Vision */
1142 return identify_fully(FALSE);
1143 case 31: /* Ultimate resistance */
1145 int v = randint1(plev/2)+plev/2;
1146 (void)set_fast(v, FALSE);
1147 set_oppose_acid(v, FALSE);
1148 set_oppose_elec(v, FALSE);
1149 set_oppose_fire(v, FALSE);
1150 set_oppose_cold(v, FALSE);
1151 set_oppose_pois(v, FALSE);
1152 set_ultimate_res(v, FALSE);
1157 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥é¥¤¥Õ¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1159 msg_format("You cast an unknown Life spell: %d.", spell);
1170 static bool cast_sorcery_spell(int spell)
1173 int plev = p_ptr->lev;
1177 case 0: /* Detect Monsters */
1178 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1180 case 1: /* Phase Door */
1181 teleport_player(10);
1183 case 2: /* Detect Doors and Traps */
1184 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1185 (void)detect_doors(DETECT_RAD_DEFAULT);
1186 (void)detect_stairs(DETECT_RAD_DEFAULT);
1188 case 3: /* Light Area */
1189 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1191 case 4: /* Confuse Monster */
1192 if (!get_aim_dir(&dir)) return FALSE;
1194 (void)confuse_monster(dir, (plev * 3) / 2);
1196 case 5: /* Teleport */
1197 teleport_player(plev * 5);
1199 case 6: /* Sleep Monster */
1200 if (!get_aim_dir(&dir)) return FALSE;
1202 (void)sleep_monster(dir);
1204 case 7: /* Recharging */
1205 return recharge(plev * 4);
1206 case 8: /* Magic Mapping */
1207 map_area(DETECT_RAD_MAP);
1209 case 9: /* Identify */
1210 return ident_spell(FALSE);
1211 case 10: /* Slow Monster */
1212 if (!get_aim_dir(&dir)) return FALSE;
1214 (void)slow_monster(dir);
1216 case 11: /* Mass Sleep */
1217 (void)sleep_monsters();
1219 case 12: /* Teleport Away */
1220 if (!get_aim_dir(&dir)) return FALSE;
1222 (void)fire_beam(GF_AWAY_ALL, dir, plev);
1224 case 13: /* Haste Self */
1225 (void)set_fast(randint1(20 + plev) + plev, FALSE);
1227 case 14: /* Detection True */
1228 (void)detect_all(DETECT_RAD_DEFAULT);
1230 case 15: /* Identify True */
1231 return identify_fully(FALSE);
1232 case 16: /* Detect Objects and Treasure*/
1233 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
1234 (void)detect_treasure(DETECT_RAD_DEFAULT);
1235 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
1237 case 17: /* Charm Monster */
1238 if (!get_aim_dir(&dir)) return FALSE;
1240 (void)charm_monster(dir, plev);
1242 case 18: /* Sense Minds */
1243 (void)set_tim_esp(randint1(30) + 25, FALSE);
1245 case 19: /* Teleport to town */
1247 case 20: /* Self knowledge */
1248 (void)self_knowledge();
1250 case 21: /* Teleport Level */
1252 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
1254 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
1256 (void)teleport_level(0);
1258 case 22: /* Word of Recall */
1259 return word_of_recall();
1260 case 23: /* Dimension Door */
1262 msg_print("¼¡¸µ¤ÎÈ⤬³«¤¤¤¿¡£ÌÜŪÃϤòÁª¤ó¤Ç²¼¤µ¤¤¡£");
1264 msg_print("You open a dimensional gate. Choose a destination.");
1267 return dimension_door();
1268 case 24: /* Probing */
1271 case 25: /* Explosive Rune */
1274 case 26: /* Telekinesis */
1275 if (!get_aim_dir(&dir)) return FALSE;
1277 fetch(dir, plev * 15, FALSE);
1279 case 27: /* Clairvoyance */
1280 chg_virtue(V_KNOWLEDGE, 1);
1281 chg_virtue(V_ENLIGHTEN, 1);
1284 if (!(p_ptr->telepathy))
1286 (void)set_tim_esp(randint1(30) + 25, FALSE);
1289 case 28: /* Charm Monsters */
1290 charm_monsters(plev * 2);
1292 case 29: /* Alchemy */
1294 case 30: /* Banish */
1295 banish_monsters(plev * 4);
1297 case 31: /* Globe of Invulnerability */
1298 (void)set_invuln(randint1(4) + 4, FALSE);
1302 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥½¡¼¥µ¥ê¡¼¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1304 msg_format("You cast an unknown Sorcery spell: %d.", spell);
1314 static bool cast_nature_spell(int spell)
1318 int plev = p_ptr->lev;
1320 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1321 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1322 else beam = plev / 2;
1326 case 0: /* Detect Creatures */
1327 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1329 case 1: /* Lightning Bolt */
1330 project_length = plev / 6 + 2;
1331 if (!get_aim_dir(&dir)) return FALSE;
1333 fire_beam(GF_ELEC, dir,
1334 damroll(3 + ((plev - 1) / 5), 4));
1336 case 2: /* Detect Doors & Traps */
1337 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1338 (void)detect_doors(DETECT_RAD_DEFAULT);
1339 (void)detect_stairs(DETECT_RAD_DEFAULT);
1341 case 3: /* Produce Food */
1343 object_type forge, *q_ptr = &forge;
1346 msg_print("¿©ÎÁ¤òÀ¸À®¤·¤¿¡£");
1348 msg_print("A food ration is produced.");
1351 /* Create the food ration */
1352 object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_RATION));
1354 /* Drop the object from heaven */
1355 (void)drop_near(q_ptr, -1, py, px);
1359 case 4: /* Daylight */
1360 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1361 if ((prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
1364 msg_print("Æü¤Î¸÷¤¬¤¢¤Ê¤¿¤ÎÆùÂΤò¾Ç¤¬¤·¤¿¡ª");
1366 msg_print("The daylight scorches your flesh!");
1370 take_hit(DAMAGE_NOESCAPE, damroll(2, 2), "Æü¤Î¸÷", -1);
1372 take_hit(DAMAGE_NOESCAPE, damroll(2, 2), "daylight", -1);
1377 case 5: /* Animal Taming */
1378 if (!get_aim_dir(&dir)) return FALSE;
1380 (void)charm_animal(dir, plev);
1382 case 6: /* Resist Environment */
1383 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1384 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1385 (void)set_oppose_elec(randint1(20) + 20, FALSE);
1387 case 7: /* Cure Wounds & Poison */
1388 (void)hp_player(damroll(2, 8));
1390 (void)set_poisoned(0);
1392 case 8: /* Stone to Mud */
1393 if (!get_aim_dir(&dir)) return FALSE;
1395 (void)wall_to_mud(dir);
1397 case 9: /* Frost Bolt */
1398 if (!get_aim_dir(&dir)) return FALSE;
1399 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
1400 damroll(3 + ((plev - 5) / 4), 8));
1402 case 10: /* Nature Awareness -- downgraded */
1403 map_area(DETECT_RAD_MAP);
1404 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1405 (void)detect_doors(DETECT_RAD_DEFAULT);
1406 (void)detect_stairs(DETECT_RAD_DEFAULT);
1407 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1409 case 11: /* Fire Bolt */
1410 if (!get_aim_dir(&dir)) return FALSE;
1411 fire_bolt_or_beam(beam - 10, GF_FIRE, dir,
1412 damroll(5 + ((plev - 5) / 4), 8));
1414 case 12: /* Ray of Sunlight */
1415 if (!get_aim_dir(&dir)) return FALSE;
1417 msg_print("ÂÀÍÛ¸÷Àþ¤¬¸½¤ì¤¿¡£");
1419 msg_print("A line of sunlight appears.");
1422 (void)lite_line(dir);
1424 case 13: /* Entangle */
1427 case 14: /* Summon Animals */
1428 if (!(summon_specific(-1, py, px, plev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET))))
1431 msg_print("ưʪ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
1433 msg_print("No animals arrive.");
1437 case 15: /* Herbal Healing */
1438 (void)hp_player(500);
1441 (void)set_poisoned(0);
1443 case 16: /* Stair Building */
1444 (void)stair_creation();
1446 case 17: /* Stone Skin */
1447 (void)set_shield(randint1(20) + 30, FALSE);
1449 case 18: /* Resistance True */
1450 (void)set_oppose_acid(randint1(20) + 20, FALSE);
1451 (void)set_oppose_elec(randint1(20) + 20, FALSE);
1452 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1453 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1454 (void)set_oppose_pois(randint1(20) + 20, FALSE);
1456 case 19: /* Tree Creation */
1457 (void)tree_creation();
1459 case 20: /* Animal Friendship */
1460 (void)charm_animals(plev * 2);
1462 case 21: /* Stone Tell */
1463 return identify_fully(FALSE);
1464 case 22: /* Wall of Stone */
1467 case 23: /* Protection from Corrosion */
1469 case 24: /* Earthquake */
1470 earthquake(py, px, 10);
1472 case 25: /* Whirlwind Attack */
1476 monster_type *m_ptr;
1478 for (dir = 0; dir < 8; dir++)
1480 y = py + ddy_ddd[dir];
1481 x = px + ddx_ddd[dir];
1482 c_ptr = &cave[y][x];
1484 /* Get the monster */
1485 m_ptr = &m_list[c_ptr->m_idx];
1487 /* Hack -- attack monsters */
1488 if (c_ptr->m_idx && (m_ptr->ml || cave_floor_bold(y, x)))
1493 case 26: /* Blizzard */
1494 if (!get_aim_dir(&dir)) return FALSE;
1496 fire_ball(GF_COLD, dir, 70 + plev * 3 / 2, (plev / 12) + 1);
1498 case 27: /* Lightning Storm */
1499 if (!get_aim_dir(&dir)) return FALSE;
1500 fire_ball(GF_ELEC, dir, 90 + plev * 3 / 2, (plev / 12) + 1);
1502 case 28: /* Whirlpool */
1503 if (!get_aim_dir(&dir)) return FALSE;
1504 fire_ball(GF_WATER, dir, 100 + plev * 3 / 2, (plev / 12) + 1);
1506 case 29: /* Call Sunlight */
1507 fire_ball(GF_LITE, 0, 150, 8);
1508 chg_virtue(V_KNOWLEDGE, 1);
1509 chg_virtue(V_ENLIGHTEN, 1);
1511 if ((prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
1514 msg_print("Æü¸÷¤¬¤¢¤Ê¤¿¤ÎÆùÂΤò¾Ç¤¬¤·¤¿¡ª");
1516 msg_print("The sunlight scorches your flesh!");
1520 take_hit(DAMAGE_NOESCAPE, 50, "Æü¸÷", -1);
1522 take_hit(DAMAGE_NOESCAPE, 50, "sunlight", -1);
1527 case 30: /* Elemental Branding */
1528 brand_weapon(randint0(2));
1530 case 31: /* Nature's Wrath */
1531 (void)dispel_monsters(plev * 4);
1532 earthquake(py, px, 20 + (plev / 2));
1533 project(0, 1 + plev / 12, py, px,
1534 (100 + plev) * 2, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM, -1);
1538 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥Í¥¤¥Á¥ã¡¼¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1540 msg_format("You cast an unknown Nature spell: %d.", spell);
1550 static bool cast_chaos_spell(int spell)
1553 int plev = p_ptr->lev;
1555 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1556 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1557 else beam = plev / 2;
1561 case 0: /* Magic Missile */
1562 if (!get_aim_dir(&dir)) return FALSE;
1564 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
1565 damroll(3 + ((plev - 1) / 5), 4));
1567 case 1: /* Trap / Door destruction */
1568 (void)destroy_doors_touch();
1570 case 2: /* Flash of Light == Light Area */
1571 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1573 case 3: /* Touch of Confusion */
1574 if (!(p_ptr->special_attack & ATTACK_CONFUSE))
1577 msg_print("¤¢¤Ê¤¿¤Î¼ê¤Ï¸÷¤ê»Ï¤á¤¿¡£");
1579 msg_print("Your hands start glowing.");
1582 p_ptr->special_attack |= ATTACK_CONFUSE;
1583 p_ptr->redraw |= (PR_STATUS);
1586 case 4: /* Mana Burst */
1587 if (!get_aim_dir(&dir)) return FALSE;
1589 fire_ball(GF_MISSILE, dir,
1590 (damroll(3, 5) + plev +
1591 (plev / (((p_ptr->pclass == CLASS_MAGE)
1592 || (p_ptr->pclass == CLASS_HIGH_MAGE)
1593 || (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
1594 ((plev < 30) ? 2 : 3));
1595 /* Shouldn't actually use GF_MANA, as it will destroy all
1596 * items on the floor */
1598 case 5: /* Fire Bolt */
1599 if (!get_aim_dir(&dir)) return FALSE;
1601 fire_bolt_or_beam(beam, GF_FIRE, dir,
1602 damroll(8 + ((plev - 5) / 4), 8));
1604 case 6: /* Fist of Force ("Fist of Fun") */
1605 if (!get_aim_dir(&dir)) return FALSE;
1607 fire_ball(GF_DISINTEGRATE, dir,
1608 damroll(8 + ((plev - 5) / 4), 8), 0);
1610 case 7: /* Teleport Self */
1611 teleport_player(plev * 5);
1613 case 8: /* Wonder */
1615 /* This spell should become more useful (more
1616 controlled) as the player gains experience levels.
1617 Thus, add 1/5 of the player's level to the die roll.
1618 This eliminates the worst effects later on, while
1619 keeping the results quite random. It also allows
1620 some potent effects only at high level. */
1622 int die = randint1(100) + plev / 5;
1623 int vir = virtue_number(V_CHANCE);
1626 if (p_ptr->virtues[vir - 1] > 0)
1628 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
1632 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
1637 chg_virtue(V_CHANCE, 1);
1639 if (!get_aim_dir(&dir)) return FALSE;
1642 msg_print("¤¢¤Ê¤¿¤ÏÎϤ¬¤ß¤Ê¤®¤ë¤Î¤ò´¶¤¸¤¿¡ª");
1644 msg_print("You feel a surge of power!");
1647 if (die < 8) clone_monster(dir);
1648 else if (die < 14) speed_monster(dir);
1649 else if (die < 26) heal_monster(dir, damroll(4, 6));
1650 else if (die < 31) poly_monster(dir);
1652 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
1653 damroll(3 + ((plev - 1) / 5), 4));
1654 else if (die < 41) confuse_monster(dir, plev);
1655 else if (die < 46) fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
1656 else if (die < 51) (void)lite_line(dir);
1658 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
1659 damroll(3 + ((plev - 5) / 4), 8));
1661 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
1662 damroll(5 + ((plev - 5) / 4), 8));
1664 fire_bolt_or_beam(beam, GF_ACID, dir,
1665 damroll(6 + ((plev - 5) / 4), 8));
1667 fire_bolt_or_beam(beam, GF_FIRE, dir,
1668 damroll(8 + ((plev - 5) / 4), 8));
1669 else if (die < 76) drain_life(dir, 75);
1670 else if (die < 81) fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
1671 else if (die < 86) fire_ball(GF_ACID, dir, 40 + plev, 2);
1672 else if (die < 91) fire_ball(GF_ICE, dir, 70 + plev, 3);
1673 else if (die < 96) fire_ball(GF_FIRE, dir, 80 + plev, 3);
1674 else if (die < 101) drain_life(dir, 100 + plev);
1677 earthquake(py, px, 12);
1681 (void)destroy_area(py, px, 13 + randint0(5), FALSE);
1685 symbol_genocide(plev+50, TRUE);
1687 else if (die < 110) dispel_monsters(120);
1690 dispel_monsters(150);
1697 case 9: /* Chaos Bolt */
1698 if (!get_aim_dir(&dir)) return FALSE;
1700 fire_bolt_or_beam(beam, GF_CHAOS, dir,
1701 damroll(10 + ((plev - 5) / 4), 8));
1703 case 10: /* Sonic Boom */
1705 msg_print("¥É¡¼¥ó¡ªÉô²°¤¬Íɤ줿¡ª");
1707 msg_print("BOOM! Shake the room!");
1710 project(0, plev / 10 + 2, py, px,
1711 (60 + plev), GF_SOUND, PROJECT_KILL | PROJECT_ITEM, -1);
1713 case 11: /* Doom Bolt -- always beam in 2.0.7 or later */
1714 if (!get_aim_dir(&dir)) return FALSE;
1716 fire_beam(GF_MANA, dir, damroll(11 + ((plev - 5) / 4), 8));
1718 case 12: /* Fire Ball */
1719 if (!get_aim_dir(&dir)) return FALSE;
1721 fire_ball(GF_FIRE, dir, plev + 55, 2);
1723 case 13: /* Teleport Other */
1724 if (!get_aim_dir(&dir)) return FALSE;
1726 (void)fire_beam(GF_AWAY_ALL, dir, plev);
1728 case 14: /* Word of Destruction */
1729 (void)destroy_area(py, px, 13 + randint0(5), FALSE);
1731 case 15: /* Invoke Logrus */
1732 if (!get_aim_dir(&dir)) return FALSE;
1734 fire_ball(GF_CHAOS, dir, plev*2 + 99, plev / 5);
1736 case 16: /* Polymorph Other */
1737 if (!get_aim_dir(&dir)) return FALSE;
1739 (void)poly_monster(dir);
1741 case 17: /* Chain Lightning */
1742 for (dir = 0; dir <= 9; dir++)
1743 fire_beam(GF_ELEC, dir, damroll(5 + (plev / 10), 8));
1745 case 18: /* Arcane Binding == Charging */
1746 return recharge(90);
1747 case 19: /* Disintegration */
1748 if (!get_aim_dir(&dir)) return FALSE;
1750 fire_ball(GF_DISINTEGRATE, dir, plev + 70, 3 + plev / 40);
1752 case 20: /* Alter Reality */
1755 case 21: /* Magic Rocket */
1756 if (!get_aim_dir(&dir)) return FALSE;
1759 msg_print("¥í¥±¥Ã¥Èȯ¼Í¡ª");
1761 msg_print("You launch a rocket!");
1764 fire_rocket(GF_ROCKET, dir, 120 + plev*2, 2);
1766 case 22: /* Chaos Branding */
1769 case 23: /* Summon monster, demon */
1772 bool pet = !one_in_(3);
1774 if (pet) mode |= PM_FORCE_PET;
1775 else mode |= PM_NO_PET;
1776 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
1778 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, SUMMON_DEMON, mode))
1781 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
1783 msg_print("The area fills with a stench of sulphur and brimstone.");
1789 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
1791 msg_print("'What is thy bidding... Master?'");
1796 msg_print("¡ÖÈܤ·¤¼Ô¤è¡¢²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª ¤ªÁ°¤Îº²¤òĺ¤¯¤¾¡ª¡×");
1798 msg_print("'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'");
1804 case 24: /* Beam of Gravity */
1805 if (!get_aim_dir(&dir)) return FALSE;
1807 fire_beam(GF_GRAVITY, dir, damroll(9 + ((plev - 5) / 4), 8));
1809 case 25: /* Meteor Swarm */
1812 int b = 10 + randint1(10);
1813 for (i = 0; i < b; i++)
1815 int count = 0, d = 0;
1820 if (count > 20) break;
1821 x = px - 8 + randint0(17);
1822 y = py - 8 + randint0(17);
1824 if (!in_bounds(y,x) || (!cave_floor_bold(y,x) && (cave[y][x].feat != FEAT_TREES)) || !player_has_los_bold(y, x)) continue;
1826 dx = (px > x) ? (px - x) : (x - px);
1827 dy = (py > y) ? (py - y) : (y - py);
1829 /* Approximate distance */
1830 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
1834 if (count > 20) continue;
1836 project(0, 2, y, x, plev * 2, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
1840 case 26: /* Flame Strike */
1841 fire_ball(GF_FIRE, 0, 300 + (3 * plev), 8);
1843 case 27: /* Call Chaos */
1846 case 28: /* Polymorph Self */
1848 if (!get_check("ÊѿȤ·¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©")) return FALSE;
1850 if (!get_check("You will polymorph yourself. Are you sure? ")) return FALSE;
1854 case 29: /* Mana Storm */
1855 if (!get_aim_dir(&dir)) return FALSE;
1857 fire_ball(GF_MANA, dir, 300 + (plev * 4), 4);
1859 case 30: /* Breathe Logrus */
1860 if (!get_aim_dir(&dir)) return FALSE;
1862 fire_ball(GF_CHAOS, dir, p_ptr->chp, 2);
1864 case 31: /* Call the Void */
1869 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥«¥ª¥¹¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1871 msg_format("You cast an unknown Chaos spell: %d.", spell);
1881 static bool cast_death_spell(int spell)
1885 int plev = p_ptr->lev;
1888 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1889 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1890 else beam = plev / 2;
1894 case 0: /* Detect Undead & Demons -> Unlife */
1895 (void)detect_monsters_nonliving(DETECT_RAD_DEFAULT);
1897 case 1: /* Malediction */
1898 if (!get_aim_dir(&dir)) return FALSE;
1899 /* A radius-0 ball may (1) be aimed at objects etc.,
1900 * and will affect them; (2) may be aimed at ANY
1901 * visible monster, unlike a 'bolt' which must travel
1902 * to the monster. */
1904 fire_ball(GF_HELL_FIRE, dir,
1905 damroll(3 + ((plev - 1) / 5), 4), 0);
1908 { /* Special effect first */
1909 dummy = randint1(1000);
1911 fire_ball_hide(GF_DEATH_RAY, dir, plev * 200, 0);
1912 else if (dummy < 500)
1913 fire_ball_hide(GF_TURN_ALL, dir, plev, 0);
1914 else if (dummy < 800)
1915 fire_ball_hide(GF_OLD_CONF, dir, plev, 0);
1917 fire_ball_hide(GF_STUN, dir, plev, 0);
1920 case 2: /* Detect Evil */
1921 (void)detect_monsters_evil(DETECT_RAD_DEFAULT);
1923 case 3: /* Stinking Cloud */
1924 if (!get_aim_dir(&dir)) return FALSE;
1926 fire_ball(GF_POIS, dir, 10 + (plev / 2), 2);
1928 case 4: /* Black Sleep */
1929 if (!get_aim_dir(&dir)) return FALSE;
1931 (void)sleep_monster(dir);
1933 case 5: /* Resist Poison */
1934 (void)set_oppose_pois(randint1(20) + 20, FALSE);
1936 case 6: /* Horrify */
1937 if (!get_aim_dir(&dir)) return FALSE;
1939 (void)fear_monster(dir, plev);
1940 (void)stun_monster(dir, plev);
1942 case 7: /* Enslave Undead */
1943 if (!get_aim_dir(&dir)) return FALSE;
1945 (void)control_one_undead(dir, plev);
1947 case 8: /* Orb of Entropy */
1948 if (!get_aim_dir(&dir)) return FALSE;
1950 fire_ball(GF_OLD_DRAIN, dir,
1951 (damroll(3, 6) + plev +
1952 (plev / (((p_ptr->pclass == CLASS_MAGE) ||
1953 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
1954 (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
1955 ((plev < 30) ? 2 : 3));
1957 case 9: /* Nether Bolt */
1958 if (!get_aim_dir(&dir)) return FALSE;
1960 fire_bolt_or_beam(beam, GF_NETHER, dir,
1961 damroll(8 + ((plev - 5) / 4), 8));
1963 case 10: /* Cloud kill */
1964 project(0, plev / 10 + 2, py, px,
1965 (30 + plev) * 2, GF_POIS, PROJECT_KILL | PROJECT_ITEM, -1);
1967 case 11: /* Genocide One */
1968 if (!get_aim_dir(&dir)) return FALSE;
1970 fire_ball_hide(GF_GENOCIDE, dir, plev + 50, 0);
1972 case 12: /* Poison Branding */
1975 case 13: /* Vampiric Drain */
1976 if (!get_aim_dir(&dir)) return FALSE;
1978 dummy = plev * 2 + randint1(plev * 2); /* Dmg */
1979 if (drain_life(dir, dummy))
1981 chg_virtue(V_SACRIFICE, -1);
1982 chg_virtue(V_VITALITY, -1);
1984 (void)hp_player(dummy);
1985 /* Gain nutritional sustenance: 150/hp drained */
1986 /* A Food ration gives 5000 food points (by contrast) */
1987 /* Don't ever get more than "Full" this way */
1988 /* But if we ARE Gorged, it won't cure us */
1989 dummy = p_ptr->food + MIN(5000, 100 * dummy);
1990 if (p_ptr->food < PY_FOOD_MAX) /* Not gorged already */
1991 (void)set_food(dummy >= PY_FOOD_MAX ? PY_FOOD_MAX - 1 : dummy);
1994 case 14: /* Animate Dead */
1995 animate_dead(0, py, px);
1997 case 15: /* Genocide */
1998 (void)symbol_genocide(plev+50, TRUE);
2000 case 16: /* Berserk */
2001 (void)set_shero(randint1(25) + 25, FALSE);
2002 (void)hp_player(30);
2003 (void)set_afraid(0);
2005 case 17: /* Invoke Spirits */
2007 int die = randint1(100) + plev / 5;
2008 int vir = virtue_number(V_CHANCE);
2011 if (p_ptr->virtues[vir - 1] > 0)
2013 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
2017 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
2021 if (!get_aim_dir(&dir)) return FALSE;
2024 msg_print("¤¢¤Ê¤¿¤Ï»à¼Ô¤¿¤Á¤ÎÎϤò¾·½¸¤·¤¿...");
2026 msg_print("You call on the power of the dead...");
2029 chg_virtue(V_CHANCE, 1);
2033 msg_print("¤¢¤Ê¤¿¤Ï¤ª¤É¤í¤ª¤É¤í¤·¤¤ÎϤΤ¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
2035 msg_print("You feel a surge of eldritch force!");
2042 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¤¢¤Ê¤¿¤Î¼þ¤ê¤ÎÃÏÌ̤«¤éµà¤Á¤¿¿Í±Æ¤¬Î©¤Á¾å¤¬¤Ã¤Æ¤¤¿¡ª");
2044 msg_print("Oh no! Mouldering forms rise from the earth around you!");
2047 (void)summon_specific(0, py, px, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
2048 chg_virtue(V_UNLIFE, 1);
2053 msg_print("̾¾õ¤·Æñ¤¤¼Ù°¤Ê¸ºß¤¬¤¢¤Ê¤¿¤Î¿´¤òÄ̤ê²á¤®¤Æ¹Ô¤Ã¤¿...");
2055 msg_print("An unnamable evil brushes against your mind...");
2058 set_afraid(p_ptr->afraid + randint1(4) + 4);
2063 msg_print("¤¢¤Ê¤¿¤ÎƬ¤ËÂçÎ̤ÎÍ©Î¤Á¤ÎÁû¡¹¤·¤¤À¼¤¬²¡¤·´ó¤»¤Æ¤¤¿...");
2065 msg_print("Your head is invaded by a horde of gibbering spectral voices...");
2068 set_confused(p_ptr->confused + randint1(4) + 4);
2076 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
2077 damroll(3 + ((plev - 1) / 5), 4));
2081 confuse_monster (dir, plev);
2085 fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
2089 (void)lite_line(dir);
2093 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
2094 damroll(3+((plev-5)/4),8));
2098 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
2099 damroll(5+((plev-5)/4),8));
2103 fire_bolt_or_beam(beam, GF_ACID, dir,
2104 damroll(6+((plev-5)/4),8));
2108 fire_bolt_or_beam(beam, GF_FIRE, dir,
2109 damroll(8+((plev-5)/4),8));
2113 drain_life(dir, 75);
2117 fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
2121 fire_ball(GF_ACID, dir, 40 + plev, 2);
2125 fire_ball(GF_ICE, dir, 70 + plev, 3);
2129 fire_ball(GF_FIRE, dir, 80 + plev, 3);
2133 drain_life(dir, 100 + plev);
2137 earthquake(py, px, 12);
2141 (void)destroy_area(py, px, 13 + randint0(5), FALSE);
2145 symbol_genocide(plev+50, TRUE);
2149 dispel_monsters(120);
2153 dispel_monsters(150);
2161 msg_print("±¢±µ¤ÊÀ¼¤¬¥¯¥¹¥¯¥¹¾Ð¤¦¡£¡Ö¤â¤¦¤¹¤°¤ª¤Þ¤¨¤Ï²æ¡¹¤ÎÃç´Ö¤Ë¤Ê¤ë¤À¤í¤¦¡£¼å¤¼Ô¤è¡£¡×");
2163 msg_print("Sepulchral voices chuckle. 'Soon you will join us, mortal.'");
2168 case 18: /* Dark Bolt */
2169 if (!get_aim_dir(&dir)) return FALSE;
2171 fire_bolt_or_beam(beam, GF_DARK, dir,
2172 damroll(4 + ((plev - 5) / 4), 8));
2174 case 19: /* Battle Frenzy */
2175 (void)set_shero(randint1(25) + 25, FALSE);
2176 (void)hp_player(30);
2177 (void)set_afraid(0);
2178 (void)set_fast(randint1(20 + (plev / 2)) + (plev / 2), FALSE);
2180 case 20: /* Vampiric Branding */
2183 case 21: /* Vampirism True */
2184 if (!get_aim_dir(&dir)) return FALSE;
2186 chg_virtue(V_SACRIFICE, -1);
2187 chg_virtue(V_VITALITY, -1);
2189 for (dummy = 0; dummy < 3; dummy++)
2191 if (drain_life(dir, 100))
2195 case 22: /* Word of Death */
2196 (void)dispel_living(randint1(plev * 3));
2198 case 23: /* Darkness Storm */
2199 if (!get_aim_dir(&dir)) return FALSE;
2201 fire_ball(GF_DARK, dir, 100+plev*2, 4);
2203 case 24: /* Death Ray */
2204 if (!get_aim_dir(&dir)) return FALSE;
2206 (void)death_ray(dir, plev);
2208 case 25: /* Raise the Dead */
2211 bool pet = one_in_(3);
2214 type = (plev > 47 ? SUMMON_HI_UNDEAD : SUMMON_UNDEAD);
2216 if (!pet || (pet && (plev > 24) && one_in_(3)))
2217 mode |= PM_ALLOW_GROUP;
2219 if (pet) mode |= PM_FORCE_PET;
2220 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
2222 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, type, mode))
2225 msg_print("Î䤿¤¤É÷¤¬¤¢¤Ê¤¿¤Î¼þ¤ê¤Ë¿á¤»Ï¤á¤¿¡£¤½¤ì¤ÏÉåÇÔ½¤ò±¿¤ó¤Ç¤¤¤ë...");
2227 msg_print("Cold winds begin to blow around you, carrying with them the stench of decay...");
2233 msg_print("¸Å¤¨¤Î»à¤»¤ë¼Ô¶¦¤¬¤¢¤Ê¤¿¤Ë»Å¤¨¤ë¤¿¤áÅÚ¤«¤éᴤä¿¡ª");
2235 msg_print("Ancient, long-dead forms arise from the ground to serve you!");
2240 msg_print("»à¼Ô¤¬á´¤Ã¤¿¡£Ì²¤ê¤ò˸¤²¤ë¤¢¤Ê¤¿¤òȳ¤¹¤ë¤¿¤á¤Ë¡ª");
2242 msg_print("'The dead arise... to punish you for disturbing them!'");
2245 chg_virtue(V_UNLIFE, 1);
2250 case 26: /* Esoteria */
2251 if (randint1(50) > plev)
2252 return ident_spell(FALSE);
2254 return identify_fully(FALSE);
2255 case 27: /* Mimic vampire */
2256 (void)set_mimic(10+plev/2 + randint1(10+plev/2), MIMIC_VAMPIRE, FALSE);
2258 case 28: /* Restore Life */
2259 (void)restore_level();
2261 case 29: /* Mass Genocide */
2262 (void)mass_genocide(plev+50, TRUE);
2264 case 30: /* Hellfire */
2265 if (!get_aim_dir(&dir)) return FALSE;
2267 fire_ball(GF_HELL_FIRE, dir, 666, 3);
2269 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "ÃϹö¤Î¹å²Ð¤Î¼öʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
2271 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "the strain of casting Hellfire", -1);
2275 case 31: /* Wraithform */
2276 set_wraith_form(randint1(plev / 2) + (plev / 2), FALSE);
2279 msg_format("You cast an unknown Death spell: %d.", spell);
2287 static bool cast_trump_spell(int spell, bool success)
2290 int plev = p_ptr->lev;
2291 int summon_lev = plev * 2 / 3 + randint1(plev/2);
2293 bool no_trump = FALSE;
2294 bool unique_okay = FALSE;
2296 if (summon_lev < 1) summon_lev = 1;
2297 if (!success || (randint1(50+plev) < plev/10)) unique_okay = TRUE;
2300 case 0: /* Phase Door */
2303 teleport_player(10);
2306 case 1: /* Trump Spiders */
2308 bool pet = success; /* (randint1(5) > 2) */
2309 u32b mode = PM_ALLOW_GROUP;
2311 if (pet) mode |= PM_FORCE_PET;
2312 else mode |= PM_NO_PET;
2315 msg_print("¤¢¤Ê¤¿¤ÏÃØéá¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2317 msg_print("You concentrate on the trump of an spider...");
2320 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_SPIDER, mode))
2324 msg_print("¾¤´¤µ¤ì¤¿ÃØéá¤ÏÅܤäƤ¤¤ë¡ª");
2326 msg_print("The summoned spiders get angry!");
2336 case 2: /* Shuffle */
2339 /* A limited power 'wonder' spell */
2340 int die = randint1(120);
2341 int vir = virtue_number(V_CHANCE);
2343 if ((p_ptr->pclass == CLASS_ROGUE) ||
2344 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
2345 (p_ptr->pclass == CLASS_SORCERER))
2346 die = (randint1(110)) + plev / 5;
2347 /* Card sharks and high mages get a level bonus */
2351 if (p_ptr->virtues[vir - 1] > 0)
2353 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
2357 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
2362 msg_print("¤¢¤Ê¤¿¤Ï¥«¡¼¥É¤òÀڤäưìËç°ú¤¤¤¿...");
2364 msg_print("You shuffle the deck and draw a card...");
2368 chg_virtue(V_CHANCE, 1);
2373 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡Ô»à¡Õ¤À¡ª");
2375 msg_print("Oh no! It's Death!");
2378 for (dummy = 0; dummy < randint1(3); dummy++)
2379 (void)activate_hi_summon(py, px, FALSE);
2384 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡Ô°Ëâ¡Õ¤À¡ª");
2386 msg_print("Oh no! It's the Devil!");
2389 (void)summon_specific(0, py, px, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
2395 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡ÔÄߤé¤ì¤¿ÃË¡Õ¤À¡ª");
2397 msg_print("Oh no! It's the Hanged Man.");
2400 (void)activate_ty_curse(FALSE, &count);
2405 msg_print("¡ÔÉÔĴϤηõ¡Õ¤À¡£");
2407 msg_print("It's the swords of discord.");
2410 aggravate_monsters(0);
2415 msg_print("¡Ô¶ò¼Ô¡Õ¤À¡£");
2417 msg_print("It's the Fool.");
2420 (void)do_dec_stat(A_INT);
2421 (void)do_dec_stat(A_WIS);
2426 msg_print("´ñ̯¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2428 msg_print("It's the picture of a strange monster.");
2431 if (!(summon_specific(0, py, px, (dun_level * 3) / 2, 32 + randint1(6), (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET))))
2437 msg_print("¡Ô·î¡Õ¤À¡£");
2439 msg_print("It's the Moon.");
2447 msg_print("¡Ô±¿Ì¿¤ÎÎØ¡Õ¤À¡£");
2449 msg_print("It's the Wheel of Fortune.");
2452 wild_magic(randint0(32));
2457 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2459 msg_print("It's a teleport trump card.");
2462 teleport_player(10);
2467 msg_print("¡ÔÀµµÁ¡Õ¤À¡£");
2469 msg_print("It's Justice.");
2472 set_blessed(p_ptr->lev, FALSE);
2477 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2479 msg_print("It's a teleport trump card.");
2482 teleport_player(100);
2487 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2489 msg_print("It's a teleport trump card.");
2492 teleport_player(200);
2497 msg_print("¡ÔÅã¡Õ¤À¡£");
2499 msg_print("It's the Tower.");
2507 msg_print("¡ÔÀáÀ©¡Õ¤À¡£");
2509 msg_print("It's Temperance.");
2512 sleep_monsters_touch();
2517 msg_print("¡ÔÅã¡Õ¤À¡£");
2519 msg_print("It's the Tower.");
2522 earthquake(py, px, 5);
2527 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2529 msg_print("It's the picture of a friendly monster.");
2532 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE1, PM_FORCE_PET)))
2538 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2540 msg_print("It's the picture of a friendly monster.");
2543 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE2, PM_FORCE_PET)))
2549 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2551 msg_print("It's the picture of a friendly monster.");
2554 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE4, PM_FORCE_PET)))
2560 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2562 msg_print("It's the picture of a friendly monster.");
2565 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE5, PM_FORCE_PET)))
2571 msg_print("¡ÔÎø¿Í¡Õ¤À¡£");
2573 msg_print("It's the Lovers.");
2576 if (get_aim_dir(&dir))
2577 (void)charm_monster(dir, MIN(p_ptr->lev, 20));
2582 msg_print("¡Ô±£¼Ô¡Õ¤À¡£");
2584 msg_print("It's the Hermit.");
2592 msg_print("¡Ô¿³È½¡Õ¤À¡£");
2594 msg_print("It's the Judgement.");
2597 do_cmd_rerate(FALSE);
2598 if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3)
2601 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
2603 msg_print("You are cured of all mutations.");
2606 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
2607 p_ptr->update |= PU_BONUS;
2614 msg_print("¡ÔÂÀÍÛ¡Õ¤À¡£");
2616 msg_print("It's the Sun.");
2619 chg_virtue(V_KNOWLEDGE, 1);
2620 chg_virtue(V_ENLIGHTEN, 1);
2626 msg_print("¡ÔÀ¤³¦¡Õ¤À¡£");
2628 msg_print("It's the World.");
2631 if (p_ptr->exp < PY_MAX_EXP)
2633 s32b ee = (p_ptr->exp / 25) + 1;
2634 if (ee > 5000) ee = 5000;
2636 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
2638 msg_print("You feel more experienced.");
2646 case 3: /* Reset Recall */
2649 if (!reset_recall()) return FALSE;
2652 case 4: /* Teleport Self */
2655 teleport_player(plev * 4);
2658 case 5: /* Trump Spying */
2661 (void)set_tim_esp(randint1(30) + 25, FALSE);
2664 case 6: /* Teleport Away */
2667 if (!get_aim_dir(&dir)) return FALSE;
2668 (void)fire_beam(GF_AWAY_ALL, dir, plev);
2671 case 7: /* Trump Animals */
2673 bool pet = success; /* was (randint1(5) > 2) */
2674 int type = (pet ? SUMMON_ANIMAL_RANGER : SUMMON_ANIMAL);
2677 if (pet) mode |= PM_FORCE_PET;
2678 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2681 msg_print("¤¢¤Ê¤¿¤Ïưʪ¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2683 msg_print("You concentrate on the trump of an animal...");
2687 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
2691 msg_print("¾¤´¤µ¤ì¤¿Æ°Êª¤ÏÅܤäƤ¤¤ë¡ª");
2693 msg_print("The summoned animal gets angry!");
2704 case 8: /* Trump Reach */
2707 if (!get_aim_dir(&dir)) return FALSE;
2708 fetch(dir, plev * 15, TRUE);
2711 case 9: /* Trump Kamikaze */
2716 if (!target_set(TARGET_KILL)) return FALSE;
2723 msg_print("¤¢¤Ê¤¿¤Ï¥«¥ß¥«¥¼¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2725 msg_print("You concentrate on several trumps at once...");
2729 for (dummy = 2 + randint0(plev / 7); dummy > 0; dummy--)
2731 bool pet = success; /* was (randint1(10) > 3) */
2735 if (pet) mode |= PM_FORCE_PET;
2736 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2738 if (p_ptr->pclass == CLASS_BEASTMASTER)
2740 type = SUMMON_KAMIKAZE_LIVING;
2744 type = SUMMON_KAMIKAZE;
2747 if (summon_specific((pet ? -1 : 0), y, x, summon_lev, type, mode))
2751 msg_print("¾¤´¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
2753 msg_print("The summoned creatures get angry!");
2761 case 10: /* Phantasmal Servant */
2764 if (summon_specific(-1, py, px, (summon_lev * 3) / 2, SUMMON_PHANTOM, PM_FORCE_PET))
2767 msg_print("¸æÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¸æ¼ç¿ÍÍÍ¡©");
2769 msg_print("'Your wish, master?'");
2779 case 11: /* Speed Monster */
2782 bool old_target_pet = target_pet;
2784 if (!get_aim_dir(&dir))
2786 target_pet = old_target_pet;
2789 target_pet = old_target_pet;
2790 (void)speed_monster(dir);
2793 case 12: /* Teleport Level */
2797 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
2799 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
2801 (void)teleport_level(0);
2804 case 13: /* Dimension Door */
2808 msg_print("¼¡¸µ¤ÎÈ⤬³«¤¤¤¿¡£ÌÜŪÃϤòÁª¤ó¤Ç²¼¤µ¤¤¡£");
2810 msg_print("You open a dimensional gate. Choose a destination.");
2813 return dimension_door();
2816 case 14: /* Word of Recall */
2819 return word_of_recall();
2822 case 15: /* Banish */
2825 banish_monsters(plev * 4);
2828 case 16: /* Swap Position */
2832 project_length = -1;
2833 if (!get_aim_dir(&dir))
2840 (void)teleport_swap(dir);
2844 case 17: /* Trump Undead */
2846 bool pet = success; /* (randint1(10) > 3) */
2849 if (pet) mode |= PM_FORCE_PET;
2850 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2853 msg_print("¤¢¤Ê¤¿¤Ï¥¢¥ó¥Ç¥Ã¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2855 msg_print("You concentrate on the trump of an undead creature...");
2859 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_UNDEAD, mode))
2863 msg_print("¾¤´¤µ¤ì¤¿¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
2865 msg_print("The summoned undead creature gets angry!");
2876 case 18: /* Trump Reptiles */
2878 bool pet = success; /* was (randint1(5) > 2) */
2881 if (pet) mode |= PM_FORCE_PET;
2882 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2885 msg_print("¤¢¤Ê¤¿¤Ïà¨ÃîÎà¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2887 msg_print("You concentrate on the trump of a reptile...");
2891 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HYDRA, mode))
2895 msg_print("¾¤´¤µ¤ì¤¿à¨ÃîÎà¤ÏÅܤäƤ¤¤ë¡ª");
2897 msg_print("The summoned reptile gets angry!");
2908 case 19: /* Trump Monsters */
2913 msg_print("¤¢¤Ê¤¿¤Ï¥â¥ó¥¹¥¿¡¼¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2915 msg_print("You concentrate on several trumps at once...");
2919 for (dummy = 0; dummy < 1 + ((plev - 15)/ 10); dummy++)
2921 bool pet = success; /* was (randint1(10) > 3) */
2925 if (pet) mode |= PM_FORCE_PET;
2926 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2928 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
2930 if (p_ptr->pclass == CLASS_BEASTMASTER)
2932 type = SUMMON_LIVING;
2939 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
2943 msg_print("¾¤´¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
2945 msg_print("The summoned creatures get angry!");
2953 case 20: /* Trump Hounds */
2955 bool pet = success; /* was (randint1(5) > 2) */
2956 u32b mode = PM_ALLOW_GROUP;
2958 if (pet) mode |= PM_FORCE_PET;
2959 else mode |= PM_NO_PET;
2962 msg_print("¤¢¤Ê¤¿¤Ï¥Ï¥¦¥ó¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2964 msg_print("You concentrate on the trump of a hound...");
2968 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HOUND, mode))
2972 msg_print("¾¤´¤µ¤ì¤¿¥Ï¥¦¥ó¥É¤ÏÅܤäƤ¤¤ë¡ª");
2974 msg_print("The summoned hounds get angry!");
2985 case 21: /* Trump Branding */
2991 case 22: /* Living Trump */
2995 /* Teleport control */
2998 /* Random teleportation (uncontrolled) */
3000 /* Gain the mutation */
3001 if (gain_random_mutation(dummy))
3003 msg_print("¤¢¤Ê¤¿¤ÏÀ¸¤¤Æ¤¤¤ë¥«¡¼¥É¤ËÊѤï¤Ã¤¿¡£");
3005 msg_print("You have turned into a Living Trump.");
3010 case 23: /* Trump Cyberdemon */
3012 bool pet = success; /* was (randint1(10) > 3) */
3015 if (pet) mode |= PM_FORCE_PET;
3016 else mode |= PM_NO_PET;
3019 msg_print("¤¢¤Ê¤¿¤Ï¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3021 msg_print("You concentrate on the trump of a Cyberdemon...");
3025 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_CYBER, mode))
3029 msg_print("¾¤´¤µ¤ì¤¿¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3031 msg_print("The summoned Cyberdemon gets angry!");
3042 case 24: /* Trump Divination */
3045 (void)detect_all(DETECT_RAD_DEFAULT);
3048 case 25: /* Trump Lore */
3051 return identify_fully(FALSE);
3054 case 26: /* Heal Monster */
3057 bool old_target_pet = target_pet;
3059 if (!get_aim_dir(&dir))
3061 target_pet = old_target_pet;
3064 target_pet = old_target_pet;
3066 (void)heal_monster(dir, p_ptr->lev * 10 + 200);
3069 case 27: /* Trump Dragon */
3071 bool pet = success; /* was (randint1(10) > 3) */
3074 if (pet) mode |= PM_FORCE_PET;
3075 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3078 msg_print("¤¢¤Ê¤¿¤Ï¥É¥é¥´¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3080 msg_print("You concentrate on the trump of a dragon...");
3084 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DRAGON, mode))
3088 msg_print("¾¤´¤µ¤ì¤¿¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3090 msg_print("The summoned dragon gets angry!");
3101 case 28: /* Trump Meteor */
3104 int x, y, dx, dy, i;
3105 int b = 10 + randint1(10);
3106 for (i = 0; i < b; i++)
3108 int count = 0, d = 0;
3113 if (count > 20) break;
3114 x = px - 8 + randint0(17);
3115 y = py - 8 + randint0(17);
3117 if (!in_bounds(y,x) || (!cave_floor_bold(y,x) && (cave[y][x].feat != FEAT_TREES)) || !player_has_los_bold(y, x)) continue;
3119 dx = (px > x) ? (px - x) : (x - px);
3120 dy = (py > y) ? (py - y) : (y - py);
3122 /* Approximate distance */
3123 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
3127 if (count > 20) continue;
3129 project(0, 2, y, x, plev * 2, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
3133 case 29: /* Trump Demon */
3135 bool pet = success; /* was (randint1(10) > 3) */
3138 if (pet) mode |= PM_FORCE_PET;
3139 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3142 msg_print("¤¢¤Ê¤¿¤Ï¥Ç¡¼¥â¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3144 msg_print("You concentrate on the trump of a demon...");
3148 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DEMON, mode))
3152 msg_print("¾¤´¤µ¤ì¤¿¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3154 msg_print("The summoned demon gets angry!");
3165 case 30: /* Trump Greater Undead */
3167 bool pet = success; /* was (randint1(10) > 3) */
3170 if (pet) mode |= PM_FORCE_PET;
3171 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3173 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
3176 msg_print("¤¢¤Ê¤¿¤Ï¶¯ÎϤʥ¢¥ó¥Ç¥Ã¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3178 msg_print("You concentrate on the trump of a greater undead being...");
3182 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HI_UNDEAD, mode))
3186 msg_print("¾¤´¤µ¤ì¤¿¾åµé¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
3188 msg_print("The summoned greater undead creature gets angry!");
3199 case 31: /* Trump Ancient Dragon */
3201 bool pet = success; /* was (randint1(10) > 3) */
3205 if (pet) mode |= PM_FORCE_PET;
3206 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3208 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
3210 if (p_ptr->pclass == CLASS_BEASTMASTER)
3212 type = SUMMON_HI_DRAGON_LIVING;
3216 type = SUMMON_HI_DRAGON;
3220 msg_print("¤¢¤Ê¤¿¤Ï¸ÅÂå¥É¥é¥´¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3222 msg_print("You concentrate on the trump of an ancient dragon...");
3226 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
3230 msg_print("¾¤´¤µ¤ì¤¿¸ÅÂå¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3232 msg_print("The summoned ancient dragon gets angry!");
3245 msg_format("̤ÃΤΥ«¡¼¥É¤Î¼öʸ¤Ç¤¹: %d", spell);
3247 msg_format("You cast an unknown Trump spell: %d.", spell);
3256 msg_print("ï¤â¤¢¤Ê¤¿¤Î¥«¡¼¥É¤Î¸Æ¤ÓÀ¼¤ËÅú¤¨¤Ê¤¤¡£");
3258 msg_print("Nobody answers to your Trump call.");
3267 static bool cast_arcane_spell(int spell)
3271 int plev = p_ptr->lev;
3274 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3275 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3276 else beam = plev / 2;
3281 if (!get_aim_dir(&dir)) return FALSE;
3283 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
3284 damroll(3 + ((plev - 1) / 5), 3));
3286 case 1: /* Wizard Lock */
3287 if (!get_aim_dir(&dir)) return FALSE;
3289 (void)wizard_lock(dir);
3291 case 2: /* Detect Invisibility */
3292 (void)detect_monsters_invis(DETECT_RAD_DEFAULT);
3294 case 3: /* Detect Monsters */
3295 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
3298 teleport_player(10);
3300 case 5: /* Light Area */
3301 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
3303 case 6: /* Trap & Door Destruction */
3304 if (!get_aim_dir(&dir)) return FALSE;
3306 (void)destroy_door(dir);
3308 case 7: /* Cure Light Wounds */
3309 (void)hp_player(damroll(2, 8));
3310 (void)set_cut(p_ptr->cut - 10);
3312 case 8: /* Detect Doors & Traps */
3313 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
3314 (void)detect_doors(DETECT_RAD_DEFAULT);
3315 (void)detect_stairs(DETECT_RAD_DEFAULT);
3317 case 9: /* Phlogiston */
3320 case 10: /* Detect Treasure */
3321 (void)detect_treasure(DETECT_RAD_DEFAULT);
3322 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
3324 case 11: /* Detect Enchantment */
3325 (void)detect_objects_magic(DETECT_RAD_DEFAULT);
3327 case 12: /* Detect Objects */
3328 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
3330 case 13: /* Cure Poison */
3331 (void)set_poisoned(0);
3333 case 14: /* Resist Cold */
3334 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3336 case 15: /* Resist Fire */
3337 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3339 case 16: /* Resist Lightning */
3340 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3342 case 17: /* Resist Acid */
3343 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3345 case 18: /* Cure Medium Wounds */
3346 (void)hp_player(damroll(4, 8));
3347 (void)set_cut((p_ptr->cut / 2) - 50);
3349 case 19: /* Teleport */
3350 teleport_player(plev * 5);
3352 case 20: /* Identify */
3353 return ident_spell(FALSE);
3354 case 21: /* Stone to Mud */
3355 if (!get_aim_dir(&dir)) return FALSE;
3357 (void)wall_to_mud(dir);
3359 case 22: /* Ray of Light */
3360 if (!get_aim_dir(&dir)) return FALSE;
3363 msg_print("¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
3365 msg_print("A line of light appears.");
3368 (void)lite_line(dir);
3370 case 23: /* Satisfy Hunger */
3371 (void)set_food(PY_FOOD_MAX - 1);
3373 case 24: /* See Invisible */
3374 (void)set_tim_invis(randint1(24) + 24, FALSE);
3376 case 25: /* Conjure Elemental */
3377 if (!summon_specific(-1, py, px, plev, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3380 msg_print("¥¨¥ì¥á¥ó¥¿¥ë¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3382 msg_print("No Elementals arrive.");
3386 case 26: /* Teleport Level */
3388 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
3390 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
3392 (void)teleport_level(0);
3394 case 27: /* Teleport Away */
3395 if (!get_aim_dir(&dir)) return FALSE;
3397 (void)fire_beam(GF_AWAY_ALL, dir, plev);
3399 case 28: /* Elemental Ball */
3400 if (!get_aim_dir(&dir)) return FALSE;
3402 switch (randint1(4))
3404 case 1: dummy = GF_FIRE;break;
3405 case 2: dummy = GF_ELEC;break;
3406 case 3: dummy = GF_COLD;break;
3407 default: dummy = GF_ACID;break;
3409 fire_ball(dummy, dir, 75 + (plev), 2);
3411 case 29: /* Detection */
3412 (void)detect_all(DETECT_RAD_DEFAULT);
3414 case 30: /* Word of Recall */
3415 return word_of_recall();
3416 case 31: /* Clairvoyance */
3417 chg_virtue(V_KNOWLEDGE, 1);
3418 chg_virtue(V_ENLIGHTEN, 1);
3420 if (!p_ptr->telepathy)
3422 (void)set_tim_esp(randint1(30) + 25, FALSE);
3426 msg_format("You cast an unknown Arcane spell: %d.", spell);
3434 static bool cast_enchant_spell(int spell)
3436 int plev = p_ptr->lev;
3441 case 0: /* Infravision */
3442 set_tim_infra(100 + randint1(100), FALSE);
3444 case 1: /* Regeneration */
3445 set_tim_regen(80 + randint1(80), FALSE);
3447 case 2: /* Satisfy Hunger */
3448 (void)set_food(PY_FOOD_MAX - 1);
3450 case 3: /* Resist Cold */
3451 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3453 case 4: /* Resist Fire */
3454 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3456 case 5: /* Heroism */
3457 (void)set_hero(randint1(25) + 25, FALSE);
3458 (void)hp_player(10);
3459 (void)set_afraid(0);
3461 case 6: /* Resist Lightning */
3462 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3464 case 7: /* Resist Acid */
3465 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3467 case 8: /* See Invisibility */
3468 (void)set_tim_invis(randint1(24) + 24, FALSE);
3470 case 9: /* Remove Curse */
3474 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
3476 msg_print("You feel as if someone is watching over you.");
3480 case 10: /* Resist Poison */
3481 (void)set_oppose_pois(randint1(20) + 20, FALSE);
3483 case 11: /* Berserk */
3484 (void)set_shero(randint1(25) + 25, FALSE);
3485 (void)hp_player(30);
3486 (void)set_afraid(0);
3488 case 12: /* Self Knowledge */
3489 (void)self_knowledge();
3491 case 13: /* Protection from Evil */
3492 (void)set_protevil(randint1(25) + 3 * p_ptr->lev, FALSE);
3494 case 14: /* Healing */
3500 case 15: /* Mana Branding */
3501 return choose_ele_attack();
3502 case 16: /* Telepathy */
3503 (void)set_tim_esp(randint1(30) + 25, FALSE);
3505 case 17: /* Stone Skin */
3506 (void)set_shield(randint1(20) + 30, FALSE);
3508 case 18: /* Resistance */
3509 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3510 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3511 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3512 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3513 (void)set_oppose_pois(randint1(20) + 20, FALSE);
3515 case 19: /* Haste */
3516 (void)set_fast(randint1(20 + plev) + plev, FALSE);
3518 case 20: /* Walk through Wall */
3519 (void)set_kabenuke(randint1(plev/2) + plev/2, FALSE);
3521 case 21: /* Pulish Shield */
3522 (void)pulish_shield();
3524 case 22: /* Create Golem */
3525 if (summon_specific(-1, py, px, plev, SUMMON_GOLEM, PM_FORCE_PET))
3528 msg_print("¥´¡¼¥ì¥à¤òºî¤Ã¤¿¡£");
3530 msg_print("You make a golem.");
3536 msg_print("¤¦¤Þ¤¯¥´¡¼¥ì¥à¤òºî¤ì¤Ê¤«¤Ã¤¿¡£");
3538 msg_print("No Golems arrive.");
3542 case 23: /* Magic armor */
3543 (void)set_magicdef(randint1(20) + 20, FALSE);
3545 case 24: /* Remove Enchantment */
3546 if (!mundane_spell(TRUE)) return FALSE;
3548 case 25: /* Remove All Curse */
3549 if (remove_all_curse())
3552 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
3554 msg_print("You feel as if someone is watching over you.");
3558 case 26: /* Total Knowledge */
3559 return identify_fully(FALSE);
3560 case 27: /* Enchant Weapon */
3561 return enchant_spell(randint0(4) + 1, randint0(4) + 1, 0);
3562 case 28: /* Enchant Armor */
3563 return enchant_spell(0, 0, randint0(3) + 2);
3564 case 29: /* Brand Weapon */
3565 brand_weapon(randint0(18));
3567 case 30: /* Living Trump */
3569 /* Teleport control */
3572 /* Random teleportation (uncontrolled) */
3574 /* Gain the mutation */
3575 if (gain_random_mutation(dummy))
3577 msg_print("¤¢¤Ê¤¿¤ÏÀ¸¤¤Æ¤¤¤ë¥«¡¼¥É¤ËÊѤï¤Ã¤¿¡£");
3579 msg_print("You have turned into a Living Trump.");
3582 case 31: /* Immune */
3583 return choose_ele_immune(13 + randint1(13));
3585 msg_format("You cast an unknown Craft spell: %d.", spell);
3594 * An "item_tester_hook" for offer
3596 static bool item_tester_offer(object_type *o_ptr)
3598 /* Flasks of oil are okay */
3599 if (o_ptr->tval != TV_CORPSE) return (FALSE);
3601 if (o_ptr->sval != SV_CORPSE) return (FALSE);
3603 if (strchr("pht", r_info[o_ptr->pval].d_char)) return (TRUE);
3605 /* Assume not okay */
3610 static bool cast_daemon_spell(int spell)
3613 int plev = p_ptr->lev;
3615 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3616 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3617 else beam = plev / 2;
3621 case 0: /* Magic Missile */
3622 if (!get_aim_dir(&dir)) return FALSE;
3624 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
3625 damroll(3 + ((plev - 1) / 5), 4));
3627 case 1: /* Detect Undead & Demons -> Unlife */
3628 (void)detect_monsters_nonliving(DETECT_RAD_DEFAULT);
3631 (void)set_blessed(randint1(12) + 12, FALSE);
3633 case 3: /* Resist Fire */
3634 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3636 case 4: /* Horrify */
3637 if (!get_aim_dir(&dir)) return FALSE;
3639 (void)fear_monster(dir, plev);
3640 (void)stun_monster(dir, plev);
3642 case 5: /* Nether Bolt */
3643 if (!get_aim_dir(&dir)) return FALSE;
3645 fire_bolt_or_beam(beam, GF_NETHER, dir,
3646 damroll(6 + ((plev - 5) / 4), 8));
3648 case 6: /* Summon monster, demon */
3649 if (!summon_specific(-1, py, px, (plev * 3) / 2, SUMMON_MANES, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3652 msg_print("¸ÅÂå¤Î»àÎî¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3654 msg_print("No Manes arrive.");
3658 case 7: /* Mini Hellfire */
3659 if (!get_aim_dir(&dir)) return FALSE;
3661 fire_ball(GF_HELL_FIRE, dir,
3662 (damroll(3, 6) + plev +
3663 (plev / (((p_ptr->pclass == CLASS_MAGE) ||
3664 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
3665 (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
3666 ((plev < 30) ? 2 : 3));
3668 case 8: /* Enslave Demon */
3669 if (!get_aim_dir(&dir)) return FALSE;
3671 (void)control_one_demon(dir, plev);
3673 case 9: /* Vision */
3674 map_area(DETECT_RAD_MAP);
3676 case 10: /* Resist Nether */
3677 (void)set_tim_res_nether(randint1(20) + 20, FALSE);
3679 case 11: /* Plasma Bolt */
3680 if (!get_aim_dir(&dir)) return FALSE;
3682 fire_bolt_or_beam(beam, GF_PLASMA, dir,
3683 damroll(11 + ((plev - 5) / 4), 8));
3685 case 12: /* Fire Ball */
3686 if (!get_aim_dir(&dir)) return FALSE;
3688 fire_ball(GF_FIRE, dir, plev + 55, 2);
3690 case 13: /* Fire Branding */
3693 case 14: /* Nether Ball */
3694 if (!get_aim_dir(&dir)) return FALSE;
3696 fire_ball(GF_NETHER, dir, plev*3/2 + 100, plev / 20+2);
3698 case 15: /* Summon monster, demon */
3700 bool pet = !one_in_(3);
3703 if (pet) mode |= PM_FORCE_PET;
3704 else mode |= PM_NO_PET;
3705 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
3707 if (summon_specific((pet ? -1 : 0), py, px, plev*2/3+randint1(plev/2), SUMMON_DEMON, mode))
3710 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
3712 msg_print("The area fills with a stench of sulphur and brimstone.");
3718 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
3720 msg_print("'What is thy bidding... Master?'");
3725 msg_print("¡ÖÈܤ·¤¼Ô¤è¡¢²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª ¤ªÁ°¤Îº²¤òĺ¤¯¤¾¡ª¡×");
3727 msg_print("'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'");
3734 msg_print("°Ëâ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3736 msg_print("No demons arrive.");
3741 case 16: /* Telepathy */
3742 (void)set_tim_esp(randint1(30) + 25, FALSE);
3744 case 17: /* Demoncloak */
3746 int dur=randint1(20) + 20;
3748 set_oppose_fire(dur, FALSE);
3749 set_oppose_cold(dur, FALSE);
3750 set_tim_sh_fire(dur, FALSE);
3754 case 18: /* Rain of Lava */
3755 fire_ball(GF_FIRE, 0, (55 + plev)*2, 3);
3756 fire_ball_hide(GF_LAVA_FLOW, 0, 2+randint1(2), 3);
3758 case 19: /* Plasma ball */
3759 if (!get_aim_dir(&dir)) return FALSE;
3761 fire_ball(GF_PLASMA, dir, plev*3/2 + 80, 2 + plev/40);
3763 case 20: /* Mimic demon */
3764 (void)set_mimic(10+plev/2 + randint1(10+plev/2), MIMIC_DEMON, FALSE);
3766 case 21: /* Nether Wave == Dispel Good */
3767 (void)dispel_monsters(randint1(plev * 2));
3768 (void)dispel_good(randint1(plev * 2));
3771 if (!get_aim_dir(&dir)) return FALSE;
3772 fire_ball(GF_NEXUS, dir, 100 + plev*2, 4);
3774 case 23: /* Hand Doom */
3775 if (!get_aim_dir(&dir)) return FALSE;
3777 else msg_print("<ÇËÌǤμê>¤òÊü¤Ã¤¿¡ª");
3779 else msg_print("You invoke the Hand of Doom!");
3782 fire_ball_hide(GF_HAND_DOOM, dir, plev * 2, 0);
3784 case 24: /* Heroism */
3785 (void)set_hero(randint1(25) + 25, FALSE);
3786 (void)hp_player(10);
3787 (void)set_afraid(0);
3789 case 25: /* Tim resist time */
3790 (void)set_tim_res_time(randint1(20)+20, FALSE);
3792 case 26: /* Circle of Madness */
3793 fire_ball(GF_CHAOS, 0, 50+plev, 3+plev/20);
3794 fire_ball(GF_CONFUSION, 0, 50+plev, 3+plev/20);
3795 fire_ball(GF_CHARM, 0, 20+plev, 3+plev/20);
3797 case 27: /* True Discharge Minion */
3800 case 28: /* Summon Greater Demon */
3807 item_tester_hook = item_tester_offer;
3809 q = "¤É¤Î»àÂΤòÊû¤²¤Þ¤¹¤«? ";
3810 s = "Êû¤²¤é¤ì¤ë»àÂΤò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
3812 q = "Sacrifice which corpse? ";
3813 s = "You have nothing to scrifice.";
3815 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return FALSE;
3817 /* Get the item (in the pack) */
3820 o_ptr = &inventory[item];
3823 /* Get the item (on the floor) */
3826 o_ptr = &o_list[0 - item];
3829 summon_lev = p_ptr->lev * 2 / 3 + r_info[o_ptr->pval].level;
3830 if (summon_specific(-1, py, px, summon_lev, SUMMON_HI_DEMON, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3833 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
3835 msg_print("The area fills with a stench of sulphur and brimstone.");
3840 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
3842 msg_print("'What is thy bidding... Master?'");
3845 /* Decrease the item (from the pack) */
3848 inven_item_increase(item, -1);
3849 inven_item_describe(item);
3850 inven_item_optimize(item);
3853 /* Decrease the item (from the floor) */
3856 floor_item_increase(0 - item, -1);
3857 floor_item_describe(0 - item);
3858 floor_item_optimize(0 - item);
3864 msg_print("°Ëâ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3866 msg_print("No Greater Demon arrive.");
3871 case 29: /* Nether Storm */
3872 if (!get_aim_dir(&dir)) return FALSE;
3874 fire_ball(GF_NETHER, dir, plev*15, plev / 5);
3876 case 30: /* Blood curse */
3878 if (!get_aim_dir(&dir)) return FALSE;
3880 fire_ball_hide(GF_BLOOD_CURSE, dir, 600, 0);
3882 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "·ì¤Î¼ö¤¤", -1);
3884 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "Blood curse", -1);
3888 case 31: /* Mimic Demon lord */
3889 (void)set_mimic(15 + randint1(15), MIMIC_DEMON_LORD, FALSE);
3892 msg_format("You cast an unknown Daemon spell: %d.", spell);
3900 static bool cast_crusade_spell(int spell)
3904 int plev = p_ptr->lev;
3906 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3907 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3908 else beam = plev / 2;
3913 if (!get_aim_dir(&dir)) return FALSE;
3915 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
3916 damroll(3 + ((plev - 1) / 5), 4));
3919 (void)detect_monsters_evil(DETECT_RAD_DEFAULT);
3921 case 2: /* Remove Fear */
3922 (void)set_afraid(0);
3925 if (!get_aim_dir(&dir)) return FALSE;
3927 (void)fear_monster(dir, plev);
3930 (void)sleep_monsters_touch();
3933 teleport_player(25+plev/2);
3936 if (!get_aim_dir(&dir)) return FALSE;
3937 fire_blast(GF_LITE, dir, 3+((plev-1)/9), 2, 10, 3);
3941 (void)set_poisoned(0);
3945 if (!get_aim_dir(&dir)) return FALSE;
3946 (void)fire_ball(GF_AWAY_EVIL, dir, MAX_SIGHT*5, 0);
3948 case 9: /* Holy Orb */
3949 if (!get_aim_dir(&dir)) return FALSE;
3951 fire_ball(GF_HOLY_FIRE, dir,
3952 (damroll(3, 6) + plev +
3953 (plev / ((p_ptr->pclass == CLASS_PRIEST ||
3954 p_ptr->pclass == CLASS_HIGH_MAGE ||
3955 p_ptr->pclass == CLASS_SORCERER) ? 2 : 4))),
3956 ((plev < 30) ? 2 : 3));
3959 case 10: /* Exorcism */
3960 (void)dispel_undead(randint1(plev));
3961 (void)dispel_demons(randint1(plev));
3962 (void)turn_evil(plev);
3964 case 11: /* Remove Curse */
3968 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
3970 msg_print("You feel as if someone is watching over you.");
3974 case 12: /* Sense Unseen */
3975 (void)set_tim_invis(randint1(24) + 24, FALSE);
3977 case 13: /* Protection from Evil */
3978 (void)set_protevil(randint1(25) + 3 * p_ptr->lev, FALSE);
3981 if (!get_aim_dir(&dir)) return FALSE;
3982 (void)fire_bolt(GF_ELEC, dir, plev*5);
3984 case 15: /* Holy Word */
3985 (void)dispel_evil(randint1(plev * 6));
3986 (void)hp_player(100);
3987 (void)set_afraid(0);
3988 (void)set_poisoned(0);
3993 if (!get_aim_dir(&dir)) return FALSE;
3995 (void)destroy_door(dir);
3998 if (!get_aim_dir(&dir)) return FALSE;
3999 (void)stasis_evil(dir);
4002 set_tim_sh_holy(randint1(20)+20, FALSE);
4004 case 19: /* Dispel Undead + Demons */
4005 (void)dispel_undead(randint1(plev * 4));
4006 (void)dispel_demons(randint1(plev * 4));
4008 case 20: /* Dispel Evil */
4009 (void)dispel_evil(randint1(plev * 4));
4014 case 22: /* Star Burst */
4015 if (!get_aim_dir(&dir)) return FALSE;
4017 fire_ball(GF_LITE, dir, 100+plev*2, 4);
4019 case 23: /* Summon monster, angel */
4021 bool pet = !one_in_(3);
4024 if (pet) mode |= PM_FORCE_PET;
4025 else mode |= PM_NO_PET;
4026 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
4028 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, SUMMON_ANGEL, mode))
4032 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
4034 msg_print("'What is thy bidding... Master?'");
4039 msg_print("¡Ö²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª °¹Ô¼Ô¤è¡¢²ù¤¤²þ¤á¤è¡ª¡×");
4041 msg_print("Mortal! Repent of thy impiousness.");
4047 case 24: /* Heroism */
4048 (void)set_hero(randint1(25) + 25, FALSE);
4049 (void)hp_player(10);
4050 (void)set_afraid(0);
4052 case 25: /* Remove All Curse */
4053 if (remove_all_curse())
4056 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
4058 msg_print("You feel as if someone is watching over you.");
4062 case 26: /* Banishment */
4063 if (banish_evil(100))
4066 msg_print("¿ÀÀ»¤ÊÎϤ¬¼Ù°¤òÂǤÁʧ¤Ã¤¿¡ª");
4068 msg_print("The holy power banishes evil!");
4073 case 27: /* Word of Destruction */
4074 (void)destroy_area(py, px, 13 + randint0(5), FALSE);
4076 case 28: /* Eye for an Eye */
4077 set_tim_eyeeye(randint1(10)+10, FALSE);
4084 int b = 10 + randint1(10);
4086 if (!get_aim_dir(&dir)) return FALSE;
4088 /* Use the given direction */
4089 tx = px + 99 * ddx[dir];
4090 ty = py + 99 * ddy[dir];
4092 /* Hack -- Use an actual "target" */
4093 if ((dir == 5) && target_okay())
4104 /* Hack -- Stop at the target */
4105 if ((y == ty) && (x == tx)) break;
4109 mmove2(&ny, &nx, py, px, ty, tx);
4111 /* Stop at maximum range */
4112 if (MAX_RANGE <= distance(py, px, ny, nx)) break;
4114 /* Stopped by walls/doors */
4115 if (!cave_floor_bold(ny, nx)) break;
4117 /* Stopped by monsters */
4118 if ((dir != 5) && cave[ny][nx].m_idx != 0) break;
4120 /* Save the new location */
4127 for (i = 0; i < b; i++)
4129 int count = 20, d = 0;
4135 x = tx - 5 + randint0(11);
4136 y = ty - 5 + randint0(11);
4138 dx = (tx > x) ? (tx - x) : (x - tx);
4139 dy = (ty > y) ? (ty - y) : (y - ty);
4141 /* Approximate distance */
4142 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
4143 /* Within the radius */
4147 if (count < 0) continue;
4149 /* Cannot penetrate perm walls */
4150 if (!in_bounds(y,x) ||
4151 cave_stop_disintegration(y,x) ||
4152 !in_disintegration_range(ty, tx, y, x))
4155 project(0, 2, y, x, plev * 3+25, GF_DISINTEGRATE, PROJECT_JUMP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1);
4159 case 30: /* Divine Intervention */
4160 project(0, 1, py, px, plev*11, GF_HOLY_FIRE, PROJECT_KILL, -1);
4161 dispel_monsters(plev * 4);
4163 stun_monsters(plev * 4);
4164 confuse_monsters(plev * 4);
4165 turn_monsters(plev * 4);
4166 stasis_monsters(plev * 4);
4167 (void)hp_player(100);
4173 for (i = 0; i < 12; i++)
4180 scatter(&my, &mx, py, px, 4, 0);
4182 /* Require empty grids */
4183 if (cave_empty_bold2(my, mx)) break;
4185 if (attempt < 0) continue;
4186 summon_specific(-1, my, mx, plev, SUMMON_KNIGHTS, (PM_ALLOW_GROUP | PM_FORCE_PET | PM_HASTE));
4188 (void)set_hero(randint1(25) + 25, FALSE);
4189 (void)set_blessed(randint1(25) + 25, FALSE);
4190 (void)set_fast(randint1(20 + plev) + plev, FALSE);
4191 (void)set_protevil(randint1(25) + 25, FALSE);
4192 (void)set_afraid(0);
4197 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤ÊÇ˼٤μöʸ %d ¤ò¾§¤¨¤¿¡£", spell);
4199 msg_format("You cast an unknown crusade spell: %d.", spell);
4210 void stop_singing(void)
4212 if (p_ptr->pclass != CLASS_BARD) return;
4214 if (p_ptr->magic_num1[1])
4216 p_ptr->magic_num1[1] = 0;
4219 if (!p_ptr->magic_num1[0]) return;
4221 /* Hack -- if called from set_action(), avoid recursive loop */
4222 if (p_ptr->action == ACTION_SING) set_action(ACTION_NONE);
4224 switch(p_ptr->magic_num1[0])
4227 if (!p_ptr->blessed)
4229 msg_print("¹â·é¤Êµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4231 msg_print("The prayer has expired.");
4238 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4240 msg_print("The heroism wears off.");
4242 /* Recalculate hitpoints */
4243 p_ptr->update |= (PU_HP);
4247 if (!p_ptr->tim_esp)
4250 msg_print("°Õ¼±¤Ï¸µ¤ËÌá¤Ã¤¿¡£");
4252 msg_print("Your consciousness contracts again.");
4254 /* Update the monsters */
4255 p_ptr->update |= (PU_MONSTERS);
4259 if (!p_ptr->tim_stealth)
4261 msg_print("»Ñ¤¬¤Ï¤Ã¤¤ê¤È¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
4263 msg_print("You are no longer hided.");
4267 if (!p_ptr->oppose_acid)
4269 msg_print("»À¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4271 msg_print("You feel less resistant to acid.");
4273 if (!p_ptr->oppose_elec)
4275 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4277 msg_print("You feel less resistant to elec.");
4279 if (!p_ptr->oppose_fire)
4281 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4283 msg_print("You feel less resistant to fire.");
4285 if (!p_ptr->oppose_cold)
4287 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4289 msg_print("You feel less resistant to cold.");
4291 if (!p_ptr->oppose_pois)
4293 msg_print("ÆǤؤÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4295 msg_print("You feel less resistant to pois.");
4301 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
4303 msg_print("You feel yourself slow down.");
4310 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4312 msg_print("The heroism wears off.");
4314 /* Recalculate hitpoints */
4315 p_ptr->update |= (PU_HP);
4320 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
4322 msg_print("You feel yourself slow down.");
4329 msg_print("̵Ũ¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£");
4331 msg_print("The invulnerability wears off.");
4334 p_ptr->redraw |= (PR_MAP);
4336 /* Update monsters */
4337 p_ptr->update |= (PU_MONSTERS);
4340 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4344 p_ptr->magic_num1[0] = MUSIC_NONE;
4345 p_ptr->magic_num2[0] = 0;
4347 /* Recalculate bonuses */
4348 p_ptr->update |= (PU_BONUS | PU_HP);
4350 /* Redraw status bar */
4351 p_ptr->redraw |= (PR_STATUS);
4355 static bool cast_music_spell(int spell)
4357 int plev = p_ptr->lev;
4360 if(p_ptr->magic_num1[0])
4365 p_ptr->magic_num2[0] = spell;
4369 case 0: /* Song of Holding ÃÙÆߤβΠ*/
4371 msg_print("¤æ¤Ã¤¯¤ê¤È¤·¤¿¥á¥í¥Ç¥£¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4373 msg_print("You start humming a slow, steady melody...");
4375 p_ptr->magic_num1[0] = MUSIC_SLOW;
4377 case 1: /* Song of Blessing ½ËÊ¡¤Î²Î */
4379 msg_print("¸·¤«¤Ê¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4381 msg_print("The holy power of the Music of the Ainur enters you...");
4383 p_ptr->magic_num1[0] = MUSIC_BLESS;
4386 case 2: /* Wrecking Note Êø²õ¤Î²»¿§ */
4387 if (!get_aim_dir(&dir)) return FALSE;
4388 fire_bolt(GF_SOUND, dir,
4389 damroll(4 + ((plev - 1) / 5), 4));
4391 case 3: /* Stun Pattern Û¯Û°¤ÎÀûΧ */
4393 msg_print("âÁÏǤµ¤»¤ë¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4395 msg_print("You weave a pattern of sounds to bewilder and daze...");
4397 p_ptr->magic_num1[0] = MUSIC_STUN;
4399 case 4: /* Flow of life À¸Ì¿¤Îή¤ì */
4401 msg_print("²Î¤òÄ̤·¤ÆÂΤ˳赤¤¬Ìá¤Ã¤Æ¤¤¿¡¥¡¥¡¥");
4403 msg_print("Life flows through you as you sing a song of healing...");
4405 p_ptr->magic_num1[0] = MUSIC_L_LIFE;
4407 case 5: /* Song of the Sun ÂÀÍۤβΠ*/
4409 msg_print("¸÷¤êµ±¤¯²Î¤¬ÊÕ¤ê¤ò¾È¤é¤·¤¿¡£");
4411 msg_print("Your uplifting song brings brightness to dark places...");
4413 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
4415 case 6: /* Song of fear ¶²ÉݤβΠ*/
4417 msg_print("¤ª¤É¤í¤ª¤É¤í¤·¤¤¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4419 msg_print("You start weaving a fearful pattern...");
4421 p_ptr->magic_num1[0] = MUSIC_FEAR;
4423 case 7: /* Heroic Ballad À襤¤Î²Î */
4425 msg_print("·ã¤·¤¤À襤¤Î²Î¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4427 msg_print("You start singing a song of intense fighting...");
4429 p_ptr->magic_num1[0] = MUSIC_HERO;
4431 case 8: /* Clairaudience ÎîŪÃγР*/
4433 msg_print("ÀŤ«¤Ê²»³Ú¤¬´¶³Ð¤ò¸¦¤®À¡¤Þ¤µ¤»¤¿¡¥¡¥¡¥");
4435 msg_print("Your quiet music sharpens your sense of hearing...");
4437 p_ptr->magic_num1[0] = MUSIC_DETECT;
4439 case 9: /* º²¤Î²Î */
4441 msg_print("Àº¿À¤òDZ¤¸¶Ê¤²¤ë²Î¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4443 msg_print("You start singing a song of soul in pain...");
4445 p_ptr->magic_num1[0] = MUSIC_PSI;
4447 case 10: /* Song of Lore Ãμ±¤Î²Î */
4449 msg_print("¤³¤ÎÀ¤³¦¤ÎÃ챤¬Î®¤ì¹þ¤ó¤Ç¤¤¿¡¥¡¥¡¥");
4451 msg_print("You recall the rich lore of the world...");
4453 p_ptr->magic_num1[0] = MUSIC_ID;
4455 case 11: /* hidding song ±£ÆۤβΠ*/
4457 msg_print("¤¢¤Ê¤¿¤Î»Ñ¤¬·Ê¿§¤Ë¤È¤±¤³¤ó¤Ç¤¤¤Ã¤¿¡¥¡¥¡¥");
4459 msg_print("Your song carries you beyond the sight of mortal eyes...");
4461 p_ptr->magic_num1[0] = MUSIC_STEALTH;
4463 case 12: /* Illusion Pattern ¸¸±Æ¤ÎÀûΧ */
4465 msg_print("ÊÕ¤ê°ìÌ̤˸¸±Æ¤¬¸½¤ì¤¿¡¥¡¥¡¥");
4467 msg_print("You weave a pattern of sounds to beguile and confuse...");
4469 p_ptr->magic_num1[0] = MUSIC_CONF;
4471 case 13: /* Doomcall (vibration song) ÇËÌǤζ«¤Ó */
4473 msg_print("¹ì²»¤¬¶Á¤¤¤¿¡¥¡¥¡¥");
4475 msg_print("The fury of the Downfall of Numenor lashes out...");
4477 p_ptr->magic_num1[0] = MUSIC_SOUND;
4479 case 14: /* Firiel's Song (song of the Undeads) ¥Õ¥£¥ê¥¨¥ë¤Î²Î */
4481 msg_print("À¸Ì¿¤ÈÉü³è¤Î¥Æ¡¼¥Þ¤òÁդǻϤ᤿¡¥¡¥¡¥");
4483 msg_print("The themes of life and revival are woven into your song...");
4485 animate_dead(0, py, px);
4487 case 15: /* Fellowship Chant (charming song) ι¤ÎÃç´Ö */
4489 msg_print("°Â¤é¤«¤Ê¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4491 msg_print("You weave a slow, soothing melody of imploration...");
4493 p_ptr->magic_num1[0] = MUSIC_CHARM;
4495 case 16: /* (wall breaking song) ʬ²ò²»ÇÈ */
4497 msg_print("Ê´ºÕ¤¹¤ë¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4499 msg_print("You weave a violent pattern of sounds to break wall.");
4501 p_ptr->magic_num1[0] = MUSIC_WALL;
4502 project(0, 0, py, px,
4503 0, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM | PROJECT_HIDE, -1);
4505 case 17: /* Finrod's Resistance (song of resistance) ¸µÁÇÂÑÀ */
4507 msg_print("¸µÁǤÎÎϤËÂФ¹¤ëǦÂѤβΤò²Î¤Ã¤¿¡£");
4509 msg_print("You sing a song of perseverance against powers...");
4511 p_ptr->magic_num1[0] = MUSIC_RESIST;
4513 case 18: /* Hobbit Melodies (song of time) ¥Û¥Ó¥Ã¥È¤Î¥á¥í¥Ç¥£ */
4515 msg_print("·Ú²÷¤Ê²Î¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4517 msg_print("You start singing joyful pop song...");
4519 p_ptr->magic_num1[0] = MUSIC_SPEED;
4521 case 19: /* World Contortion ÏĤó¤ÀÀ¤³¦ */
4523 msg_print("²Î¤¬¶õ´Ö¤òÏĤ᤿¡¥¡¥¡¥");
4525 msg_print("Reality whirls wildly as you sing a dizzying melody...");
4527 project(0, plev/15 + 1, py, px, plev * 3 + 1, GF_AWAY_ALL , PROJECT_KILL, -1);
4529 case 20: /* Â໶¤Î²Î */
4531 msg_print("ÂѤ¨¤é¤ì¤Ê¤¤ÉÔ¶¨Ï²»¤¬Å¨¤òÀÕ¤áΩ¤Æ¤¿¡¥¡¥¡¥");
4533 msg_print("You cry out in an ear-wracking voice...");
4535 p_ptr->magic_num1[0] = MUSIC_DISPEL;
4537 case 21: /* The Voice of Saruman ¥µ¥ë¥Þ¥ó¤Î´Å¸À */
4539 msg_print("Í¥¤·¤¯¡¢Ì¥ÎÏŪ¤Ê²Î¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4541 msg_print("You start humming a gentle and attractive song...");
4543 p_ptr->magic_num1[0] = MUSIC_SARUMAN;
4545 case 22: /* Song of Tempest (song of death) Íò¤Î²»¿§ */
4546 if (!get_aim_dir(&dir)) return FALSE;
4547 fire_beam(GF_SOUND, dir,
4548 damroll(15 + ((plev - 1) / 2), 10));
4550 case 23: /* (song of disruption) ¤â¤¦°ì¤Ä¤ÎÀ¤³¦ */
4552 msg_print("¼þ°Ï¤¬ÊѲ½¤·»Ï¤á¤¿¡¥¡¥¡¥");
4554 msg_print("You sing of the primeval shaping of Middle-earth...");
4558 case 24: /* Wrecking Pattern (destruction shriek) Ç˲õ¤ÎÀûΧ */
4560 msg_print("Ç˲õŪ¤Ê²Î¤¬¶Á¤¤ï¤¿¤Ã¤¿¡¥¡¥¡¥");
4562 msg_print("You weave a pattern of sounds to contort and shatter...");
4564 p_ptr->magic_num1[0] = MUSIC_QUAKE;
4566 case 25: /* ÄäÂڤβΠ*/
4568 msg_print("¤æ¤Ã¤¯¤ê¤È¤·¤¿¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4570 msg_print("You weave a very slow pattern which is almost likely to stop...");
4572 p_ptr->magic_num1[0] = MUSIC_STASIS;
4574 case 26: /* ¼é¤ê¤Î²Î */
4576 msg_print("²Î¤¬¿ÀÀ»¤Ê¾ì¤òºî¤ê½Ð¤·¤¿¡¥¡¥¡¥");
4578 msg_print("The holy power of the Music is creating sacred field...");
4582 case 27: /* ±Ñͺ¤Î»í */
4584 msg_print("±Ñͺ¤Î²Î¤ò¸ý¤º¤µ¤ó¤À¡¥¡¥¡¥");
4586 msg_print("You chant a powerful, heroic call to arms...");
4588 p_ptr->magic_num1[0] = MUSIC_SHERO;
4589 (void)hp_player(10);
4590 (void)set_afraid(0);
4592 case 28: /* ¥ä¥ô¥¡¥ó¥Ê¤Î½õ¤± */
4594 msg_print("²Î¤òÄ̤·¤ÆÂΤ˳赤¤¬Ìá¤Ã¤Æ¤¤¿¡¥¡¥¡¥");
4596 msg_print("Life flows through you as you sing the song...");
4598 p_ptr->magic_num1[0] = MUSIC_H_LIFE;
4600 case 29: /* ºÆÀ¸¤Î²Î */
4602 msg_print("°Å¹õ¤ÎÃæ¤Ë¸÷¤ÈÈþ¤ò¤Õ¤ê¤Þ¤¤¤¿¡£ÂΤ¬¸µ¤Î³èÎϤò¼è¤êÌᤷ¤¿¡£");
4604 msg_print("You strewed light and beauty in the dark as you sing. You feel refreshed.");
4606 (void)do_res_stat(A_STR);
4607 (void)do_res_stat(A_INT);
4608 (void)do_res_stat(A_WIS);
4609 (void)do_res_stat(A_DEX);
4610 (void)do_res_stat(A_CON);
4611 (void)do_res_stat(A_CHR);
4612 (void)restore_level();
4614 case 30: /* shriek of death ¥µ¥¦¥í¥ó¤ÎËâ½Ñ */
4615 if (!get_aim_dir(&dir)) return FALSE;
4616 fire_ball(GF_SOUND, dir, damroll(50 + plev, 10), 0);
4618 case 31: /* song of liberty ¥Õ¥£¥ó¥´¥ë¥Õ¥£¥ó¤ÎÄ©Àï */
4620 msg_print("¥Õ¥£¥ó¥´¥ë¥Õ¥£¥ó¤Î̽²¦¤Ø¤ÎÄ©Àï¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4622 msg_print("You recall the valor of Fingolfin's challenge to the Dark Lord...");
4624 p_ptr->magic_num1[0] = MUSIC_INVULN;
4627 p_ptr->redraw |= (PR_MAP);
4629 /* Update monsters */
4630 p_ptr->update |= (PU_MONSTERS);
4633 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4637 msg_format("̤ÃΤβÎ(%d)¤ò²Î¤Ã¤¿¡£", spell);
4639 msg_format("You sing an unknown song: %d.", spell);
4644 if (p_ptr->magic_num1[0]) set_action(ACTION_SING);
4646 /* Recalculate bonuses */
4647 p_ptr->update |= (PU_BONUS | PU_HP);
4649 /* Redraw status bar */
4650 p_ptr->redraw |= (PR_STATUS);
4658 void do_cmd_cast(void)
4660 int item, sval, spell, realm;
4675 /* Require spell ability */
4676 if (!p_ptr->realm1 && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE))
4679 msg_print("¼öʸ¤ò¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4681 msg_print("You cannot cast spells!");
4688 if (p_ptr->blind || no_lite())
4691 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡ª");
4693 msg_print("You cannot see!");
4695 if (p_ptr->pclass == CLASS_FORCETRAINER)
4702 /* Not when confused */
4703 if (p_ptr->confused)
4706 msg_print("º®Í𤷤Ƥ¤¤Æ¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4708 msg_print("You are too confused!");
4714 prayer = spell_category_name(mp_ptr->spell_book);
4716 /* Restrict choices to spell books */
4717 item_tester_tval = mp_ptr->spell_book;
4721 q = "¤É¤Î¼öʸ½ñ¤ò»È¤¤¤Þ¤¹¤«? ";
4723 q = "Use which book? ";
4727 s = "¼öʸ½ñ¤¬¤Ê¤¤¡ª";
4729 s = "You have no spell books!";
4732 if (p_ptr->pclass == CLASS_FORCETRAINER)
4733 select_the_force = TRUE;
4734 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))){
4735 select_the_force = FALSE;
4738 select_the_force = FALSE;
4740 if (item == INVEN_FORCE) { /* the_force */
4744 /* Get the item (in the pack) */
4747 o_ptr = &inventory[item];
4750 /* Get the item (on the floor) */
4753 o_ptr = &o_list[0 - item];
4756 /* Access the item's sval */
4759 if ((p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE) && (o_ptr->tval == REALM2_BOOK)) increment = 32;
4762 /* Track the object kind */
4763 object_kind_track(o_ptr->k_idx);
4765 /* Hack -- Handle stuff */
4768 if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
4769 realm = o_ptr->tval - TV_LIFE_BOOK + 1;
4770 else if (increment) realm = p_ptr->realm2;
4771 else realm = p_ptr->realm1;
4773 /* Ask for a spell */
4775 if (!get_spell(&spell,
4776 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "±Ó¾§¤¹¤ë" : (mp_ptr->spell_book == TV_MUSIC_BOOK) ? "²Î¤¦" : "¾§¤¨¤ë"),
4779 if (spell == -2) msg_format("¤½¤ÎËܤˤÏÃΤäƤ¤¤ë%s¤¬¤Ê¤¤¡£", prayer);
4783 if (!get_spell(&spell, ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "recite" : "cast"),
4787 msg_format("You don't know any %ss in that book.", prayer);
4793 use_realm = tval2realm(o_ptr->tval);
4795 if (!is_magic(use_realm))
4797 s_ptr = &technic_info[use_realm - MIN_TECHNIC][spell];
4801 s_ptr = &mp_ptr->info[realm - 1][spell];
4804 /* Extract mana consumption rate */
4805 need_mana = mod_need_mana(s_ptr->smana, spell, realm);
4807 /* Verify "dangerous" spells */
4808 if (need_mana > p_ptr->csp)
4810 if (flush_failure) flush();
4814 msg_format("¤½¤Î%s¤ò%s¤Î¤Ë½½Ê¬¤Ê¥Þ¥¸¥Ã¥¯¥Ý¥¤¥ó¥È¤¬¤Ê¤¤¡£",prayer,
4815 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "±Ó¾§¤¹¤ë" : (mp_ptr->spell_book == TV_LIFE_BOOK) ? "²Î¤¦" : "¾§¤¨¤ë"));
4817 msg_format("You do not have enough mana to %s this %s.",
4818 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "recite" : "cast"),
4823 if (!over_exert) return;
4827 if (!get_check_strict("¤½¤ì¤Ç¤âÄ©À路¤Þ¤¹¤«? ", CHECK_OKAY_CANCEL)) return;
4829 if (!get_check_strict("Attempt it anyway? ", CHECK_OKAY_CANCEL)) return;
4835 /* Spell failure chance */
4836 chance = spell_chance(spell, use_realm);
4839 if (randint0(100) < chance)
4841 if (flush_failure) flush();
4844 msg_format("%s¤ò¤¦¤Þ¤¯¾§¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡ª", prayer);
4846 msg_format("You failed to get the %s off!", prayer);
4854 if (randint1(100) < chance) chg_virtue(V_VITALITY, -1);
4857 if (randint1(100) < chance) chg_virtue(V_UNLIFE, -1);
4860 if (randint1(100) < chance) chg_virtue(V_NATURE, -1);
4863 if (randint1(100) < chance) chg_virtue(V_JUSTICE, 1);
4866 if (randint1(100) < chance) chg_virtue(V_JUSTICE, -1);
4869 if (randint1(100) < chance) chg_virtue(V_KNOWLEDGE, -1);
4873 if (realm == REALM_TRUMP)
4875 cast_trump_spell(spell, FALSE);
4877 else if ((o_ptr->tval == TV_CHAOS_BOOK) && (randint1(100) < spell))
4880 msg_print("¥«¥ª¥¹Åª¤Ê¸ú²Ì¤òȯÀ¸¤·¤¿¡ª");
4882 msg_print("You produce a chaotic effect!");
4887 else if ((o_ptr->tval == TV_DEATH_BOOK) && (randint1(100) < spell))
4889 if ((sval == 3) && one_in_(2))
4891 sanity_blast(0, TRUE);
4896 msg_print("Äˤ¤¡ª");
4898 msg_print("It hurts!");
4902 take_hit(DAMAGE_LOSELIFE, damroll(o_ptr->sval + 1, 6), "°Å¹õËâË¡¤ÎµÕή", -1);
4904 take_hit(DAMAGE_LOSELIFE, damroll(o_ptr->sval + 1, 6), "a miscast Death spell", -1);
4907 if ((spell > 15) && one_in_(6) && !p_ptr->hold_life)
4908 lose_exp(spell * 250);
4911 else if ((o_ptr->tval == TV_MUSIC_BOOK) && (randint1(200) < spell))
4914 msg_print("¤¤¤ä¤Ê²»¤¬¶Á¤¤¤¿");
4916 msg_print("An infernal sound echoed.");
4919 aggravate_monsters(0);
4921 if (randint1(100) >= chance)
4922 chg_virtue(V_CHANCE,-1);
4931 case REALM_LIFE: /* * LIFE * */
4932 cast = cast_life_spell(spell);
4934 case REALM_SORCERY: /* * SORCERY * */
4935 cast = cast_sorcery_spell(spell);
4937 case REALM_NATURE: /* * NATURE * */
4938 cast = cast_nature_spell(spell);
4940 case REALM_CHAOS: /* * CHAOS * */
4941 cast = cast_chaos_spell(spell);
4943 case REALM_DEATH: /* * DEATH * */
4944 cast = cast_death_spell(spell);
4946 case REALM_TRUMP: /* TRUMP */
4947 cast = cast_trump_spell(spell, TRUE);
4949 case REALM_ARCANE: /* ARCANE */
4950 cast = cast_arcane_spell(spell);
4952 case REALM_ENCHANT: /* ENCHANT */
4953 cast = cast_enchant_spell(spell);
4955 case REALM_DAEMON: /* DAEMON */
4956 cast = cast_daemon_spell(spell);
4958 case REALM_CRUSADE: /* CRUSADE */
4959 cast = cast_crusade_spell(spell);
4961 case REALM_MUSIC: /* MUSIC */
4962 cast = cast_music_spell(spell);
4966 msg_format("You cast a spell from an unknown realm: realm %d, spell %d.", realm, spell);
4970 /* Canceled spells cost neither a turn nor mana */
4973 if (randint1(100) < chance)
4974 chg_virtue(V_CHANCE,1);
4976 /* A spell was cast */
4978 (p_ptr->spell_worked2 & (1L << spell)) :
4979 (p_ptr->spell_worked1 & (1L << spell)))
4980 && (p_ptr->pclass != CLASS_SORCERER)
4981 && (p_ptr->pclass != CLASS_RED_MAGE))
4983 int e = s_ptr->sexp;
4985 /* The spell worked */
4986 if (realm == p_ptr->realm1)
4988 p_ptr->spell_worked1 |= (1L << spell);
4992 p_ptr->spell_worked2 |= (1L << spell);
4995 /* Gain experience */
4996 gain_exp(e * s_ptr->slevel);
4998 /* Redraw object recall */
4999 p_ptr->window |= (PW_OBJECT);
5004 chg_virtue(V_TEMPERANCE, 1);
5005 chg_virtue(V_COMPASSION, 1);
5006 chg_virtue(V_VITALITY, 1);
5007 chg_virtue(V_DILIGENCE, 1);
5010 chg_virtue(V_UNLIFE, 1);
5011 chg_virtue(V_JUSTICE, -1);
5012 chg_virtue(V_FAITH, -1);
5013 chg_virtue(V_VITALITY, -1);
5016 chg_virtue(V_JUSTICE, -1);
5017 chg_virtue(V_FAITH, -1);
5018 chg_virtue(V_HONOUR, -1);
5019 chg_virtue(V_TEMPERANCE, -1);
5022 chg_virtue(V_FAITH, 1);
5023 chg_virtue(V_JUSTICE, 1);
5024 chg_virtue(V_SACRIFICE, 1);
5025 chg_virtue(V_HONOUR, 1);
5028 chg_virtue(V_NATURE, 1);
5029 chg_virtue(V_HARMONY, 1);
5032 chg_virtue(V_KNOWLEDGE, 1);
5039 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_TEMPERANCE, 1);
5040 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_COMPASSION, 1);
5041 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_VITALITY, 1);
5042 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_DILIGENCE, 1);
5045 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_UNLIFE, 1);
5046 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_JUSTICE, -1);
5047 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_FAITH, -1);
5048 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_VITALITY, -1);
5051 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_JUSTICE, -1);
5052 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_FAITH, -1);
5053 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_HONOUR, -1);
5054 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_TEMPERANCE, -1);
5057 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_FAITH, 1);
5058 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_JUSTICE, 1);
5059 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_SACRIFICE, 1);
5060 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_HONOUR, 1);
5063 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_NATURE, 1);
5064 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_HARMONY, 1);
5067 if (mp_ptr->spell_xtra & MAGIC_GAIN_EXP)
5069 s16b cur_exp = p_ptr->spell_exp[(increment ? 32 : 0)+spell];
5072 if (cur_exp < SPELL_EXP_BEGINNER)
5074 else if (cur_exp < SPELL_EXP_SKILLED)
5076 if ((dun_level > 4) && ((dun_level + 10) > p_ptr->lev))
5079 else if (cur_exp < SPELL_EXP_EXPERT)
5081 if (((dun_level + 5) > p_ptr->lev) && ((dun_level + 5) > s_ptr->slevel))
5084 else if ((cur_exp < SPELL_EXP_MASTER) && !increment)
5086 if (((dun_level + 5) > p_ptr->lev) && (dun_level > s_ptr->slevel))
5089 p_ptr->spell_exp[(increment ? 32 : 0) + spell] += exp_gain;
5096 /* Sufficient mana */
5097 if (need_mana <= p_ptr->csp)
5100 p_ptr->csp -= need_mana;
5103 /* Over-exert the player */
5106 int oops = need_mana;
5110 p_ptr->csp_frac = 0;
5114 msg_print("Àº¿À¤ò½¸Ã椷¤¹¤®¤Æµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
5116 msg_print("You faint from the effort!");
5120 /* Hack -- Bypass free action */
5121 (void)set_paralyzed(p_ptr->paralyzed + randint1(5 * oops + 1));
5126 chg_virtue(V_VITALITY, -10);
5129 chg_virtue(V_UNLIFE, -10);
5132 chg_virtue(V_JUSTICE, 10);
5135 chg_virtue(V_NATURE, -10);
5138 chg_virtue(V_JUSTICE, -10);
5141 chg_virtue(V_KNOWLEDGE, -10);
5145 /* Damage CON (possibly permanently) */
5146 if (randint0(100) < 50)
5148 bool perm = (randint0(100) < 25);
5152 msg_print("ÂΤò°¤¯¤·¤Æ¤·¤Þ¤Ã¤¿¡ª");
5154 msg_print("You have damaged your health!");
5158 /* Reduce constitution */
5159 (void)dec_stat(A_CON, 15 + randint1(10), perm);
5164 p_ptr->redraw |= (PR_MANA);
5167 p_ptr->window |= (PW_PLAYER);
5168 p_ptr->window |= (PW_SPELL);
5173 * Pray a prayer -- Unused in Hengband
5175 void do_cmd_pray(void)
5177 msg_print("Praying is not used in Hengband. Use magic spell casting instead.");
5180 static bool ang_sort_comp_pet_dismiss(vptr u, vptr v, int a, int b)
5182 u16b *who = (u16b*)(u);
5187 monster_type *m_ptr1 = &m_list[w1];
5188 monster_type *m_ptr2 = &m_list[w2];
5189 monster_race *r_ptr1 = &r_info[m_ptr1->r_idx];
5190 monster_race *r_ptr2 = &r_info[m_ptr2->r_idx];
5195 if (w1 == p_ptr->riding) return TRUE;
5196 if (w2 == p_ptr->riding) return FALSE;
5198 if (m_ptr1->nickname && !m_ptr2->nickname) return TRUE;
5199 if (m_ptr2->nickname && !m_ptr1->nickname) return FALSE;
5201 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return TRUE;
5202 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return FALSE;
5204 if (r_ptr1->level > r_ptr2->level) return TRUE;
5205 if (r_ptr2->level > r_ptr1->level) return FALSE;
5207 if (m_ptr1->hp > m_ptr2->hp) return TRUE;
5208 if (m_ptr2->hp > m_ptr1->hp) return FALSE;
5213 int calculate_upkeep(void)
5215 s32b old_friend_align = friend_align;
5217 bool have_a_unique = FALSE;
5220 total_friend_levels = 0;
5223 for (m_idx = m_max - 1; m_idx >=1; m_idx--)
5225 monster_type *m_ptr;
5226 monster_race *r_ptr;
5228 m_ptr = &m_list[m_idx];
5229 if (!m_ptr->r_idx) continue;
5230 r_ptr = &r_info[m_ptr->r_idx];
5235 if (r_ptr->flags1 & RF1_UNIQUE)
5237 if (p_ptr->pclass == CLASS_CAVALRY)
5239 if (p_ptr->riding == m_idx)
5240 total_friend_levels += (r_ptr->level+5)*2;
5241 else if (!have_a_unique && (r_info[m_ptr->r_idx].flags7 & RF7_RIDING))
5242 total_friend_levels += (r_ptr->level+5)*7/2;
5244 total_friend_levels += (r_ptr->level+5)*10;
5245 have_a_unique = TRUE;
5248 total_friend_levels += (r_ptr->level+5)*10;
5251 total_friend_levels += r_ptr->level;
5253 /* Determine pet alignment */
5254 if (r_ptr->flags3 & RF3_GOOD) friend_align += r_ptr->level;
5255 if (r_ptr->flags3 & RF3_EVIL) friend_align -= r_ptr->level;
5258 if (old_friend_align != friend_align) p_ptr->update |= (PU_BONUS);
5262 upkeep_factor = (total_friend_levels - (p_ptr->lev * 80 / (cp_ptr->pet_upkeep_div)));
5263 if (upkeep_factor < 0) upkeep_factor = 0;
5264 if (upkeep_factor > 1000) upkeep_factor = 1000;
5265 return upkeep_factor;
5271 void do_cmd_pet_dismiss(void)
5273 monster_type *m_ptr;
5274 bool all_pets = FALSE;
5288 /* Allocate the "who" array */
5289 C_MAKE(who, max_m_idx, u16b);
5291 /* Process the monsters (backwards) */
5292 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
5294 if (is_pet(&m_list[pet_ctr]))
5295 who[max_pet++] = pet_ctr;
5298 /* Select the sort method */
5299 ang_sort_comp = ang_sort_comp_pet_dismiss;
5300 ang_sort_swap = ang_sort_swap_hook;
5302 ang_sort(who, &dummy_why, max_pet);
5304 /* Process the monsters (backwards) */
5305 for (i = 0; i < max_pet; i++)
5308 char friend_name[80];
5312 /* Access the monster */
5314 m_ptr = &m_list[pet_ctr];
5316 delete_this = FALSE;
5317 kakunin = ((pet_ctr == p_ptr->riding) || (m_ptr->nickname));
5318 monster_desc(friend_name, m_ptr, MD_ASSUME_VISIBLE);
5322 /* Hack -- health bar for this monster */
5323 health_track(pet_ctr);
5325 /* Hack -- handle stuff */
5329 sprintf(buf, "%s¤òÊü¤·¤Þ¤¹¤«¡© [Yes/No/Unnamed (%dɤ)]", friend_name, max_pet-i);
5331 sprintf(buf, "Dismiss %s? [Yes/No/Unnamed (%d remain)]", friend_name, max_pet-i);
5336 move_cursor_relative(m_ptr->fy, m_ptr->fx);
5342 if (ch == 'Y' || ch == 'y')
5349 sprintf(buf, "ËÜÅö¤Ë¤è¤í¤·¤¤¤Ç¤¹¤«¡© (%s) ", friend_name);
5351 sprintf(buf, "Are you sure? (%s) ", friend_name);
5353 if (!get_check(buf))
5354 delete_this = FALSE;
5359 if (ch == 'U' || ch == 'u')
5365 if (ch == ESCAPE || ch == 'N' || ch == 'n')
5372 if ((all_pets && !kakunin) || (!all_pets && delete_this))
5374 if (record_named_pet && m_ptr->nickname)
5378 monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
5379 do_cmd_write_nikki(NIKKI_NAMED_PET, 2, m_name);
5382 if (pet_ctr == p_ptr->riding)
5385 msg_format("%s¤«¤é¹ß¤ê¤¿¡£", friend_name);
5387 msg_format("You have got off %s. ", friend_name);
5392 /* Update the monsters */
5393 p_ptr->update |= (PU_BONUS | PU_MONSTERS);
5394 p_ptr->redraw |= (PR_EXTRA);
5397 /* HACK : Add the line to message buffer */
5399 sprintf(buf, "%s ¤òÊü¤·¤¿¡£", friend_name);
5401 sprintf(buf, "Dismissed %s.", friend_name);
5404 p_ptr->window |= (PW_MESSAGE);
5407 delete_monster_idx(pet_ctr);
5416 C_KILL(who, max_m_idx, u16b);
5419 msg_format("%d ɤ¤Î¥Ú¥Ã¥È¤òÊü¤·¤Þ¤·¤¿¡£", Dismissed);
5421 msg_format("You have dismissed %d pet%s.", Dismissed,
5422 (Dismissed == 1 ? "" : "s"));
5424 if (Dismissed == 0 && all_pets)
5426 msg_print("'U'nnamed ¤Ï¡¢¾èÇϰʳ°¤Î̾Á°¤Î¤Ê¤¤¥Ú¥Ã¥È¤À¤±¤òÁ´¤Æ²òÊü¤·¤Þ¤¹¡£");
5428 msg_print("'U'nnamed means all your pets except named pets and your mount.");
5431 p_ptr->update |= (PU_MON_LITE);
5434 bool rakuba(int dam, bool force)
5436 int i, y, x, oy, ox;
5437 int sn = 0, sy = 0, sx = 0;
5439 monster_type *m_ptr = &m_list[p_ptr->riding];
5440 monster_race *r_ptr = &r_info[m_ptr->r_idx];
5442 if (!p_ptr->riding) return FALSE;
5443 if (p_ptr->wild_mode) return FALSE;
5445 if (dam >= 0 || force)
5449 int cur = p_ptr->skill_exp[GINOU_RIDING];
5450 int max = s_info[p_ptr->pclass].s_max[GINOU_RIDING];
5451 int ridinglevel = r_ptr->level;
5453 /* ÍîÇϤΤ·¤ä¤¹¤µ */
5454 int rakubalevel = r_ptr->level;
5455 if (p_ptr->riding_ryoute) rakubalevel += 20;
5457 if ((cur < max) && (max > 1000) &&
5458 (dam / 2 + ridinglevel) > (cur / 30 + 10))
5462 if (ridinglevel > (cur / 100 + 15))
5463 inc += 1 + (ridinglevel - cur / 100 - 15);
5467 p_ptr->skill_exp[GINOU_RIDING] = MIN(max, cur + inc);
5470 /* ¥ì¥Ù¥ë¤ÎÄ㤤¾èÇϤ«¤é¤ÏÍîÇϤ·¤Ë¤¯¤¤ */
5471 if (randint0(dam / 2 + rakubalevel * 2) < cur / 30 + 10)
5473 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))
5480 /* Check around the player */
5481 for (i = 0; i < 8; i++)
5485 /* Access the location */
5486 y = py + ddy_ddd[i];
5487 x = px + ddx_ddd[i];
5489 c_ptr = &cave[y][x];
5491 /* Skip non-empty grids */
5492 if (cave_perma_grid(c_ptr)) continue;
5493 if (!cave_empty_grid2(c_ptr)) continue;
5495 if (c_ptr->m_idx) continue;
5497 /* Count "safe" grids */
5500 /* Randomize choice */
5501 if (randint0(sn) > 0) continue;
5503 /* Save the safe location */
5508 monster_desc(m_name, m_ptr, 0);
5510 msg_format("%s¤«¤é¿¶¤êÍî¤È¤µ¤ì¤½¤¦¤Ë¤Ê¤Ã¤Æ¡¢Êɤˤ֤Ĥ«¤Ã¤¿¡£",m_name);
5511 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "Êɤؤξ×ÆÍ", -1);
5513 msg_format("You have nearly fallen from %s, but bumped into wall.",m_name);
5514 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "bumping into wall", -1);
5525 /* Redraw the old spot */
5528 /* Redraw the new spot */
5531 /* Check for new panel */
5536 p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5537 p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE;
5541 p_ptr->update |= (PU_BONUS);
5544 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
5546 /* Update the monsters */
5547 p_ptr->update |= (PU_DISTANCE);
5550 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5552 p_ptr->redraw |= (PR_EXTRA);
5554 /* Update health track of mount */
5555 p_ptr->redraw |= (PR_UHEALTH);
5557 if (p_ptr->ffall && !force)
5559 monster_desc(m_name, m_ptr, 0);
5561 msg_format("%s¤«¤éÍî¤Á¤¿¤¬¡¢¶õÃæ¤Ç¤¦¤Þ¤¯ÂÎÀª¤òΩ¤Æľ¤·¤ÆÃåÃϤ·¤¿¡£",m_name);
5563 msg_format("You are thrown from %s, but make a good landing.",m_name);
5568 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "ÍîÇÏ", -1);
5570 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "Falling from riding", -1);
5576 bool do_riding(bool force)
5578 int oy, ox, x, y, dir = 0;
5580 monster_type *m_ptr;
5582 if (!get_rep_dir2(&dir)) return FALSE;
5585 c_ptr = &cave[y][x];
5589 /* Skip non-empty grids */
5590 if (!cave_empty_bold2(y, x) || c_ptr->m_idx)
5593 msg_print("¤½¤Á¤é¤Ë¤Ï¹ß¤ê¤é¤ì¤Þ¤»¤ó¡£");
5595 msg_print("You cannot go to that direction.");
5600 p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5601 p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE;
5605 if (p_ptr->confused)
5608 msg_print("º®Í𤷤Ƥ¤¤Æ¾è¤ì¤Ê¤¤¡ª");
5610 msg_print("You are too confused!");
5614 if (!(c_ptr->m_idx))
5617 msg_print("¤½¤Î¾ì½ê¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
5619 msg_print("Here is no pet.");
5625 m_ptr = &m_list[c_ptr->m_idx];
5627 if (!is_pet(m_ptr) && !force)
5630 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï¥Ú¥Ã¥È¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£");
5632 msg_print("That monster is not a pet.");
5637 if (!(r_info[m_ptr->r_idx].flags7 & RF7_RIDING))
5640 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ë¤Ï¾è¤ì¤Ê¤µ¤½¤¦¤À¡£");
5642 msg_print("This monster doesn't seem suitable for riding.");
5647 if (!(p_ptr->pass_wall) && (c_ptr->feat >= FEAT_RUBBLE) && (c_ptr->feat <= FEAT_PERM_SOLID))
5650 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤ÏÊɤÎÃæ¤Ë¤¤¤ë¡£");
5652 msg_print("This monster is in the wall.");
5657 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)))
5660 msg_print("¥Ñ¥¿¡¼¥ó¤Î¾å¤«¤é¤Ï¾è¤ì¤Þ¤»¤ó¡£");
5662 msg_print("You cannot ride from on Pattern.");
5670 msg_print("¤½¤Î¾ì½ê¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
5672 msg_print("Here is no monster.");
5677 if (r_info[m_ptr->r_idx].level > randint1((p_ptr->skill_exp[GINOU_RIDING] / 50 + p_ptr->lev / 2 + 20)))
5680 msg_print("¤¦¤Þ¤¯¾è¤ì¤Ê¤«¤Ã¤¿¡£");
5682 msg_print("You failed to ride.");
5692 monster_desc(m_name, m_ptr, 0);
5695 msg_format("%s¤òµ¯¤³¤·¤¿¡£", m_name);
5697 msg_format("You have waked %s up.", m_name);
5701 p_ptr->riding = c_ptr->m_idx;
5703 /* Hack -- remove tracked monster */
5704 if (p_ptr->riding == p_ptr->health_who) health_track(0);
5707 /* Save the old location */
5711 /* Move the player to the safe location */
5715 /* Redraw the old spot */
5718 /* Redraw the new spot */
5721 /* Check for new panel */
5726 /* Mega-Hack -- Forget the view and lite */
5727 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
5730 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
5732 /* Update the monsters */
5733 p_ptr->update |= (PU_DISTANCE);
5735 /* Update the monsters */
5736 p_ptr->update |= (PU_BONUS);
5739 p_ptr->redraw |= (PR_MAP | PR_EXTRA);
5742 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5744 p_ptr->redraw |= (PR_UHEALTH);
5750 static void do_name_pet(void)
5752 monster_type *m_ptr;
5755 bool old_name = FALSE;
5756 bool old_target_pet = target_pet;
5759 if (!target_set(TARGET_KILL))
5761 target_pet = old_target_pet;
5764 target_pet = old_target_pet;
5766 if (cave[target_row][target_col].m_idx)
5768 m_ptr = &m_list[cave[target_row][target_col].m_idx];
5774 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï¥Ú¥Ã¥È¤Ç¤Ï¤Ê¤¤¡£");
5776 msg_format("This monster is not a pet.");
5780 if (r_info[m_ptr->r_idx].flags1 & RF1_UNIQUE)
5783 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Î̾Á°¤ÏÊѤ¨¤é¤ì¤Ê¤¤¡ª");
5785 msg_format("You cannot change name of this monster!");
5789 monster_desc(m_name, m_ptr, 0);
5793 msg_format("%s¤Ë̾Á°¤ò¤Ä¤±¤ë¡£", m_name);
5795 msg_format("Name %s.", m_name);
5800 /* Start with nothing */
5801 strcpy(out_val, "");
5803 /* Use old inscription */
5804 if (m_ptr->nickname)
5806 /* Start with the old inscription */
5807 strcpy(out_val, quark_str(m_ptr->nickname));
5811 /* Get a new inscription (possibly empty) */
5813 if (get_string("̾Á°: ", out_val, 15))
5815 if (get_string("Name: ", out_val, 15))
5821 /* Save the inscription */
5822 m_ptr->nickname = quark_add(out_val);
5823 if (record_named_pet)
5827 monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
5828 do_cmd_write_nikki(NIKKI_NAMED_PET, 0, m_name);
5833 if (record_named_pet && old_name)
5837 monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
5838 do_cmd_write_nikki(NIKKI_NAMED_PET, 1, m_name);
5840 m_ptr->nickname = 0;
5847 * Issue a pet command
5849 void do_cmd_pet(void)
5854 cptr power_desc[36];
5860 monster_type *m_ptr;
5867 char target_buf[160];
5872 power_desc[num] = "¥Ú¥Ã¥È¤òÊü¤¹";
5874 power_desc[num] = "dismiss pets";
5877 powers[num++] = PET_DISMISS;
5880 sprintf(target_buf,"¥Ú¥Ã¥È¤Î¥¿¡¼¥²¥Ã¥È¤ò»ØÄê (¸½ºß¡§%s)",
5881 (pet_t_m_idx ? r_name + r_info[m_list[pet_t_m_idx].r_idx].name : "»ØÄê¤Ê¤·"));
5883 sprintf(target_buf,"specify a targert of pet (now:%s)",
5884 (pet_t_m_idx ? r_name + r_info[m_list[pet_t_m_idx].r_idx].name : "nothing"));
5886 power_desc[num] = target_buf;
5888 powers[num++] = PET_TARGET;
5891 power_desc[num] = "¶á¤¯¤Ë¤¤¤í";
5893 power_desc[num] = "stay close";
5896 if (p_ptr->pet_follow_distance == PET_CLOSE_DIST) mode = num;
5897 powers[num++] = PET_STAY_CLOSE;
5900 power_desc[num] = "¤Ä¤¤¤ÆÍ褤";
5902 power_desc[num] = "follow me";
5905 if (p_ptr->pet_follow_distance == PET_FOLLOW_DIST) mode = num;
5906 powers[num++] = PET_FOLLOW_ME;
5909 power_desc[num] = "Ũ¤ò¸«¤Ä¤±¤ÆÅݤ»";
5911 power_desc[num] = "seek and destroy";
5914 if (p_ptr->pet_follow_distance == PET_DESTROY_DIST) mode = num;
5915 powers[num++] = PET_SEEK_AND_DESTROY;
5918 power_desc[num] = "¾¯¤·Î¥¤ì¤Æ¤¤¤í";
5920 power_desc[num] = "give me space";
5923 if (p_ptr->pet_follow_distance == PET_SPACE_DIST) mode = num;
5924 powers[num++] = PET_ALLOW_SPACE;
5927 power_desc[num] = "Î¥¤ì¤Æ¤¤¤í";
5929 power_desc[num] = "stay away";
5932 if (p_ptr->pet_follow_distance == PET_AWAY_DIST) mode = num;
5933 powers[num++] = PET_STAY_AWAY;
5935 if (p_ptr->pet_extra_flags & PF_OPEN_DOORS)
5938 power_desc[num] = "¥É¥¢¤ò³«¤±¤ë (¸½ºß:ON)";
5940 power_desc[num] = "pets open doors (now On)";
5947 power_desc[num] = "¥É¥¢¤ò³«¤±¤ë (¸½ºß:OFF)";
5949 power_desc[num] = "pets open doors (now Off)";
5953 powers[num++] = PET_OPEN_DOORS;
5955 if (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS)
5958 power_desc[num] = "¥¢¥¤¥Æ¥à¤ò½¦¤¦ (¸½ºß:ON)";
5960 power_desc[num] = "pets pick up items (now On)";
5967 power_desc[num] = "¥¢¥¤¥Æ¥à¤ò½¦¤¦ (¸½ºß:OFF)";
5969 power_desc[num] = "pets pick up items (now Off)";
5973 powers[num++] = PET_TAKE_ITEMS;
5975 if (p_ptr->pet_extra_flags & PF_TELEPORT)
5978 power_desc[num] = "¥Æ¥ì¥Ý¡¼¥È·ÏËâË¡¤ò»È¤¦ (¸½ºß:ON)";
5980 power_desc[num] = "allow teleport (now On)";
5987 power_desc[num] = "¥Æ¥ì¥Ý¡¼¥È·ÏËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
5989 power_desc[num] = "allow teleport (now Off)";
5993 powers[num++] = PET_TELEPORT;
5995 if (p_ptr->pet_extra_flags & PF_ATTACK_SPELL)
5998 power_desc[num] = "¹¶·âËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6000 power_desc[num] = "allow cast attack spell (now On)";
6007 power_desc[num] = "¹¶·âËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6009 power_desc[num] = "allow cast attack spell (now Off)";
6013 powers[num++] = PET_ATTACK_SPELL;
6015 if (p_ptr->pet_extra_flags & PF_SUMMON_SPELL)
6018 power_desc[num] = "¾¤´ËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6020 power_desc[num] = "allow cast summon spell (now On)";
6027 power_desc[num] = "¾¤´ËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6029 power_desc[num] = "allow cast summon spell (now Off)";
6033 powers[num++] = PET_SUMMON_SPELL;
6035 if (p_ptr->pet_extra_flags & PF_BALL_SPELL)
6038 power_desc[num] = "¥×¥ì¥¤¥ä¡¼¤ò´¬¤¹þ¤àÈÏ°ÏËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6040 power_desc[num] = "allow involve player in area spell (now On)";
6047 power_desc[num] = "¥×¥ì¥¤¥ä¡¼¤ò´¬¤¹þ¤àÈÏ°ÏËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6049 power_desc[num] = "allow involve player in area spell (now Off)";
6053 powers[num++] = PET_BALL_SPELL;
6058 power_desc[num] = "¥Ú¥Ã¥È¤«¤é¹ß¤ê¤ë";
6060 power_desc[num] = "get off a pet";
6067 power_desc[num] = "¥Ú¥Ã¥È¤Ë¾è¤ë";
6069 power_desc[num] = "ride a pet";
6073 powers[num++] = PET_RIDING;
6076 power_desc[num] = "¥Ú¥Ã¥È¤Ë̾Á°¤ò¤Ä¤±¤ë¡£";
6078 power_desc[num] = "name pets";
6081 powers[num++] = PET_NAME;
6083 if (p_ptr->riding && buki_motteruka(INVEN_RARM) && (empty_hands(FALSE) & 0x00000001) && ((inventory[INVEN_RARM].weight > 99) || (inventory[INVEN_RARM].tval == TV_POLEARM)))
6085 if (p_ptr->pet_extra_flags & PF_RYOUTE)
6088 power_desc[num] = "Éð´ï¤òÊÒ¼ê¤Ç»ý¤Ä";
6090 power_desc[num] = "use one hand to control a riding pet";
6097 power_desc[num] = "Éð´ï¤òξ¼ê¤Ç»ý¤Ä";
6099 power_desc[num] = "use both hands for a weapon.";
6104 powers[num++] = PET_RYOUTE;
6107 /* Nothing chosen yet */
6110 /* Build a prompt (accept all spells) */
6113 /* Build a prompt (accept all spells) */
6115 strnfmt(out_val, 78, "(¥³¥Þ¥ó¥É %c-%c¡¢'*'=°ìÍ÷¡¢ESC=½ªÎ») ¥³¥Þ¥ó¥É¤òÁª¤ó¤Ç¤¯¤À¤µ¤¤:",
6117 strnfmt(out_val, 78, "(Command %c-%c, *=List, ESC=exit) Select a command: ",
6120 I2A(0), I2A(num - 1));
6125 strnfmt(out_val, 78, "(¥³¥Þ¥ó¥É %c-%c¡¢'*'=°ìÍ÷¡¢ESC=½ªÎ») ¥³¥Þ¥ó¥É¤òÁª¤ó¤Ç¤¯¤À¤µ¤¤:",
6127 strnfmt(out_val, 78, "(Command %c-%c, *=List, ESC=exit) Select a command: ",
6130 I2A(0), '0' + num - 27);
6136 /* Save the screen */
6143 prt(format("%s%c) %s", (ctr == mode) ? "*" : " ", I2A(ctr), power_desc[ctr]), y + ctr, x);
6149 prt("", y + ctr, x);
6156 /* Get a command from the user */
6157 while (!flag && get_com(out_val, &choice, TRUE))
6159 /* Request redraw */
6160 if ((choice == ' ') || (choice == '*') || (choice == '?'))
6172 /* Save the screen */
6179 sprintf(buf, "%s%c) %s", (ctr == mode) ? "*" : " ", I2A(ctr), power_desc[ctr]);
6180 prt(buf, y + ctr, x);
6186 prt("", y + ctr, x);
6200 /* Restore the screen */
6208 if (isalpha(choice))
6211 ask = (isupper(choice));
6214 if (ask) choice = tolower(choice);
6216 /* Extract request */
6217 i = (islower(choice) ? A2I(choice) : -1);
6221 ask = FALSE; /* Can't uppercase digits */
6223 i = choice - '0' + 26;
6226 /* Totally Illegal */
6227 if ((i < 0) || (i >= num))
6238 strnfmt(buf, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡© ", power_desc[i]);
6240 strnfmt(buf, 78, "Use %s? ", power_desc[i]);
6244 /* Belay that order */
6245 if (!get_check(buf)) continue;
6252 /* Restore the screen */
6253 if (redraw) Term_load();
6255 /* Abort if needed */
6264 case PET_DISMISS: /* Dismiss pets */
6266 /* Check pets (backwards) */
6267 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
6269 /* Player has pet */
6270 if (is_pet(&m_list[pet_ctr])) break;
6276 msg_print("¥Ú¥Ã¥È¤¬¤¤¤Ê¤¤¡ª");
6278 msg_print("You have no pets!");
6282 do_cmd_pet_dismiss();
6283 (void)calculate_upkeep();
6288 project_length = -1;
6289 if (!target_set(TARGET_KILL)) pet_t_m_idx = 0;
6292 cave_type *c_ptr = &cave[target_row][target_col];
6293 if (c_ptr->m_idx && (m_list[c_ptr->m_idx].ml))
6295 pet_t_m_idx = cave[target_row][target_col].m_idx;
6296 p_ptr->pet_follow_distance = PET_DESTROY_DIST;
6298 else pet_t_m_idx = 0;
6305 case PET_STAY_CLOSE:
6307 p_ptr->pet_follow_distance = PET_CLOSE_DIST;
6314 p_ptr->pet_follow_distance = PET_FOLLOW_DIST;
6318 /* "Seek and destoy" */
6319 case PET_SEEK_AND_DESTROY:
6321 p_ptr->pet_follow_distance = PET_DESTROY_DIST;
6324 /* "Give me space" */
6325 case PET_ALLOW_SPACE:
6327 p_ptr->pet_follow_distance = PET_SPACE_DIST;
6333 p_ptr->pet_follow_distance = PET_AWAY_DIST;
6336 /* flag - allow pets to open doors */
6337 case PET_OPEN_DOORS:
6339 if (p_ptr->pet_extra_flags & PF_OPEN_DOORS) p_ptr->pet_extra_flags &= ~(PF_OPEN_DOORS);
6340 else p_ptr->pet_extra_flags |= (PF_OPEN_DOORS);
6343 /* flag - allow pets to pickup items */
6344 case PET_TAKE_ITEMS:
6346 if (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS)
6348 p_ptr->pet_extra_flags &= ~(PF_PICKUP_ITEMS);
6349 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
6351 /* Access the monster */
6352 m_ptr = &m_list[pet_ctr];
6356 monster_drop_carried_objects(m_ptr);
6360 else p_ptr->pet_extra_flags |= (PF_PICKUP_ITEMS);
6364 /* flag - allow pets to teleport */
6367 if (p_ptr->pet_extra_flags & PF_TELEPORT) p_ptr->pet_extra_flags &= ~(PF_TELEPORT);
6368 else p_ptr->pet_extra_flags |= (PF_TELEPORT);
6371 /* flag - allow pets to cast attack spell */
6372 case PET_ATTACK_SPELL:
6374 if (p_ptr->pet_extra_flags & PF_ATTACK_SPELL) p_ptr->pet_extra_flags &= ~(PF_ATTACK_SPELL);
6375 else p_ptr->pet_extra_flags |= (PF_ATTACK_SPELL);
6378 /* flag - allow pets to cast attack spell */
6379 case PET_SUMMON_SPELL:
6381 if (p_ptr->pet_extra_flags & PF_SUMMON_SPELL) p_ptr->pet_extra_flags &= ~(PF_SUMMON_SPELL);
6382 else p_ptr->pet_extra_flags |= (PF_SUMMON_SPELL);
6385 /* flag - allow pets to cast attack spell */
6386 case PET_BALL_SPELL:
6388 if (p_ptr->pet_extra_flags & PF_BALL_SPELL) p_ptr->pet_extra_flags &= ~(PF_BALL_SPELL);
6389 else p_ptr->pet_extra_flags |= (PF_BALL_SPELL);
6407 if (p_ptr->pet_extra_flags & PF_RYOUTE) p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
6408 else p_ptr->pet_extra_flags |= (PF_RYOUTE);
6409 p_ptr->update |= (PU_BONUS);