4 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
6 * This software may be copied and distributed for educational, research,
7 * and not for profit purposes provided that this copyright and statement
8 * are included in all such copies. Other copyrights may also apply.
11 /* Purpose: Spell/Prayer commands */
15 #include "spellstips.h"
17 cptr spell_categoly_name(int tval)
22 case TV_HISSATSU_BOOK:
31 case TV_HISSATSU_BOOK:
44 * Allow user to choose a spell/prayer from the given book.
46 * If a valid spell is chosen, saves it in '*sn' and returns TRUE
47 * If the user hits escape, returns FALSE, and set '*sn' to -1
48 * If there are no legal choices, returns FALSE, and sets '*sn' to -2
50 * The "prompt" should be "cast", "recite", or "study"
51 * The "known" should be TRUE for cast/pray, FALSE for study
54 bool select_the_force=FALSE;
56 static int get_spell(int *sn, cptr prompt, int sval, bool learned, int use_realm)
64 bool flag, redraw, okay;
72 int menu_line = (use_menu ? 1 : 0);
74 #ifdef ALLOW_REPEAT /* TNB */
76 /* Get the spell, if available */
79 /* Verify the spell */
80 if (spell_okay(*sn, learned, FALSE, use_realm))
87 #endif /* ALLOW_REPEAT -- TNB */
89 p = spell_categoly_name(mp_ptr->spell_book);
92 for (spell = 0; spell < 32; spell++)
94 /* Check for this spell */
95 if ((fake_spell_flags[sval] & (1L << spell)))
97 /* Collect this spell */
98 spells[num++] = spell;
102 /* Assume no usable spells */
105 /* Assume no spells available */
108 /* Check for "okay" spells */
109 for (i = 0; i < num; i++)
111 /* Look for "okay" spells */
112 if (spell_okay(spells[i], learned, FALSE, use_realm)) okay = TRUE;
115 /* No "okay" spells */
116 if (!okay) return (FALSE);
117 if (((use_realm) != p_ptr->realm1) && ((use_realm) != p_ptr->realm2) && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE)) return FALSE;
118 if (((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE)) && !is_magic(use_realm)) return FALSE;
119 if ((p_ptr->pclass == CLASS_RED_MAGE) && ((use_realm) != REALM_ARCANE) && (sval > 1)) return FALSE;
121 /* Assume cancelled */
124 /* Nothing chosen yet */
134 p_ptr->window |= (PW_SPELL);
140 /* Build a prompt (accept all spells) */
142 jverb1( prompt, jverb_buf );
143 (void) strnfmt(out_val, 78, "(%^s:%c-%c, '*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤Î%s¤ò%^s¤Þ¤¹¤«? ",
144 p, I2A(0), I2A(num - 1), p, jverb_buf );
146 (void)strnfmt(out_val, 78, "(%^ss %c-%c, *=List, ESC=exit) %^s which %s? ",
147 p, I2A(0), I2A(num - 1), prompt, p);
150 /* Get a spell from the user */
152 choice = (always_show_list || use_menu) ? ESCAPE:1;
155 if( choice==ESCAPE ) choice = ' ';
156 else if( !get_com(out_val, &choice, TRUE) )break;
158 if (use_menu && choice != ' ')
173 menu_line += (num - 1);
195 if (menu_line > num) menu_line -= num;
196 /* Display a list of spells */
197 print_spells(menu_line, spells, num, 1, 15, use_realm);
203 if ((choice == ' ') || (choice == '*') || (choice == '?'))
211 /* Save the screen */
214 /* Display a list of spells */
215 print_spells(menu_line, spells, num, 1, 15, use_realm);
221 if (use_menu) continue;
226 /* Restore the screen */
236 ask = (isupper(choice));
239 if (ask) choice = tolower(choice);
241 /* Extract request */
242 i = (islower(choice) ? A2I(choice) : -1);
245 /* Totally Illegal */
246 if ((i < 0) || (i >= num))
252 /* Save the spell index */
255 /* Require "okay" spells */
256 if (!spell_okay(spell, learned, FALSE, use_realm))
260 msg_format("¤½¤Î%s¤ò%s¤³¤È¤Ï¤Ç¤¤Þ¤»¤ó¡£", p, prompt);
262 msg_format("You may not %s that %s.", prompt, p);
273 /* Access the spell */
274 if (!is_magic(use_realm))
276 s_ptr = &technic_info[use_realm - MIN_TECHNIC][spell];
280 s_ptr = &mp_ptr->info[use_realm - 1][spell];
283 /* Extract mana consumption rate */
284 if (use_realm == REALM_HISSATSU)
286 need_mana = s_ptr->smana;
290 need_mana = mod_need_mana(s_ptr->smana, spell, use_realm);
295 jverb1( prompt, jverb_buf );
296 /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½¤ËÂбþ */
297 (void) strnfmt(tmp_val, 78, "%s(MP%d, ¼ºÇÔΨ%d%%)¤ò%s¤Þ¤¹¤«? ",
298 spell_names[technic2magic(use_realm)-1][spell], need_mana,
299 spell_chance(spell, use_realm),jverb_buf);
301 (void)strnfmt(tmp_val, 78, "%^s %s (%d mana, %d%% fail)? ",
302 prompt, spell_names[technic2magic(use_realm)-1][spell], need_mana,
303 spell_chance(spell, use_realm));
307 /* Belay that order */
308 if (!get_check(tmp_val)) continue;
316 /* Restore the screen */
317 if (redraw) screen_load();
324 p_ptr->window |= (PW_SPELL);
331 /* Abort if needed */
332 if (!flag) return (FALSE);
334 /* Save the choice */
337 #ifdef ALLOW_REPEAT /* TNB */
341 #endif /* ALLOW_REPEAT -- TNB */
348 static bool item_tester_learn_spell(object_type *o_ptr)
350 s32b choices = realm_choices2[p_ptr->pclass];
352 if (p_ptr->pclass == CLASS_PRIEST)
354 if (is_good_realm(p_ptr->realm1))
356 choices &= ~(CH_DEATH | CH_DAEMON);
360 choices &= ~(CH_LIFE | CH_CRUSADE);
364 if ((o_ptr->tval < TV_LIFE_BOOK) || (o_ptr->tval > (TV_LIFE_BOOK + MAX_REALM - 1))) return (FALSE);
365 if ((o_ptr->tval == TV_MUSIC_BOOK) && (p_ptr->pclass == CLASS_BARD)) return (TRUE);
366 else if (!is_magic(tval2realm(o_ptr->tval))) return FALSE;
367 if ((REALM1_BOOK == o_ptr->tval) || (REALM2_BOOK == o_ptr->tval)) return (TRUE);
368 if (choices & (0x0001 << (tval2realm(o_ptr->tval) - 1))) return (TRUE);
374 * Peruse the spells/prayers in a book
376 * Note that *all* spells in the book are listed
378 * Note that browsing is allowed while confused or blind,
379 * and in the dark, primarily to allow browsing in stores.
381 void do_cmd_browse(void)
383 int item, sval, use_realm = 0, j, line;
396 /* Warriors are illiterate */
397 if (!(p_ptr->realm1 || p_ptr->realm2) && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE))
400 msg_print("ËܤòÆɤळ¤È¤¬¤Ç¤¤Ê¤¤¡ª");
402 msg_print("You cannot read books!");
408 if (p_ptr->special_defense & KATA_MUSOU)
410 set_action(ACTION_NONE);
413 /* Restrict choices to "useful" books */
414 if (p_ptr->realm2 == REALM_NONE) item_tester_tval = mp_ptr->spell_book;
415 else item_tester_hook = item_tester_learn_spell;
419 q = "¤É¤ÎËܤòÆɤߤޤ¹¤«? ";
421 q = "Browse which book? ";
425 s = "Æɤá¤ëËܤ¬¤Ê¤¤¡£";
427 s = "You have no books that you can read.";
430 if (p_ptr->pclass == CLASS_FORCETRAINER)
431 select_the_force = TRUE;
432 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))){
433 select_the_force = FALSE;
436 select_the_force = FALSE;
438 if (item == INVEN_FORCE) { /* the_force */
439 do_cmd_mind_browse();
442 /* Get the item (in the pack) */
445 o_ptr = &inventory[item];
448 /* Get the item (on the floor) */
451 o_ptr = &o_list[0 - item];
454 /* Access the item's sval */
457 use_realm = tval2realm(o_ptr->tval);
458 if ((p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE) && is_magic(use_realm))
460 if (o_ptr->tval == REALM2_BOOK) increment = 32;
461 else if (o_ptr->tval != REALM1_BOOK) increment = 64;
464 /* Track the object kind */
465 object_kind_track(o_ptr->k_idx);
467 /* Hack -- Handle stuff */
472 for (spell = 0; spell < 32; spell++)
474 /* Check for this spell */
475 if ((fake_spell_flags[sval] & (1L << spell)))
477 /* Collect this spell */
478 spells[num++] = spell;
483 /* Save the screen */
486 /* Clear the top line */
489 /* Keep browsing spells. Exit browsing on cancel. */
492 /* Ask for a spell, allow cancel */
494 if (!get_spell(&spell, "Æɤà", o_ptr->sval, TRUE, use_realm))
496 if (!get_spell(&spell, "browse", o_ptr->sval, TRUE, use_realm))
499 /* If cancelled, leave immediately. */
500 if (spell == -1) break;
502 /* Display a list of spells */
503 print_spells(0, spells, num, 1, 15, use_realm);
505 /* Notify that there's nothing to see, and wait. */
506 if (use_realm == REALM_HISSATSU)
508 prt("Æɤá¤ëµ»¤¬¤Ê¤¤¡£", 0, 0);
510 prt("No techniques to browse.", 0, 0);
514 prt("Æɤá¤ë¼öʸ¤¬¤Ê¤¤¡£", 0, 0);
516 prt("No spells to browse.", 0, 0);
521 /* Restore the screen */
527 /* Clear lines, position cursor (really should use strlen here) */
528 Term_erase(14, 14, 255);
529 Term_erase(14, 13, 255);
530 Term_erase(14, 12, 255);
531 Term_erase(14, 11, 255);
533 /* Access the spell */
534 if (!is_magic(use_realm))
536 s_ptr = &technic_info[use_realm - MIN_TECHNIC][spell];
540 s_ptr = &mp_ptr->info[use_realm - 1][spell];
543 roff_to_buf(spell_tips[technic2magic(use_realm)-1][spell] ,62, temp, sizeof(temp));
544 for(j=0, line = 11;temp[j];j+=(1+strlen(&temp[j])))
546 prt(&temp[j], line, 15);
551 /* Restore the screen */
556 static void change_realm2(int next_realm)
561 for (i = 0; i < 64; i++)
563 p_ptr->spell_order[j] = p_ptr->spell_order[i];
564 if(p_ptr->spell_order[i] < 32) j++;
567 p_ptr->spell_order[j] = 99;
569 for (i = 32; i < 64; i++)
571 p_ptr->spell_exp[i] = 0;
573 p_ptr->spell_learned2 = 0L;
574 p_ptr->spell_worked2 = 0L;
575 p_ptr->spell_forgotten2 = 0L;
578 sprintf(tmp,"ËâË¡¤ÎÎΰè¤ò%s¤«¤é%s¤ËÊѹ¹¤·¤¿¡£", realm_names[p_ptr->realm2], realm_names[next_realm]);
580 sprintf(tmp,"change magic realm from %s to %s.", realm_names[p_ptr->realm2], realm_names[next_realm]);
582 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
583 p_ptr->old_realm |= 1 << (p_ptr->realm2-1);
584 p_ptr->realm2 = next_realm;
586 p_ptr->notice |= (PN_REORDER);
587 p_ptr->update |= (PU_SPELLS);
593 * Study a book to gain a new spell/prayer
595 void do_cmd_study(void)
599 bool learned = FALSE;
601 /* Spells of realm2 will have an increment of +32 */
604 cptr p = spell_categoly_name(mp_ptr->spell_book);
613 msg_print("ËܤòÆɤळ¤È¤¬¤Ç¤¤Ê¤¤¡ª");
615 msg_print("You cannot read books!");
621 if (p_ptr->blind || no_lite())
624 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡ª");
626 msg_print("You cannot see!");
635 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡ª");
637 msg_print("You are too confused!");
643 if (!(p_ptr->new_spells))
646 msg_format("¿·¤·¤¤%s¤ò³Ð¤¨¤ë¤³¤È¤Ï¤Ç¤¤Ê¤¤¡ª", p);
648 msg_format("You cannot learn any new %ss!", p);
654 if (p_ptr->special_defense & KATA_MUSOU)
656 set_action(ACTION_NONE);
659 p = spell_categoly_name(mp_ptr->spell_book);
662 if( p_ptr->new_spells < 10 ){
663 msg_format("¤¢¤È %d ¤Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
665 msg_format("¤¢¤È %d ¸Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
668 msg_format("You can learn %d new %s%s.", p_ptr->new_spells, p,
669 (p_ptr->new_spells == 1?"":"s"));
675 /* Restrict choices to "useful" books */
676 if (p_ptr->realm2 == REALM_NONE) item_tester_tval = mp_ptr->spell_book;
677 else item_tester_hook = item_tester_learn_spell;
681 q = "¤É¤ÎËܤ«¤é³Ø¤Ó¤Þ¤¹¤«? ";
683 q = "Study which book? ";
687 s = "Æɤá¤ëËܤ¬¤Ê¤¤¡£";
689 s = "You have no books that you can read.";
692 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
694 /* Get the item (in the pack) */
697 o_ptr = &inventory[item];
700 /* Get the item (on the floor) */
703 o_ptr = &o_list[0 - item];
706 /* Access the item's sval */
709 if (o_ptr->tval == REALM2_BOOK) increment = 32;
710 else if (o_ptr->tval != REALM1_BOOK)
713 if (!get_check("ËÜÅö¤ËËâË¡¤ÎÎΰè¤òÊѹ¹¤·¤Þ¤¹¤«¡©")) return;
715 if (!get_check("Really, change magic realm? ")) return;
717 change_realm2(tval2realm(o_ptr->tval));
721 /* Track the object kind */
722 object_kind_track(o_ptr->k_idx);
724 /* Hack -- Handle stuff */
727 /* Mage -- Learn a selected spell */
728 if (mp_ptr->spell_book != TV_LIFE_BOOK)
730 /* Ask for a spell, allow cancel */
732 if (!get_spell(&spell, "³Ø¤Ö", sval, FALSE, o_ptr->tval - TV_LIFE_BOOK + 1)
733 && (spell == -1)) return;
735 if (!get_spell(&spell, "study", sval, FALSE, o_ptr->tval - TV_LIFE_BOOK + 1)
736 && (spell == -1)) return;
741 /* Priest -- Learn a random prayer */
749 for (spell = 0; spell < 32; spell++)
751 /* Check spells in the book */
752 if ((fake_spell_flags[sval] & (1L << spell)))
754 /* Skip non "okay" prayers */
755 if (!spell_okay(spell, FALSE, TRUE,
756 (increment ? p_ptr->realm2 : p_ptr->realm1))) continue;
758 /* Hack -- Prepare the randomizer */
761 /* Hack -- Apply the randomizer */
762 if (one_in_(k)) gift = spell;
770 /* Nothing to study */
775 msg_format("¤½¤ÎËܤˤϳؤ֤٤%s¤¬¤Ê¤¤¡£", p);
777 msg_format("You cannot learn any %ss in that book.", p);
786 if (increment) spell += increment;
788 /* Learn the spell */
791 if (p_ptr->spell_learned1 & (1L << spell)) learned = TRUE;
792 else p_ptr->spell_learned1 |= (1L << spell);
796 if (p_ptr->spell_learned2 & (1L << (spell - 32))) learned = TRUE;
797 else p_ptr->spell_learned2 |= (1L << (spell - 32));
802 int max_exp = (spell < 32) ? 1600 : 1400;
803 int old_exp = p_ptr->spell_exp[spell];
805 cptr name = spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell%32];
807 if (old_exp >= max_exp)
810 msg_format("¤½¤Î%s¤Ï´°Á´¤Ë»È¤¤¤³¤Ê¤»¤ë¤Î¤Ç³Ø¤ÖɬÍפϤʤ¤¡£", spell_categoly_name(mp_ptr->spell_book));
812 msg_format("You don't need to study this %s anymore.", spell_categoly_name(mp_ptr->spell_book));
817 if (!get_check(format("%s¤Î%s¤ò¤µ¤é¤Ë³Ø¤Ó¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©", name, spell_categoly_name(mp_ptr->spell_book))))
819 if (!get_check(format("You will study a %s of %s again. Are you sure? ", spell_categoly_name(mp_ptr->spell_book), name)))
824 else if (old_exp >= 1400)
826 p_ptr->spell_exp[spell] = 1600;
829 else if (old_exp >= 1200)
831 if (spell >= 32) p_ptr->spell_exp[spell] = 1400;
832 else p_ptr->spell_exp[spell] += 200;
835 else if (old_exp >= 900)
837 p_ptr->spell_exp[spell] = 1200+(old_exp-900)*2/3;
842 p_ptr->spell_exp[spell] = 900+(old_exp)/3;
846 msg_format("%s¤Î½ÏÎýÅÙ¤¬%s¤Ë¾å¤¬¤Ã¤¿¡£", name, shougou_moji[new_rank]);
848 msg_format("Your proficiency of %s is now %s rank.", name, shougou_moji[new_rank]);
853 /* Find the next open entry in "p_ptr->spell_order[]" */
854 for (i = 0; i < 64; i++)
856 /* Stop at the first empty space */
857 if (p_ptr->spell_order[i] == 99) break;
860 /* Add the spell to the known list */
861 p_ptr->spell_order[i++] = spell;
863 /* Mention the result */
865 /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½¤ËÂбþ */
866 if (mp_ptr->spell_book == TV_MUSIC_BOOK)
868 msg_format("%s¤ò³Ø¤ó¤À¡£",
869 spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32]);
873 msg_format("%s¤Î%s¤ò³Ø¤ó¤À¡£",
874 spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32] ,p);
877 msg_format("You have learned the %s of %s.",
878 p, spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32]);
885 if (mp_ptr->spell_book == TV_LIFE_BOOK)
886 chg_virtue(V_FAITH, 1);
887 else if (mp_ptr->spell_book == TV_DEATH_BOOK)
888 chg_virtue(V_UNLIFE, 1);
889 else if (mp_ptr->spell_book == TV_NATURE_BOOK)
890 chg_virtue(V_NATURE, 1);
892 chg_virtue(V_KNOWLEDGE, 1);
897 /* One less spell available */
898 p_ptr->learned_spells++;
900 /* Message if needed */
901 if (p_ptr->new_spells)
905 if( p_ptr->new_spells < 10 ){
906 msg_format("¤¢¤È %d ¤Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
908 msg_format("¤¢¤È %d ¸Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
911 msg_format("You can learn %d more %s%s.",
912 p_ptr->new_spells, p,
913 (p_ptr->new_spells != 1) ? "s" : "");
920 p_ptr->update |= (PU_SPELLS);
923 /* Redraw object recall */
924 p_ptr->window |= (PW_OBJECT);
928 static void wild_magic(int spell)
931 int type = SUMMON_BIZARRE1 + randint0(6);
933 if (type < SUMMON_BIZARRE1) type = SUMMON_BIZARRE1;
934 else if (type > SUMMON_BIZARRE6) type = SUMMON_BIZARRE6;
936 switch (randint1(spell) + randint1(8) + 1)
946 teleport_player(100);
950 teleport_player(200);
960 lite_area(damroll(2, 3), 2);
963 destroy_doors_touch();
968 sleep_monsters_touch();
972 trap_creation(py, px);
981 aggravate_monsters(0);
984 earthquake(py, px, 5);
988 (void)gain_random_mutation(0);
998 fire_ball(GF_CHAOS, 0, spell + 5, 1 + (spell / 10));
1005 while (counter++ < 8)
1007 (void)summon_specific(0, py, px, (dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET));
1012 activate_hi_summon(py, px, FALSE);
1015 (void)summon_cyber(-1, py, px);
1020 (void)activate_ty_curse(FALSE, &count);
1029 static bool cast_life_spell(int spell)
1032 int plev = p_ptr->lev;
1036 case 0: /* Cure Light Wounds */
1037 (void)hp_player(damroll(2, 10));
1038 (void)set_cut(p_ptr->cut - 10);
1041 (void)set_blessed(randint1(12) + 12, FALSE);
1043 case 2: /* Make Light Wounds */
1044 if (!get_aim_dir(&dir)) return FALSE;
1045 fire_ball_hide(GF_WOUNDS, dir, damroll(3 + ((plev - 1) / 5), 4), 0);
1047 case 3: /* Call Light */
1048 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1050 case 4: /* Detect Traps + Secret Doors */
1051 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1052 (void)detect_doors(DETECT_RAD_DEFAULT);
1053 (void)detect_stairs(DETECT_RAD_DEFAULT);
1055 case 5: /* Cure Medium Wounds */
1056 (void)hp_player(damroll(4, 10));
1057 (void)set_cut((p_ptr->cut / 2) - 20);
1059 case 6: /* Cure Poison */
1060 (void)set_poisoned(0);
1062 case 7: /* Satisfy Hunger */
1063 (void)set_food(PY_FOOD_MAX - 1);
1065 case 8: /* Remove Curse */
1069 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1071 msg_print("You feel as if someone is watching over you.");
1075 case 9: /* Make Medium Wounds */
1076 if (!get_aim_dir(&dir)) return FALSE;
1077 fire_ball_hide(GF_WOUNDS, dir, damroll(8 + ((plev - 5) / 4), 8), 0);
1079 case 10: /* Cure Critical Wounds */
1080 (void)hp_player(damroll(8, 10));
1085 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1086 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1089 map_area(DETECT_RAD_MAP);
1092 (void)turn_undead();
1094 case 14: /* Healing */
1095 (void)hp_player(300);
1099 case 15: /* Glyph of Warding */
1102 case 16: /* Dispel Curse */
1103 if (remove_all_curse())
1106 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1108 msg_print("You feel as if someone is watching over you.");
1112 case 17: /* Perception */
1113 return ident_spell(FALSE);
1114 case 18: /* Dispel Undead */
1115 (void)dispel_undead(randint1(plev * 5));
1117 case 19: /* 'Day of the Dove' */
1118 charm_monsters(plev * 2);
1120 case 20: /* Make Critical Wounds */
1121 if (!get_aim_dir(&dir)) return FALSE;
1122 fire_ball_hide(GF_WOUNDS, dir, damroll(5+((plev - 5) / 3), 15), 0);
1124 case 21: /* Word of Recall */
1125 if (!word_of_recall()) return FALSE;
1127 case 22: /* Alter Reality */
1130 case 23: /* Warding True */
1135 num_repro += MAX_REPRO;
1137 case 25: /* Detection True */
1138 (void)detect_all(DETECT_RAD_DEFAULT);
1140 case 26: /* Genocide Undead */
1141 (void)mass_genocide_undead(plev+50,TRUE);
1143 case 27: /* Clairvoyance */
1146 case 28: /* Restoration */
1147 (void)do_res_stat(A_STR);
1148 (void)do_res_stat(A_INT);
1149 (void)do_res_stat(A_WIS);
1150 (void)do_res_stat(A_DEX);
1151 (void)do_res_stat(A_CON);
1152 (void)do_res_stat(A_CHR);
1153 (void)restore_level();
1155 case 29: /* Healing True */
1156 (void)hp_player(2000);
1160 case 30: /* Holy Vision */
1161 return identify_fully(FALSE);
1162 case 31: /* Ultimate resistance */
1164 int v = randint1(plev/2)+plev/2;
1165 (void)set_fast(v, FALSE);
1166 set_oppose_acid(v, FALSE);
1167 set_oppose_elec(v, FALSE);
1168 set_oppose_fire(v, FALSE);
1169 set_oppose_cold(v, FALSE);
1170 set_oppose_pois(v, FALSE);
1171 set_ultimate_res(v, FALSE);
1176 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥é¥¤¥Õ¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1178 msg_format("You cast an unknown Life spell: %d.", spell);
1189 static bool cast_sorcery_spell(int spell)
1192 int plev = p_ptr->lev;
1196 case 0: /* Detect Monsters */
1197 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1199 case 1: /* Phase Door */
1200 teleport_player(10);
1202 case 2: /* Detect Doors and Traps */
1203 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1204 (void)detect_doors(DETECT_RAD_DEFAULT);
1205 (void)detect_stairs(DETECT_RAD_DEFAULT);
1207 case 3: /* Light Area */
1208 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1210 case 4: /* Confuse Monster */
1211 if (!get_aim_dir(&dir)) return FALSE;
1213 (void)confuse_monster(dir, (plev * 3) / 2);
1215 case 5: /* Teleport */
1216 teleport_player(plev * 5);
1218 case 6: /* Sleep Monster */
1219 if (!get_aim_dir(&dir)) return FALSE;
1221 (void)sleep_monster(dir);
1223 case 7: /* Recharging */
1224 return recharge(plev * 4);
1225 case 8: /* Magic Mapping */
1226 map_area(DETECT_RAD_MAP);
1228 case 9: /* Identify */
1229 return ident_spell(FALSE);
1230 case 10: /* Slow Monster */
1231 if (!get_aim_dir(&dir)) return FALSE;
1233 (void)slow_monster(dir);
1235 case 11: /* Mass Sleep */
1236 (void)sleep_monsters();
1238 case 12: /* Teleport Away */
1239 if (!get_aim_dir(&dir)) return FALSE;
1241 (void)fire_beam(GF_AWAY_ALL, dir, plev);
1243 case 13: /* Haste Self */
1244 (void)set_fast(randint1(20 + plev) + plev, FALSE);
1246 case 14: /* Detection True */
1247 (void)detect_all(DETECT_RAD_DEFAULT);
1249 case 15: /* Identify True */
1250 return identify_fully(FALSE);
1251 case 16: /* Detect Objects and Treasure*/
1252 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
1253 (void)detect_treasure(DETECT_RAD_DEFAULT);
1254 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
1256 case 17: /* Charm Monster */
1257 if (!get_aim_dir(&dir)) return FALSE;
1259 (void)charm_monster(dir, plev);
1261 case 18: /* Sense Minds */
1262 (void)set_tim_esp(randint1(30) + 25, FALSE);
1264 case 19: /* Teleport to town */
1267 case 20: /* Self knowledge */
1268 (void)self_knowledge();
1270 case 21: /* Teleport Level */
1272 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
1274 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
1276 (void)teleport_player_level();
1278 case 22: /* Word of Recall */
1279 if (!word_of_recall()) return FALSE;
1281 case 23: /* Dimension Door */
1283 msg_print("¼¡¸µ¤ÎÈ⤬³«¤¤¤¿¡£ÌÜŪÃϤòÁª¤ó¤Ç²¼¤µ¤¤¡£");
1285 msg_print("You open a dimensional gate. Choose a destination.");
1288 return dimension_door();
1289 case 24: /* Probing */
1292 case 25: /* Explosive Rune */
1295 case 26: /* Telekinesis */
1296 if (!get_aim_dir(&dir)) return FALSE;
1298 fetch(dir, plev * 15, FALSE);
1300 case 27: /* Clairvoyance */
1301 chg_virtue(V_KNOWLEDGE, 1);
1302 chg_virtue(V_ENLIGHTEN, 1);
1305 if (!(p_ptr->telepathy))
1307 (void)set_tim_esp(randint1(30) + 25, FALSE);
1310 case 28: /* Charm Monsters */
1311 charm_monsters(plev * 2);
1313 case 29: /* Alchemy */
1315 case 30: /* Banish */
1316 banish_monsters(plev * 4);
1318 case 31: /* Globe of Invulnerability */
1319 (void)set_invuln(randint1(4) + 4, FALSE);
1323 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥½¡¼¥µ¥ê¡¼¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1325 msg_format("You cast an unknown Sorcery spell: %d.", spell);
1335 static bool cast_nature_spell(int spell)
1339 int plev = p_ptr->lev;
1340 bool no_trump = FALSE;
1342 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1343 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1344 else beam = plev / 2;
1348 case 0: /* Detect Creatures */
1349 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1351 case 1: /* Lightning Bolt */
1352 project_length = plev / 6 + 2;
1353 if (!get_aim_dir(&dir)) return FALSE;
1355 fire_beam(GF_ELEC, dir,
1356 damroll(3 + ((plev - 1) / 5), 4));
1358 case 2: /* Detect Doors & Traps */
1359 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1360 (void)detect_doors(DETECT_RAD_DEFAULT);
1361 (void)detect_stairs(DETECT_RAD_DEFAULT);
1363 case 3: /* Produce Food */
1365 object_type forge, *q_ptr = &forge;
1368 msg_print("¿©ÎÁ¤òÀ¸À®¤·¤¿¡£");
1370 msg_print("A food ration is produced.");
1373 /* Create the food ration */
1374 object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_RATION));
1376 /* Drop the object from heaven */
1377 (void)drop_near(q_ptr, -1, py, px);
1381 case 4: /* Daylight */
1382 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1383 if ((prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
1386 msg_print("Æü¤Î¸÷¤¬¤¢¤Ê¤¿¤ÎÆùÂΤò¾Ç¤¬¤·¤¿¡ª");
1388 msg_print("The daylight scorches your flesh!");
1392 take_hit(DAMAGE_NOESCAPE, damroll(2, 2), "Æü¤Î¸÷", -1);
1394 take_hit(DAMAGE_NOESCAPE, damroll(2, 2), "daylight", -1);
1399 case 5: /* Animal Taming */
1400 if (!get_aim_dir(&dir)) return FALSE;
1402 (void)charm_animal(dir, plev);
1404 case 6: /* Resist Environment */
1405 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1406 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1407 (void)set_oppose_elec(randint1(20) + 20, FALSE);
1409 case 7: /* Cure Wounds & Poison */
1410 (void)hp_player(damroll(2, 8));
1412 (void)set_poisoned(0);
1414 case 8: /* Stone to Mud */
1415 if (!get_aim_dir(&dir)) return FALSE;
1417 (void)wall_to_mud(dir);
1419 case 9: /* Frost Bolt */
1420 if (!get_aim_dir(&dir)) return FALSE;
1421 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
1422 damroll(3 + ((plev - 5) / 4), 8));
1424 case 10: /* Nature Awareness -- downgraded */
1425 map_area(DETECT_RAD_MAP);
1426 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1427 (void)detect_doors(DETECT_RAD_DEFAULT);
1428 (void)detect_stairs(DETECT_RAD_DEFAULT);
1429 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1431 case 11: /* Fire Bolt */
1432 if (!get_aim_dir(&dir)) return FALSE;
1433 fire_bolt_or_beam(beam - 10, GF_FIRE, dir,
1434 damroll(5 + ((plev - 5) / 4), 8));
1436 case 12: /* Ray of Sunlight */
1437 if (!get_aim_dir(&dir)) return FALSE;
1439 msg_print("ÂÀÍÛ¸÷Àþ¤¬¸½¤ì¤¿¡£");
1441 msg_print("A line of sunlight appears.");
1444 (void)lite_line(dir);
1446 case 13: /* Entangle */
1449 case 14: /* Summon Animals */
1450 if (!(summon_specific(-1, py, px, plev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET))))
1453 case 15: /* Herbal Healing */
1454 (void)hp_player(500);
1457 (void)set_poisoned(0);
1459 case 16: /* Stair Building */
1460 (void)stair_creation();
1462 case 17: /* Stone Skin */
1463 (void)set_shield(randint1(20) + 30, FALSE);
1465 case 18: /* Resistance True */
1466 (void)set_oppose_acid(randint1(20) + 20, FALSE);
1467 (void)set_oppose_elec(randint1(20) + 20, FALSE);
1468 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1469 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1470 (void)set_oppose_pois(randint1(20) + 20, FALSE);
1472 case 19: /* Tree Creation */
1473 (void)tree_creation();
1475 case 20: /* Animal Friendship */
1476 (void)charm_animals(plev * 2);
1478 case 21: /* Stone Tell */
1479 return identify_fully(FALSE);
1480 case 22: /* Wall of Stone */
1483 case 23: /* Protection from Corrosion */
1485 case 24: /* Earthquake */
1486 earthquake(py, px, 10);
1488 case 25: /* Whirlwind Attack */
1492 monster_type *m_ptr;
1494 for (dir = 0; dir < 8; dir++)
1496 y = py + ddy_ddd[dir];
1497 x = px + ddx_ddd[dir];
1498 c_ptr = &cave[y][x];
1500 /* Get the monster */
1501 m_ptr = &m_list[c_ptr->m_idx];
1503 /* Hack -- attack monsters */
1504 if (c_ptr->m_idx && (m_ptr->ml || cave_floor_bold(y, x)))
1509 case 26: /* Blizzard */
1510 if (!get_aim_dir(&dir)) return FALSE;
1512 fire_ball(GF_COLD, dir, 70 + plev * 3 / 2, (plev / 12) + 1);
1514 case 27: /* Lightning Storm */
1515 if (!get_aim_dir(&dir)) return FALSE;
1516 fire_ball(GF_ELEC, dir, 90 + plev * 3 / 2, (plev / 12) + 1);
1518 case 28: /* Whirlpool */
1519 if (!get_aim_dir(&dir)) return FALSE;
1520 fire_ball(GF_WATER, dir, 100 + plev * 3 / 2, (plev / 12) + 1);
1522 case 29: /* Call Sunlight */
1523 fire_ball(GF_LITE, 0, 150, 8);
1524 chg_virtue(V_KNOWLEDGE, 1);
1525 chg_virtue(V_ENLIGHTEN, 1);
1527 if ((prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
1530 msg_print("Æü¸÷¤¬¤¢¤Ê¤¿¤ÎÆùÂΤò¾Ç¤¬¤·¤¿¡ª");
1532 msg_print("The sunlight scorches your flesh!");
1536 take_hit(DAMAGE_NOESCAPE, 50, "Æü¸÷", -1);
1538 take_hit(DAMAGE_NOESCAPE, 50, "sunlight", -1);
1543 case 30: /* Elemental Branding */
1544 brand_weapon(randint0(2));
1546 case 31: /* Nature's Wrath */
1547 (void)dispel_monsters(plev * 4);
1548 earthquake(py, px, 20 + (plev / 2));
1549 project(0, 1 + plev / 12, py, px,
1550 (100 + plev) * 2, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM, -1);
1554 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥Í¥¤¥Á¥ã¡¼¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1556 msg_format("You cast an unknown Nature spell: %d.", spell);
1564 msg_print("ưʪ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
1566 msg_print("No animals arrive.");
1574 static bool cast_chaos_spell(int spell)
1577 int plev = p_ptr->lev;
1579 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1580 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1581 else beam = plev / 2;
1585 case 0: /* Magic Missile */
1586 if (!get_aim_dir(&dir)) return FALSE;
1588 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
1589 damroll(3 + ((plev - 1) / 5), 4));
1591 case 1: /* Trap / Door destruction */
1592 (void)destroy_doors_touch();
1594 case 2: /* Flash of Light == Light Area */
1595 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1597 case 3: /* Touch of Confusion */
1598 if (!(p_ptr->special_attack & ATTACK_CONFUSE))
1601 msg_print("¤¢¤Ê¤¿¤Î¼ê¤Ï¸÷¤ê»Ï¤á¤¿¡£");
1603 msg_print("Your hands start glowing.");
1606 p_ptr->special_attack |= ATTACK_CONFUSE;
1607 p_ptr->redraw |= (PR_STATUS);
1610 case 4: /* Mana Burst */
1611 if (!get_aim_dir(&dir)) return FALSE;
1613 fire_ball(GF_MISSILE, dir,
1614 (damroll(3, 5) + plev +
1615 (plev / (((p_ptr->pclass == CLASS_MAGE)
1616 || (p_ptr->pclass == CLASS_HIGH_MAGE)
1617 || (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
1618 ((plev < 30) ? 2 : 3));
1619 /* Shouldn't actually use GF_MANA, as it will destroy all
1620 * items on the floor */
1622 case 5: /* Fire Bolt */
1623 if (!get_aim_dir(&dir)) return FALSE;
1625 fire_bolt_or_beam(beam, GF_FIRE, dir,
1626 damroll(8 + ((plev - 5) / 4), 8));
1628 case 6: /* Fist of Force ("Fist of Fun") */
1629 if (!get_aim_dir(&dir)) return FALSE;
1631 fire_ball(GF_DISINTEGRATE, dir,
1632 damroll(8 + ((plev - 5) / 4), 8), 0);
1634 case 7: /* Teleport Self */
1635 teleport_player(plev * 5);
1637 case 8: /* Wonder */
1639 /* This spell should become more useful (more
1640 controlled) as the player gains experience levels.
1641 Thus, add 1/5 of the player's level to the die roll.
1642 This eliminates the worst effects later on, while
1643 keeping the results quite random. It also allows
1644 some potent effects only at high level. */
1646 int die = randint1(100) + plev / 5;
1647 int vir = virtue_number(V_CHANCE);
1650 if (p_ptr->virtues[vir - 1] > 0)
1652 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
1656 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
1661 chg_virtue(V_CHANCE, 1);
1663 if (!get_aim_dir(&dir)) return FALSE;
1666 msg_print("¤¢¤Ê¤¿¤ÏÎϤ¬¤ß¤Ê¤®¤ë¤Î¤ò´¶¤¸¤¿¡ª");
1668 msg_print("You feel a surge of power!");
1671 if (die < 8) clone_monster(dir);
1672 else if (die < 14) speed_monster(dir);
1673 else if (die < 26) heal_monster(dir, damroll(4, 6));
1674 else if (die < 31) poly_monster(dir);
1676 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
1677 damroll(3 + ((plev - 1) / 5), 4));
1678 else if (die < 41) confuse_monster(dir, plev);
1679 else if (die < 46) fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
1680 else if (die < 51) (void)lite_line(dir);
1682 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
1683 damroll(3 + ((plev - 5) / 4), 8));
1685 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
1686 damroll(5 + ((plev - 5) / 4), 8));
1688 fire_bolt_or_beam(beam, GF_ACID, dir,
1689 damroll(6 + ((plev - 5) / 4), 8));
1691 fire_bolt_or_beam(beam, GF_FIRE, dir,
1692 damroll(8 + ((plev - 5) / 4), 8));
1693 else if (die < 76) drain_life(dir, 75);
1694 else if (die < 81) fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
1695 else if (die < 86) fire_ball(GF_ACID, dir, 40 + plev, 2);
1696 else if (die < 91) fire_ball(GF_ICE, dir, 70 + plev, 3);
1697 else if (die < 96) fire_ball(GF_FIRE, dir, 80 + plev, 3);
1698 else if (die < 101) drain_life(dir, 100 + plev);
1701 earthquake(py, px, 12);
1705 destroy_area(py, px, 13+randint0(5));
1709 symbol_genocide(plev+50, TRUE);
1711 else if (die < 110) dispel_monsters(120);
1714 dispel_monsters(150);
1722 case 9: /* Chaos Bolt */
1723 if (!get_aim_dir(&dir)) return FALSE;
1725 fire_bolt_or_beam(beam, GF_CHAOS, dir,
1726 damroll(10 + ((plev - 5) / 4), 8));
1728 case 10: /* Sonic Boom */
1730 msg_print("¥É¡¼¥ó¡ªÉô²°¤¬Íɤ줿¡ª");
1732 msg_print("BOOM! Shake the room!");
1735 project(0, plev / 10 + 2, py, px,
1736 (60 + plev), GF_SOUND, PROJECT_KILL | PROJECT_ITEM, -1);
1738 case 11: /* Doom Bolt -- always beam in 2.0.7 or later */
1739 if (!get_aim_dir(&dir)) return FALSE;
1741 fire_beam(GF_MANA, dir, damroll(11 + ((plev - 5) / 4), 8));
1743 case 12: /* Fire Ball */
1744 if (!get_aim_dir(&dir)) return FALSE;
1746 fire_ball(GF_FIRE, dir, plev + 55, 2);
1748 case 13: /* Teleport Other */
1749 if (!get_aim_dir(&dir)) return FALSE;
1751 (void)fire_beam(GF_AWAY_ALL, dir, plev);
1753 case 14: /* Word of Destruction */
1754 destroy_area(py, px, 13+randint0(5));
1756 case 15: /* Invoke Logrus */
1757 if (!get_aim_dir(&dir)) return FALSE;
1759 fire_ball(GF_CHAOS, dir, plev*2 + 99, plev / 5);
1761 case 16: /* Polymorph Other */
1762 if (!get_aim_dir(&dir)) return FALSE;
1764 (void)poly_monster(dir);
1766 case 17: /* Chain Lightning */
1767 for (dir = 0; dir <= 9; dir++)
1768 fire_beam(GF_ELEC, dir, damroll(5 + (plev / 10), 8));
1770 case 18: /* Arcane Binding == Charging */
1771 return recharge(90);
1772 case 19: /* Disintegration */
1773 if (!get_aim_dir(&dir)) return FALSE;
1775 fire_ball(GF_DISINTEGRATE, dir, plev + 70, 3 + plev / 40);
1777 case 20: /* Alter Reality */
1780 case 21: /* Magic Rocket */
1781 if (!get_aim_dir(&dir)) return FALSE;
1784 msg_print("¥í¥±¥Ã¥Èȯ¼Í¡ª");
1786 msg_print("You launch a rocket!");
1789 fire_rocket(GF_ROCKET, dir, 120 + plev*2, 2);
1791 case 22: /* Chaos Branding */
1794 case 23: /* Summon monster, demon */
1797 bool pet = !one_in_(3);
1799 if (pet) mode |= PM_FORCE_PET;
1800 else mode |= PM_NO_PET;
1801 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
1803 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, SUMMON_DEMON, mode))
1806 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
1808 msg_print("The area fills with a stench of sulphur and brimstone.");
1814 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
1816 msg_print("'What is thy bidding... Master?'");
1821 msg_print("¡ÖÈܤ·¤¼Ô¤è¡¢²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª ¤ªÁ°¤Îº²¤òĺ¤¯¤¾¡ª¡×");
1823 msg_print("'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'");
1829 case 24: /* Beam of Gravity */
1830 if (!get_aim_dir(&dir)) return FALSE;
1832 fire_beam(GF_GRAVITY, dir, damroll(9 + ((plev - 5) / 4), 8));
1834 case 25: /* Meteor Swarm */
1837 int b = 10 + randint1(10);
1838 for (i = 0; i < b; i++)
1840 int count = 0, d = 0;
1845 if (count > 20) break;
1846 x = px - 8 + randint0(17);
1847 y = py - 8 + randint0(17);
1849 if (!in_bounds(y,x) || (!cave_floor_bold(y,x) && (cave[y][x].feat != FEAT_TREES)) || !player_has_los_bold(y, x)) continue;
1851 dx = (px > x) ? (px - x) : (x - px);
1852 dy = (py > y) ? (py - y) : (y - py);
1854 /* Approximate distance */
1855 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
1859 if (count > 20) continue;
1861 project(0, 2, y, x, plev * 2, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
1865 case 26: /* Flame Strike */
1866 fire_ball(GF_FIRE, 0, 300 + (3 * plev), 8);
1868 case 27: /* Call Chaos */
1871 case 28: /* Polymorph Self */
1873 if (!get_check("ÊѿȤ·¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©")) return FALSE;
1875 if (!get_check("You will polymorph yourself. Are you sure? ")) return FALSE;
1879 case 29: /* Mana Storm */
1880 if (!get_aim_dir(&dir)) return FALSE;
1882 fire_ball(GF_MANA, dir, 300 + (plev * 4), 4);
1884 case 30: /* Breathe Logrus */
1885 if (!get_aim_dir(&dir)) return FALSE;
1887 fire_ball(GF_CHAOS, dir, p_ptr->chp, 2);
1889 case 31: /* Call the Void */
1894 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥«¥ª¥¹¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1896 msg_format("You cast an unknown Chaos spell: %d.", spell);
1906 static bool cast_death_spell(int spell)
1910 int plev = p_ptr->lev;
1913 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1914 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1915 else beam = plev / 2;
1919 case 0: /* Detect Undead & Demons -> Unlife */
1920 (void)detect_monsters_nonliving(DETECT_RAD_DEFAULT);
1922 case 1: /* Malediction */
1923 if (!get_aim_dir(&dir)) return FALSE;
1924 /* A radius-0 ball may (1) be aimed at objects etc.,
1925 * and will affect them; (2) may be aimed at ANY
1926 * visible monster, unlike a 'bolt' which must travel
1927 * to the monster. */
1929 fire_ball(GF_HELL_FIRE, dir,
1930 damroll(3 + ((plev - 1) / 5), 4), 0);
1933 { /* Special effect first */
1934 dummy = randint1(1000);
1936 fire_ball_hide(GF_DEATH_RAY, dir, plev * 200, 0);
1937 else if (dummy < 500)
1938 fire_ball_hide(GF_TURN_ALL, dir, plev, 0);
1939 else if (dummy < 800)
1940 fire_ball_hide(GF_OLD_CONF, dir, plev, 0);
1942 fire_ball_hide(GF_STUN, dir, plev, 0);
1945 case 2: /* Detect Evil */
1946 (void)detect_monsters_evil(DETECT_RAD_DEFAULT);
1948 case 3: /* Stinking Cloud */
1949 if (!get_aim_dir(&dir)) return FALSE;
1951 fire_ball(GF_POIS, dir, 10 + (plev / 2), 2);
1953 case 4: /* Black Sleep */
1954 if (!get_aim_dir(&dir)) return FALSE;
1956 (void)sleep_monster(dir);
1958 case 5: /* Resist Poison */
1959 (void)set_oppose_pois(randint1(20) + 20, FALSE);
1961 case 6: /* Horrify */
1962 if (!get_aim_dir(&dir)) return FALSE;
1964 (void)fear_monster(dir, plev);
1965 (void)stun_monster(dir, plev);
1967 case 7: /* Enslave Undead */
1968 if (!get_aim_dir(&dir)) return FALSE;
1970 (void)control_one_undead(dir, plev);
1972 case 8: /* Orb of Entropy */
1973 if (!get_aim_dir(&dir)) return FALSE;
1975 fire_ball(GF_OLD_DRAIN, dir,
1976 (damroll(3, 6) + plev +
1977 (plev / (((p_ptr->pclass == CLASS_MAGE) ||
1978 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
1979 (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
1980 ((plev < 30) ? 2 : 3));
1982 case 9: /* Nether Bolt */
1983 if (!get_aim_dir(&dir)) return FALSE;
1985 fire_bolt_or_beam(beam, GF_NETHER, dir,
1986 damroll(8 + ((plev - 5) / 4), 8));
1988 case 10: /* Cloud kill */
1989 project(0, plev / 10 + 2, py, px,
1990 (30 + plev) * 2, GF_POIS, PROJECT_KILL | PROJECT_ITEM, -1);
1992 case 11: /* Genocide One */
1993 if (!get_aim_dir(&dir)) return FALSE;
1995 fire_ball_hide(GF_GENOCIDE, dir, plev + 50, 0);
1997 case 12: /* Poison Branding */
2000 case 13: /* Vampiric Drain */
2001 if (!get_aim_dir(&dir)) return FALSE;
2003 dummy = plev * 2 + randint1(plev * 2); /* Dmg */
2004 if (drain_life(dir, dummy))
2006 chg_virtue(V_SACRIFICE, -1);
2007 chg_virtue(V_VITALITY, -1);
2009 (void)hp_player(dummy);
2010 /* Gain nutritional sustenance: 150/hp drained */
2011 /* A Food ration gives 5000 food points (by contrast) */
2012 /* Don't ever get more than "Full" this way */
2013 /* But if we ARE Gorged, it won't cure us */
2014 dummy = p_ptr->food + MIN(5000, 100 * dummy);
2015 if (p_ptr->food < PY_FOOD_MAX) /* Not gorged already */
2016 (void)set_food(dummy >= PY_FOOD_MAX ? PY_FOOD_MAX - 1 : dummy);
2019 case 14: /* Animate Dead */
2020 animate_dead(0, py, px);
2022 case 15: /* Genocide */
2023 (void)symbol_genocide(plev+50, TRUE);
2025 case 16: /* Berserk */
2026 (void)set_shero(randint1(25) + 25, FALSE);
2027 (void)hp_player(30);
2028 (void)set_afraid(0);
2030 case 17: /* Invoke Spirits */
2032 int die = randint1(100) + plev / 5;
2033 int vir = virtue_number(V_CHANCE);
2036 if (p_ptr->virtues[vir - 1] > 0)
2038 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
2042 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
2046 if (!get_aim_dir(&dir)) return FALSE;
2049 msg_print("¤¢¤Ê¤¿¤Ï»à¼Ô¤¿¤Á¤ÎÎϤò¾·½¸¤·¤¿...");
2051 msg_print("You call on the power of the dead...");
2054 chg_virtue(V_CHANCE, 1);
2058 msg_print("¤¢¤Ê¤¿¤Ï¤ª¤É¤í¤ª¤É¤í¤·¤¤ÎϤΤ¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
2060 msg_print("You feel a surge of eldritch force!");
2067 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¤¢¤Ê¤¿¤Î¼þ¤ê¤ÎÃÏÌ̤«¤éµà¤Á¤¿¿Í±Æ¤¬Î©¤Á¾å¤¬¤Ã¤Æ¤¤¿¡ª");
2069 msg_print("Oh no! Mouldering forms rise from the earth around you!");
2072 (void)summon_specific(0, py, px, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
2073 chg_virtue(V_UNLIFE, 1);
2078 msg_print("̾¾õ¤·Æñ¤¤¼Ù°¤Ê¸ºß¤¬¤¢¤Ê¤¿¤Î¿´¤òÄ̤ê²á¤®¤Æ¹Ô¤Ã¤¿...");
2080 msg_print("An unnamable evil brushes against your mind...");
2083 set_afraid(p_ptr->afraid + randint1(4) + 4);
2088 msg_print("¤¢¤Ê¤¿¤ÎƬ¤ËÂçÎ̤ÎÍ©Î¤Á¤ÎÁû¡¹¤·¤¤À¼¤¬²¡¤·´ó¤»¤Æ¤¤¿...");
2090 msg_print("Your head is invaded by a horde of gibbering spectral voices...");
2093 set_confused(p_ptr->confused + randint1(4) + 4);
2101 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
2102 damroll(3 + ((plev - 1) / 5), 4));
2106 confuse_monster (dir, plev);
2110 fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
2114 (void)lite_line(dir);
2118 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
2119 damroll(3+((plev-5)/4),8));
2123 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
2124 damroll(5+((plev-5)/4),8));
2128 fire_bolt_or_beam(beam, GF_ACID, dir,
2129 damroll(6+((plev-5)/4),8));
2133 fire_bolt_or_beam(beam, GF_FIRE, dir,
2134 damroll(8+((plev-5)/4),8));
2138 drain_life(dir, 75);
2142 fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
2146 fire_ball(GF_ACID, dir, 40 + plev, 2);
2150 fire_ball(GF_ICE, dir, 70 + plev, 3);
2154 fire_ball(GF_FIRE, dir, 80 + plev, 3);
2158 drain_life(dir, 100 + plev);
2162 earthquake(py, px, 12);
2166 destroy_area(py, px, 13+randint0(5));
2170 symbol_genocide(plev+50, TRUE);
2174 dispel_monsters(120);
2178 dispel_monsters(150);
2186 msg_print("±¢±µ¤ÊÀ¼¤¬¥¯¥¹¥¯¥¹¾Ð¤¦¡£¡Ö¤â¤¦¤¹¤°¤ª¤Þ¤¨¤Ï²æ¡¹¤ÎÃç´Ö¤Ë¤Ê¤ë¤À¤í¤¦¡£¼å¤¼Ô¤è¡£¡×");
2188 msg_print("Sepulchral voices chuckle. 'Soon you will join us, mortal.'");
2193 case 18: /* Dark Bolt */
2194 if (!get_aim_dir(&dir)) return FALSE;
2196 fire_bolt_or_beam(beam, GF_DARK, dir,
2197 damroll(4 + ((plev - 5) / 4), 8));
2199 case 19: /* Battle Frenzy */
2200 (void)set_shero(randint1(25) + 25, FALSE);
2201 (void)hp_player(30);
2202 (void)set_afraid(0);
2203 (void)set_fast(randint1(20 + (plev / 2)) + (plev / 2), FALSE);
2205 case 20: /* Vampiric Branding */
2208 case 21: /* Vampirism True */
2209 if (!get_aim_dir(&dir)) return FALSE;
2211 chg_virtue(V_SACRIFICE, -1);
2212 chg_virtue(V_VITALITY, -1);
2214 for (dummy = 0; dummy < 3; dummy++)
2216 if (drain_life(dir, 100))
2220 case 22: /* Word of Death */
2221 (void)dispel_living(randint1(plev * 3));
2223 case 23: /* Darkness Storm */
2224 if (!get_aim_dir(&dir)) return FALSE;
2226 fire_ball(GF_DARK, dir, 100+plev*2, 4);
2228 case 24: /* Death Ray */
2229 if (!get_aim_dir(&dir)) return FALSE;
2231 (void)death_ray(dir, plev);
2233 case 25: /* Raise the Dead */
2236 bool pet = one_in_(3);
2239 type = (plev > 47 ? SUMMON_HI_UNDEAD : SUMMON_UNDEAD);
2241 if (!pet || (pet && (plev > 24) && one_in_(3)))
2242 mode |= PM_ALLOW_GROUP;
2244 if (pet) mode |= PM_FORCE_PET;
2245 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
2247 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, type, mode))
2250 msg_print("Î䤿¤¤É÷¤¬¤¢¤Ê¤¿¤Î¼þ¤ê¤Ë¿á¤»Ï¤á¤¿¡£¤½¤ì¤ÏÉåÇÔ½¤ò±¿¤ó¤Ç¤¤¤ë...");
2252 msg_print("Cold winds begin to blow around you, carrying with them the stench of decay...");
2258 msg_print("¸Å¤¨¤Î»à¤»¤ë¼Ô¶¦¤¬¤¢¤Ê¤¿¤Ë»Å¤¨¤ë¤¿¤áÅÚ¤«¤éᴤä¿¡ª");
2260 msg_print("Ancient, long-dead forms arise from the ground to serve you!");
2265 msg_print("»à¼Ô¤¬á´¤Ã¤¿¡£Ì²¤ê¤ò˸¤²¤ë¤¢¤Ê¤¿¤òȳ¤¹¤ë¤¿¤á¤Ë¡ª");
2267 msg_print("'The dead arise... to punish you for disturbing them!'");
2270 chg_virtue(V_UNLIFE, 1);
2275 case 26: /* Esoteria */
2276 if (randint1(50) > plev)
2277 return ident_spell(FALSE);
2279 return identify_fully(FALSE);
2281 case 27: /* Mimic vampire */
2282 (void)set_mimic(10+plev/2 + randint1(10+plev/2), MIMIC_VAMPIRE, FALSE);
2284 case 28: /* Restore Life */
2285 (void)restore_level();
2287 case 29: /* Mass Genocide */
2288 (void)mass_genocide(plev+50, TRUE);
2290 case 30: /* Hellfire */
2291 if (!get_aim_dir(&dir)) return FALSE;
2293 fire_ball(GF_HELL_FIRE, dir, 666, 3);
2295 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "ÃϹö¤Î¹å²Ð¤Î¼öʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
2297 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "the strain of casting Hellfire", -1);
2301 case 31: /* Wraithform */
2302 set_wraith_form(randint1(plev / 2) + (plev / 2), FALSE);
2305 msg_format("You cast an unknown Death spell: %d.", spell);
2313 static bool cast_trump_spell(int spell, bool success)
2317 int plev = p_ptr->lev;
2318 int summon_lev = plev * 2 / 3 + randint1(plev/2);
2320 bool no_trump = FALSE;
2321 bool unique_okay = FALSE;
2324 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
2325 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
2326 else beam = plev / 2;
2328 if (summon_lev < 1) summon_lev = 1;
2329 if (!success || (randint1(50+plev) < plev/10)) unique_okay = TRUE;
2332 case 0: /* Phase Door */
2335 teleport_player(10);
2338 case 1: /* Trump Spiders */
2340 bool pet = success; /* (randint1(5) > 2) */
2341 u32b mode = PM_ALLOW_GROUP;
2343 if (pet) mode |= PM_FORCE_PET;
2344 else mode |= PM_NO_PET;
2347 msg_print("¤¢¤Ê¤¿¤ÏÃØéá¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2349 msg_print("You concentrate on the trump of an spider...");
2352 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_SPIDER, mode))
2356 msg_print("¾¤´¤µ¤ì¤¿ÃØéá¤ÏÅܤäƤ¤¤ë¡ª");
2358 msg_print("The summoned spiders get angry!");
2368 case 2: /* Shuffle */
2371 /* A limited power 'wonder' spell */
2372 int die = randint1(120);
2373 int vir = virtue_number(V_CHANCE);
2375 if ((p_ptr->pclass == CLASS_ROGUE) ||
2376 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
2377 (p_ptr->pclass == CLASS_SORCERER))
2378 die = (randint1(110)) + plev / 5;
2379 /* Card sharks and high mages get a level bonus */
2383 if (p_ptr->virtues[vir - 1] > 0)
2385 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
2389 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
2394 msg_print("¤¢¤Ê¤¿¤Ï¥«¡¼¥É¤òÀڤäưìËç°ú¤¤¤¿...");
2396 msg_print("You shuffle the deck and draw a card...");
2400 chg_virtue(V_CHANCE, 1);
2405 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡Ô»à¡Õ¤À¡ª");
2407 msg_print("Oh no! It's Death!");
2410 for (dummy = 0; dummy < randint1(3); dummy++)
2411 (void)activate_hi_summon(py, px, FALSE);
2416 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡Ô°Ëâ¡Õ¤À¡ª");
2418 msg_print("Oh no! It's the Devil!");
2421 (void)summon_specific(0, py, px, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
2427 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡ÔÄߤé¤ì¤¿ÃË¡Õ¤À¡ª");
2429 msg_print("Oh no! It's the Hanged Man.");
2432 (void)activate_ty_curse(FALSE, &count);
2437 msg_print("¡ÔÉÔĴϤηõ¡Õ¤À¡£");
2439 msg_print("It's the swords of discord.");
2442 aggravate_monsters(0);
2447 msg_print("¡Ô¶ò¼Ô¡Õ¤À¡£");
2449 msg_print("It's the Fool.");
2452 (void)do_dec_stat(A_INT);
2453 (void)do_dec_stat(A_WIS);
2458 msg_print("´ñ̯¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2460 msg_print("It's the picture of a strange monster.");
2463 if (!(summon_specific(0, py, px, (dun_level * 3) / 2, 32 + randint1(6), (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET))))
2469 msg_print("¡Ô·î¡Õ¤À¡£");
2471 msg_print("It's the Moon.");
2479 msg_print("¡Ô±¿Ì¿¤ÎÎØ¡Õ¤À¡£");
2481 msg_print("It's the Wheel of Fortune.");
2484 wild_magic(randint0(32));
2489 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2491 msg_print("It's a teleport trump card.");
2494 teleport_player(10);
2499 msg_print("¡ÔÀµµÁ¡Õ¤À¡£");
2501 msg_print("It's Justice.");
2504 set_blessed(p_ptr->lev, FALSE);
2509 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2511 msg_print("It's a teleport trump card.");
2514 teleport_player(100);
2519 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2521 msg_print("It's a teleport trump card.");
2524 teleport_player(200);
2529 msg_print("¡ÔÅã¡Õ¤À¡£");
2531 msg_print("It's the Tower.");
2539 msg_print("¡ÔÀáÀ©¡Õ¤À¡£");
2541 msg_print("It's Temperance.");
2544 sleep_monsters_touch();
2549 msg_print("¡ÔÅã¡Õ¤À¡£");
2551 msg_print("It's the Tower.");
2554 earthquake(py, px, 5);
2559 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2561 msg_print("It's the picture of a friendly monster.");
2564 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE1, PM_FORCE_PET)))
2570 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2572 msg_print("It's the picture of a friendly monster.");
2575 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE2, PM_FORCE_PET)))
2581 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2583 msg_print("It's the picture of a friendly monster.");
2586 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE4, PM_FORCE_PET)))
2592 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2594 msg_print("It's the picture of a friendly monster.");
2597 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE5, PM_FORCE_PET)))
2603 msg_print("¡ÔÎø¿Í¡Õ¤À¡£");
2605 msg_print("It's the Lovers.");
2608 if (get_aim_dir(&dir))
2609 (void)charm_monster(dir, MIN(p_ptr->lev, 20));
2614 msg_print("¡Ô±£¼Ô¡Õ¤À¡£");
2616 msg_print("It's the Hermit.");
2624 msg_print("¡Ô¿³È½¡Õ¤À¡£");
2626 msg_print("It's the Judgement.");
2629 do_cmd_rerate(FALSE);
2630 if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3)
2633 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
2635 msg_print("You are cured of all mutations.");
2638 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
2639 p_ptr->update |= PU_BONUS;
2646 msg_print("¡ÔÂÀÍÛ¡Õ¤À¡£");
2648 msg_print("It's the Sun.");
2651 chg_virtue(V_KNOWLEDGE, 1);
2652 chg_virtue(V_ENLIGHTEN, 1);
2658 msg_print("¡ÔÀ¤³¦¡Õ¤À¡£");
2660 msg_print("It's the World.");
2663 if (p_ptr->exp < PY_MAX_EXP)
2665 s32b ee = (p_ptr->exp / 25) + 1;
2666 if (ee > 5000) ee = 5000;
2668 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
2670 msg_print("You feel more experienced.");
2678 case 3: /* Reset Recall */
2681 if (!reset_recall()) return FALSE;
2684 case 4: /* Teleport Self */
2687 teleport_player(plev * 4);
2690 case 5: /* Trump Spying */
2693 (void)set_tim_esp(randint1(30) + 25, FALSE);
2696 case 6: /* Teleport Away */
2699 if (!get_aim_dir(&dir)) return FALSE;
2700 (void)fire_beam(GF_AWAY_ALL, dir, plev);
2703 case 7: /* Trump Animals */
2705 bool pet = success; /* was (randint1(5) > 2) */
2706 int type = (pet ? SUMMON_ANIMAL_RANGER : SUMMON_ANIMAL);
2709 if (pet) mode |= PM_FORCE_PET;
2710 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2713 msg_print("¤¢¤Ê¤¿¤Ïưʪ¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2715 msg_print("You concentrate on the trump of an animal...");
2719 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
2723 msg_print("¾¤´¤µ¤ì¤¿Æ°Êª¤ÏÅܤäƤ¤¤ë¡ª");
2725 msg_print("The summoned animal gets angry!");
2736 case 8: /* Trump Reach */
2739 if (!get_aim_dir(&dir)) return FALSE;
2740 fetch(dir, plev * 15, TRUE);
2743 case 9: /* Trump Kamikaze */
2748 if (!target_set(TARGET_KILL)) return FALSE;
2755 msg_print("¤¢¤Ê¤¿¤Ï¥«¥ß¥«¥¼¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2757 msg_print("You concentrate on several trumps at once...");
2761 for (dummy = 2 + randint0(plev / 7); dummy > 0; dummy--)
2763 bool pet = success; /* was (randint1(10) > 3) */
2767 if (pet) mode |= PM_FORCE_PET;
2768 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2770 if (p_ptr->pclass == CLASS_BEASTMASTER)
2772 type = SUMMON_KAMIKAZE_LIVING;
2776 type = SUMMON_KAMIKAZE;
2779 if (summon_specific((pet ? -1 : 0), y, x, summon_lev, type, mode))
2783 msg_print("¾¤´¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
2785 msg_print("The summoned creatures get angry!");
2793 case 10: /* Phantasmal Servant */
2796 if (summon_specific(-1, py, px, (summon_lev * 3) / 2, SUMMON_PHANTOM, PM_FORCE_PET))
2799 msg_print("¸æÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¸æ¼ç¿ÍÍÍ¡©");
2801 msg_print("'Your wish, master?'");
2811 case 11: /* Speed Monster */
2814 bool old_target_pet = target_pet;
2816 if (!get_aim_dir(&dir))
2818 target_pet = old_target_pet;
2821 target_pet = old_target_pet;
2822 (void)speed_monster(dir);
2825 case 12: /* Teleport Level */
2829 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
2831 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
2833 (void)teleport_player_level();
2836 case 13: /* Dimension Door */
2840 msg_print("¼¡¸µ¤ÎÈ⤬³«¤¤¤¿¡£ÌÜŪÃϤòÁª¤ó¤Ç²¼¤µ¤¤¡£");
2842 msg_print("You open a dimensional gate. Choose a destination.");
2845 return dimension_door();
2848 case 14: /* Word of Recall */
2851 if (!word_of_recall()) return FALSE;
2854 case 15: /* Banish */
2857 banish_monsters(plev * 4);
2860 case 16: /* Swap Position */
2864 project_length = -1;
2865 if (!get_aim_dir(&dir))
2872 (void)teleport_swap(dir);
2876 case 17: /* Trump Undead */
2878 bool pet = success; /* (randint1(10) > 3) */
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 an undead creature...");
2891 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_UNDEAD, mode))
2895 msg_print("¾¤´¤µ¤ì¤¿¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
2897 msg_print("The summoned undead creature gets angry!");
2908 case 18: /* Trump Reptiles */
2910 bool pet = success; /* was (randint1(5) > 2) */
2913 if (pet) mode |= PM_FORCE_PET;
2914 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2917 msg_print("¤¢¤Ê¤¿¤Ïà¨ÃîÎà¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2919 msg_print("You concentrate on the trump of a reptile...");
2923 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HYDRA, mode))
2927 msg_print("¾¤´¤µ¤ì¤¿à¨ÃîÎà¤ÏÅܤäƤ¤¤ë¡ª");
2929 msg_print("The summoned reptile gets angry!");
2940 case 19: /* Trump Monsters */
2945 msg_print("¤¢¤Ê¤¿¤Ï¥â¥ó¥¹¥¿¡¼¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2947 msg_print("You concentrate on several trumps at once...");
2951 for (dummy = 0; dummy < 1 + ((plev - 15)/ 10); dummy++)
2953 bool pet = success; /* was (randint1(10) > 3) */
2957 if (pet) mode |= PM_FORCE_PET;
2958 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2960 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
2962 if (p_ptr->pclass == CLASS_BEASTMASTER)
2964 type = SUMMON_LIVING;
2971 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
2975 msg_print("¾¤´¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
2977 msg_print("The summoned creatures get angry!");
2985 case 20: /* Trump Hounds */
2987 bool pet = success; /* was (randint1(5) > 2) */
2988 u32b mode = PM_ALLOW_GROUP;
2990 if (pet) mode |= PM_FORCE_PET;
2991 else mode |= PM_NO_PET;
2994 msg_print("¤¢¤Ê¤¿¤Ï¥Ï¥¦¥ó¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2996 msg_print("You concentrate on the trump of a hound...");
3000 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HOUND, mode))
3004 msg_print("¾¤´¤µ¤ì¤¿¥Ï¥¦¥ó¥É¤ÏÅܤäƤ¤¤ë¡ª");
3006 msg_print("The summoned hounds get angry!");
3017 case 21: /* Trump Branding */
3023 case 22: /* Living Trump */
3027 /* Teleport control */
3030 /* Random teleportation (uncontrolled) */
3032 /* Gain the mutation */
3033 if (gain_random_mutation(dummy))
3035 msg_print("¤¢¤Ê¤¿¤ÏÀ¸¤¤Æ¤¤¤ë¥«¡¼¥É¤ËÊѤï¤Ã¤¿¡£");
3037 msg_print("You have turned into a Living Trump.");
3042 case 23: /* Trump Cyberdemon */
3044 bool pet = success; /* was (randint1(10) > 3) */
3047 if (pet) mode |= PM_FORCE_PET;
3048 else mode |= PM_NO_PET;
3051 msg_print("¤¢¤Ê¤¿¤Ï¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3053 msg_print("You concentrate on the trump of a Cyberdemon...");
3057 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_CYBER, mode))
3061 msg_print("¾¤´¤µ¤ì¤¿¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3063 msg_print("The summoned Cyberdemon gets angry!");
3074 case 24: /* Trump Divination */
3077 (void)detect_all(DETECT_RAD_DEFAULT);
3080 case 25: /* Trump Lore */
3083 return identify_fully(FALSE);
3086 case 26: /* Heal Monster */
3089 bool old_target_pet = target_pet;
3091 if (!get_aim_dir(&dir))
3093 target_pet = old_target_pet;
3096 target_pet = old_target_pet;
3098 (void)heal_monster(dir, p_ptr->lev * 10 + 200);
3101 case 27: /* Trump Dragon */
3103 bool pet = success; /* was (randint1(10) > 3) */
3106 if (pet) mode |= PM_FORCE_PET;
3107 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3110 msg_print("¤¢¤Ê¤¿¤Ï¥É¥é¥´¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3112 msg_print("You concentrate on the trump of a dragon...");
3116 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DRAGON, mode))
3120 msg_print("¾¤´¤µ¤ì¤¿¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3122 msg_print("The summoned dragon gets angry!");
3133 case 28: /* Trump Meteor */
3136 int x, y, dx, dy, i;
3137 int b = 10 + randint1(10);
3138 for (i = 0; i < b; i++)
3140 int count = 0, d = 0;
3145 if (count > 20) break;
3146 x = px - 8 + randint0(17);
3147 y = py - 8 + randint0(17);
3149 if (!in_bounds(y,x) || (!cave_floor_bold(y,x) && (cave[y][x].feat != FEAT_TREES)) || !player_has_los_bold(y, x)) continue;
3151 dx = (px > x) ? (px - x) : (x - px);
3152 dy = (py > y) ? (py - y) : (y - py);
3154 /* Approximate distance */
3155 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
3159 if (count > 20) continue;
3161 project(0, 2, y, x, plev * 2, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
3165 case 29: /* Trump Demon */
3167 bool pet = success; /* was (randint1(10) > 3) */
3170 if (pet) mode |= PM_FORCE_PET;
3171 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3174 msg_print("¤¢¤Ê¤¿¤Ï¥Ç¡¼¥â¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3176 msg_print("You concentrate on the trump of a demon...");
3180 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DEMON, mode))
3184 msg_print("¾¤´¤µ¤ì¤¿¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3186 msg_print("The summoned demon gets angry!");
3197 case 30: /* Trump Greater Undead */
3199 bool pet = success; /* was (randint1(10) > 3) */
3202 if (pet) mode |= PM_FORCE_PET;
3203 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3205 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
3208 msg_print("¤¢¤Ê¤¿¤Ï¶¯ÎϤʥ¢¥ó¥Ç¥Ã¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3210 msg_print("You concentrate on the trump of a greater undead being...");
3214 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HI_UNDEAD, mode))
3218 msg_print("¾¤´¤µ¤ì¤¿¾åµé¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
3220 msg_print("The summoned greater undead creature gets angry!");
3231 case 31: /* Trump Ancient Dragon */
3233 bool pet = success; /* was (randint1(10) > 3) */
3237 if (pet) mode |= PM_FORCE_PET;
3238 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3240 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
3242 if (p_ptr->pclass == CLASS_BEASTMASTER)
3244 type = SUMMON_HI_DRAGON_LIVING;
3248 type = SUMMON_HI_DRAGON;
3252 msg_print("¤¢¤Ê¤¿¤Ï¸ÅÂå¥É¥é¥´¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3254 msg_print("You concentrate on the trump of an ancient dragon...");
3258 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
3262 msg_print("¾¤´¤µ¤ì¤¿¸ÅÂå¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3264 msg_print("The summoned ancient dragon gets angry!");
3277 msg_format("̤ÃΤΥ«¡¼¥É¤Î¼öʸ¤Ç¤¹: %d", spell);
3279 msg_format("You cast an unknown Trump spell: %d.", spell);
3288 msg_print("ï¤â¤¢¤Ê¤¿¤Î¥«¡¼¥É¤Î¸Æ¤ÓÀ¼¤ËÅú¤¨¤Ê¤¤¡£");
3290 msg_print("Nobody answers to your Trump call.");
3299 static bool cast_arcane_spell(int spell)
3303 int plev = p_ptr->lev;
3305 bool no_trump = FALSE;
3307 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3308 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3309 else beam = plev / 2;
3314 if (!get_aim_dir(&dir)) return FALSE;
3316 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
3317 damroll(3 + ((plev - 1) / 5), 3));
3319 case 1: /* Wizard Lock */
3320 if (!get_aim_dir(&dir)) return FALSE;
3322 (void)wizard_lock(dir);
3324 case 2: /* Detect Invisibility */
3325 (void)detect_monsters_invis(DETECT_RAD_DEFAULT);
3327 case 3: /* Detect Monsters */
3328 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
3331 teleport_player(10);
3333 case 5: /* Light Area */
3334 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
3336 case 6: /* Trap & Door Destruction */
3337 if (!get_aim_dir(&dir)) return FALSE;
3339 (void)destroy_door(dir);
3341 case 7: /* Cure Light Wounds */
3342 (void)hp_player(damroll(2, 8));
3343 (void)set_cut(p_ptr->cut - 10);
3345 case 8: /* Detect Doors & Traps */
3346 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
3347 (void)detect_doors(DETECT_RAD_DEFAULT);
3348 (void)detect_stairs(DETECT_RAD_DEFAULT);
3350 case 9: /* Phlogiston */
3353 case 10: /* Detect Treasure */
3354 (void)detect_treasure(DETECT_RAD_DEFAULT);
3355 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
3357 case 11: /* Detect Enchantment */
3358 (void)detect_objects_magic(DETECT_RAD_DEFAULT);
3360 case 12: /* Detect Objects */
3361 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
3363 case 13: /* Cure Poison */
3364 (void)set_poisoned(0);
3366 case 14: /* Resist Cold */
3367 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3369 case 15: /* Resist Fire */
3370 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3372 case 16: /* Resist Lightning */
3373 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3375 case 17: /* Resist Acid */
3376 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3378 case 18: /* Cure Medium Wounds */
3379 (void)hp_player(damroll(4, 8));
3380 (void)set_cut((p_ptr->cut / 2) - 50);
3382 case 19: /* Teleport */
3383 teleport_player(plev * 5);
3385 case 20: /* Identify */
3386 return ident_spell(FALSE);
3387 case 21: /* Stone to Mud */
3388 if (!get_aim_dir(&dir)) return FALSE;
3390 (void)wall_to_mud(dir);
3392 case 22: /* Ray of Light */
3393 if (!get_aim_dir(&dir)) return FALSE;
3396 msg_print("¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
3398 msg_print("A line of light appears.");
3401 (void)lite_line(dir);
3403 case 23: /* Satisfy Hunger */
3404 (void)set_food(PY_FOOD_MAX - 1);
3406 case 24: /* See Invisible */
3407 (void)set_tim_invis(randint1(24) + 24, FALSE);
3409 case 25: /* Conjure Elemental */
3410 if (!summon_specific(-1, py, px, plev, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3413 case 26: /* Teleport Level */
3415 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
3417 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
3419 (void)teleport_player_level();
3421 case 27: /* Teleport Away */
3422 if (!get_aim_dir(&dir)) return FALSE;
3424 (void)fire_beam(GF_AWAY_ALL, dir, plev);
3426 case 28: /* Elemental Ball */
3427 if (!get_aim_dir(&dir)) return FALSE;
3429 switch (randint1(4))
3431 case 1: dummy = GF_FIRE;break;
3432 case 2: dummy = GF_ELEC;break;
3433 case 3: dummy = GF_COLD;break;
3434 default: dummy = GF_ACID;break;
3436 fire_ball(dummy, dir, 75 + (plev), 2);
3438 case 29: /* Detection */
3439 (void)detect_all(DETECT_RAD_DEFAULT);
3441 case 30: /* Word of Recall */
3442 if (!word_of_recall()) return FALSE;
3444 case 31: /* Clairvoyance */
3445 chg_virtue(V_KNOWLEDGE, 1);
3446 chg_virtue(V_ENLIGHTEN, 1);
3448 if (!p_ptr->telepathy)
3450 (void)set_tim_esp(randint1(30) + 25, FALSE);
3454 msg_format("You cast an unknown Arcane spell: %d.", spell);
3460 msg_print("¥¨¥ì¥á¥ó¥¿¥ë¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3462 msg_print("No Elementals arrive.");
3469 static bool cast_enchant_spell(int spell)
3471 int plev = p_ptr->lev;
3473 bool no_trump = FALSE;
3477 case 0: /* Infravision */
3478 set_tim_infra(100 + randint1(100), FALSE);
3480 case 1: /* Regeneration */
3481 set_tim_regen(80 + randint1(80), FALSE);
3483 case 2: /* Satisfy Hunger */
3484 (void)set_food(PY_FOOD_MAX - 1);
3486 case 3: /* Resist Cold */
3487 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3489 case 4: /* Resist Fire */
3490 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3492 case 5: /* Heroism */
3493 (void)set_hero(randint1(25) + 25, FALSE);
3494 (void)hp_player(10);
3495 (void)set_afraid(0);
3497 case 6: /* Resist Lightning */
3498 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3500 case 7: /* Resist Acid */
3501 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3503 case 8: /* See Invisibility */
3504 (void)set_tim_invis(randint1(24) + 24, FALSE);
3506 case 9: /* Remove Curse */
3510 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
3512 msg_print("You feel as if someone is watching over you.");
3516 case 10: /* Resist Poison */
3517 (void)set_oppose_pois(randint1(20) + 20, FALSE);
3519 case 11: /* Berserk */
3520 (void)set_shero(randint1(25) + 25, FALSE);
3521 (void)hp_player(30);
3522 (void)set_afraid(0);
3524 case 12: /* Self Knowledge */
3525 (void)self_knowledge();
3527 case 13: /* Protection from Evil */
3528 (void)set_protevil(randint1(25) + 3 * p_ptr->lev, FALSE);
3530 case 14: /* Healing */
3536 case 15: /* Mana Branding */
3537 return choose_ele_attack();
3539 case 16: /* Telepathy */
3540 (void)set_tim_esp(randint1(30) + 25, FALSE);
3542 case 17: /* Stone Skin */
3543 (void)set_shield(randint1(20) + 30, FALSE);
3545 case 18: /* Resistance */
3546 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3547 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3548 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3549 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3550 (void)set_oppose_pois(randint1(20) + 20, FALSE);
3552 case 19: /* Haste */
3553 (void)set_fast(randint1(20 + plev) + plev, FALSE);
3555 case 20: /* Walk through Wall */
3556 (void)set_kabenuke(randint1(plev/2) + plev/2, FALSE);
3558 case 21: /* Pulish Shield */
3559 (void)pulish_shield();
3561 case 22: /* Create Golem */
3562 if (summon_specific(-1, py, px, plev, SUMMON_GOLEM, PM_FORCE_PET))
3565 msg_print("¥´¡¼¥ì¥à¤òºî¤Ã¤¿¡£");
3567 msg_print("You make a golem.");
3575 case 23: /* Magic armor */
3576 (void)set_magicdef(randint1(20) + 20, FALSE);
3578 case 24: /* Remove Enchantment */
3579 if (!mundane_spell(TRUE)) return FALSE;
3581 case 25: /* Remove All Curse */
3582 if (remove_all_curse())
3585 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
3587 msg_print("You feel as if someone is watching over you.");
3591 case 26: /* Total Knowledge */
3592 return identify_fully(FALSE);
3594 case 27: /* Enchant Weapon */
3595 return enchant_spell(randint0(4) + 1, randint0(4) + 1, 0);
3597 case 28: /* Enchant Armor */
3598 return enchant_spell(0, 0, randint0(3) + 2);
3600 case 29: /* Brand Weapon */
3601 brand_weapon(randint0(18));
3603 case 30: /* Living Trump */
3605 /* Teleport control */
3608 /* Random teleportation (uncontrolled) */
3610 /* Gain the mutation */
3611 if (gain_random_mutation(dummy))
3613 msg_print("¤¢¤Ê¤¿¤ÏÀ¸¤¤Æ¤¤¤ë¥«¡¼¥É¤ËÊѤï¤Ã¤¿¡£");
3615 msg_print("You have turned into a Living Trump.");
3618 case 31: /* Immune */
3619 return (choose_ele_immune(13 + randint1(13)));
3622 msg_format("You cast an unknown Craft spell: %d.", spell);
3628 msg_print("¤¦¤Þ¤¯¥´¡¼¥ì¥à¤òºî¤ì¤Ê¤«¤Ã¤¿¡£");
3630 msg_print("No Golems arrive.");
3638 * An "item_tester_hook" for offer
3640 static bool item_tester_offer(object_type *o_ptr)
3642 /* Flasks of oil are okay */
3643 if (o_ptr->tval != TV_CORPSE) return (FALSE);
3645 if (o_ptr->sval != SV_CORPSE) return (FALSE);
3647 if (strchr("pht", r_info[o_ptr->pval].d_char)) return (TRUE);
3649 /* Assume not okay */
3654 static bool cast_daemon_spell(int spell)
3657 int plev = p_ptr->lev;
3659 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3660 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3661 else beam = plev / 2;
3665 case 0: /* Magic Missile */
3666 if (!get_aim_dir(&dir)) return FALSE;
3668 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
3669 damroll(3 + ((plev - 1) / 5), 4));
3671 case 1: /* Detect Undead & Demons -> Unlife */
3672 (void)detect_monsters_nonliving(DETECT_RAD_DEFAULT);
3675 (void)set_blessed(randint1(12) + 12, FALSE);
3677 case 3: /* Resist Fire */
3678 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3680 case 4: /* Horrify */
3681 if (!get_aim_dir(&dir)) return FALSE;
3683 (void)fear_monster(dir, plev);
3684 (void)stun_monster(dir, plev);
3686 case 5: /* Nether Bolt */
3687 if (!get_aim_dir(&dir)) return FALSE;
3689 fire_bolt_or_beam(beam, GF_NETHER, dir,
3690 damroll(6 + ((plev - 5) / 4), 8));
3692 case 6: /* Summon monster, demon */
3693 if (!summon_specific(-1, py, px, (plev * 3) / 2, SUMMON_MANES, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3696 msg_print("¸ÅÂå¤Î»àÎî¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3698 msg_print("No Manes arrive.");
3702 case 7: /* Mini Hellfire */
3703 if (!get_aim_dir(&dir)) return FALSE;
3705 fire_ball(GF_HELL_FIRE, dir,
3706 (damroll(3, 6) + plev +
3707 (plev / (((p_ptr->pclass == CLASS_MAGE) ||
3708 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
3709 (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
3710 ((plev < 30) ? 2 : 3));
3712 case 8: /* Enslave Demon */
3713 if (!get_aim_dir(&dir)) return FALSE;
3715 (void)control_one_demon(dir, plev);
3717 case 9: /* Vision */
3718 map_area(DETECT_RAD_MAP);
3720 case 10: /* Resist Nether */
3721 (void)set_tim_res_nether(randint1(20) + 20, FALSE);
3723 case 11: /* Plasma Bolt */
3724 if (!get_aim_dir(&dir)) return FALSE;
3726 fire_bolt_or_beam(beam, GF_PLASMA, dir,
3727 damroll(11 + ((plev - 5) / 4), 8));
3729 case 12: /* Fire Ball */
3730 if (!get_aim_dir(&dir)) return FALSE;
3732 fire_ball(GF_FIRE, dir, plev + 55, 2);
3734 case 13: /* Fire Branding */
3737 case 14: /* Nether Ball */
3738 if (!get_aim_dir(&dir)) return FALSE;
3740 fire_ball(GF_NETHER, dir, plev*3/2 + 100, plev / 20+2);
3742 case 15: /* Summon monster, demon */
3744 bool pet = !one_in_(3);
3747 if (pet) mode |= PM_FORCE_PET;
3748 else mode |= PM_NO_PET;
3749 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
3751 if (summon_specific((pet ? -1 : 0), py, px, plev*2/3+randint1(plev/2), SUMMON_DEMON, mode))
3754 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
3756 msg_print("The area fills with a stench of sulphur and brimstone.");
3762 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
3764 msg_print("'What is thy bidding... Master?'");
3769 msg_print("¡ÖÈܤ·¤¼Ô¤è¡¢²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª ¤ªÁ°¤Îº²¤òĺ¤¯¤¾¡ª¡×");
3771 msg_print("'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'");
3778 msg_print("°Ëâ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3780 msg_print("No demons arrive.");
3785 case 16: /* Telepathy */
3786 (void)set_tim_esp(randint1(30) + 25, FALSE);
3788 case 17: /* Demoncloak */
3790 int dur=randint1(20) + 20;
3792 set_oppose_fire(dur, FALSE);
3793 set_oppose_cold(dur, FALSE);
3794 set_tim_sh_fire(dur, FALSE);
3798 case 18: /* Rain of Lava */
3799 fire_ball(GF_FIRE, 0, (55 + plev)*2, 3);
3800 fire_ball_hide(GF_LAVA_FLOW, 0, 2+randint1(2), 3);
3802 case 19: /* Plasma ball */
3803 if (!get_aim_dir(&dir)) return FALSE;
3805 fire_ball(GF_PLASMA, dir, plev*3/2 + 80, 2 + plev/40);
3807 case 20: /* Mimic demon */
3808 (void)set_mimic(10+plev/2 + randint1(10+plev/2), MIMIC_DEMON, FALSE);
3810 case 21: /* Nether Wave == Dispel Good */
3811 (void)dispel_monsters(randint1(plev * 2));
3812 (void)dispel_good(randint1(plev * 2));
3815 if (!get_aim_dir(&dir)) return FALSE;
3816 fire_ball(GF_NEXUS, dir, 100 + plev*2, 4);
3818 case 23: /* Hand Doom */
3819 if (!get_aim_dir(&dir)) return FALSE;
3821 else msg_print("<ÇËÌǤμê>¤òÊü¤Ã¤¿¡ª");
3823 else msg_print("You invoke the Hand of Doom!");
3826 fire_ball_hide(GF_HAND_DOOM, dir, plev * 2, 0);
3828 case 24: /* Heroism */
3829 (void)set_hero(randint1(25) + 25, FALSE);
3830 (void)hp_player(10);
3831 (void)set_afraid(0);
3833 case 25: /* Tim resist time */
3834 (void)set_tim_res_time(randint1(20)+20, FALSE);
3836 case 26: /* Circle of Madness */
3837 fire_ball(GF_CHAOS, 0, 50+plev, 3+plev/20);
3838 fire_ball(GF_CONFUSION, 0, 50+plev, 3+plev/20);
3839 fire_ball(GF_CHARM, 0, 20+plev, 3+plev/20);
3841 case 27: /* True Discharge Minion */
3844 case 28: /* Summon Greater Demon */
3851 item_tester_hook = item_tester_offer;
3853 q = "¤É¤Î»àÂΤòÊû¤²¤Þ¤¹¤«? ";
3854 s = "Êû¤²¤é¤ì¤ë»àÂΤò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
3856 q = "Sacrifice which corpse? ";
3857 s = "You have nothing to scrifice.";
3859 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return FALSE;
3861 /* Get the item (in the pack) */
3864 o_ptr = &inventory[item];
3867 /* Get the item (on the floor) */
3870 o_ptr = &o_list[0 - item];
3873 summon_lev = p_ptr->lev * 2 / 3 + r_info[o_ptr->pval].level;
3874 if (summon_specific(-1, py, px, summon_lev, SUMMON_HI_DEMON, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3877 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
3879 msg_print("The area fills with a stench of sulphur and brimstone.");
3884 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
3886 msg_print("'What is thy bidding... Master?'");
3889 /* Decrease the item (from the pack) */
3892 inven_item_increase(item, -1);
3893 inven_item_describe(item);
3894 inven_item_optimize(item);
3897 /* Decrease the item (from the floor) */
3900 floor_item_increase(0 - item, -1);
3901 floor_item_describe(0 - item);
3902 floor_item_optimize(0 - item);
3908 msg_print("°Ëâ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3910 msg_print("No Greater Demon arrive.");
3915 case 29: /* Nether Storm */
3916 if (!get_aim_dir(&dir)) return FALSE;
3918 fire_ball(GF_NETHER, dir, plev*15, plev / 5);
3920 case 30: /* Blood curse */
3922 if (!get_aim_dir(&dir)) return FALSE;
3924 fire_ball_hide(GF_BLOOD_CURSE, dir, 600, 0);
3926 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "·ì¤Î¼ö¤¤", -1);
3928 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "Blood curse", -1);
3932 case 31: /* Mimic Demon lord */
3933 (void)set_mimic(15 + randint1(15), MIMIC_DEMON_LORD, FALSE);
3936 msg_format("You cast an unknown Daemon spell: %d.", spell);
3944 static bool cast_crusade_spell(int spell)
3948 int plev = p_ptr->lev;
3950 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3951 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3952 else beam = plev / 2;
3957 if (!get_aim_dir(&dir)) return FALSE;
3959 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
3960 damroll(3 + ((plev - 1) / 5), 4));
3963 (void)detect_monsters_evil(DETECT_RAD_DEFAULT);
3965 case 2: /* Remove Fear */
3966 (void)set_afraid(0);
3969 if (!get_aim_dir(&dir)) return FALSE;
3971 (void)fear_monster(dir, plev);
3974 (void)sleep_monsters_touch();
3977 teleport_player(25+plev/2);
3980 if (!get_aim_dir(&dir)) return FALSE;
3981 fire_blast(GF_LITE, dir, 3+((plev-1)/9), 2, 10, 3);
3985 (void)set_poisoned(0);
3989 if (!get_aim_dir(&dir)) return FALSE;
3990 (void)fire_ball(GF_AWAY_EVIL, dir, MAX_SIGHT*5, 0);
3992 case 9: /* Holy Orb */
3993 if (!get_aim_dir(&dir)) return FALSE;
3995 fire_ball(GF_HOLY_FIRE, dir,
3996 (damroll(3, 6) + plev +
3997 (plev / ((p_ptr->pclass == CLASS_PRIEST ||
3998 p_ptr->pclass == CLASS_HIGH_MAGE ||
3999 p_ptr->pclass == CLASS_SORCERER) ? 2 : 4))),
4000 ((plev < 30) ? 2 : 3));
4003 case 10: /* Exorcism */
4004 (void)dispel_undead(randint1(plev));
4005 (void)dispel_demons(randint1(plev));
4006 (void)turn_evil(plev);
4008 case 11: /* Remove Curse */
4012 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
4014 msg_print("You feel as if someone is watching over you.");
4018 case 12: /* Sense Unseen */
4019 (void)set_tim_invis(randint1(24) + 24, FALSE);
4021 case 13: /* Protection from Evil */
4022 (void)set_protevil(randint1(25) + 3 * p_ptr->lev, FALSE);
4025 if (!get_aim_dir(&dir)) return FALSE;
4026 (void)fire_bolt(GF_ELEC, dir, plev*5);
4028 case 15: /* Holy Word */
4029 (void)dispel_evil(randint1(plev * 6));
4030 (void)hp_player(100);
4031 (void)set_afraid(0);
4032 (void)set_poisoned(0);
4037 if (!get_aim_dir(&dir)) return FALSE;
4039 (void)destroy_door(dir);
4042 if (!get_aim_dir(&dir)) return FALSE;
4043 (void)stasis_evil(dir);
4046 set_tim_sh_holy(randint1(20)+20, FALSE);
4048 case 19: /* Dispel Undead + Demons */
4049 (void)dispel_undead(randint1(plev * 4));
4050 (void)dispel_demons(randint1(plev * 4));
4052 case 20: /* Dispel Evil */
4053 (void)dispel_evil(randint1(plev * 4));
4058 case 22: /* Star Burst */
4059 if (!get_aim_dir(&dir)) return FALSE;
4061 fire_ball(GF_LITE, dir, 100+plev*2, 4);
4063 case 23: /* Summon monster, angel */
4065 bool pet = !one_in_(3);
4068 if (pet) mode |= PM_FORCE_PET;
4069 else mode |= PM_NO_PET;
4070 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
4072 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, SUMMON_ANGEL, mode))
4076 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
4078 msg_print("'What is thy bidding... Master?'");
4083 msg_print("¡Ö²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª °¹Ô¼Ô¤è¡¢²ù¤¤²þ¤á¤è¡ª¡×");
4085 msg_print("Mortal! Repent of thy impiousness.");
4091 case 24: /* Heroism */
4092 (void)set_hero(randint1(25) + 25, FALSE);
4093 (void)hp_player(10);
4094 (void)set_afraid(0);
4096 case 25: /* Remove All Curse */
4097 if (remove_all_curse())
4100 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
4102 msg_print("You feel as if someone is watching over you.");
4106 case 26: /* Banishment */
4107 if (banish_evil(100))
4110 msg_print("¿ÀÀ»¤ÊÎϤ¬¼Ù°¤òÂǤÁʧ¤Ã¤¿¡ª");
4112 msg_print("The holy power banishes evil!");
4117 case 27: /* Word of Destruction */
4118 destroy_area(py, px, 13+randint0(5));
4120 case 28: /* Eye for an Eye */
4121 set_tim_eyeeye(randint1(10)+10, FALSE);
4128 int b = 10 + randint1(10);
4130 if (!get_aim_dir(&dir)) return FALSE;
4132 /* Use the given direction */
4133 tx = px + 99 * ddx[dir];
4134 ty = py + 99 * ddy[dir];
4136 /* Hack -- Use an actual "target" */
4137 if ((dir == 5) && target_okay())
4148 /* Hack -- Stop at the target */
4149 if ((y == ty) && (x == tx)) break;
4153 mmove2(&ny, &nx, py, px, ty, tx);
4155 /* Stop at maximum range */
4156 if (MAX_SIGHT*2 < distance(py, px, ny, nx)) break;
4158 /* Stopped by walls/doors */
4159 if (!cave_floor_bold(ny, nx)) break;
4161 /* Stopped by monsters */
4162 if ((dir != 5) && cave[ny][nx].m_idx != 0) break;
4164 /* Save the new location */
4171 for (i = 0; i < b; i++)
4173 int count = 20, d = 0;
4179 x = tx - 5 + randint0(11);
4180 y = ty - 5 + randint0(11);
4182 dx = (tx > x) ? (tx - x) : (x - tx);
4183 dy = (ty > y) ? (ty - y) : (y - ty);
4185 /* Approximate distance */
4186 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
4187 /* Within the radius */
4191 if (count < 0) continue;
4193 /* Cannot penetrate perm walls */
4194 if (!in_bounds(y,x) ||
4195 cave_stop_disintegration(y,x) ||
4196 !in_disintegration_range(ty, tx, y, x))
4199 project(0, 2, y, x, plev * 3+25, GF_DISINTEGRATE, PROJECT_JUMP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1);
4203 case 30: /* Divine Intervention */
4204 project(0, 1, py, px, plev*11, GF_HOLY_FIRE, PROJECT_KILL, -1);
4205 dispel_monsters(plev * 4);
4207 stun_monsters(plev * 4);
4208 confuse_monsters(plev * 4);
4209 turn_monsters(plev * 4);
4210 stasis_monsters(plev * 4);
4211 (void)hp_player(100);
4217 for (i = 0; i < 12; i++)
4224 scatter(&my, &mx, py, px, 4, 0);
4226 /* Require empty grids */
4227 if (cave_empty_bold2(my, mx)) break;
4229 if (attempt < 0) continue;
4230 summon_specific(-1, my, mx, plev, SUMMON_KNIGHTS, (PM_ALLOW_GROUP | PM_FORCE_PET | PM_HASTE));
4232 (void)set_hero(randint1(25) + 25, FALSE);
4233 (void)set_blessed(randint1(25) + 25, FALSE);
4234 (void)set_fast(randint1(20 + plev) + plev, FALSE);
4235 (void)set_protevil(randint1(25) + 25, FALSE);
4236 (void)set_afraid(0);
4241 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤ÊÇ˼٤μöʸ %d ¤ò¾§¤¨¤¿¡£", spell);
4243 msg_format("You cast an unknown crusade spell: %d.", spell);
4254 void stop_singing(void)
4256 if (p_ptr->pclass != CLASS_BARD) return;
4258 if (p_ptr->magic_num1[1])
4260 p_ptr->magic_num1[1] = 0;
4263 if (!p_ptr->magic_num1[0]) return;
4265 set_action(ACTION_NONE);
4267 switch(p_ptr->magic_num1[0])
4270 if (!p_ptr->blessed)
4272 msg_print("¹â·é¤Êµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4274 msg_print("The prayer has expired.");
4281 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4283 msg_print("The heroism wears off.");
4285 /* Recalculate hitpoints */
4286 p_ptr->update |= (PU_HP);
4290 if (!p_ptr->tim_esp)
4293 msg_print("°Õ¼±¤Ï¸µ¤ËÌá¤Ã¤¿¡£");
4295 msg_print("Your consciousness contracts again.");
4297 /* Update the monsters */
4298 p_ptr->update |= (PU_MONSTERS);
4302 if (!p_ptr->tim_stealth)
4304 msg_print("»Ñ¤¬¤Ï¤Ã¤¤ê¤È¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
4306 msg_print("You are no longer hided.");
4310 if (!p_ptr->oppose_acid)
4312 msg_print("»À¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4314 msg_print("You feel less resistant to acid.");
4316 if (!p_ptr->oppose_elec)
4318 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4320 msg_print("You feel less resistant to elec.");
4322 if (!p_ptr->oppose_fire)
4324 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4326 msg_print("You feel less resistant to fire.");
4328 if (!p_ptr->oppose_cold)
4330 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4332 msg_print("You feel less resistant to cold.");
4334 if (!p_ptr->oppose_pois)
4336 msg_print("ÆǤؤÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4338 msg_print("You feel less resistant to pois.");
4344 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
4346 msg_print("You feel yourself slow down.");
4353 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4355 msg_print("The heroism wears off.");
4357 /* Recalculate hitpoints */
4358 p_ptr->update |= (PU_HP);
4363 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
4365 msg_print("You feel yourself slow down.");
4372 msg_print("̵Ũ¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£");
4374 msg_print("The invulnerability wears off.");
4377 p_ptr->redraw |= (PR_MAP);
4379 /* Update monsters */
4380 p_ptr->update |= (PU_MONSTERS);
4383 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4387 p_ptr->magic_num1[0] = MUSIC_NONE;
4388 p_ptr->magic_num2[0] = 0;
4390 /* Recalculate bonuses */
4391 p_ptr->update |= (PU_BONUS | PU_HP);
4393 /* Redraw status bar */
4394 p_ptr->redraw |= (PR_STATUS);
4398 static bool cast_music_spell(int spell)
4400 int plev = p_ptr->lev;
4403 if(p_ptr->magic_num1[0])
4408 p_ptr->magic_num2[0] = spell;
4412 case 0: /* Song of Holding ÃÙÆߤβΠ*/
4414 msg_print("¤æ¤Ã¤¯¤ê¤È¤·¤¿¥á¥í¥Ç¥£¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4416 msg_print("You start humming a slow, steady melody...");
4418 p_ptr->magic_num1[0] = MUSIC_SLOW;
4420 case 1: /* Song of Blessing ½ËÊ¡¤Î²Î */
4422 msg_print("¸·¤«¤Ê¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4424 msg_print("The holy power of the Music of the Ainur enters you...");
4426 p_ptr->magic_num1[0] = MUSIC_BLESS;
4429 case 2: /* Wrecking Note Êø²õ¤Î²»¿§ */
4430 if (!get_aim_dir(&dir)) return FALSE;
4431 fire_bolt(GF_SOUND, dir,
4432 damroll(4 + ((plev - 1) / 5), 4));
4434 case 3: /* Stun Pattern Û¯Û°¤ÎÀûΧ */
4436 msg_print("âÁÏǤµ¤»¤ë¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4438 msg_print("You weave a pattern of sounds to bewilder and daze...");
4440 p_ptr->magic_num1[0] = MUSIC_STUN;
4442 case 4: /* Flow of life À¸Ì¿¤Îή¤ì */
4444 msg_print("²Î¤òÄ̤·¤ÆÂΤ˳赤¤¬Ìá¤Ã¤Æ¤¤¿¡¥¡¥¡¥");
4446 msg_print("Life flows through you as you sing a song of healing...");
4448 p_ptr->magic_num1[0] = MUSIC_L_LIFE;
4450 case 5: /* Song of the Sun ÂÀÍۤβΠ*/
4452 msg_print("¸÷¤êµ±¤¯²Î¤¬ÊÕ¤ê¤ò¾È¤é¤·¤¿¡£");
4454 msg_print("Your uplifting song brings brightness to dark places...");
4456 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
4458 case 6: /* Song of fear ¶²ÉݤβΠ*/
4460 msg_print("¤ª¤É¤í¤ª¤É¤í¤·¤¤¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4462 msg_print("You start weaving a fearful pattern...");
4464 p_ptr->magic_num1[0] = MUSIC_FEAR;
4466 case 7: /* Heroic Ballad À襤¤Î²Î */
4468 msg_print("·ã¤·¤¤À襤¤Î²Î¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4470 msg_print("You start singing a song of intense fighting...");
4472 p_ptr->magic_num1[0] = MUSIC_HERO;
4474 case 8: /* Clairaudience ÎîŪÃγР*/
4476 msg_print("ÀŤ«¤Ê²»³Ú¤¬´¶³Ð¤ò¸¦¤®À¡¤Þ¤µ¤»¤¿¡¥¡¥¡¥");
4478 msg_print("Your quiet music sharpens your sense of hearing...");
4480 p_ptr->magic_num1[0] = MUSIC_DETECT;
4482 case 9: /* º²¤Î²Î */
4484 msg_print("Àº¿À¤òDZ¤¸¶Ê¤²¤ë²Î¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4486 msg_print("You start singing a song of soul in pain...");
4488 p_ptr->magic_num1[0] = MUSIC_PSI;
4490 case 10: /* Song of Lore Ãμ±¤Î²Î */
4492 msg_print("¤³¤ÎÀ¤³¦¤ÎÃ챤¬Î®¤ì¹þ¤ó¤Ç¤¤¿¡¥¡¥¡¥");
4494 msg_print("You recall the rich lore of the world...");
4496 p_ptr->magic_num1[0] = MUSIC_ID;
4498 case 11: /* hidding song ±£ÆۤβΠ*/
4500 msg_print("¤¢¤Ê¤¿¤Î»Ñ¤¬·Ê¿§¤Ë¤È¤±¤³¤ó¤Ç¤¤¤Ã¤¿¡¥¡¥¡¥");
4502 msg_print("Your song carries you beyond the sight of mortal eyes...");
4504 p_ptr->magic_num1[0] = MUSIC_STEALTH;
4506 case 12: /* Illusion Pattern ¸¸±Æ¤ÎÀûΧ */
4508 msg_print("ÊÕ¤ê°ìÌ̤˸¸±Æ¤¬¸½¤ì¤¿¡¥¡¥¡¥");
4510 msg_print("You weave a pattern of sounds to beguile and confuse...");
4512 p_ptr->magic_num1[0] = MUSIC_CONF;
4514 case 13: /* Doomcall (vibration song) ÇËÌǤζ«¤Ó */
4516 msg_print("¹ì²»¤¬¶Á¤¤¤¿¡¥¡¥¡¥");
4518 msg_print("The fury of the Downfall of Numenor lashes out...");
4520 p_ptr->magic_num1[0] = MUSIC_SOUND;
4522 case 14: /* Firiel's Song (song of the Undeads) ¥Õ¥£¥ê¥¨¥ë¤Î²Î */
4524 msg_print("À¸Ì¿¤ÈÉü³è¤Î¥Æ¡¼¥Þ¤òÁդǻϤ᤿¡¥¡¥¡¥");
4526 msg_print("The themes of life and revival are woven into your song...");
4528 animate_dead(0, py, px);
4530 case 15: /* Fellowship Chant (charming song) ι¤ÎÃç´Ö */
4532 msg_print("°Â¤é¤«¤Ê¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4534 msg_print("You weave a slow, soothing melody of imploration...");
4536 p_ptr->magic_num1[0] = MUSIC_CHARM;
4538 case 16: /* (wall breaking song) ʬ²ò²»ÇÈ */
4540 msg_print("Ê´ºÕ¤¹¤ë¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4542 msg_print("You weave a violent pattern of sounds to break wall.");
4544 p_ptr->magic_num1[0] = MUSIC_WALL;
4545 project(0, 0, py, px,
4546 0, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM | PROJECT_HIDE, -1);
4548 case 17: /* Finrod's Resistance (song of resistance) ¸µÁÇÂÑÀ */
4550 msg_print("¸µÁǤÎÎϤËÂФ¹¤ëǦÂѤβΤò²Î¤Ã¤¿¡£");
4552 msg_print("You sing a song of perseverance against powers...");
4554 p_ptr->magic_num1[0] = MUSIC_RESIST;
4556 case 18: /* Hobbit Melodies (song of time) ¥Û¥Ó¥Ã¥È¤Î¥á¥í¥Ç¥£ */
4558 msg_print("·Ú²÷¤Ê²Î¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4560 msg_print("You start singing joyful pop song...");
4562 p_ptr->magic_num1[0] = MUSIC_SPEED;
4564 case 19: /* World Contortion ÏĤó¤ÀÀ¤³¦ */
4566 msg_print("²Î¤¬¶õ´Ö¤òÏĤ᤿¡¥¡¥¡¥");
4568 msg_print("Reality whirls wildly as you sing a dizzying melody...");
4570 project(0, plev/15 + 1, py, px, plev * 3 + 1, GF_AWAY_ALL , PROJECT_KILL, -1);
4572 case 20: /* Â໶¤Î²Î */
4574 msg_print("ÂѤ¨¤é¤ì¤Ê¤¤ÉÔ¶¨Ï²»¤¬Å¨¤òÀÕ¤áΩ¤Æ¤¿¡¥¡¥¡¥");
4576 msg_print("You cry out in an ear-wracking voice...");
4578 p_ptr->magic_num1[0] = MUSIC_DISPEL;
4580 case 21: /* The Voice of Saruman ¥µ¥ë¥Þ¥ó¤Î´Å¸À */
4582 msg_print("Í¥¤·¤¯¡¢Ì¥ÎÏŪ¤Ê²Î¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4584 msg_print("You start humming a gentle and attractive song...");
4586 p_ptr->magic_num1[0] = MUSIC_SARUMAN;
4588 case 22: /* Song of Tempest (song of death) Íò¤Î²»¿§ */
4589 if (!get_aim_dir(&dir)) return FALSE;
4590 fire_beam(GF_SOUND, dir,
4591 damroll(15 + ((plev - 1) / 2), 10));
4593 case 23: /* (song of disruption) ¤â¤¦°ì¤Ä¤ÎÀ¤³¦ */
4595 msg_print("¼þ°Ï¤¬ÊѲ½¤·»Ï¤á¤¿¡¥¡¥¡¥");
4597 msg_print("You sing of the primeval shaping of Middle-earth...");
4601 case 24: /* Wrecking Pattern (destruction shriek) Ç˲õ¤ÎÀûΧ */
4603 msg_print("Ç˲õŪ¤Ê²Î¤¬¶Á¤¤ï¤¿¤Ã¤¿¡¥¡¥¡¥");
4605 msg_print("You weave a pattern of sounds to contort and shatter...");
4607 p_ptr->magic_num1[0] = MUSIC_QUAKE;
4609 case 25: /* ÄäÂڤβΠ*/
4611 msg_print("¤æ¤Ã¤¯¤ê¤È¤·¤¿¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4613 msg_print("You weave a very slow pattern which is almost likely to stop...");
4615 p_ptr->magic_num1[0] = MUSIC_STASIS;
4617 case 26: /* ¼é¤ê¤Î²Î */
4619 msg_print("²Î¤¬¿ÀÀ»¤Ê¾ì¤òºî¤ê½Ð¤·¤¿¡¥¡¥¡¥");
4621 msg_print("The holy power of the Music is creating sacred field...");
4625 case 27: /* ±Ñͺ¤Î»í */
4627 msg_print("±Ñͺ¤Î²Î¤ò¸ý¤º¤µ¤ó¤À¡¥¡¥¡¥");
4629 msg_print("You chant a powerful, heroic call to arms...");
4631 p_ptr->magic_num1[0] = MUSIC_SHERO;
4632 (void)hp_player(10);
4633 (void)set_afraid(0);
4635 case 28: /* ¥ä¥ô¥¡¥ó¥Ê¤Î½õ¤± */
4637 msg_print("²Î¤òÄ̤·¤ÆÂΤ˳赤¤¬Ìá¤Ã¤Æ¤¤¿¡¥¡¥¡¥");
4639 msg_print("Life flows through you as you sing the song...");
4641 p_ptr->magic_num1[0] = MUSIC_H_LIFE;
4643 case 29: /* ºÆÀ¸¤Î²Î */
4645 msg_print("°Å¹õ¤ÎÃæ¤Ë¸÷¤ÈÈþ¤ò¤Õ¤ê¤Þ¤¤¤¿¡£ÂΤ¬¸µ¤Î³èÎϤò¼è¤êÌᤷ¤¿¡£");
4647 msg_print("You strewed light and beauty in the dark as you sing. You feel refreshed.");
4649 (void)do_res_stat(A_STR);
4650 (void)do_res_stat(A_INT);
4651 (void)do_res_stat(A_WIS);
4652 (void)do_res_stat(A_DEX);
4653 (void)do_res_stat(A_CON);
4654 (void)do_res_stat(A_CHR);
4655 (void)restore_level();
4657 case 30: /* shriek of death ¥µ¥¦¥í¥ó¤ÎËâ½Ñ */
4658 if (!get_aim_dir(&dir)) return FALSE;
4659 fire_ball(GF_SOUND, dir, damroll(50 + plev, 10), 0);
4661 case 31: /* song of liberty ¥Õ¥£¥ó¥´¥ë¥Õ¥£¥ó¤ÎÄ©Àï */
4663 msg_print("¥Õ¥£¥ó¥´¥ë¥Õ¥£¥ó¤Î̽²¦¤Ø¤ÎÄ©Àï¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4665 msg_print("You recall the valor of Fingolfin's challenge to the Dark Lord...");
4667 p_ptr->magic_num1[0] = MUSIC_INVULN;
4670 p_ptr->redraw |= (PR_MAP);
4672 /* Update monsters */
4673 p_ptr->update |= (PU_MONSTERS);
4676 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4680 msg_format("̤ÃΤβÎ(%d)¤ò²Î¤Ã¤¿¡£", spell);
4682 msg_format("You sing an unknown song: %d.", spell);
4687 if (p_ptr->magic_num1[0]) set_action(ACTION_SING);
4689 /* Recalculate bonuses */
4690 p_ptr->update |= (PU_BONUS | PU_HP);
4692 /* Redraw status bar */
4693 p_ptr->redraw |= (PR_STATUS);
4701 void do_cmd_cast(void)
4703 int item, sval, spell, realm;
4718 /* Require spell ability */
4719 if (!p_ptr->realm1 && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE))
4722 msg_print("¼öʸ¤ò¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4724 msg_print("You cannot cast spells!");
4731 if (p_ptr->blind || no_lite())
4734 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡ª");
4736 msg_print("You cannot see!");
4738 if (p_ptr->pclass == CLASS_FORCETRAINER)
4745 /* Not when confused */
4746 if (p_ptr->confused)
4749 msg_print("º®Í𤷤Ƥ¤¤Æ¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4751 msg_print("You are too confused!");
4757 prayer = spell_categoly_name(mp_ptr->spell_book);
4759 /* Restrict choices to spell books */
4760 item_tester_tval = mp_ptr->spell_book;
4764 q = "¤É¤Î¼öʸ½ñ¤ò»È¤¤¤Þ¤¹¤«? ";
4766 q = "Use which book? ";
4770 s = "¼öʸ½ñ¤¬¤Ê¤¤¡ª";
4772 s = "You have no spell books!";
4775 if (p_ptr->pclass == CLASS_FORCETRAINER)
4776 select_the_force = TRUE;
4777 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))){
4778 select_the_force = FALSE;
4781 select_the_force = FALSE;
4783 if (item == INVEN_FORCE) { /* the_force */
4787 /* Get the item (in the pack) */
4790 o_ptr = &inventory[item];
4793 /* Get the item (on the floor) */
4796 o_ptr = &o_list[0 - item];
4799 /* Access the item's sval */
4802 if ((p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE) && (o_ptr->tval == REALM2_BOOK)) increment = 32;
4805 /* Track the object kind */
4806 object_kind_track(o_ptr->k_idx);
4808 /* Hack -- Handle stuff */
4811 if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
4812 realm = o_ptr->tval - TV_LIFE_BOOK + 1;
4813 else if (increment) realm = p_ptr->realm2;
4814 else realm = p_ptr->realm1;
4816 /* Ask for a spell */
4818 if (!get_spell(&spell,
4819 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "±Ó¾§¤¹¤ë" : (mp_ptr->spell_book == TV_MUSIC_BOOK) ? "²Î¤¦" : "¾§¤¨¤ë"),
4822 if (spell == -2) msg_format("¤½¤ÎËܤˤÏÃΤäƤ¤¤ë%s¤¬¤Ê¤¤¡£", prayer);
4826 if (!get_spell(&spell, ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "recite" : "cast"),
4830 msg_format("You don't know any %ss in that book.", prayer);
4836 use_realm = tval2realm(o_ptr->tval);
4838 if (!is_magic(use_realm))
4840 s_ptr = &technic_info[use_realm - MIN_TECHNIC][spell];
4844 s_ptr = &mp_ptr->info[realm - 1][spell];
4847 /* Extract mana consumption rate */
4848 need_mana = mod_need_mana(s_ptr->smana, spell, realm);
4850 /* Verify "dangerous" spells */
4851 if (need_mana > p_ptr->csp)
4853 if (flush_failure) flush();
4857 msg_format("¤½¤Î%s¤ò%s¤Î¤Ë½½Ê¬¤Ê¥Þ¥¸¥Ã¥¯¥Ý¥¤¥ó¥È¤¬¤Ê¤¤¡£",prayer,
4858 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "±Ó¾§¤¹¤ë" : (mp_ptr->spell_book == TV_LIFE_BOOK) ? "²Î¤¦" : "¾§¤¨¤ë"));
4860 msg_format("You do not have enough mana to %s this %s.",
4861 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "recite" : "cast"),
4866 if (!over_exert) return;
4870 if (!get_check_strict("¤½¤ì¤Ç¤âÄ©À路¤Þ¤¹¤«? ", CHECK_OKAY_CANCEL)) return;
4872 if (!get_check_strict("Attempt it anyway? ", CHECK_OKAY_CANCEL)) return;
4878 /* Spell failure chance */
4879 chance = spell_chance(spell, use_realm);
4882 if (randint0(100) < chance)
4884 if (flush_failure) flush();
4887 msg_format("%s¤ò¤¦¤Þ¤¯¾§¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡ª", prayer);
4889 msg_format("You failed to get the %s off!", prayer);
4897 if (randint1(100) < chance) chg_virtue(V_VITALITY, -1);
4900 if (randint1(100) < chance) chg_virtue(V_UNLIFE, -1);
4903 if (randint1(100) < chance) chg_virtue(V_NATURE, -1);
4906 if (randint1(100) < chance) chg_virtue(V_JUSTICE, 1);
4909 if (randint1(100) < chance) chg_virtue(V_JUSTICE, -1);
4912 if (randint1(100) < chance) chg_virtue(V_KNOWLEDGE, -1);
4916 if (realm == REALM_TRUMP)
4918 cast_trump_spell(spell, FALSE);
4920 else if ((o_ptr->tval == TV_CHAOS_BOOK) && (randint1(100) < spell))
4923 msg_print("¥«¥ª¥¹Åª¤Ê¸ú²Ì¤òȯÀ¸¤·¤¿¡ª");
4925 msg_print("You produce a chaotic effect!");
4930 else if ((o_ptr->tval == TV_DEATH_BOOK) && (randint1(100) < spell))
4932 if ((sval == 3) && one_in_(2))
4934 sanity_blast(0, TRUE);
4939 msg_print("Äˤ¤¡ª");
4941 msg_print("It hurts!");
4945 take_hit(DAMAGE_LOSELIFE, damroll(o_ptr->sval + 1, 6), "°Å¹õËâË¡¤ÎµÕή", -1);
4947 take_hit(DAMAGE_LOSELIFE, damroll(o_ptr->sval + 1, 6), "a miscast Death spell", -1);
4950 if ((spell > 15) && one_in_(6) && !p_ptr->hold_life)
4951 lose_exp(spell * 250);
4954 else if ((o_ptr->tval == TV_MUSIC_BOOK) && (randint1(200) < spell))
4957 msg_print("¤¤¤ä¤Ê²»¤¬¶Á¤¤¤¿");
4959 msg_print("An infernal sound echoed.");
4962 aggravate_monsters(0);
4964 if (randint1(100) >= chance)
4965 chg_virtue(V_CHANCE,-1);
4974 case REALM_LIFE: /* * LIFE * */
4975 cast = cast_life_spell(spell);
4977 case REALM_SORCERY: /* * SORCERY * */
4978 cast = cast_sorcery_spell(spell);
4980 case REALM_NATURE: /* * NATURE * */
4981 cast = cast_nature_spell(spell);
4983 case REALM_CHAOS: /* * CHAOS * */
4984 cast = cast_chaos_spell(spell);
4986 case REALM_DEATH: /* * DEATH * */
4987 cast = cast_death_spell(spell);
4989 case REALM_TRUMP: /* TRUMP */
4990 cast = cast_trump_spell(spell, TRUE);
4992 case REALM_ARCANE: /* ARCANE */
4993 cast = cast_arcane_spell(spell);
4995 case REALM_ENCHANT: /* ENCHANT */
4996 cast = cast_enchant_spell(spell);
4998 case REALM_DAEMON: /* DAEMON */
4999 cast = cast_daemon_spell(spell);
5001 case REALM_CRUSADE: /* CRUSADE */
5002 cast = cast_crusade_spell(spell);
5004 case REALM_MUSIC: /* MUSIC */
5005 cast = cast_music_spell(spell);
5009 msg_format("You cast a spell from an unknown realm: realm %d, spell %d.", realm, spell);
5013 /* Canceled spells cost neither a turn nor mana */
5016 if (randint1(100) < chance)
5017 chg_virtue(V_CHANCE,1);
5019 /* A spell was cast */
5021 (p_ptr->spell_worked2 & (1L << spell)) :
5022 (p_ptr->spell_worked1 & (1L << spell)))
5023 && (p_ptr->pclass != CLASS_SORCERER)
5024 && (p_ptr->pclass != CLASS_RED_MAGE))
5026 int e = s_ptr->sexp;
5028 /* The spell worked */
5029 if (realm == p_ptr->realm1)
5031 p_ptr->spell_worked1 |= (1L << spell);
5035 p_ptr->spell_worked2 |= (1L << spell);
5038 /* Gain experience */
5039 gain_exp(e * s_ptr->slevel);
5041 /* Redraw object recall */
5042 p_ptr->window |= (PW_OBJECT);
5047 chg_virtue(V_TEMPERANCE, 1);
5048 chg_virtue(V_COMPASSION, 1);
5049 chg_virtue(V_VITALITY, 1);
5050 chg_virtue(V_DILIGENCE, 1);
5053 chg_virtue(V_UNLIFE, 1);
5054 chg_virtue(V_JUSTICE, -1);
5055 chg_virtue(V_FAITH, -1);
5056 chg_virtue(V_VITALITY, -1);
5059 chg_virtue(V_JUSTICE, -1);
5060 chg_virtue(V_FAITH, -1);
5061 chg_virtue(V_HONOUR, -1);
5062 chg_virtue(V_TEMPERANCE, -1);
5065 chg_virtue(V_FAITH, 1);
5066 chg_virtue(V_JUSTICE, 1);
5067 chg_virtue(V_SACRIFICE, 1);
5068 chg_virtue(V_HONOUR, 1);
5071 chg_virtue(V_NATURE, 1);
5072 chg_virtue(V_HARMONY, 1);
5075 chg_virtue(V_KNOWLEDGE, 1);
5082 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_TEMPERANCE, 1);
5083 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_COMPASSION, 1);
5084 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_VITALITY, 1);
5085 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_DILIGENCE, 1);
5088 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_UNLIFE, 1);
5089 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_JUSTICE, -1);
5090 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_FAITH, -1);
5091 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_VITALITY, -1);
5094 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_JUSTICE, -1);
5095 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_FAITH, -1);
5096 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_HONOUR, -1);
5097 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_TEMPERANCE, -1);
5100 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_FAITH, 1);
5101 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_JUSTICE, 1);
5102 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_SACRIFICE, 1);
5103 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_HONOUR, 1);
5106 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_NATURE, 1);
5107 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_HARMONY, 1);
5110 if (mp_ptr->spell_xtra & MAGIC_GAIN_EXP)
5112 s16b cur_exp = p_ptr->spell_exp[(increment ? 32 : 0)+spell];
5117 else if(cur_exp < 1200)
5119 if ((dun_level > 4) && ((dun_level + 10) > p_ptr->lev))
5122 else if(cur_exp < 1400)
5124 if (((dun_level + 5) > p_ptr->lev) && ((dun_level + 5) > s_ptr->slevel))
5127 else if((cur_exp < 1600) && !increment)
5129 if (((dun_level + 5) > p_ptr->lev) && (dun_level > s_ptr->slevel))
5132 p_ptr->spell_exp[(increment ? 32 : 0)+spell] += exp_gain;
5139 /* Sufficient mana */
5140 if (need_mana <= p_ptr->csp)
5143 p_ptr->csp -= need_mana;
5146 /* Over-exert the player */
5149 int oops = need_mana;
5153 p_ptr->csp_frac = 0;
5157 msg_print("Àº¿À¤ò½¸Ã椷¤¹¤®¤Æµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
5159 msg_print("You faint from the effort!");
5163 /* Hack -- Bypass free action */
5164 (void)set_paralyzed(p_ptr->paralyzed + randint1(5 * oops + 1));
5169 chg_virtue(V_VITALITY, -10);
5172 chg_virtue(V_UNLIFE, -10);
5175 chg_virtue(V_JUSTICE, 10);
5178 chg_virtue(V_NATURE, -10);
5181 chg_virtue(V_JUSTICE, -10);
5184 chg_virtue(V_KNOWLEDGE, -10);
5188 /* Damage CON (possibly permanently) */
5189 if (randint0(100) < 50)
5191 bool perm = (randint0(100) < 25);
5195 msg_print("ÂΤò°¤¯¤·¤Æ¤·¤Þ¤Ã¤¿¡ª");
5197 msg_print("You have damaged your health!");
5201 /* Reduce constitution */
5202 (void)dec_stat(A_CON, 15 + randint1(10), perm);
5207 p_ptr->redraw |= (PR_MANA);
5210 p_ptr->window |= (PW_PLAYER);
5211 p_ptr->window |= (PW_SPELL);
5216 * Pray a prayer -- Unused in Hengband
5218 void do_cmd_pray(void)
5220 msg_print("Praying is not used in Hengband. Use magic spell casting instead.");
5223 static bool ang_sort_comp_pet_dismiss(vptr u, vptr v, int a, int b)
5225 u16b *who = (u16b*)(u);
5230 monster_type *m_ptr1 = &m_list[w1];
5231 monster_type *m_ptr2 = &m_list[w2];
5232 monster_race *r_ptr1 = &r_info[m_ptr1->r_idx];
5233 monster_race *r_ptr2 = &r_info[m_ptr2->r_idx];
5238 if (w1 == p_ptr->riding) return TRUE;
5239 if (w2 == p_ptr->riding) return FALSE;
5241 if (m_ptr1->nickname && !m_ptr2->nickname) return TRUE;
5242 if (m_ptr2->nickname && !m_ptr1->nickname) return FALSE;
5244 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return TRUE;
5245 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return FALSE;
5247 if (r_ptr1->level > r_ptr2->level) return TRUE;
5248 if (r_ptr2->level > r_ptr1->level) return FALSE;
5250 if (m_ptr1->hp > m_ptr2->hp) return TRUE;
5251 if (m_ptr2->hp > m_ptr1->hp) return FALSE;
5256 int calculate_upkeep(void)
5258 s32b old_friend_align = friend_align;
5260 bool have_a_unique = FALSE;
5263 total_friend_levels = 0;
5266 for (m_idx = m_max - 1; m_idx >=1; m_idx--)
5268 monster_type *m_ptr;
5269 monster_race *r_ptr;
5271 m_ptr = &m_list[m_idx];
5272 if (!m_ptr->r_idx) continue;
5273 r_ptr = &r_info[m_ptr->r_idx];
5278 if (r_ptr->flags1 & RF1_UNIQUE)
5280 if (p_ptr->pclass == CLASS_CAVALRY)
5282 if (p_ptr->riding == m_idx)
5283 total_friend_levels += (r_ptr->level+5)*2;
5284 else if (!have_a_unique && (r_info[m_ptr->r_idx].flags7 & RF7_RIDING))
5285 total_friend_levels += (r_ptr->level+5)*7/2;
5287 total_friend_levels += (r_ptr->level+5)*10;
5288 have_a_unique = TRUE;
5291 total_friend_levels += (r_ptr->level+5)*10;
5294 total_friend_levels += r_ptr->level;
5296 /* Determine pet alignment */
5297 if (r_ptr->flags3 & RF3_GOOD)
5299 friend_align += r_ptr->level;
5301 else if (r_ptr->flags3 & RF3_EVIL)
5303 friend_align -= r_ptr->level;
5307 if (old_friend_align != friend_align) p_ptr->update |= (PU_BONUS);
5311 upkeep_factor = (total_friend_levels - (p_ptr->lev * 80 / (cp_ptr->pet_upkeep_div)));
5312 if (upkeep_factor < 0) upkeep_factor = 0;
5313 if (upkeep_factor > 1000) upkeep_factor = 1000;
5314 return upkeep_factor;
5320 void do_cmd_pet_dismiss(void)
5322 monster_type *m_ptr;
5323 bool all_pets = FALSE;
5337 /* Allocate the "who" array */
5338 C_MAKE(who, max_m_idx, u16b);
5340 /* Process the monsters (backwards) */
5341 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
5343 if (is_pet(&m_list[pet_ctr]))
5344 who[max_pet++] = pet_ctr;
5347 /* Select the sort method */
5348 ang_sort_comp = ang_sort_comp_pet_dismiss;
5349 ang_sort_swap = ang_sort_swap_hook;
5351 ang_sort(who, &dummy_why, max_pet);
5353 /* Process the monsters (backwards) */
5354 for (i = 0; i < max_pet; i++)
5357 char friend_name[80];
5361 /* Access the monster */
5363 m_ptr = &m_list[pet_ctr];
5365 delete_this = FALSE;
5366 kakunin = ((pet_ctr == p_ptr->riding) || (m_ptr->nickname));
5367 monster_desc(friend_name, m_ptr, 0x80);
5371 /* Hack -- health bar for this monster */
5372 health_track(pet_ctr);
5374 /* Hack -- handle stuff */
5378 sprintf(buf, "%s¤òÊü¤·¤Þ¤¹¤«¡© [Yes/No/Unnamed (%dɤ)]", friend_name, max_pet-i);
5380 sprintf(buf, "Dismiss %s? [Yes/No/Unnamed (%d remain)]", friend_name, max_pet-i);
5385 move_cursor_relative(m_ptr->fy, m_ptr->fx);
5391 if (ch == 'Y' || ch == 'y')
5398 sprintf(buf, "ËÜÅö¤Ë¤è¤í¤·¤¤¤Ç¤¹¤«¡© (%s) ", friend_name);
5400 sprintf(buf, "Are you sure? (%s) ", friend_name);
5402 if (!get_check(buf))
5403 delete_this = FALSE;
5408 if (ch == 'U' || ch == 'u')
5414 if (ch == ESCAPE || ch == 'N' || ch == 'n')
5421 if ((all_pets && !kakunin) || (!all_pets && delete_this))
5423 if (record_named_pet && m_ptr->nickname)
5427 monster_desc(m_name, m_ptr, 0x08);
5428 do_cmd_write_nikki(NIKKI_NAMED_PET, 2, m_name);
5431 if (pet_ctr == p_ptr->riding)
5434 msg_format("%s¤«¤é¹ß¤ê¤¿¡£", friend_name);
5436 msg_format("You have got off %s. ", friend_name);
5441 /* Update the monsters */
5442 p_ptr->update |= (PU_BONUS | PU_MONSTERS);
5443 p_ptr->redraw |= (PR_EXTRA);
5446 /* HACK : Add the line to message buffer */
5448 sprintf(buf, "%s ¤òÊü¤·¤¿¡£", friend_name);
5450 sprintf(buf, "Dismissed %s.", friend_name);
5453 p_ptr->window |= (PW_MESSAGE);
5456 delete_monster_idx(pet_ctr);
5465 C_KILL(who, max_m_idx, u16b);
5468 msg_format("%d ɤ¤Î¥Ú¥Ã¥È¤òÊü¤·¤Þ¤·¤¿¡£", Dismissed);
5470 msg_format("You have dismissed %d pet%s.", Dismissed,
5471 (Dismissed == 1 ? "" : "s"));
5473 if (Dismissed == 0 && all_pets)
5475 msg_print("'U'nnamed ¤Ï¡¢¾èÇϰʳ°¤Î̾Á°¤Î¤Ê¤¤¥Ú¥Ã¥È¤À¤±¤òÁ´¤Æ²òÊü¤·¤Þ¤¹¡£");
5477 msg_print("'U'nnamed means all your pets except named pets and your mount.");
5480 p_ptr->update |= (PU_MON_LITE);
5483 bool rakuba(int dam, bool force)
5485 int i, y, x, oy, ox;
5486 int sn = 0, sy = 0, sx = 0;
5488 monster_type *m_ptr = &m_list[p_ptr->riding];
5489 monster_race *r_ptr = &r_info[m_ptr->r_idx];
5491 if (!p_ptr->riding) return FALSE;
5492 if (p_ptr->wild_mode) return FALSE;
5494 if (dam >= 0 || force)
5498 int level = r_ptr->level;
5499 if (p_ptr->riding_ryoute) level += 20;
5500 if ((dam/2 + r_ptr->level) > (p_ptr->skill_exp[GINOU_RIDING]/30+10))
5502 if((p_ptr->skill_exp[GINOU_RIDING] < s_info[p_ptr->pclass].s_max[GINOU_RIDING]) && s_info[p_ptr->pclass].s_max[GINOU_RIDING] > 1000)
5504 if (r_ptr->level*100 > (p_ptr->skill_exp[GINOU_RIDING] + 1500))
5505 p_ptr->skill_exp[GINOU_RIDING] += (1+(r_ptr->level - p_ptr->skill_exp[GINOU_RIDING]/100 - 15));
5506 else p_ptr->skill_exp[GINOU_RIDING]++;
5509 if (randint0(dam/2 + level*2) < (p_ptr->skill_exp[GINOU_RIDING]/30+10))
5511 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))
5517 /* Check around the player */
5518 for (i = 0; i < 8; i++)
5522 /* Access the location */
5523 y = py + ddy_ddd[i];
5524 x = px + ddx_ddd[i];
5526 c_ptr = &cave[y][x];
5528 /* Skip non-empty grids */
5529 if (cave_perma_grid(c_ptr)) continue;
5530 if (!cave_empty_grid2(c_ptr)) continue;
5532 if (c_ptr->m_idx) continue;
5534 /* Count "safe" grids */
5537 /* Randomize choice */
5538 if (randint0(sn) > 0) continue;
5540 /* Save the safe location */
5545 monster_desc(m_name, m_ptr, 0);
5547 msg_format("%s¤«¤é¿¶¤êÍî¤È¤µ¤ì¤½¤¦¤Ë¤Ê¤Ã¤Æ¡¢Êɤˤ֤Ĥ«¤Ã¤¿¡£",m_name);
5548 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "Êɤؤξ×ÆÍ", -1);
5550 msg_format("You have nearly fallen from %s, but bumped into wall.",m_name);
5551 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "bumping into wall", -1);
5562 /* Redraw the old spot */
5565 /* Redraw the new spot */
5568 /* Check for new panel */
5573 p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5574 p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE;
5578 p_ptr->update |= (PU_BONUS);
5581 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW);
5583 /* Update the monsters */
5584 p_ptr->update |= (PU_DISTANCE);
5587 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5589 p_ptr->redraw |= (PR_EXTRA);
5591 /* Update health track of mount */
5592 p_ptr->redraw |= (PR_UHEALTH);
5594 if (p_ptr->ffall && !force)
5596 monster_desc(m_name, m_ptr, 0);
5598 msg_format("%s¤«¤éÍî¤Á¤¿¤¬¡¢¶õÃæ¤Ç¤¦¤Þ¤¯ÂÎÀª¤òΩ¤Æľ¤·¤ÆÃåÃϤ·¤¿¡£",m_name);
5600 msg_format("You are thrown from %s, but make a good landing.",m_name);
5605 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "ÍîÇÏ", -1);
5607 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "Falling from riding", -1);
5613 bool do_riding(bool force)
5615 int oy, ox, x, y, dir = 0;
5617 monster_type *m_ptr;
5619 if (!get_rep_dir2(&dir)) return FALSE;
5622 c_ptr = &cave[y][x];
5626 /* Skip non-empty grids */
5627 if (!cave_empty_bold2(y, x) || c_ptr->m_idx)
5630 msg_print("¤½¤Á¤é¤Ë¤Ï¹ß¤ê¤é¤ì¤Þ¤»¤ó¡£");
5632 msg_print("You cannot go to that direction.");
5637 p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5638 p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE;
5642 if (p_ptr->confused)
5645 msg_print("º®Í𤷤Ƥ¤¤Æ¾è¤ì¤Ê¤¤¡ª");
5647 msg_print("You are too confused!");
5651 if (!(c_ptr->m_idx))
5654 msg_print("¤½¤Î¾ì½ê¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
5656 msg_print("Here is no pet.");
5662 m_ptr = &m_list[c_ptr->m_idx];
5664 if (!is_pet(m_ptr) && !force)
5667 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï¥Ú¥Ã¥È¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£");
5669 msg_print("That monster is not a pet.");
5674 if (!(r_info[m_ptr->r_idx].flags7 & RF7_RIDING))
5677 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ë¤Ï¾è¤ì¤Ê¤µ¤½¤¦¤À¡£");
5679 msg_print("This monster doesn't seem suitable for riding.");
5684 if (!(p_ptr->pass_wall) && (c_ptr->feat >= FEAT_RUBBLE) && (c_ptr->feat <= FEAT_PERM_SOLID))
5687 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤ÏÊɤÎÃæ¤Ë¤¤¤ë¡£");
5689 msg_print("This monster is in the wall.");
5694 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)))
5697 msg_print("¥Ñ¥¿¡¼¥ó¤Î¾å¤«¤é¤Ï¾è¤ì¤Þ¤»¤ó¡£");
5699 msg_print("You cannot ride from on Pattern.");
5707 msg_print("¤½¤Î¾ì½ê¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
5709 msg_print("Here is no monster.");
5714 if (r_info[m_ptr->r_idx].level > randint1((p_ptr->skill_exp[GINOU_RIDING]/50 + p_ptr->lev/2 +20)))
5717 msg_print("¤¦¤Þ¤¯¾è¤ì¤Ê¤«¤Ã¤¿¡£");
5719 msg_print("You failed to ride.");
5729 monster_desc(m_name, m_ptr, 0);
5732 msg_format("%s¤òµ¯¤³¤·¤¿¡£", m_name);
5734 msg_format("You have waked %s up.", m_name);
5738 p_ptr->riding = c_ptr->m_idx;
5740 /* Hack -- remove tracked monster */
5741 if (p_ptr->riding == p_ptr->health_who) health_track(0);
5744 /* Save the old location */
5748 /* Move the player to the safe location */
5752 /* Redraw the old spot */
5755 /* Redraw the new spot */
5758 /* Check for new panel */
5763 /* Mega-Hack -- Forget the view and lite */
5764 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
5767 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW);
5769 /* Update the monsters */
5770 p_ptr->update |= (PU_DISTANCE);
5772 /* Update the monsters */
5773 p_ptr->update |= (PU_BONUS);
5776 p_ptr->redraw |= (PR_MAP | PR_EXTRA);
5779 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5781 p_ptr->redraw |= (PR_UHEALTH);
5787 static void do_name_pet(void)
5789 monster_type *m_ptr;
5792 bool old_name = FALSE;
5793 bool old_target_pet = target_pet;
5796 if (!target_set(TARGET_KILL))
5798 target_pet = old_target_pet;
5801 target_pet = old_target_pet;
5803 if (cave[target_row][target_col].m_idx)
5805 m_ptr = &m_list[cave[target_row][target_col].m_idx];
5811 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï¥Ú¥Ã¥È¤Ç¤Ï¤Ê¤¤¡£");
5813 msg_format("This monster is not a pet.");
5817 if (r_info[m_ptr->r_idx].flags1 & RF1_UNIQUE)
5820 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Î̾Á°¤ÏÊѤ¨¤é¤ì¤Ê¤¤¡ª");
5822 msg_format("You cannot change name of this monster!");
5826 monster_desc(m_name, m_ptr, 0);
5830 msg_format("%s¤Ë̾Á°¤ò¤Ä¤±¤ë¡£", m_name);
5832 msg_format("Name %s.", m_name);
5837 /* Start with nothing */
5838 strcpy(out_val, "");
5840 /* Use old inscription */
5841 if (m_ptr->nickname)
5843 /* Start with the old inscription */
5844 strcpy(out_val, quark_str(m_ptr->nickname));
5848 /* Get a new inscription (possibly empty) */
5850 if (get_string("̾Á°: ", out_val, 15))
5852 if (get_string("Name: ", out_val, 15))
5858 /* Save the inscription */
5859 m_ptr->nickname = quark_add(out_val);
5860 if (record_named_pet)
5864 monster_desc(m_name, m_ptr, 0x08);
5865 do_cmd_write_nikki(NIKKI_NAMED_PET, 0, m_name);
5870 if (record_named_pet && old_name)
5874 monster_desc(m_name, m_ptr, 0x08);
5875 do_cmd_write_nikki(NIKKI_NAMED_PET, 1, m_name);
5877 m_ptr->nickname = 0;
5884 * Issue a pet command
5886 void do_cmd_pet(void)
5891 cptr power_desc[36];
5896 int pets = 0, pet_ctr;
5897 monster_type *m_ptr;
5904 char target_buf[160];
5908 /* Calculate pets */
5909 /* Process the monsters (backwards) */
5910 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
5912 /* Access the monster */
5913 m_ptr = &m_list[pet_ctr];
5915 if (is_pet(m_ptr)) pets++;
5919 power_desc[num] = "¥Ú¥Ã¥È¤òÊü¤¹";
5921 power_desc[num] = "dismiss pets";
5924 powers[num++] = PET_DISMISS;
5927 sprintf(target_buf,"¥Ú¥Ã¥È¤Î¥¿¡¼¥²¥Ã¥È¤ò»ØÄê (¸½ºß¡§%s)",
5928 (pet_t_m_idx ? r_name + r_info[m_list[pet_t_m_idx].r_idx].name : "»ØÄê¤Ê¤·"));
5930 sprintf(target_buf,"specify a targert of pet (now:%s)",
5931 (pet_t_m_idx ? r_name + r_info[m_list[pet_t_m_idx].r_idx].name : "nothing"));
5933 power_desc[num] = target_buf;
5935 powers[num++] = PET_TARGET;
5938 power_desc[num] = "¶á¤¯¤Ë¤¤¤í";
5940 power_desc[num] = "stay close";
5943 if (p_ptr->pet_follow_distance == PET_CLOSE_DIST) mode = num;
5944 powers[num++] = PET_STAY_CLOSE;
5947 power_desc[num] = "¤Ä¤¤¤ÆÍ褤";
5949 power_desc[num] = "follow me";
5952 if (p_ptr->pet_follow_distance == PET_FOLLOW_DIST) mode = num;
5953 powers[num++] = PET_FOLLOW_ME;
5956 power_desc[num] = "Ũ¤ò¸«¤Ä¤±¤ÆÅݤ»";
5958 power_desc[num] = "seek and destroy";
5961 if (p_ptr->pet_follow_distance == PET_DESTROY_DIST) mode = num;
5962 powers[num++] = PET_SEEK_AND_DESTROY;
5965 power_desc[num] = "¾¯¤·Î¥¤ì¤Æ¤¤¤í";
5967 power_desc[num] = "give me space";
5970 if (p_ptr->pet_follow_distance == PET_SPACE_DIST) mode = num;
5971 powers[num++] = PET_ALLOW_SPACE;
5974 power_desc[num] = "Î¥¤ì¤Æ¤¤¤í";
5976 power_desc[num] = "stay away";
5979 if (p_ptr->pet_follow_distance == PET_AWAY_DIST) mode = num;
5980 powers[num++] = PET_STAY_AWAY;
5982 if (p_ptr->pet_extra_flags & PF_OPEN_DOORS)
5985 power_desc[num] = "¥É¥¢¤ò³«¤±¤ë (¸½ºß:ON)";
5987 power_desc[num] = "pets open doors (now On)";
5994 power_desc[num] = "¥É¥¢¤ò³«¤±¤ë (¸½ºß:OFF)";
5996 power_desc[num] = "pets open doors (now Off)";
6000 powers[num++] = PET_OPEN_DOORS;
6002 if (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS)
6005 power_desc[num] = "¥¢¥¤¥Æ¥à¤ò½¦¤¦ (¸½ºß:ON)";
6007 power_desc[num] = "pets pick up items (now On)";
6014 power_desc[num] = "¥¢¥¤¥Æ¥à¤ò½¦¤¦ (¸½ºß:OFF)";
6016 power_desc[num] = "pets pick up items (now Off)";
6020 powers[num++] = PET_TAKE_ITEMS;
6022 if (p_ptr->pet_extra_flags & PF_TELEPORT)
6025 power_desc[num] = "¥Æ¥ì¥Ý¡¼¥È·ÏËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6027 power_desc[num] = "allow teleport (now On)";
6034 power_desc[num] = "¥Æ¥ì¥Ý¡¼¥È·ÏËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6036 power_desc[num] = "allow teleport (now Off)";
6040 powers[num++] = PET_TELEPORT;
6042 if (p_ptr->pet_extra_flags & PF_ATTACK_SPELL)
6045 power_desc[num] = "¹¶·âËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6047 power_desc[num] = "allow cast attack spell (now On)";
6054 power_desc[num] = "¹¶·âËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6056 power_desc[num] = "allow cast attack spell (now Off)";
6060 powers[num++] = PET_ATTACK_SPELL;
6062 if (p_ptr->pet_extra_flags & PF_SUMMON_SPELL)
6065 power_desc[num] = "¾¤´ËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6067 power_desc[num] = "allow cast summon spell (now On)";
6074 power_desc[num] = "¾¤´ËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6076 power_desc[num] = "allow cast summon spell (now Off)";
6080 powers[num++] = PET_SUMMON_SPELL;
6082 if (p_ptr->pet_extra_flags & PF_BALL_SPELL)
6085 power_desc[num] = "¥×¥ì¥¤¥ä¡¼¤ò´¬¤¹þ¤àÈÏ°ÏËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6087 power_desc[num] = "allow involve player in area spell (now On)";
6094 power_desc[num] = "¥×¥ì¥¤¥ä¡¼¤ò´¬¤¹þ¤àÈÏ°ÏËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6096 power_desc[num] = "allow involve player in area spell (now Off)";
6100 powers[num++] = PET_BALL_SPELL;
6105 power_desc[num] = "¥Ú¥Ã¥È¤«¤é¹ß¤ê¤ë";
6107 power_desc[num] = "get off a pet";
6114 power_desc[num] = "¥Ú¥Ã¥È¤Ë¾è¤ë";
6116 power_desc[num] = "ride a pet";
6120 powers[num++] = PET_RIDING;
6123 power_desc[num] = "¥Ú¥Ã¥È¤Ë̾Á°¤ò¤Ä¤±¤ë¡£";
6125 power_desc[num] = "name pets";
6128 powers[num++] = PET_NAME;
6130 if (p_ptr->riding && buki_motteruka(INVEN_RARM) && (empty_hands(FALSE) & 0x00000001) && ((inventory[INVEN_RARM].weight > 99) || (inventory[INVEN_RARM].tval == TV_POLEARM)))
6132 if (p_ptr->pet_extra_flags & PF_RYOUTE)
6135 power_desc[num] = "Éð´ï¤òÊÒ¼ê¤Ç»ý¤Ä";
6137 power_desc[num] = "use one hand to control a riding pet";
6144 power_desc[num] = "Éð´ï¤òξ¼ê¤Ç»ý¤Ä";
6146 power_desc[num] = "use both hands for a weapon.";
6151 powers[num++] = PET_RYOUTE;
6154 /* Nothing chosen yet */
6157 /* Build a prompt (accept all spells) */
6160 /* Build a prompt (accept all spells) */
6162 strnfmt(out_val, 78, "(¥³¥Þ¥ó¥É %c-%c¡¢'*'=°ìÍ÷¡¢ESC=½ªÎ») ¥³¥Þ¥ó¥É¤òÁª¤ó¤Ç¤¯¤À¤µ¤¤:",
6164 strnfmt(out_val, 78, "(Command %c-%c, *=List, ESC=exit) Select a command: ",
6167 I2A(0), I2A(num - 1));
6172 strnfmt(out_val, 78, "(¥³¥Þ¥ó¥É %c-%c¡¢'*'=°ìÍ÷¡¢ESC=½ªÎ») ¥³¥Þ¥ó¥É¤òÁª¤ó¤Ç¤¯¤À¤µ¤¤:",
6174 strnfmt(out_val, 78, "(Command %c-%c, *=List, ESC=exit) Select a command: ",
6177 I2A(0), '0' + num - 27);
6183 /* Save the screen */
6190 prt(format("%s%c) %s", (ctr == mode) ? "*" : " ", I2A(ctr), power_desc[ctr]), y + ctr, x);
6196 prt("", y + ctr, x);
6203 /* Get a command from the user */
6204 while (!flag && get_com(out_val, &choice, TRUE))
6206 /* Request redraw */
6207 if ((choice == ' ') || (choice == '*') || (choice == '?'))
6219 /* Save the screen */
6226 sprintf(buf, "%s%c) %s", (ctr == mode) ? "*" : " ", I2A(ctr), power_desc[ctr]);
6227 prt(buf, y + ctr, x);
6233 prt("", y + ctr, x);
6247 /* Restore the screen */
6255 if (isalpha(choice))
6258 ask = (isupper(choice));
6261 if (ask) choice = tolower(choice);
6263 /* Extract request */
6264 i = (islower(choice) ? A2I(choice) : -1);
6268 ask = FALSE; /* Can't uppercase digits */
6270 i = choice - '0' + 26;
6273 /* Totally Illegal */
6274 if ((i < 0) || (i >= num))
6285 strnfmt(buf, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡© ", power_desc[i]);
6287 strnfmt(buf, 78, "Use %s? ", power_desc[i]);
6291 /* Belay that order */
6292 if (!get_check(buf)) continue;
6299 /* Restore the screen */
6300 if (redraw) Term_load();
6302 /* Abort if needed */
6311 case PET_DISMISS: /* Dismiss pets */
6316 msg_print("¥Ú¥Ã¥È¤¬¤¤¤Ê¤¤¡ª");
6318 msg_print("You have no pets!");
6322 do_cmd_pet_dismiss();
6323 (void)calculate_upkeep();
6328 project_length = -1;
6329 if (!target_set(TARGET_KILL)) pet_t_m_idx = 0;
6332 cave_type *c_ptr = &cave[target_row][target_col];
6333 if (c_ptr->m_idx && (m_list[c_ptr->m_idx].ml))
6335 pet_t_m_idx = cave[target_row][target_col].m_idx;
6336 p_ptr->pet_follow_distance = PET_DESTROY_DIST;
6338 else pet_t_m_idx = 0;
6345 case PET_STAY_CLOSE:
6347 p_ptr->pet_follow_distance = PET_CLOSE_DIST;
6354 p_ptr->pet_follow_distance = PET_FOLLOW_DIST;
6358 /* "Seek and destoy" */
6359 case PET_SEEK_AND_DESTROY:
6361 p_ptr->pet_follow_distance = PET_DESTROY_DIST;
6364 /* "Give me space" */
6365 case PET_ALLOW_SPACE:
6367 p_ptr->pet_follow_distance = PET_SPACE_DIST;
6373 p_ptr->pet_follow_distance = PET_AWAY_DIST;
6376 /* flag - allow pets to open doors */
6377 case PET_OPEN_DOORS:
6379 if (p_ptr->pet_extra_flags & PF_OPEN_DOORS) p_ptr->pet_extra_flags &= ~(PF_OPEN_DOORS);
6380 else p_ptr->pet_extra_flags |= (PF_OPEN_DOORS);
6383 /* flag - allow pets to pickup items */
6384 case PET_TAKE_ITEMS:
6386 if (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS)
6388 p_ptr->pet_extra_flags &= ~(PF_PICKUP_ITEMS);
6389 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
6391 /* Access the monster */
6392 m_ptr = &m_list[pet_ctr];
6396 monster_drop_carried_objects(m_ptr);
6400 else p_ptr->pet_extra_flags |= (PF_PICKUP_ITEMS);
6404 /* flag - allow pets to teleport */
6407 if (p_ptr->pet_extra_flags & PF_TELEPORT) p_ptr->pet_extra_flags &= ~(PF_TELEPORT);
6408 else p_ptr->pet_extra_flags |= (PF_TELEPORT);
6411 /* flag - allow pets to cast attack spell */
6412 case PET_ATTACK_SPELL:
6414 if (p_ptr->pet_extra_flags & PF_ATTACK_SPELL) p_ptr->pet_extra_flags &= ~(PF_ATTACK_SPELL);
6415 else p_ptr->pet_extra_flags |= (PF_ATTACK_SPELL);
6418 /* flag - allow pets to cast attack spell */
6419 case PET_SUMMON_SPELL:
6421 if (p_ptr->pet_extra_flags & PF_SUMMON_SPELL) p_ptr->pet_extra_flags &= ~(PF_SUMMON_SPELL);
6422 else p_ptr->pet_extra_flags |= (PF_SUMMON_SPELL);
6425 /* flag - allow pets to cast attack spell */
6426 case PET_BALL_SPELL:
6428 if (p_ptr->pet_extra_flags & PF_BALL_SPELL) p_ptr->pet_extra_flags &= ~(PF_BALL_SPELL);
6429 else p_ptr->pet_extra_flags |= (PF_BALL_SPELL);
6447 if (p_ptr->pet_extra_flags & PF_RYOUTE) p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
6448 else p_ptr->pet_extra_flags |= (PF_RYOUTE);
6449 p_ptr->update |= (PU_BONUS);