4 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
6 * This software may be copied and distributed for educational, research,
7 * and not for profit purposes provided that this copyright and statement
8 * are included in all such copies. Other copyrights may also apply.
11 /* Purpose: Spell/Prayer commands */
15 #include "spellstips.h"
17 cptr spell_category_name(int tval)
22 case TV_HISSATSU_BOOK:
31 case TV_HISSATSU_BOOK:
44 * Allow user to choose a spell/prayer from the given book.
46 * If a valid spell is chosen, saves it in '*sn' and returns TRUE
47 * If the user hits escape, returns FALSE, and set '*sn' to -1
48 * If there are no legal choices, returns FALSE, and sets '*sn' to -2
50 * The "prompt" should be "cast", "recite", or "study"
51 * The "known" should be TRUE for cast/pray, FALSE for study
54 bool select_the_force=FALSE;
56 static int get_spell(int *sn, cptr prompt, int sval, bool learned, int use_realm)
64 bool flag, redraw, okay;
72 int menu_line = (use_menu ? 1 : 0);
74 #ifdef ALLOW_REPEAT /* TNB */
76 /* Get the spell, if available */
79 /* Verify the spell */
80 if (spell_okay(*sn, learned, FALSE, use_realm))
87 #endif /* ALLOW_REPEAT -- TNB */
89 p = spell_category_name(mp_ptr->spell_book);
92 for (spell = 0; spell < 32; spell++)
94 /* Check for this spell */
95 if ((fake_spell_flags[sval] & (1L << spell)))
97 /* Collect this spell */
98 spells[num++] = spell;
102 /* Assume no usable spells */
105 /* Assume no spells available */
108 /* Check for "okay" spells */
109 for (i = 0; i < num; i++)
111 /* Look for "okay" spells */
112 if (spell_okay(spells[i], learned, FALSE, use_realm)) okay = TRUE;
115 /* No "okay" spells */
116 if (!okay) return (FALSE);
117 if (((use_realm) != p_ptr->realm1) && ((use_realm) != p_ptr->realm2) && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE)) return FALSE;
118 if (((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE)) && !is_magic(use_realm)) return FALSE;
119 if ((p_ptr->pclass == CLASS_RED_MAGE) && ((use_realm) != REALM_ARCANE) && (sval > 1)) return FALSE;
121 /* Assume cancelled */
124 /* Nothing chosen yet */
131 p_ptr->window |= (PW_SPELL);
136 /* Build a prompt (accept all spells) */
138 jverb1( prompt, jverb_buf );
139 (void) strnfmt(out_val, 78, "(%^s:%c-%c, '*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤Î%s¤ò%^s¤Þ¤¹¤«? ",
140 p, I2A(0), I2A(num - 1), p, jverb_buf );
142 (void)strnfmt(out_val, 78, "(%^ss %c-%c, *=List, ESC=exit) %^s which %s? ",
143 p, I2A(0), I2A(num - 1), prompt, p);
146 /* Get a spell from the user */
148 choice = (always_show_list || use_menu) ? ESCAPE : 1;
151 if (choice == ESCAPE) choice = ' ';
152 else if (!get_com(out_val, &choice, TRUE))break;
154 if (use_menu && choice != ' ')
168 menu_line += (num - 1);
190 if (menu_line > num) menu_line -= num;
191 /* Display a list of spells */
192 print_spells(menu_line, spells, num, 1, 15, use_realm);
198 if ((choice == ' ') || (choice == '*') || (choice == '?'))
206 /* Save the screen */
209 /* Display a list of spells */
210 print_spells(menu_line, spells, num, 1, 15, use_realm);
216 if (use_menu) continue;
221 /* Restore the screen */
231 ask = (isupper(choice));
234 if (ask) choice = tolower(choice);
236 /* Extract request */
237 i = (islower(choice) ? A2I(choice) : -1);
240 /* Totally Illegal */
241 if ((i < 0) || (i >= num))
247 /* Save the spell index */
250 /* Require "okay" spells */
251 if (!spell_okay(spell, learned, FALSE, use_realm))
255 msg_format("¤½¤Î%s¤ò%s¤³¤È¤Ï¤Ç¤¤Þ¤»¤ó¡£", p, prompt);
257 msg_format("You may not %s that %s.", prompt, p);
268 /* Access the spell */
269 if (!is_magic(use_realm))
271 s_ptr = &technic_info[use_realm - MIN_TECHNIC][spell];
275 s_ptr = &mp_ptr->info[use_realm - 1][spell];
278 /* Extract mana consumption rate */
279 if (use_realm == REALM_HISSATSU)
281 need_mana = s_ptr->smana;
285 need_mana = mod_need_mana(s_ptr->smana, spell, use_realm);
290 jverb1( prompt, jverb_buf );
291 /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½¤ËÂбþ */
292 (void) strnfmt(tmp_val, 78, "%s(MP%d, ¼ºÇÔΨ%d%%)¤ò%s¤Þ¤¹¤«? ",
293 spell_names[technic2magic(use_realm)-1][spell], need_mana,
294 spell_chance(spell, use_realm),jverb_buf);
296 (void)strnfmt(tmp_val, 78, "%^s %s (%d mana, %d%% fail)? ",
297 prompt, spell_names[technic2magic(use_realm)-1][spell], need_mana,
298 spell_chance(spell, use_realm));
302 /* Belay that order */
303 if (!get_check(tmp_val)) continue;
311 /* Restore the screen */
312 if (redraw) screen_load();
316 p_ptr->window |= (PW_SPELL);
322 /* Abort if needed */
323 if (!flag) return FALSE;
325 /* Save the choice */
328 #ifdef ALLOW_REPEAT /* TNB */
332 #endif /* ALLOW_REPEAT -- TNB */
339 static bool item_tester_learn_spell(object_type *o_ptr)
341 s32b choices = realm_choices2[p_ptr->pclass];
343 if (p_ptr->pclass == CLASS_PRIEST)
345 if (is_good_realm(p_ptr->realm1))
347 choices &= ~(CH_DEATH | CH_DAEMON);
351 choices &= ~(CH_LIFE | CH_CRUSADE);
355 if ((o_ptr->tval < TV_LIFE_BOOK) || (o_ptr->tval > (TV_LIFE_BOOK + MAX_REALM - 1))) return (FALSE);
356 if ((o_ptr->tval == TV_MUSIC_BOOK) && (p_ptr->pclass == CLASS_BARD)) return (TRUE);
357 else if (!is_magic(tval2realm(o_ptr->tval))) return FALSE;
358 if ((REALM1_BOOK == o_ptr->tval) || (REALM2_BOOK == o_ptr->tval)) return (TRUE);
359 if (choices & (0x0001 << (tval2realm(o_ptr->tval) - 1))) return (TRUE);
365 * Peruse the spells/prayers in a book
367 * Note that *all* spells in the book are listed
369 * Note that browsing is allowed while confused or blind,
370 * and in the dark, primarily to allow browsing in stores.
372 void do_cmd_browse(void)
374 int item, sval, use_realm = 0, j, line;
385 /* Warriors are illiterate */
386 if (!(p_ptr->realm1 || p_ptr->realm2) && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE))
389 msg_print("ËܤòÆɤळ¤È¤¬¤Ç¤¤Ê¤¤¡ª");
391 msg_print("You cannot read books!");
397 if (p_ptr->special_defense & KATA_MUSOU)
399 set_action(ACTION_NONE);
402 /* Restrict choices to "useful" books */
403 if (p_ptr->realm2 == REALM_NONE) item_tester_tval = mp_ptr->spell_book;
404 else item_tester_hook = item_tester_learn_spell;
408 q = "¤É¤ÎËܤòÆɤߤޤ¹¤«? ";
410 q = "Browse which book? ";
414 s = "Æɤá¤ëËܤ¬¤Ê¤¤¡£";
416 s = "You have no books that you can read.";
419 if (p_ptr->pclass == CLASS_FORCETRAINER)
420 select_the_force = TRUE;
421 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))){
422 select_the_force = FALSE;
425 select_the_force = FALSE;
427 if (item == INVEN_FORCE) { /* the_force */
428 do_cmd_mind_browse();
431 /* Get the item (in the pack) */
434 o_ptr = &inventory[item];
437 /* Get the item (on the floor) */
440 o_ptr = &o_list[0 - item];
443 /* Access the item's sval */
446 use_realm = tval2realm(o_ptr->tval);
448 /* Track the object kind */
449 object_kind_track(o_ptr->k_idx);
451 /* Hack -- Handle stuff */
456 for (spell = 0; spell < 32; spell++)
458 /* Check for this spell */
459 if ((fake_spell_flags[sval] & (1L << spell)))
461 /* Collect this spell */
462 spells[num++] = spell;
467 /* Save the screen */
470 /* Clear the top line */
473 /* Keep browsing spells. Exit browsing on cancel. */
476 /* Ask for a spell, allow cancel */
478 if (!get_spell(&spell, "Æɤà", o_ptr->sval, TRUE, use_realm))
480 if (!get_spell(&spell, "browse", o_ptr->sval, TRUE, use_realm))
483 /* If cancelled, leave immediately. */
484 if (spell == -1) break;
486 /* Display a list of spells */
487 print_spells(0, spells, num, 1, 15, use_realm);
489 /* Notify that there's nothing to see, and wait. */
490 if (use_realm == REALM_HISSATSU)
492 prt("Æɤá¤ëµ»¤¬¤Ê¤¤¡£", 0, 0);
494 prt("No techniques to browse.", 0, 0);
498 prt("Æɤá¤ë¼öʸ¤¬¤Ê¤¤¡£", 0, 0);
500 prt("No spells to browse.", 0, 0);
505 /* Restore the screen */
511 /* Clear lines, position cursor (really should use strlen here) */
512 Term_erase(14, 14, 255);
513 Term_erase(14, 13, 255);
514 Term_erase(14, 12, 255);
515 Term_erase(14, 11, 255);
517 roff_to_buf(spell_tips[technic2magic(use_realm) - 1][spell], 62, temp, sizeof(temp));
518 for (j = 0, line = 11; temp[j]; j += 1 + strlen(&temp[j]))
520 prt(&temp[j], line, 15);
525 /* Restore the screen */
530 static void change_realm2(int next_realm)
535 for (i = 0; i < 64; i++)
537 p_ptr->spell_order[j] = p_ptr->spell_order[i];
538 if (p_ptr->spell_order[i] < 32) j++;
541 p_ptr->spell_order[j] = 99;
543 for (i = 32; i < 64; i++)
545 p_ptr->spell_exp[i] = SPELL_EXP_UNSKILLED;
547 p_ptr->spell_learned2 = 0L;
548 p_ptr->spell_worked2 = 0L;
549 p_ptr->spell_forgotten2 = 0L;
552 sprintf(tmp,"ËâË¡¤ÎÎΰè¤ò%s¤«¤é%s¤ËÊѹ¹¤·¤¿¡£", realm_names[p_ptr->realm2], realm_names[next_realm]);
554 sprintf(tmp,"change magic realm from %s to %s.", realm_names[p_ptr->realm2], realm_names[next_realm]);
556 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
557 p_ptr->old_realm |= 1 << (p_ptr->realm2-1);
558 p_ptr->realm2 = next_realm;
560 p_ptr->notice |= (PN_REORDER);
561 p_ptr->update |= (PU_SPELLS);
564 /* Load an autopick preference file */
565 autopick_load_pref(FALSE);
570 * Study a book to gain a new spell/prayer
572 void do_cmd_study(void)
576 bool learned = FALSE;
578 /* Spells of realm2 will have an increment of +32 */
581 cptr p = spell_category_name(mp_ptr->spell_book);
590 msg_print("ËܤòÆɤळ¤È¤¬¤Ç¤¤Ê¤¤¡ª");
592 msg_print("You cannot read books!");
598 if (p_ptr->blind || no_lite())
601 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡ª");
603 msg_print("You cannot see!");
612 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡ª");
614 msg_print("You are too confused!");
620 if (!(p_ptr->new_spells))
623 msg_format("¿·¤·¤¤%s¤ò³Ð¤¨¤ë¤³¤È¤Ï¤Ç¤¤Ê¤¤¡ª", p);
625 msg_format("You cannot learn any new %ss!", p);
631 if (p_ptr->special_defense & KATA_MUSOU)
633 set_action(ACTION_NONE);
637 if( p_ptr->new_spells < 10 ){
638 msg_format("¤¢¤È %d ¤Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
640 msg_format("¤¢¤È %d ¸Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
643 msg_format("You can learn %d new %s%s.", p_ptr->new_spells, p,
644 (p_ptr->new_spells == 1?"":"s"));
650 /* Restrict choices to "useful" books */
651 if (p_ptr->realm2 == REALM_NONE) item_tester_tval = mp_ptr->spell_book;
652 else item_tester_hook = item_tester_learn_spell;
656 q = "¤É¤ÎËܤ«¤é³Ø¤Ó¤Þ¤¹¤«? ";
658 q = "Study which book? ";
662 s = "Æɤá¤ëËܤ¬¤Ê¤¤¡£";
664 s = "You have no books that you can read.";
667 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
669 /* Get the item (in the pack) */
672 o_ptr = &inventory[item];
675 /* Get the item (on the floor) */
678 o_ptr = &o_list[0 - item];
681 /* Access the item's sval */
684 if (o_ptr->tval == REALM2_BOOK) increment = 32;
685 else if (o_ptr->tval != REALM1_BOOK)
688 if (!get_check("ËÜÅö¤ËËâË¡¤ÎÎΰè¤òÊѹ¹¤·¤Þ¤¹¤«¡©")) return;
690 if (!get_check("Really, change magic realm? ")) return;
692 change_realm2(tval2realm(o_ptr->tval));
696 /* Track the object kind */
697 object_kind_track(o_ptr->k_idx);
699 /* Hack -- Handle stuff */
702 /* Mage -- Learn a selected spell */
703 if (mp_ptr->spell_book != TV_LIFE_BOOK)
705 /* Ask for a spell, allow cancel */
707 if (!get_spell(&spell, "³Ø¤Ö", sval, FALSE, o_ptr->tval - TV_LIFE_BOOK + 1)
708 && (spell == -1)) return;
710 if (!get_spell(&spell, "study", sval, FALSE, o_ptr->tval - TV_LIFE_BOOK + 1)
711 && (spell == -1)) return;
716 /* Priest -- Learn a random prayer */
724 for (spell = 0; spell < 32; spell++)
726 /* Check spells in the book */
727 if ((fake_spell_flags[sval] & (1L << spell)))
729 /* Skip non "okay" prayers */
730 if (!spell_okay(spell, FALSE, TRUE,
731 (increment ? p_ptr->realm2 : p_ptr->realm1))) continue;
733 /* Hack -- Prepare the randomizer */
736 /* Hack -- Apply the randomizer */
737 if (one_in_(k)) gift = spell;
745 /* Nothing to study */
750 msg_format("¤½¤ÎËܤˤϳؤ֤٤%s¤¬¤Ê¤¤¡£", p);
752 msg_format("You cannot learn any %ss in that book.", p);
761 if (increment) spell += increment;
763 /* Learn the spell */
766 if (p_ptr->spell_learned1 & (1L << spell)) learned = TRUE;
767 else p_ptr->spell_learned1 |= (1L << spell);
771 if (p_ptr->spell_learned2 & (1L << (spell - 32))) learned = TRUE;
772 else p_ptr->spell_learned2 |= (1L << (spell - 32));
777 int max_exp = (spell < 32) ? SPELL_EXP_MASTER : SPELL_EXP_EXPERT;
778 int old_exp = p_ptr->spell_exp[spell];
779 int new_rank = EXP_LEVEL_UNSKILLED;
780 cptr name = spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell%32];
782 if (old_exp >= max_exp)
785 msg_format("¤½¤Î%s¤Ï´°Á´¤Ë»È¤¤¤³¤Ê¤»¤ë¤Î¤Ç³Ø¤ÖɬÍפϤʤ¤¡£", p);
787 msg_format("You don't need to study this %s anymore.", p);
792 if (!get_check(format("%s¤Î%s¤ò¤µ¤é¤Ë³Ø¤Ó¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©", name, p)))
794 if (!get_check(format("You will study a %s of %s again. Are you sure? ", p, name)))
799 else if (old_exp >= SPELL_EXP_EXPERT)
801 p_ptr->spell_exp[spell] = SPELL_EXP_MASTER;
802 new_rank = EXP_LEVEL_MASTER;
804 else if (old_exp >= SPELL_EXP_SKILLED)
806 if (spell >= 32) p_ptr->spell_exp[spell] = SPELL_EXP_EXPERT;
807 else p_ptr->spell_exp[spell] += SPELL_EXP_EXPERT - SPELL_EXP_SKILLED;
808 new_rank = EXP_LEVEL_EXPERT;
810 else if (old_exp >= SPELL_EXP_BEGINNER)
812 p_ptr->spell_exp[spell] = SPELL_EXP_SKILLED + (old_exp - SPELL_EXP_BEGINNER) * 2 / 3;
813 new_rank = EXP_LEVEL_SKILLED;
817 p_ptr->spell_exp[spell] = SPELL_EXP_BEGINNER + old_exp / 3;
818 new_rank = EXP_LEVEL_BEGINNER;
821 msg_format("%s¤Î½ÏÎýÅÙ¤¬%s¤Ë¾å¤¬¤Ã¤¿¡£", name, exp_level_str[new_rank]);
823 msg_format("Your proficiency of %s is now %s rank.", name, exp_level_str[new_rank]);
828 /* Find the next open entry in "p_ptr->spell_order[]" */
829 for (i = 0; i < 64; i++)
831 /* Stop at the first empty space */
832 if (p_ptr->spell_order[i] == 99) break;
835 /* Add the spell to the known list */
836 p_ptr->spell_order[i++] = spell;
838 /* Mention the result */
840 /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½¤ËÂбþ */
841 if (mp_ptr->spell_book == TV_MUSIC_BOOK)
843 msg_format("%s¤ò³Ø¤ó¤À¡£",
844 spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32]);
848 msg_format("%s¤Î%s¤ò³Ø¤ó¤À¡£",
849 spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32] ,p);
852 msg_format("You have learned the %s of %s.",
853 p, spell_names[technic2magic(increment ? p_ptr->realm2 : p_ptr->realm1)-1][spell % 32]);
860 switch (mp_ptr->spell_book)
863 chg_virtue(V_FAITH, 1);
866 chg_virtue(V_UNLIFE, 1);
869 chg_virtue(V_NATURE, 1);
872 chg_virtue(V_KNOWLEDGE, 1);
879 /* One less spell available */
880 p_ptr->learned_spells++;
882 /* Message if needed */
883 if (p_ptr->new_spells)
887 if (p_ptr->new_spells < 10) msg_format("¤¢¤È %d ¤Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
888 else msg_format("¤¢¤È %d ¸Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
890 msg_format("You can learn %d more %s%s.", p_ptr->new_spells, p,
891 (p_ptr->new_spells != 1) ? "s" : "");
897 p_ptr->update |= (PU_SPELLS);
900 /* Redraw object recall */
901 p_ptr->window |= (PW_OBJECT);
905 static void wild_magic(int spell)
908 int type = SUMMON_BIZARRE1 + randint0(6);
910 if (type < SUMMON_BIZARRE1) type = SUMMON_BIZARRE1;
911 else if (type > SUMMON_BIZARRE6) type = SUMMON_BIZARRE6;
913 switch (randint1(spell) + randint1(8) + 1)
918 teleport_player(10, TRUE);
923 teleport_player(100, TRUE);
927 teleport_player(200, TRUE);
937 lite_area(damroll(2, 3), 2);
940 destroy_doors_touch();
945 sleep_monsters_touch();
949 trap_creation(py, px);
958 aggravate_monsters(0);
961 earthquake(py, px, 5);
965 (void)gain_random_mutation(0);
975 fire_ball(GF_CHAOS, 0, spell + 5, 1 + (spell / 10));
982 while (counter++ < 8)
984 (void)summon_specific(0, py, px, (dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET));
989 activate_hi_summon(py, px, FALSE);
992 (void)summon_cyber(-1, py, px);
997 (void)activate_ty_curse(FALSE, &count);
1006 static bool cast_life_spell(int spell)
1009 int plev = p_ptr->lev;
1013 case 0: /* Cure Light Wounds */
1014 (void)hp_player(damroll(2, 10));
1015 (void)set_cut(p_ptr->cut - 10);
1018 (void)set_blessed(randint1(12) + 12, FALSE);
1020 case 2: /* Make Light Wounds */
1021 if (!get_aim_dir(&dir)) return FALSE;
1022 fire_ball_hide(GF_WOUNDS, dir, damroll(3 + ((plev - 1) / 5), 4), 0);
1024 case 3: /* Call Light */
1025 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1027 case 4: /* Detect Traps + Secret Doors */
1028 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1029 (void)detect_doors(DETECT_RAD_DEFAULT);
1030 (void)detect_stairs(DETECT_RAD_DEFAULT);
1032 case 5: /* Cure Medium Wounds */
1033 (void)hp_player(damroll(4, 10));
1034 (void)set_cut((p_ptr->cut / 2) - 20);
1036 case 6: /* Cure Poison */
1037 (void)set_poisoned(0);
1039 case 7: /* Satisfy Hunger */
1040 (void)set_food(PY_FOOD_MAX - 1);
1042 case 8: /* Remove Curse */
1046 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1048 msg_print("You feel as if someone is watching over you.");
1052 case 9: /* Make Medium Wounds */
1053 if (!get_aim_dir(&dir)) return FALSE;
1054 fire_ball_hide(GF_WOUNDS, dir, damroll(8 + ((plev - 5) / 4), 8), 0);
1056 case 10: /* Cure Critical Wounds */
1057 (void)hp_player(damroll(8, 10));
1062 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1063 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1066 map_area(DETECT_RAD_MAP);
1069 (void)turn_undead();
1071 case 14: /* Healing */
1072 (void)hp_player(300);
1076 case 15: /* Glyph of Warding */
1079 case 16: /* Dispel Curse */
1080 if (remove_all_curse())
1083 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1085 msg_print("You feel as if someone is watching over you.");
1089 case 17: /* Perception */
1090 return ident_spell(FALSE);
1091 case 18: /* Dispel Undead */
1092 (void)dispel_undead(randint1(plev * 5));
1094 case 19: /* 'Day of the Dove' */
1095 charm_monsters(plev * 2);
1097 case 20: /* Make Critical Wounds */
1098 if (!get_aim_dir(&dir)) return FALSE;
1099 fire_ball_hide(GF_WOUNDS, dir, damroll(5+((plev - 5) / 3), 15), 0);
1101 case 21: /* Word of Recall */
1102 return word_of_recall();
1103 case 22: /* Alter Reality */
1106 case 23: /* Warding True */
1111 num_repro += MAX_REPRO;
1113 case 25: /* Detection True */
1114 (void)detect_all(DETECT_RAD_DEFAULT);
1116 case 26: /* Genocide Undead */
1117 (void)mass_genocide_undead(plev+50,TRUE);
1119 case 27: /* Clairvoyance */
1122 case 28: /* Restoration */
1123 (void)do_res_stat(A_STR);
1124 (void)do_res_stat(A_INT);
1125 (void)do_res_stat(A_WIS);
1126 (void)do_res_stat(A_DEX);
1127 (void)do_res_stat(A_CON);
1128 (void)do_res_stat(A_CHR);
1129 (void)restore_level();
1131 case 29: /* Healing True */
1132 (void)hp_player(2000);
1136 case 30: /* Holy Vision */
1137 return identify_fully(FALSE);
1138 case 31: /* Ultimate resistance */
1140 int v = randint1(plev/2)+plev/2;
1141 (void)set_fast(v, FALSE);
1142 set_oppose_acid(v, FALSE);
1143 set_oppose_elec(v, FALSE);
1144 set_oppose_fire(v, FALSE);
1145 set_oppose_cold(v, FALSE);
1146 set_oppose_pois(v, FALSE);
1147 set_ultimate_res(v, FALSE);
1152 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥é¥¤¥Õ¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1154 msg_format("You cast an unknown Life spell: %d.", spell);
1165 static bool cast_sorcery_spell(int spell)
1168 int plev = p_ptr->lev;
1172 case 0: /* Detect Monsters */
1173 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1175 case 1: /* Phase Door */
1176 teleport_player(10, FALSE);
1178 case 2: /* Detect Doors and Traps */
1179 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1180 (void)detect_doors(DETECT_RAD_DEFAULT);
1181 (void)detect_stairs(DETECT_RAD_DEFAULT);
1183 case 3: /* Light Area */
1184 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1186 case 4: /* Confuse Monster */
1187 if (!get_aim_dir(&dir)) return FALSE;
1189 (void)confuse_monster(dir, (plev * 3) / 2);
1191 case 5: /* Teleport */
1192 teleport_player(plev * 5, FALSE);
1194 case 6: /* Sleep Monster */
1195 if (!get_aim_dir(&dir)) return FALSE;
1197 (void)sleep_monster(dir);
1199 case 7: /* Recharging */
1200 return recharge(plev * 4);
1201 case 8: /* Magic Mapping */
1202 map_area(DETECT_RAD_MAP);
1204 case 9: /* Identify */
1205 return ident_spell(FALSE);
1206 case 10: /* Slow Monster */
1207 if (!get_aim_dir(&dir)) return FALSE;
1209 (void)slow_monster(dir);
1211 case 11: /* Mass Sleep */
1212 (void)sleep_monsters();
1214 case 12: /* Teleport Away */
1215 if (!get_aim_dir(&dir)) return FALSE;
1217 (void)fire_beam(GF_AWAY_ALL, dir, plev);
1219 case 13: /* Haste Self */
1220 (void)set_fast(randint1(20 + plev) + plev, FALSE);
1222 case 14: /* Detection True */
1223 (void)detect_all(DETECT_RAD_DEFAULT);
1225 case 15: /* Identify True */
1226 return identify_fully(FALSE);
1227 case 16: /* Detect Objects and Treasure*/
1228 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
1229 (void)detect_treasure(DETECT_RAD_DEFAULT);
1230 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
1232 case 17: /* Charm Monster */
1233 if (!get_aim_dir(&dir)) return FALSE;
1235 (void)charm_monster(dir, plev);
1237 case 18: /* Sense Minds */
1238 (void)set_tim_esp(randint1(30) + 25, FALSE);
1240 case 19: /* Teleport to town */
1242 case 20: /* Self knowledge */
1243 (void)self_knowledge();
1245 case 21: /* Teleport Level */
1247 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
1249 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
1251 (void)teleport_level(0);
1253 case 22: /* Word of Recall */
1254 return word_of_recall();
1255 case 23: /* Dimension Door */
1257 msg_print("¼¡¸µ¤ÎÈ⤬³«¤¤¤¿¡£ÌÜŪÃϤòÁª¤ó¤Ç²¼¤µ¤¤¡£");
1259 msg_print("You open a dimensional gate. Choose a destination.");
1262 return dimension_door();
1263 case 24: /* Probing */
1266 case 25: /* Explosive Rune */
1269 case 26: /* Telekinesis */
1270 if (!get_aim_dir(&dir)) return FALSE;
1272 fetch(dir, plev * 15, FALSE);
1274 case 27: /* Clairvoyance */
1275 chg_virtue(V_KNOWLEDGE, 1);
1276 chg_virtue(V_ENLIGHTEN, 1);
1279 if (!(p_ptr->telepathy))
1281 (void)set_tim_esp(randint1(30) + 25, FALSE);
1284 case 28: /* Charm Monsters */
1285 charm_monsters(plev * 2);
1287 case 29: /* Alchemy */
1289 case 30: /* Banish */
1290 banish_monsters(plev * 4);
1292 case 31: /* Globe of Invulnerability */
1293 (void)set_invuln(randint1(4) + 4, FALSE);
1297 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥½¡¼¥µ¥ê¡¼¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1299 msg_format("You cast an unknown Sorcery spell: %d.", spell);
1309 static bool cast_nature_spell(int spell)
1313 int plev = p_ptr->lev;
1315 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1316 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1317 else beam = plev / 2;
1321 case 0: /* Detect Creatures */
1322 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1324 case 1: /* Lightning Bolt */
1325 project_length = plev / 6 + 2;
1326 if (!get_aim_dir(&dir)) return FALSE;
1328 fire_beam(GF_ELEC, dir,
1329 damroll(3 + ((plev - 1) / 5), 4));
1331 case 2: /* Detect Doors & Traps */
1332 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1333 (void)detect_doors(DETECT_RAD_DEFAULT);
1334 (void)detect_stairs(DETECT_RAD_DEFAULT);
1336 case 3: /* Produce Food */
1338 object_type forge, *q_ptr = &forge;
1341 msg_print("¿©ÎÁ¤òÀ¸À®¤·¤¿¡£");
1343 msg_print("A food ration is produced.");
1346 /* Create the food ration */
1347 object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_RATION));
1349 /* Drop the object from heaven */
1350 (void)drop_near(q_ptr, -1, py, px);
1354 case 4: /* Daylight */
1355 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1356 if ((prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
1359 msg_print("Æü¤Î¸÷¤¬¤¢¤Ê¤¿¤ÎÆùÂΤò¾Ç¤¬¤·¤¿¡ª");
1361 msg_print("The daylight scorches your flesh!");
1365 take_hit(DAMAGE_NOESCAPE, damroll(2, 2), "Æü¤Î¸÷", -1);
1367 take_hit(DAMAGE_NOESCAPE, damroll(2, 2), "daylight", -1);
1372 case 5: /* Animal Taming */
1373 if (!get_aim_dir(&dir)) return FALSE;
1375 (void)charm_animal(dir, plev);
1377 case 6: /* Resist Environment */
1378 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1379 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1380 (void)set_oppose_elec(randint1(20) + 20, FALSE);
1382 case 7: /* Cure Wounds & Poison */
1383 (void)hp_player(damroll(2, 8));
1385 (void)set_poisoned(0);
1387 case 8: /* Stone to Mud */
1388 if (!get_aim_dir(&dir)) return FALSE;
1390 (void)wall_to_mud(dir);
1392 case 9: /* Frost Bolt */
1393 if (!get_aim_dir(&dir)) return FALSE;
1394 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
1395 damroll(3 + ((plev - 5) / 4), 8));
1397 case 10: /* Nature Awareness -- downgraded */
1398 map_area(DETECT_RAD_MAP);
1399 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1400 (void)detect_doors(DETECT_RAD_DEFAULT);
1401 (void)detect_stairs(DETECT_RAD_DEFAULT);
1402 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
1404 case 11: /* Fire Bolt */
1405 if (!get_aim_dir(&dir)) return FALSE;
1406 fire_bolt_or_beam(beam - 10, GF_FIRE, dir,
1407 damroll(5 + ((plev - 5) / 4), 8));
1409 case 12: /* Ray of Sunlight */
1410 if (!get_aim_dir(&dir)) return FALSE;
1412 msg_print("ÂÀÍÛ¸÷Àþ¤¬¸½¤ì¤¿¡£");
1414 msg_print("A line of sunlight appears.");
1417 (void)lite_line(dir);
1419 case 13: /* Entangle */
1422 case 14: /* Summon Animals */
1423 if (!(summon_specific(-1, py, px, plev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET))))
1426 msg_print("ưʪ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
1428 msg_print("No animals arrive.");
1432 case 15: /* Herbal Healing */
1433 (void)hp_player(500);
1436 (void)set_poisoned(0);
1438 case 16: /* Stair Building */
1439 (void)stair_creation();
1441 case 17: /* Stone Skin */
1442 (void)set_shield(randint1(20) + 30, FALSE);
1444 case 18: /* Resistance True */
1445 (void)set_oppose_acid(randint1(20) + 20, FALSE);
1446 (void)set_oppose_elec(randint1(20) + 20, FALSE);
1447 (void)set_oppose_fire(randint1(20) + 20, FALSE);
1448 (void)set_oppose_cold(randint1(20) + 20, FALSE);
1449 (void)set_oppose_pois(randint1(20) + 20, FALSE);
1451 case 19: /* Tree Creation */
1452 (void)tree_creation();
1454 case 20: /* Animal Friendship */
1455 (void)charm_animals(plev * 2);
1457 case 21: /* Stone Tell */
1458 return identify_fully(FALSE);
1459 case 22: /* Wall of Stone */
1462 case 23: /* Protection from Corrosion */
1464 case 24: /* Earthquake */
1465 earthquake(py, px, 10);
1467 case 25: /* Whirlwind Attack */
1471 monster_type *m_ptr;
1473 for (dir = 0; dir < 8; dir++)
1475 y = py + ddy_ddd[dir];
1476 x = px + ddx_ddd[dir];
1477 c_ptr = &cave[y][x];
1479 /* Get the monster */
1480 m_ptr = &m_list[c_ptr->m_idx];
1482 /* Hack -- attack monsters */
1483 if (c_ptr->m_idx && (m_ptr->ml || cave_have_flag_bold(y, x, FF_PROJECT)))
1488 case 26: /* Blizzard */
1489 if (!get_aim_dir(&dir)) return FALSE;
1491 fire_ball(GF_COLD, dir, 70 + plev * 3 / 2, (plev / 12) + 1);
1493 case 27: /* Lightning Storm */
1494 if (!get_aim_dir(&dir)) return FALSE;
1495 fire_ball(GF_ELEC, dir, 90 + plev * 3 / 2, (plev / 12) + 1);
1497 case 28: /* Whirlpool */
1498 if (!get_aim_dir(&dir)) return FALSE;
1499 fire_ball(GF_WATER, dir, 100 + plev * 3 / 2, (plev / 12) + 1);
1501 case 29: /* Call Sunlight */
1502 fire_ball(GF_LITE, 0, 150, 8);
1503 chg_virtue(V_KNOWLEDGE, 1);
1504 chg_virtue(V_ENLIGHTEN, 1);
1506 if ((prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
1509 msg_print("Æü¸÷¤¬¤¢¤Ê¤¿¤ÎÆùÂΤò¾Ç¤¬¤·¤¿¡ª");
1511 msg_print("The sunlight scorches your flesh!");
1515 take_hit(DAMAGE_NOESCAPE, 50, "Æü¸÷", -1);
1517 take_hit(DAMAGE_NOESCAPE, 50, "sunlight", -1);
1522 case 30: /* Elemental Branding */
1523 brand_weapon(randint0(2));
1525 case 31: /* Nature's Wrath */
1526 (void)dispel_monsters(plev * 4);
1527 earthquake(py, px, 20 + (plev / 2));
1528 project(0, 1 + plev / 12, py, px,
1529 (100 + plev) * 2, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM, -1);
1533 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥Í¥¤¥Á¥ã¡¼¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1535 msg_format("You cast an unknown Nature spell: %d.", spell);
1545 static bool cast_chaos_spell(int spell)
1548 int plev = p_ptr->lev;
1550 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1551 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1552 else beam = plev / 2;
1556 case 0: /* Magic Missile */
1557 if (!get_aim_dir(&dir)) return FALSE;
1559 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
1560 damroll(3 + ((plev - 1) / 5), 4));
1562 case 1: /* Trap / Door destruction */
1563 (void)destroy_doors_touch();
1565 case 2: /* Flash of Light == Light Area */
1566 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1568 case 3: /* Touch of Confusion */
1569 if (!(p_ptr->special_attack & ATTACK_CONFUSE))
1572 msg_print("¤¢¤Ê¤¿¤Î¼ê¤Ï¸÷¤ê»Ï¤á¤¿¡£");
1574 msg_print("Your hands start glowing.");
1577 p_ptr->special_attack |= ATTACK_CONFUSE;
1578 p_ptr->redraw |= (PR_STATUS);
1581 case 4: /* Mana Burst */
1582 if (!get_aim_dir(&dir)) return FALSE;
1584 fire_ball(GF_MISSILE, dir,
1585 (damroll(3, 5) + plev +
1586 (plev / (((p_ptr->pclass == CLASS_MAGE)
1587 || (p_ptr->pclass == CLASS_HIGH_MAGE)
1588 || (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
1589 ((plev < 30) ? 2 : 3));
1590 /* Shouldn't actually use GF_MANA, as it will destroy all
1591 * items on the floor */
1593 case 5: /* Fire Bolt */
1594 if (!get_aim_dir(&dir)) return FALSE;
1596 fire_bolt_or_beam(beam, GF_FIRE, dir,
1597 damroll(8 + ((plev - 5) / 4), 8));
1599 case 6: /* Fist of Force ("Fist of Fun") */
1600 if (!get_aim_dir(&dir)) return FALSE;
1602 fire_ball(GF_DISINTEGRATE, dir,
1603 damroll(8 + ((plev - 5) / 4), 8), 0);
1605 case 7: /* Teleport Self */
1606 teleport_player(plev * 5, FALSE);
1608 case 8: /* Wonder */
1610 /* This spell should become more useful (more
1611 controlled) as the player gains experience levels.
1612 Thus, add 1/5 of the player's level to the die roll.
1613 This eliminates the worst effects later on, while
1614 keeping the results quite random. It also allows
1615 some potent effects only at high level. */
1617 int die = randint1(100) + plev / 5;
1618 int vir = virtue_number(V_CHANCE);
1621 if (p_ptr->virtues[vir - 1] > 0)
1623 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
1627 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
1632 chg_virtue(V_CHANCE, 1);
1634 if (!get_aim_dir(&dir)) return FALSE;
1637 msg_print("¤¢¤Ê¤¿¤ÏÎϤ¬¤ß¤Ê¤®¤ë¤Î¤ò´¶¤¸¤¿¡ª");
1639 msg_print("You feel a surge of power!");
1642 if (die < 8) clone_monster(dir);
1643 else if (die < 14) speed_monster(dir);
1644 else if (die < 26) heal_monster(dir, damroll(4, 6));
1645 else if (die < 31) poly_monster(dir);
1647 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
1648 damroll(3 + ((plev - 1) / 5), 4));
1649 else if (die < 41) confuse_monster(dir, plev);
1650 else if (die < 46) fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
1651 else if (die < 51) (void)lite_line(dir);
1653 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
1654 damroll(3 + ((plev - 5) / 4), 8));
1656 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
1657 damroll(5 + ((plev - 5) / 4), 8));
1659 fire_bolt_or_beam(beam, GF_ACID, dir,
1660 damroll(6 + ((plev - 5) / 4), 8));
1662 fire_bolt_or_beam(beam, GF_FIRE, dir,
1663 damroll(8 + ((plev - 5) / 4), 8));
1664 else if (die < 76) drain_life(dir, 75);
1665 else if (die < 81) fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
1666 else if (die < 86) fire_ball(GF_ACID, dir, 40 + plev, 2);
1667 else if (die < 91) fire_ball(GF_ICE, dir, 70 + plev, 3);
1668 else if (die < 96) fire_ball(GF_FIRE, dir, 80 + plev, 3);
1669 else if (die < 101) drain_life(dir, 100 + plev);
1672 earthquake(py, px, 12);
1676 (void)destroy_area(py, px, 13 + randint0(5), FALSE);
1680 symbol_genocide(plev+50, TRUE);
1682 else if (die < 110) dispel_monsters(120);
1685 dispel_monsters(150);
1692 case 9: /* Chaos Bolt */
1693 if (!get_aim_dir(&dir)) return FALSE;
1695 fire_bolt_or_beam(beam, GF_CHAOS, dir,
1696 damroll(10 + ((plev - 5) / 4), 8));
1698 case 10: /* Sonic Boom */
1700 msg_print("¥É¡¼¥ó¡ªÉô²°¤¬Íɤ줿¡ª");
1702 msg_print("BOOM! Shake the room!");
1705 project(0, plev / 10 + 2, py, px,
1706 (60 + plev), GF_SOUND, PROJECT_KILL | PROJECT_ITEM, -1);
1708 case 11: /* Doom Bolt -- always beam in 2.0.7 or later */
1709 if (!get_aim_dir(&dir)) return FALSE;
1711 fire_beam(GF_MANA, dir, damroll(11 + ((plev - 5) / 4), 8));
1713 case 12: /* Fire Ball */
1714 if (!get_aim_dir(&dir)) return FALSE;
1716 fire_ball(GF_FIRE, dir, plev + 55, 2);
1718 case 13: /* Teleport Other */
1719 if (!get_aim_dir(&dir)) return FALSE;
1721 (void)fire_beam(GF_AWAY_ALL, dir, plev);
1723 case 14: /* Word of Destruction */
1724 (void)destroy_area(py, px, 13 + randint0(5), FALSE);
1726 case 15: /* Invoke Logrus */
1727 if (!get_aim_dir(&dir)) return FALSE;
1729 fire_ball(GF_CHAOS, dir, plev*2 + 99, plev / 5);
1731 case 16: /* Polymorph Other */
1732 if (!get_aim_dir(&dir)) return FALSE;
1734 (void)poly_monster(dir);
1736 case 17: /* Chain Lightning */
1737 for (dir = 0; dir <= 9; dir++)
1738 fire_beam(GF_ELEC, dir, damroll(5 + (plev / 10), 8));
1740 case 18: /* Arcane Binding == Charging */
1741 return recharge(90);
1742 case 19: /* Disintegration */
1743 if (!get_aim_dir(&dir)) return FALSE;
1745 fire_ball(GF_DISINTEGRATE, dir, plev + 70, 3 + plev / 40);
1747 case 20: /* Alter Reality */
1750 case 21: /* Magic Rocket */
1751 if (!get_aim_dir(&dir)) return FALSE;
1754 msg_print("¥í¥±¥Ã¥Èȯ¼Í¡ª");
1756 msg_print("You launch a rocket!");
1759 fire_rocket(GF_ROCKET, dir, 120 + plev*2, 2);
1761 case 22: /* Chaos Branding */
1764 case 23: /* Summon monster, demon */
1767 bool pet = !one_in_(3);
1769 if (pet) mode |= PM_FORCE_PET;
1770 else mode |= PM_NO_PET;
1771 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
1773 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, SUMMON_DEMON, mode))
1776 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
1778 msg_print("The area fills with a stench of sulphur and brimstone.");
1784 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
1786 msg_print("'What is thy bidding... Master?'");
1791 msg_print("¡ÖÈܤ·¤¼Ô¤è¡¢²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª ¤ªÁ°¤Îº²¤òĺ¤¯¤¾¡ª¡×");
1793 msg_print("'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'");
1799 case 24: /* Beam of Gravity */
1800 if (!get_aim_dir(&dir)) return FALSE;
1802 fire_beam(GF_GRAVITY, dir, damroll(9 + ((plev - 5) / 4), 8));
1804 case 25: /* Meteor Swarm */
1807 int b = 10 + randint1(10);
1808 for (i = 0; i < b; i++)
1810 int count = 0, d = 0;
1815 if (count > 20) break;
1816 x = px - 8 + randint0(17);
1817 y = py - 8 + randint0(17);
1819 if (!in_bounds(y, x) || !projectable(py, px, y, x)) continue;
1821 dx = (px > x) ? (px - x) : (x - px);
1822 dy = (py > y) ? (py - y) : (y - py);
1824 /* Approximate distance */
1825 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
1829 if (count > 20) continue;
1831 project(0, 2, y, x, plev * 2, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
1835 case 26: /* Flame Strike */
1836 fire_ball(GF_FIRE, 0, 300 + (3 * plev), 8);
1838 case 27: /* Call Chaos */
1841 case 28: /* Polymorph Self */
1843 if (!get_check("ÊѿȤ·¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©")) return FALSE;
1845 if (!get_check("You will polymorph yourself. Are you sure? ")) return FALSE;
1849 case 29: /* Mana Storm */
1850 if (!get_aim_dir(&dir)) return FALSE;
1852 fire_ball(GF_MANA, dir, 300 + (plev * 4), 4);
1854 case 30: /* Breathe Logrus */
1855 if (!get_aim_dir(&dir)) return FALSE;
1857 fire_ball(GF_CHAOS, dir, p_ptr->chp, 2);
1859 case 31: /* Call the Void */
1864 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤Ê¥«¥ª¥¹¤Î¼öʸ %d ¤ò¾§¤¨¤¿¡£", spell);
1866 msg_format("You cast an unknown Chaos spell: %d.", spell);
1876 static bool cast_death_spell(int spell)
1880 int plev = p_ptr->lev;
1883 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
1884 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
1885 else beam = plev / 2;
1889 case 0: /* Detect Undead & Demons -> Unlife */
1890 (void)detect_monsters_nonliving(DETECT_RAD_DEFAULT);
1892 case 1: /* Malediction */
1893 if (!get_aim_dir(&dir)) return FALSE;
1894 /* A radius-0 ball may (1) be aimed at objects etc.,
1895 * and will affect them; (2) may be aimed at ANY
1896 * visible monster, unlike a 'bolt' which must travel
1897 * to the monster. */
1899 fire_ball(GF_HELL_FIRE, dir,
1900 damroll(3 + ((plev - 1) / 5), 4), 0);
1903 { /* Special effect first */
1904 dummy = randint1(1000);
1906 fire_ball_hide(GF_DEATH_RAY, dir, plev * 200, 0);
1907 else if (dummy < 500)
1908 fire_ball_hide(GF_TURN_ALL, dir, plev, 0);
1909 else if (dummy < 800)
1910 fire_ball_hide(GF_OLD_CONF, dir, plev, 0);
1912 fire_ball_hide(GF_STUN, dir, plev, 0);
1915 case 2: /* Detect Evil */
1916 (void)detect_monsters_evil(DETECT_RAD_DEFAULT);
1918 case 3: /* Stinking Cloud */
1919 if (!get_aim_dir(&dir)) return FALSE;
1921 fire_ball(GF_POIS, dir, 10 + (plev / 2), 2);
1923 case 4: /* Black Sleep */
1924 if (!get_aim_dir(&dir)) return FALSE;
1926 (void)sleep_monster(dir);
1928 case 5: /* Resist Poison */
1929 (void)set_oppose_pois(randint1(20) + 20, FALSE);
1931 case 6: /* Horrify */
1932 if (!get_aim_dir(&dir)) return FALSE;
1934 (void)fear_monster(dir, plev);
1935 (void)stun_monster(dir, plev);
1937 case 7: /* Enslave Undead */
1938 if (!get_aim_dir(&dir)) return FALSE;
1940 (void)control_one_undead(dir, plev);
1942 case 8: /* Orb of Entropy */
1943 if (!get_aim_dir(&dir)) return FALSE;
1945 fire_ball(GF_OLD_DRAIN, dir,
1946 (damroll(3, 6) + plev +
1947 (plev / (((p_ptr->pclass == CLASS_MAGE) ||
1948 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
1949 (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
1950 ((plev < 30) ? 2 : 3));
1952 case 9: /* Nether Bolt */
1953 if (!get_aim_dir(&dir)) return FALSE;
1955 fire_bolt_or_beam(beam, GF_NETHER, dir,
1956 damroll(8 + ((plev - 5) / 4), 8));
1958 case 10: /* Cloud kill */
1959 project(0, plev / 10 + 2, py, px,
1960 (30 + plev) * 2, GF_POIS, PROJECT_KILL | PROJECT_ITEM, -1);
1962 case 11: /* Genocide One */
1963 if (!get_aim_dir(&dir)) return FALSE;
1965 fire_ball_hide(GF_GENOCIDE, dir, plev + 50, 0);
1967 case 12: /* Poison Branding */
1970 case 13: /* Vampiric Drain */
1971 if (!get_aim_dir(&dir)) return FALSE;
1973 dummy = plev * 2 + randint1(plev * 2); /* Dmg */
1974 if (drain_life(dir, dummy))
1976 chg_virtue(V_SACRIFICE, -1);
1977 chg_virtue(V_VITALITY, -1);
1979 (void)hp_player(dummy);
1980 /* Gain nutritional sustenance: 150/hp drained */
1981 /* A Food ration gives 5000 food points (by contrast) */
1982 /* Don't ever get more than "Full" this way */
1983 /* But if we ARE Gorged, it won't cure us */
1984 dummy = p_ptr->food + MIN(5000, 100 * dummy);
1985 if (p_ptr->food < PY_FOOD_MAX) /* Not gorged already */
1986 (void)set_food(dummy >= PY_FOOD_MAX ? PY_FOOD_MAX - 1 : dummy);
1989 case 14: /* Animate Dead */
1990 animate_dead(0, py, px);
1992 case 15: /* Genocide */
1993 (void)symbol_genocide(plev+50, TRUE);
1995 case 16: /* Berserk */
1996 (void)set_shero(randint1(25) + 25, FALSE);
1997 (void)hp_player(30);
1998 (void)set_afraid(0);
2000 case 17: /* Invoke Spirits */
2002 int die = randint1(100) + plev / 5;
2003 int vir = virtue_number(V_CHANCE);
2006 if (p_ptr->virtues[vir - 1] > 0)
2008 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
2012 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
2016 if (!get_aim_dir(&dir)) return FALSE;
2019 msg_print("¤¢¤Ê¤¿¤Ï»à¼Ô¤¿¤Á¤ÎÎϤò¾·½¸¤·¤¿...");
2021 msg_print("You call on the power of the dead...");
2024 chg_virtue(V_CHANCE, 1);
2028 msg_print("¤¢¤Ê¤¿¤Ï¤ª¤É¤í¤ª¤É¤í¤·¤¤ÎϤΤ¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
2030 msg_print("You feel a surge of eldritch force!");
2037 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¤¢¤Ê¤¿¤Î¼þ¤ê¤ÎÃÏÌ̤«¤éµà¤Á¤¿¿Í±Æ¤¬Î©¤Á¾å¤¬¤Ã¤Æ¤¤¿¡ª");
2039 msg_print("Oh no! Mouldering forms rise from the earth around you!");
2042 (void)summon_specific(0, py, px, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
2043 chg_virtue(V_UNLIFE, 1);
2048 msg_print("̾¾õ¤·Æñ¤¤¼Ù°¤Ê¸ºß¤¬¤¢¤Ê¤¿¤Î¿´¤òÄ̤ê²á¤®¤Æ¹Ô¤Ã¤¿...");
2050 msg_print("An unnamable evil brushes against your mind...");
2053 set_afraid(p_ptr->afraid + randint1(4) + 4);
2058 msg_print("¤¢¤Ê¤¿¤ÎƬ¤ËÂçÎ̤ÎÍ©Î¤Á¤ÎÁû¡¹¤·¤¤À¼¤¬²¡¤·´ó¤»¤Æ¤¤¿...");
2060 msg_print("Your head is invaded by a horde of gibbering spectral voices...");
2063 set_confused(p_ptr->confused + randint1(4) + 4);
2071 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
2072 damroll(3 + ((plev - 1) / 5), 4));
2076 confuse_monster (dir, plev);
2080 fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
2084 (void)lite_line(dir);
2088 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
2089 damroll(3+((plev-5)/4),8));
2093 fire_bolt_or_beam(beam - 10, GF_COLD, dir,
2094 damroll(5+((plev-5)/4),8));
2098 fire_bolt_or_beam(beam, GF_ACID, dir,
2099 damroll(6+((plev-5)/4),8));
2103 fire_bolt_or_beam(beam, GF_FIRE, dir,
2104 damroll(8+((plev-5)/4),8));
2108 drain_life(dir, 75);
2112 fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
2116 fire_ball(GF_ACID, dir, 40 + plev, 2);
2120 fire_ball(GF_ICE, dir, 70 + plev, 3);
2124 fire_ball(GF_FIRE, dir, 80 + plev, 3);
2128 drain_life(dir, 100 + plev);
2132 earthquake(py, px, 12);
2136 (void)destroy_area(py, px, 13 + randint0(5), FALSE);
2140 symbol_genocide(plev+50, TRUE);
2144 dispel_monsters(120);
2148 dispel_monsters(150);
2156 msg_print("±¢±µ¤ÊÀ¼¤¬¥¯¥¹¥¯¥¹¾Ð¤¦¡£¡Ö¤â¤¦¤¹¤°¤ª¤Þ¤¨¤Ï²æ¡¹¤ÎÃç´Ö¤Ë¤Ê¤ë¤À¤í¤¦¡£¼å¤¼Ô¤è¡£¡×");
2158 msg_print("Sepulchral voices chuckle. 'Soon you will join us, mortal.'");
2163 case 18: /* Dark Bolt */
2164 if (!get_aim_dir(&dir)) return FALSE;
2166 fire_bolt_or_beam(beam, GF_DARK, dir,
2167 damroll(4 + ((plev - 5) / 4), 8));
2169 case 19: /* Battle Frenzy */
2170 (void)set_shero(randint1(25) + 25, FALSE);
2171 (void)hp_player(30);
2172 (void)set_afraid(0);
2173 (void)set_fast(randint1(20 + (plev / 2)) + (plev / 2), FALSE);
2175 case 20: /* Vampiric Branding */
2178 case 21: /* Vampirism True */
2179 if (!get_aim_dir(&dir)) return FALSE;
2181 chg_virtue(V_SACRIFICE, -1);
2182 chg_virtue(V_VITALITY, -1);
2184 for (dummy = 0; dummy < 3; dummy++)
2186 if (drain_life(dir, 100))
2190 case 22: /* Word of Death */
2191 (void)dispel_living(randint1(plev * 3));
2193 case 23: /* Darkness Storm */
2194 if (!get_aim_dir(&dir)) return FALSE;
2196 fire_ball(GF_DARK, dir, 100+plev*2, 4);
2198 case 24: /* Death Ray */
2199 if (!get_aim_dir(&dir)) return FALSE;
2201 (void)death_ray(dir, plev);
2203 case 25: /* Raise the Dead */
2206 bool pet = one_in_(3);
2209 type = (plev > 47 ? SUMMON_HI_UNDEAD : SUMMON_UNDEAD);
2211 if (!pet || (pet && (plev > 24) && one_in_(3)))
2212 mode |= PM_ALLOW_GROUP;
2214 if (pet) mode |= PM_FORCE_PET;
2215 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
2217 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, type, mode))
2220 msg_print("Î䤿¤¤É÷¤¬¤¢¤Ê¤¿¤Î¼þ¤ê¤Ë¿á¤»Ï¤á¤¿¡£¤½¤ì¤ÏÉåÇÔ½¤ò±¿¤ó¤Ç¤¤¤ë...");
2222 msg_print("Cold winds begin to blow around you, carrying with them the stench of decay...");
2228 msg_print("¸Å¤¨¤Î»à¤»¤ë¼Ô¶¦¤¬¤¢¤Ê¤¿¤Ë»Å¤¨¤ë¤¿¤áÅÚ¤«¤éᴤä¿¡ª");
2230 msg_print("Ancient, long-dead forms arise from the ground to serve you!");
2235 msg_print("»à¼Ô¤¬á´¤Ã¤¿¡£Ì²¤ê¤ò˸¤²¤ë¤¢¤Ê¤¿¤òȳ¤¹¤ë¤¿¤á¤Ë¡ª");
2237 msg_print("'The dead arise... to punish you for disturbing them!'");
2240 chg_virtue(V_UNLIFE, 1);
2245 case 26: /* Esoteria */
2246 if (randint1(50) > plev)
2247 return ident_spell(FALSE);
2249 return identify_fully(FALSE);
2250 case 27: /* Mimic vampire */
2251 (void)set_mimic(10+plev/2 + randint1(10+plev/2), MIMIC_VAMPIRE, FALSE);
2253 case 28: /* Restore Life */
2254 (void)restore_level();
2256 case 29: /* Mass Genocide */
2257 (void)mass_genocide(plev+50, TRUE);
2259 case 30: /* Hellfire */
2260 if (!get_aim_dir(&dir)) return FALSE;
2262 fire_ball(GF_HELL_FIRE, dir, 666, 3);
2264 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "ÃϹö¤Î¹å²Ð¤Î¼öʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
2266 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "the strain of casting Hellfire", -1);
2270 case 31: /* Wraithform */
2271 set_wraith_form(randint1(plev / 2) + (plev / 2), FALSE);
2274 msg_format("You cast an unknown Death spell: %d.", spell);
2282 static bool cast_trump_spell(int spell, bool success)
2285 int plev = p_ptr->lev;
2286 int summon_lev = plev * 2 / 3 + randint1(plev/2);
2288 bool no_trump = FALSE;
2289 bool unique_okay = FALSE;
2291 if (summon_lev < 1) summon_lev = 1;
2292 if (!success || (randint1(50+plev) < plev/10)) unique_okay = TRUE;
2295 case 0: /* Phase Door */
2298 teleport_player(10, FALSE);
2301 case 1: /* Trump Spiders */
2303 bool pet = success; /* (randint1(5) > 2) */
2304 u32b mode = PM_ALLOW_GROUP;
2306 if (pet) mode |= PM_FORCE_PET;
2307 else mode |= PM_NO_PET;
2310 msg_print("¤¢¤Ê¤¿¤ÏÃØéá¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2312 msg_print("You concentrate on the trump of an spider...");
2315 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_SPIDER, mode))
2319 msg_print("¾¤´¤µ¤ì¤¿ÃØéá¤ÏÅܤäƤ¤¤ë¡ª");
2321 msg_print("The summoned spiders get angry!");
2331 case 2: /* Shuffle */
2334 /* A limited power 'wonder' spell */
2335 int die = randint1(120);
2336 int vir = virtue_number(V_CHANCE);
2338 if ((p_ptr->pclass == CLASS_ROGUE) ||
2339 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
2340 (p_ptr->pclass == CLASS_SORCERER))
2341 die = (randint1(110)) + plev / 5;
2342 /* Card sharks and high mages get a level bonus */
2346 if (p_ptr->virtues[vir - 1] > 0)
2348 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
2352 while (randint1(400) < (0-p_ptr->virtues[vir - 1])) die--;
2357 msg_print("¤¢¤Ê¤¿¤Ï¥«¡¼¥É¤òÀڤäưìËç°ú¤¤¤¿...");
2359 msg_print("You shuffle the deck and draw a card...");
2363 chg_virtue(V_CHANCE, 1);
2368 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡Ô»à¡Õ¤À¡ª");
2370 msg_print("Oh no! It's Death!");
2373 for (dummy = 0; dummy < randint1(3); dummy++)
2374 (void)activate_hi_summon(py, px, FALSE);
2379 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡Ô°Ëâ¡Õ¤À¡ª");
2381 msg_print("Oh no! It's the Devil!");
2384 (void)summon_specific(0, py, px, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
2390 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª¡ÔÄߤé¤ì¤¿ÃË¡Õ¤À¡ª");
2392 msg_print("Oh no! It's the Hanged Man.");
2395 (void)activate_ty_curse(FALSE, &count);
2400 msg_print("¡ÔÉÔĴϤηõ¡Õ¤À¡£");
2402 msg_print("It's the swords of discord.");
2405 aggravate_monsters(0);
2410 msg_print("¡Ô¶ò¼Ô¡Õ¤À¡£");
2412 msg_print("It's the Fool.");
2415 (void)do_dec_stat(A_INT);
2416 (void)do_dec_stat(A_WIS);
2421 msg_print("´ñ̯¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2423 msg_print("It's the picture of a strange monster.");
2426 if (!(summon_specific(0, py, px, (dun_level * 3) / 2, 32 + randint1(6), (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET))))
2432 msg_print("¡Ô·î¡Õ¤À¡£");
2434 msg_print("It's the Moon.");
2442 msg_print("¡Ô±¿Ì¿¤ÎÎØ¡Õ¤À¡£");
2444 msg_print("It's the Wheel of Fortune.");
2447 wild_magic(randint0(32));
2452 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2454 msg_print("It's a teleport trump card.");
2457 teleport_player(10, TRUE);
2462 msg_print("¡ÔÀµµÁ¡Õ¤À¡£");
2464 msg_print("It's Justice.");
2467 set_blessed(p_ptr->lev, FALSE);
2472 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2474 msg_print("It's a teleport trump card.");
2477 teleport_player(100, TRUE);
2482 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥«¡¼¥É¤À¡£");
2484 msg_print("It's a teleport trump card.");
2487 teleport_player(200, TRUE);
2492 msg_print("¡ÔÅã¡Õ¤À¡£");
2494 msg_print("It's the Tower.");
2502 msg_print("¡ÔÀáÀ©¡Õ¤À¡£");
2504 msg_print("It's Temperance.");
2507 sleep_monsters_touch();
2512 msg_print("¡ÔÅã¡Õ¤À¡£");
2514 msg_print("It's the Tower.");
2517 earthquake(py, px, 5);
2522 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2524 msg_print("It's the picture of a friendly monster.");
2527 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE1, PM_FORCE_PET)))
2533 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2535 msg_print("It's the picture of a friendly monster.");
2538 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE2, PM_FORCE_PET)))
2544 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2546 msg_print("It's the picture of a friendly monster.");
2549 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE4, PM_FORCE_PET)))
2555 msg_print("ͧ¹¥Åª¤Ê¥â¥ó¥¹¥¿¡¼¤Î³¨¤À¡£");
2557 msg_print("It's the picture of a friendly monster.");
2560 if (!(summon_specific(-1, py, px, (dun_level * 3) / 2, SUMMON_BIZARRE5, PM_FORCE_PET)))
2566 msg_print("¡ÔÎø¿Í¡Õ¤À¡£");
2568 msg_print("It's the Lovers.");
2571 if (get_aim_dir(&dir))
2572 (void)charm_monster(dir, MIN(p_ptr->lev, 20));
2577 msg_print("¡Ô±£¼Ô¡Õ¤À¡£");
2579 msg_print("It's the Hermit.");
2587 msg_print("¡Ô¿³È½¡Õ¤À¡£");
2589 msg_print("It's the Judgement.");
2592 do_cmd_rerate(FALSE);
2593 if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3)
2596 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
2598 msg_print("You are cured of all mutations.");
2601 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
2602 p_ptr->update |= PU_BONUS;
2609 msg_print("¡ÔÂÀÍÛ¡Õ¤À¡£");
2611 msg_print("It's the Sun.");
2614 chg_virtue(V_KNOWLEDGE, 1);
2615 chg_virtue(V_ENLIGHTEN, 1);
2621 msg_print("¡ÔÀ¤³¦¡Õ¤À¡£");
2623 msg_print("It's the World.");
2626 if (p_ptr->exp < PY_MAX_EXP)
2628 s32b ee = (p_ptr->exp / 25) + 1;
2629 if (ee > 5000) ee = 5000;
2631 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
2633 msg_print("You feel more experienced.");
2641 case 3: /* Reset Recall */
2644 if (!reset_recall()) return FALSE;
2647 case 4: /* Teleport Self */
2650 teleport_player(plev * 4, FALSE);
2653 case 5: /* Trump Spying */
2656 (void)set_tim_esp(randint1(30) + 25, FALSE);
2659 case 6: /* Teleport Away */
2662 if (!get_aim_dir(&dir)) return FALSE;
2663 (void)fire_beam(GF_AWAY_ALL, dir, plev);
2666 case 7: /* Trump Animals */
2668 bool pet = success; /* was (randint1(5) > 2) */
2669 int type = (pet ? SUMMON_ANIMAL_RANGER : SUMMON_ANIMAL);
2672 if (pet) mode |= PM_FORCE_PET;
2673 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2676 msg_print("¤¢¤Ê¤¿¤Ïưʪ¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2678 msg_print("You concentrate on the trump of an animal...");
2682 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
2686 msg_print("¾¤´¤µ¤ì¤¿Æ°Êª¤ÏÅܤäƤ¤¤ë¡ª");
2688 msg_print("The summoned animal gets angry!");
2699 case 8: /* Trump Reach */
2702 if (!get_aim_dir(&dir)) return FALSE;
2703 fetch(dir, plev * 15, TRUE);
2706 case 9: /* Trump Kamikaze */
2711 if (!target_set(TARGET_KILL)) return FALSE;
2718 msg_print("¤¢¤Ê¤¿¤Ï¥«¥ß¥«¥¼¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2720 msg_print("You concentrate on several trumps at once...");
2724 for (dummy = 2 + randint0(plev / 7); dummy > 0; dummy--)
2726 bool pet = success; /* was (randint1(10) > 3) */
2730 if (pet) mode |= PM_FORCE_PET;
2731 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2733 if (p_ptr->pclass == CLASS_BEASTMASTER)
2735 type = SUMMON_KAMIKAZE_LIVING;
2739 type = SUMMON_KAMIKAZE;
2742 if (summon_specific((pet ? -1 : 0), y, x, summon_lev, type, mode))
2746 msg_print("¾¤´¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
2748 msg_print("The summoned creatures get angry!");
2756 case 10: /* Phantasmal Servant */
2759 if (summon_specific(-1, py, px, (summon_lev * 3) / 2, SUMMON_PHANTOM, PM_FORCE_PET))
2762 msg_print("¸æÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¸æ¼ç¿ÍÍÍ¡©");
2764 msg_print("'Your wish, master?'");
2774 case 11: /* Speed Monster */
2777 bool old_target_pet = target_pet;
2779 if (!get_aim_dir(&dir))
2781 target_pet = old_target_pet;
2784 target_pet = old_target_pet;
2785 (void)speed_monster(dir);
2788 case 12: /* Teleport Level */
2792 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
2794 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
2796 (void)teleport_level(0);
2799 case 13: /* Dimension Door */
2803 msg_print("¼¡¸µ¤ÎÈ⤬³«¤¤¤¿¡£ÌÜŪÃϤòÁª¤ó¤Ç²¼¤µ¤¤¡£");
2805 msg_print("You open a dimensional gate. Choose a destination.");
2808 return dimension_door();
2811 case 14: /* Word of Recall */
2814 return word_of_recall();
2817 case 15: /* Banish */
2820 banish_monsters(plev * 4);
2823 case 16: /* Swap Position */
2827 project_length = -1;
2828 if (!get_aim_dir(&dir))
2835 (void)teleport_swap(dir);
2839 case 17: /* Trump Undead */
2841 bool pet = success; /* (randint1(10) > 3) */
2844 if (pet) mode |= PM_FORCE_PET;
2845 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2848 msg_print("¤¢¤Ê¤¿¤Ï¥¢¥ó¥Ç¥Ã¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2850 msg_print("You concentrate on the trump of an undead creature...");
2854 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_UNDEAD, mode))
2858 msg_print("¾¤´¤µ¤ì¤¿¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
2860 msg_print("The summoned undead creature gets angry!");
2871 case 18: /* Trump Reptiles */
2873 bool pet = success; /* was (randint1(5) > 2) */
2876 if (pet) mode |= PM_FORCE_PET;
2877 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2880 msg_print("¤¢¤Ê¤¿¤Ïà¨ÃîÎà¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2882 msg_print("You concentrate on the trump of a reptile...");
2886 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HYDRA, mode))
2890 msg_print("¾¤´¤µ¤ì¤¿à¨ÃîÎà¤ÏÅܤäƤ¤¤ë¡ª");
2892 msg_print("The summoned reptile gets angry!");
2903 case 19: /* Trump Monsters */
2908 msg_print("¤¢¤Ê¤¿¤Ï¥â¥ó¥¹¥¿¡¼¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2910 msg_print("You concentrate on several trumps at once...");
2914 for (dummy = 0; dummy < 1 + ((plev - 15)/ 10); dummy++)
2916 bool pet = success; /* was (randint1(10) > 3) */
2920 if (pet) mode |= PM_FORCE_PET;
2921 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
2923 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
2925 if (p_ptr->pclass == CLASS_BEASTMASTER)
2927 type = SUMMON_LIVING;
2934 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
2938 msg_print("¾¤´¤µ¤ì¤¿¥â¥ó¥¹¥¿¡¼¤ÏÅܤäƤ¤¤ë¡ª");
2940 msg_print("The summoned creatures get angry!");
2948 case 20: /* Trump Hounds */
2950 bool pet = success; /* was (randint1(5) > 2) */
2951 u32b mode = PM_ALLOW_GROUP;
2953 if (pet) mode |= PM_FORCE_PET;
2954 else mode |= PM_NO_PET;
2957 msg_print("¤¢¤Ê¤¿¤Ï¥Ï¥¦¥ó¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
2959 msg_print("You concentrate on the trump of a hound...");
2963 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HOUND, mode))
2967 msg_print("¾¤´¤µ¤ì¤¿¥Ï¥¦¥ó¥É¤ÏÅܤäƤ¤¤ë¡ª");
2969 msg_print("The summoned hounds get angry!");
2980 case 21: /* Trump Branding */
2986 case 22: /* Living Trump */
2990 /* Teleport control */
2993 /* Random teleportation (uncontrolled) */
2995 /* Gain the mutation */
2996 if (gain_random_mutation(dummy))
2998 msg_print("¤¢¤Ê¤¿¤ÏÀ¸¤¤Æ¤¤¤ë¥«¡¼¥É¤ËÊѤï¤Ã¤¿¡£");
3000 msg_print("You have turned into a Living Trump.");
3005 case 23: /* Trump Cyberdemon */
3007 bool pet = success; /* was (randint1(10) > 3) */
3010 if (pet) mode |= PM_FORCE_PET;
3011 else mode |= PM_NO_PET;
3014 msg_print("¤¢¤Ê¤¿¤Ï¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3016 msg_print("You concentrate on the trump of a Cyberdemon...");
3020 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_CYBER, mode))
3024 msg_print("¾¤´¤µ¤ì¤¿¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3026 msg_print("The summoned Cyberdemon gets angry!");
3037 case 24: /* Trump Divination */
3040 (void)detect_all(DETECT_RAD_DEFAULT);
3043 case 25: /* Trump Lore */
3046 return identify_fully(FALSE);
3049 case 26: /* Heal Monster */
3052 bool old_target_pet = target_pet;
3054 if (!get_aim_dir(&dir))
3056 target_pet = old_target_pet;
3059 target_pet = old_target_pet;
3061 (void)heal_monster(dir, p_ptr->lev * 10 + 200);
3064 case 27: /* Trump Dragon */
3066 bool pet = success; /* was (randint1(10) > 3) */
3069 if (pet) mode |= PM_FORCE_PET;
3070 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3073 msg_print("¤¢¤Ê¤¿¤Ï¥É¥é¥´¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3075 msg_print("You concentrate on the trump of a dragon...");
3079 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DRAGON, mode))
3083 msg_print("¾¤´¤µ¤ì¤¿¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3085 msg_print("The summoned dragon gets angry!");
3096 case 28: /* Trump Meteor */
3099 int x, y, dx, dy, i;
3100 int b = 10 + randint1(10);
3101 for (i = 0; i < b; i++)
3103 int count = 0, d = 0;
3108 if (count > 20) break;
3109 x = px - 8 + randint0(17);
3110 y = py - 8 + randint0(17);
3112 if (!in_bounds(y, x) || !projectable(py, px, y, x)) continue;
3114 dx = (px > x) ? (px - x) : (x - px);
3115 dy = (py > y) ? (py - y) : (y - py);
3117 /* Approximate distance */
3118 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
3122 if (count > 20) continue;
3124 project(0, 2, y, x, plev * 2, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
3128 case 29: /* Trump Demon */
3130 bool pet = success; /* was (randint1(10) > 3) */
3133 if (pet) mode |= PM_FORCE_PET;
3134 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3137 msg_print("¤¢¤Ê¤¿¤Ï¥Ç¡¼¥â¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3139 msg_print("You concentrate on the trump of a demon...");
3143 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DEMON, mode))
3147 msg_print("¾¤´¤µ¤ì¤¿¥Ç¡¼¥â¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3149 msg_print("The summoned demon gets angry!");
3160 case 30: /* Trump Greater Undead */
3162 bool pet = success; /* was (randint1(10) > 3) */
3165 if (pet) mode |= PM_FORCE_PET;
3166 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3168 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
3171 msg_print("¤¢¤Ê¤¿¤Ï¶¯ÎϤʥ¢¥ó¥Ç¥Ã¥É¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3173 msg_print("You concentrate on the trump of a greater undead being...");
3177 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HI_UNDEAD, mode))
3181 msg_print("¾¤´¤µ¤ì¤¿¾åµé¥¢¥ó¥Ç¥Ã¥É¤ÏÅܤäƤ¤¤ë¡ª");
3183 msg_print("The summoned greater undead creature gets angry!");
3194 case 31: /* Trump Ancient Dragon */
3196 bool pet = success; /* was (randint1(10) > 3) */
3200 if (pet) mode |= PM_FORCE_PET;
3201 else mode |= (PM_ALLOW_GROUP | PM_NO_PET);
3203 if (unique_okay) mode |= PM_ALLOW_UNIQUE;
3205 if (p_ptr->pclass == CLASS_BEASTMASTER)
3207 type = SUMMON_HI_DRAGON_LIVING;
3211 type = SUMMON_HI_DRAGON;
3215 msg_print("¤¢¤Ê¤¿¤Ï¸ÅÂå¥É¥é¥´¥ó¤Î¥«¡¼¥É¤Ë½¸Ã椹¤ë...");
3217 msg_print("You concentrate on the trump of an ancient dragon...");
3221 if (summon_specific((pet ? -1 : 0), py, px, summon_lev, type, mode))
3225 msg_print("¾¤´¤µ¤ì¤¿¸ÅÂå¥É¥é¥´¥ó¤ÏÅܤäƤ¤¤ë¡ª");
3227 msg_print("The summoned ancient dragon gets angry!");
3240 msg_format("̤ÃΤΥ«¡¼¥É¤Î¼öʸ¤Ç¤¹: %d", spell);
3242 msg_format("You cast an unknown Trump spell: %d.", spell);
3251 msg_print("ï¤â¤¢¤Ê¤¿¤Î¥«¡¼¥É¤Î¸Æ¤ÓÀ¼¤ËÅú¤¨¤Ê¤¤¡£");
3253 msg_print("Nobody answers to your Trump call.");
3262 static bool cast_arcane_spell(int spell)
3266 int plev = p_ptr->lev;
3269 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3270 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3271 else beam = plev / 2;
3276 if (!get_aim_dir(&dir)) return FALSE;
3278 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
3279 damroll(3 + ((plev - 1) / 5), 3));
3281 case 1: /* Wizard Lock */
3282 if (!get_aim_dir(&dir)) return FALSE;
3284 (void)wizard_lock(dir);
3286 case 2: /* Detect Invisibility */
3287 (void)detect_monsters_invis(DETECT_RAD_DEFAULT);
3289 case 3: /* Detect Monsters */
3290 (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
3293 teleport_player(10, FALSE);
3295 case 5: /* Light Area */
3296 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
3298 case 6: /* Trap & Door Destruction */
3299 if (!get_aim_dir(&dir)) return FALSE;
3301 (void)destroy_door(dir);
3303 case 7: /* Cure Light Wounds */
3304 (void)hp_player(damroll(2, 8));
3305 (void)set_cut(p_ptr->cut - 10);
3307 case 8: /* Detect Doors & Traps */
3308 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
3309 (void)detect_doors(DETECT_RAD_DEFAULT);
3310 (void)detect_stairs(DETECT_RAD_DEFAULT);
3312 case 9: /* Phlogiston */
3315 case 10: /* Detect Treasure */
3316 (void)detect_treasure(DETECT_RAD_DEFAULT);
3317 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
3319 case 11: /* Detect Enchantment */
3320 (void)detect_objects_magic(DETECT_RAD_DEFAULT);
3322 case 12: /* Detect Objects */
3323 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
3325 case 13: /* Cure Poison */
3326 (void)set_poisoned(0);
3328 case 14: /* Resist Cold */
3329 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3331 case 15: /* Resist Fire */
3332 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3334 case 16: /* Resist Lightning */
3335 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3337 case 17: /* Resist Acid */
3338 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3340 case 18: /* Cure Medium Wounds */
3341 (void)hp_player(damroll(4, 8));
3342 (void)set_cut((p_ptr->cut / 2) - 50);
3344 case 19: /* Teleport */
3345 teleport_player(plev * 5, FALSE);
3347 case 20: /* Identify */
3348 return ident_spell(FALSE);
3349 case 21: /* Stone to Mud */
3350 if (!get_aim_dir(&dir)) return FALSE;
3352 (void)wall_to_mud(dir);
3354 case 22: /* Ray of Light */
3355 if (!get_aim_dir(&dir)) return FALSE;
3358 msg_print("¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
3360 msg_print("A line of light appears.");
3363 (void)lite_line(dir);
3365 case 23: /* Satisfy Hunger */
3366 (void)set_food(PY_FOOD_MAX - 1);
3368 case 24: /* See Invisible */
3369 (void)set_tim_invis(randint1(24) + 24, FALSE);
3371 case 25: /* Conjure Elemental */
3372 if (!summon_specific(-1, py, px, plev, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3375 msg_print("¥¨¥ì¥á¥ó¥¿¥ë¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3377 msg_print("No Elementals arrive.");
3381 case 26: /* Teleport Level */
3383 if (!get_check("ËÜÅö¤Ë¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) return FALSE;
3385 if (!get_check("Are you sure? (Teleport Level)")) return FALSE;
3387 (void)teleport_level(0);
3389 case 27: /* Teleport Away */
3390 if (!get_aim_dir(&dir)) return FALSE;
3392 (void)fire_beam(GF_AWAY_ALL, dir, plev);
3394 case 28: /* Elemental Ball */
3395 if (!get_aim_dir(&dir)) return FALSE;
3397 switch (randint1(4))
3399 case 1: dummy = GF_FIRE;break;
3400 case 2: dummy = GF_ELEC;break;
3401 case 3: dummy = GF_COLD;break;
3402 default: dummy = GF_ACID;break;
3404 fire_ball(dummy, dir, 75 + (plev), 2);
3406 case 29: /* Detection */
3407 (void)detect_all(DETECT_RAD_DEFAULT);
3409 case 30: /* Word of Recall */
3410 return word_of_recall();
3411 case 31: /* Clairvoyance */
3412 chg_virtue(V_KNOWLEDGE, 1);
3413 chg_virtue(V_ENLIGHTEN, 1);
3415 if (!p_ptr->telepathy)
3417 (void)set_tim_esp(randint1(30) + 25, FALSE);
3421 msg_format("You cast an unknown Arcane spell: %d.", spell);
3429 static bool cast_enchant_spell(int spell)
3431 int plev = p_ptr->lev;
3436 case 0: /* Infravision */
3437 set_tim_infra(100 + randint1(100), FALSE);
3439 case 1: /* Regeneration */
3440 set_tim_regen(80 + randint1(80), FALSE);
3442 case 2: /* Satisfy Hunger */
3443 (void)set_food(PY_FOOD_MAX - 1);
3445 case 3: /* Resist Cold */
3446 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3448 case 4: /* Resist Fire */
3449 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3451 case 5: /* Heroism */
3452 (void)set_hero(randint1(25) + 25, FALSE);
3453 (void)hp_player(10);
3454 (void)set_afraid(0);
3456 case 6: /* Resist Lightning */
3457 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3459 case 7: /* Resist Acid */
3460 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3462 case 8: /* See Invisibility */
3463 (void)set_tim_invis(randint1(24) + 24, FALSE);
3465 case 9: /* Remove Curse */
3469 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
3471 msg_print("You feel as if someone is watching over you.");
3475 case 10: /* Resist Poison */
3476 (void)set_oppose_pois(randint1(20) + 20, FALSE);
3478 case 11: /* Berserk */
3479 (void)set_shero(randint1(25) + 25, FALSE);
3480 (void)hp_player(30);
3481 (void)set_afraid(0);
3483 case 12: /* Self Knowledge */
3484 (void)self_knowledge();
3486 case 13: /* Protection from Evil */
3487 (void)set_protevil(randint1(25) + 3 * p_ptr->lev, FALSE);
3489 case 14: /* Healing */
3495 case 15: /* Mana Branding */
3496 return choose_ele_attack();
3497 case 16: /* Telepathy */
3498 (void)set_tim_esp(randint1(30) + 25, FALSE);
3500 case 17: /* Stone Skin */
3501 (void)set_shield(randint1(20) + 30, FALSE);
3503 case 18: /* Resistance */
3504 (void)set_oppose_acid(randint1(20) + 20, FALSE);
3505 (void)set_oppose_elec(randint1(20) + 20, FALSE);
3506 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3507 (void)set_oppose_cold(randint1(20) + 20, FALSE);
3508 (void)set_oppose_pois(randint1(20) + 20, FALSE);
3510 case 19: /* Haste */
3511 (void)set_fast(randint1(20 + plev) + plev, FALSE);
3513 case 20: /* Walk through Wall */
3514 (void)set_kabenuke(randint1(plev/2) + plev/2, FALSE);
3516 case 21: /* Pulish Shield */
3517 (void)pulish_shield();
3519 case 22: /* Create Golem */
3520 if (summon_specific(-1, py, px, plev, SUMMON_GOLEM, PM_FORCE_PET))
3523 msg_print("¥´¡¼¥ì¥à¤òºî¤Ã¤¿¡£");
3525 msg_print("You make a golem.");
3531 msg_print("¤¦¤Þ¤¯¥´¡¼¥ì¥à¤òºî¤ì¤Ê¤«¤Ã¤¿¡£");
3533 msg_print("No Golems arrive.");
3537 case 23: /* Magic armor */
3538 (void)set_magicdef(randint1(20) + 20, FALSE);
3540 case 24: /* Remove Enchantment */
3541 if (!mundane_spell(TRUE)) return FALSE;
3543 case 25: /* Remove All Curse */
3544 if (remove_all_curse())
3547 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
3549 msg_print("You feel as if someone is watching over you.");
3553 case 26: /* Total Knowledge */
3554 return identify_fully(FALSE);
3555 case 27: /* Enchant Weapon */
3556 return enchant_spell(randint0(4) + 1, randint0(4) + 1, 0);
3557 case 28: /* Enchant Armor */
3558 return enchant_spell(0, 0, randint0(3) + 2);
3559 case 29: /* Brand Weapon */
3560 brand_weapon(randint0(18));
3562 case 30: /* Living Trump */
3564 /* Teleport control */
3567 /* Random teleportation (uncontrolled) */
3569 /* Gain the mutation */
3570 if (gain_random_mutation(dummy))
3572 msg_print("¤¢¤Ê¤¿¤ÏÀ¸¤¤Æ¤¤¤ë¥«¡¼¥É¤ËÊѤï¤Ã¤¿¡£");
3574 msg_print("You have turned into a Living Trump.");
3577 case 31: /* Immune */
3578 return choose_ele_immune(13 + randint1(13));
3580 msg_format("You cast an unknown Craft spell: %d.", spell);
3589 * An "item_tester_hook" for offer
3591 static bool item_tester_offer(object_type *o_ptr)
3593 /* Flasks of oil are okay */
3594 if (o_ptr->tval != TV_CORPSE) return (FALSE);
3596 if (o_ptr->sval != SV_CORPSE) return (FALSE);
3598 if (my_strchr("pht", r_info[o_ptr->pval].d_char)) return (TRUE);
3600 /* Assume not okay */
3605 static bool cast_daemon_spell(int spell)
3608 int plev = p_ptr->lev;
3610 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3611 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3612 else beam = plev / 2;
3616 case 0: /* Magic Missile */
3617 if (!get_aim_dir(&dir)) return FALSE;
3619 fire_bolt_or_beam(beam - 10, GF_MISSILE, dir,
3620 damroll(3 + ((plev - 1) / 5), 4));
3622 case 1: /* Detect Undead & Demons -> Unlife */
3623 (void)detect_monsters_nonliving(DETECT_RAD_DEFAULT);
3626 (void)set_blessed(randint1(12) + 12, FALSE);
3628 case 3: /* Resist Fire */
3629 (void)set_oppose_fire(randint1(20) + 20, FALSE);
3631 case 4: /* Horrify */
3632 if (!get_aim_dir(&dir)) return FALSE;
3634 (void)fear_monster(dir, plev);
3635 (void)stun_monster(dir, plev);
3637 case 5: /* Nether Bolt */
3638 if (!get_aim_dir(&dir)) return FALSE;
3640 fire_bolt_or_beam(beam, GF_NETHER, dir,
3641 damroll(6 + ((plev - 5) / 4), 8));
3643 case 6: /* Summon monster, demon */
3644 if (!summon_specific(-1, py, px, (plev * 3) / 2, SUMMON_MANES, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3647 msg_print("¸ÅÂå¤Î»àÎî¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3649 msg_print("No Manes arrive.");
3653 case 7: /* Mini Hellfire */
3654 if (!get_aim_dir(&dir)) return FALSE;
3656 fire_ball(GF_HELL_FIRE, dir,
3657 (damroll(3, 6) + plev +
3658 (plev / (((p_ptr->pclass == CLASS_MAGE) ||
3659 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
3660 (p_ptr->pclass == CLASS_SORCERER)) ? 2 : 4))),
3661 ((plev < 30) ? 2 : 3));
3663 case 8: /* Enslave Demon */
3664 if (!get_aim_dir(&dir)) return FALSE;
3666 (void)control_one_demon(dir, plev);
3668 case 9: /* Vision */
3669 map_area(DETECT_RAD_MAP);
3671 case 10: /* Resist Nether */
3672 (void)set_tim_res_nether(randint1(20) + 20, FALSE);
3674 case 11: /* Plasma Bolt */
3675 if (!get_aim_dir(&dir)) return FALSE;
3677 fire_bolt_or_beam(beam, GF_PLASMA, dir,
3678 damroll(11 + ((plev - 5) / 4), 8));
3680 case 12: /* Fire Ball */
3681 if (!get_aim_dir(&dir)) return FALSE;
3683 fire_ball(GF_FIRE, dir, plev + 55, 2);
3685 case 13: /* Fire Branding */
3688 case 14: /* Nether Ball */
3689 if (!get_aim_dir(&dir)) return FALSE;
3691 fire_ball(GF_NETHER, dir, plev*3/2 + 100, plev / 20+2);
3693 case 15: /* Summon monster, demon */
3695 bool pet = !one_in_(3);
3698 if (pet) mode |= PM_FORCE_PET;
3699 else mode |= PM_NO_PET;
3700 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
3702 if (summon_specific((pet ? -1 : 0), py, px, plev*2/3+randint1(plev/2), SUMMON_DEMON, mode))
3705 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
3707 msg_print("The area fills with a stench of sulphur and brimstone.");
3713 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
3715 msg_print("'What is thy bidding... Master?'");
3720 msg_print("¡ÖÈܤ·¤¼Ô¤è¡¢²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª ¤ªÁ°¤Îº²¤òĺ¤¯¤¾¡ª¡×");
3722 msg_print("'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'");
3729 msg_print("°Ëâ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3731 msg_print("No demons arrive.");
3736 case 16: /* Telepathy */
3737 (void)set_tim_esp(randint1(30) + 25, FALSE);
3739 case 17: /* Demoncloak */
3741 int dur=randint1(20) + 20;
3743 set_oppose_fire(dur, FALSE);
3744 set_oppose_cold(dur, FALSE);
3745 set_tim_sh_fire(dur, FALSE);
3749 case 18: /* Rain of Lava */
3750 fire_ball(GF_FIRE, 0, (55 + plev)*2, 3);
3751 fire_ball_hide(GF_LAVA_FLOW, 0, 2+randint1(2), 3);
3753 case 19: /* Plasma ball */
3754 if (!get_aim_dir(&dir)) return FALSE;
3756 fire_ball(GF_PLASMA, dir, plev*3/2 + 80, 2 + plev/40);
3758 case 20: /* Mimic demon */
3759 (void)set_mimic(10+plev/2 + randint1(10+plev/2), MIMIC_DEMON, FALSE);
3761 case 21: /* Nether Wave == Dispel Good */
3762 (void)dispel_monsters(randint1(plev * 2));
3763 (void)dispel_good(randint1(plev * 2));
3766 if (!get_aim_dir(&dir)) return FALSE;
3767 fire_ball(GF_NEXUS, dir, 100 + plev*2, 4);
3769 case 23: /* Hand Doom */
3770 if (!get_aim_dir(&dir)) return FALSE;
3772 else msg_print("<ÇËÌǤμê>¤òÊü¤Ã¤¿¡ª");
3774 else msg_print("You invoke the Hand of Doom!");
3777 fire_ball_hide(GF_HAND_DOOM, dir, plev * 2, 0);
3779 case 24: /* Heroism */
3780 (void)set_hero(randint1(25) + 25, FALSE);
3781 (void)hp_player(10);
3782 (void)set_afraid(0);
3784 case 25: /* Tim resist time */
3785 (void)set_tim_res_time(randint1(20)+20, FALSE);
3787 case 26: /* Circle of Madness */
3788 fire_ball(GF_CHAOS, 0, 50+plev, 3+plev/20);
3789 fire_ball(GF_CONFUSION, 0, 50+plev, 3+plev/20);
3790 fire_ball(GF_CHARM, 0, 20+plev, 3+plev/20);
3792 case 27: /* True Discharge Minion */
3795 case 28: /* Summon Greater Demon */
3802 item_tester_hook = item_tester_offer;
3804 q = "¤É¤Î»àÂΤòÊû¤²¤Þ¤¹¤«? ";
3805 s = "Êû¤²¤é¤ì¤ë»àÂΤò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
3807 q = "Sacrifice which corpse? ";
3808 s = "You have nothing to scrifice.";
3810 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return FALSE;
3812 /* Get the item (in the pack) */
3815 o_ptr = &inventory[item];
3818 /* Get the item (on the floor) */
3821 o_ptr = &o_list[0 - item];
3824 summon_lev = p_ptr->lev * 2 / 3 + r_info[o_ptr->pval].level;
3825 if (summon_specific(-1, py, px, summon_lev, SUMMON_HI_DEMON, (PM_ALLOW_GROUP | PM_FORCE_PET)))
3828 msg_print("ⲫ¤Î°½¤¬½¼Ëþ¤·¤¿¡£");
3830 msg_print("The area fills with a stench of sulphur and brimstone.");
3835 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
3837 msg_print("'What is thy bidding... Master?'");
3840 /* Decrease the item (from the pack) */
3843 inven_item_increase(item, -1);
3844 inven_item_describe(item);
3845 inven_item_optimize(item);
3848 /* Decrease the item (from the floor) */
3851 floor_item_increase(0 - item, -1);
3852 floor_item_describe(0 - item);
3853 floor_item_optimize(0 - item);
3859 msg_print("°Ëâ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
3861 msg_print("No Greater Demon arrive.");
3866 case 29: /* Nether Storm */
3867 if (!get_aim_dir(&dir)) return FALSE;
3869 fire_ball(GF_NETHER, dir, plev*15, plev / 5);
3871 case 30: /* Blood curse */
3873 if (!get_aim_dir(&dir)) return FALSE;
3875 fire_ball_hide(GF_BLOOD_CURSE, dir, 600, 0);
3877 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "·ì¤Î¼ö¤¤", -1);
3879 take_hit(DAMAGE_USELIFE, 20 + randint1(30), "Blood curse", -1);
3883 case 31: /* Mimic Demon lord */
3884 (void)set_mimic(15 + randint1(15), MIMIC_DEMON_LORD, FALSE);
3887 msg_format("You cast an unknown Daemon spell: %d.", spell);
3895 static bool cast_crusade_spell(int spell)
3899 int plev = p_ptr->lev;
3901 if (p_ptr->pclass == CLASS_MAGE) beam = plev;
3902 else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
3903 else beam = plev / 2;
3908 if (!get_aim_dir(&dir)) return FALSE;
3910 fire_bolt_or_beam(beam - 10, GF_ELEC, dir,
3911 damroll(3 + ((plev - 1) / 5), 4));
3914 (void)detect_monsters_evil(DETECT_RAD_DEFAULT);
3916 case 2: /* Remove Fear */
3917 (void)set_afraid(0);
3920 if (!get_aim_dir(&dir)) return FALSE;
3922 (void)fear_monster(dir, plev);
3925 (void)sleep_monsters_touch();
3928 teleport_player(25 + plev / 2, FALSE);
3931 if (!get_aim_dir(&dir)) return FALSE;
3932 fire_blast(GF_LITE, dir, 3+((plev-1)/9), 2, 10, 3);
3936 (void)set_poisoned(0);
3940 if (!get_aim_dir(&dir)) return FALSE;
3941 (void)fire_ball(GF_AWAY_EVIL, dir, MAX_SIGHT*5, 0);
3943 case 9: /* Holy Orb */
3944 if (!get_aim_dir(&dir)) return FALSE;
3946 fire_ball(GF_HOLY_FIRE, dir,
3947 (damroll(3, 6) + plev +
3948 (plev / ((p_ptr->pclass == CLASS_PRIEST ||
3949 p_ptr->pclass == CLASS_HIGH_MAGE ||
3950 p_ptr->pclass == CLASS_SORCERER) ? 2 : 4))),
3951 ((plev < 30) ? 2 : 3));
3954 case 10: /* Exorcism */
3955 (void)dispel_undead(randint1(plev));
3956 (void)dispel_demons(randint1(plev));
3957 (void)turn_evil(plev);
3959 case 11: /* Remove Curse */
3963 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
3965 msg_print("You feel as if someone is watching over you.");
3969 case 12: /* Sense Unseen */
3970 (void)set_tim_invis(randint1(24) + 24, FALSE);
3972 case 13: /* Protection from Evil */
3973 (void)set_protevil(randint1(25) + 3 * p_ptr->lev, FALSE);
3976 if (!get_aim_dir(&dir)) return FALSE;
3977 (void)fire_bolt(GF_ELEC, dir, plev*5);
3979 case 15: /* Holy Word */
3980 (void)dispel_evil(randint1(plev * 6));
3981 (void)hp_player(100);
3982 (void)set_afraid(0);
3983 (void)set_poisoned(0);
3988 if (!get_aim_dir(&dir)) return FALSE;
3990 (void)destroy_door(dir);
3993 if (!get_aim_dir(&dir)) return FALSE;
3994 (void)stasis_evil(dir);
3997 set_tim_sh_holy(randint1(20)+20, FALSE);
3999 case 19: /* Dispel Undead + Demons */
4000 (void)dispel_undead(randint1(plev * 4));
4001 (void)dispel_demons(randint1(plev * 4));
4003 case 20: /* Dispel Evil */
4004 (void)dispel_evil(randint1(plev * 4));
4009 case 22: /* Star Burst */
4010 if (!get_aim_dir(&dir)) return FALSE;
4012 fire_ball(GF_LITE, dir, 100+plev*2, 4);
4014 case 23: /* Summon monster, angel */
4016 bool pet = !one_in_(3);
4019 if (pet) mode |= PM_FORCE_PET;
4020 else mode |= PM_NO_PET;
4021 if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
4023 if (summon_specific((pet ? -1 : 0), py, px, (plev * 3) / 2, SUMMON_ANGEL, mode))
4027 msg_print("¡Ö¤´ÍѤǤ´¤¶¤¤¤Þ¤¹¤«¡¢¤´¼ç¿ÍÍÍ¡×");
4029 msg_print("'What is thy bidding... Master?'");
4034 msg_print("¡Ö²æ¤ÏÆò¤Î²¼Ëͤˤ¢¤é¤º¡ª °¹Ô¼Ô¤è¡¢²ù¤¤²þ¤á¤è¡ª¡×");
4036 msg_print("Mortal! Repent of thy impiousness.");
4042 case 24: /* Heroism */
4043 (void)set_hero(randint1(25) + 25, FALSE);
4044 (void)hp_player(10);
4045 (void)set_afraid(0);
4047 case 25: /* Remove All Curse */
4048 if (remove_all_curse())
4051 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
4053 msg_print("You feel as if someone is watching over you.");
4057 case 26: /* Banishment */
4058 if (banish_evil(100))
4061 msg_print("¿ÀÀ»¤ÊÎϤ¬¼Ù°¤òÂǤÁʧ¤Ã¤¿¡ª");
4063 msg_print("The holy power banishes evil!");
4068 case 27: /* Word of Destruction */
4069 (void)destroy_area(py, px, 13 + randint0(5), FALSE);
4071 case 28: /* Eye for an Eye */
4072 set_tim_eyeeye(randint1(10)+10, FALSE);
4079 int b = 10 + randint1(10);
4081 if (!get_aim_dir(&dir)) return FALSE;
4083 /* Use the given direction */
4084 tx = px + 99 * ddx[dir];
4085 ty = py + 99 * ddy[dir];
4087 /* Hack -- Use an actual "target" */
4088 if ((dir == 5) && target_okay())
4099 /* Hack -- Stop at the target */
4100 if ((y == ty) && (x == tx)) break;
4104 mmove2(&ny, &nx, py, px, ty, tx);
4106 /* Stop at maximum range */
4107 if (MAX_RANGE <= distance(py, px, ny, nx)) break;
4109 /* Stopped by walls/doors */
4110 if (!cave_have_flag_bold(ny, nx, FF_PROJECT)) break;
4112 /* Stopped by monsters */
4113 if ((dir != 5) && cave[ny][nx].m_idx != 0) break;
4115 /* Save the new location */
4122 for (i = 0; i < b; i++)
4124 int count = 20, d = 0;
4130 x = tx - 5 + randint0(11);
4131 y = ty - 5 + randint0(11);
4133 dx = (tx > x) ? (tx - x) : (x - tx);
4134 dy = (ty > y) ? (ty - y) : (y - ty);
4136 /* Approximate distance */
4137 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
4138 /* Within the radius */
4142 if (count < 0) continue;
4144 /* Cannot penetrate perm walls */
4145 if (!in_bounds(y,x) ||
4146 cave_stop_disintegration(y,x) ||
4147 !in_disintegration_range(ty, tx, y, x))
4150 project(0, 2, y, x, plev * 3+25, GF_DISINTEGRATE, PROJECT_JUMP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1);
4154 case 30: /* Divine Intervention */
4155 project(0, 1, py, px, plev*11, GF_HOLY_FIRE, PROJECT_KILL, -1);
4156 dispel_monsters(plev * 4);
4158 stun_monsters(plev * 4);
4159 confuse_monsters(plev * 4);
4160 turn_monsters(plev * 4);
4161 stasis_monsters(plev * 4);
4162 (void)hp_player(100);
4168 for (i = 0; i < 12; i++)
4175 scatter(&my, &mx, py, px, 4, 0);
4177 /* Require empty grids */
4178 if (cave_empty_bold2(my, mx)) break;
4180 if (attempt < 0) continue;
4181 summon_specific(-1, my, mx, plev, SUMMON_KNIGHTS, (PM_ALLOW_GROUP | PM_FORCE_PET | PM_HASTE));
4183 (void)set_hero(randint1(25) + 25, FALSE);
4184 (void)set_blessed(randint1(25) + 25, FALSE);
4185 (void)set_fast(randint1(20 + plev) + plev, FALSE);
4186 (void)set_protevil(randint1(25) + 25, FALSE);
4187 (void)set_afraid(0);
4192 msg_format("¤¢¤Ê¤¿¤ÏÉÔÌÀ¤ÊÇ˼٤μöʸ %d ¤ò¾§¤¨¤¿¡£", spell);
4194 msg_format("You cast an unknown crusade spell: %d.", spell);
4205 void stop_singing(void)
4207 if (p_ptr->pclass != CLASS_BARD) return;
4209 if (p_ptr->magic_num1[1])
4211 p_ptr->magic_num1[1] = 0;
4214 if (!p_ptr->magic_num1[0]) return;
4216 /* Hack -- if called from set_action(), avoid recursive loop */
4217 if (p_ptr->action == ACTION_SING) set_action(ACTION_NONE);
4219 switch(p_ptr->magic_num1[0])
4222 if (!p_ptr->blessed)
4224 msg_print("¹â·é¤Êµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4226 msg_print("The prayer has expired.");
4233 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4235 msg_print("The heroism wears off.");
4237 /* Recalculate hitpoints */
4238 p_ptr->update |= (PU_HP);
4242 if (!p_ptr->tim_esp)
4245 msg_print("°Õ¼±¤Ï¸µ¤ËÌá¤Ã¤¿¡£");
4247 msg_print("Your consciousness contracts again.");
4249 /* Update the monsters */
4250 p_ptr->update |= (PU_MONSTERS);
4254 if (!p_ptr->tim_stealth)
4256 msg_print("»Ñ¤¬¤Ï¤Ã¤¤ê¤È¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
4258 msg_print("You are no longer hided.");
4262 if (!p_ptr->oppose_acid)
4264 msg_print("»À¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4266 msg_print("You feel less resistant to acid.");
4268 if (!p_ptr->oppose_elec)
4270 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4272 msg_print("You feel less resistant to elec.");
4274 if (!p_ptr->oppose_fire)
4276 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4278 msg_print("You feel less resistant to fire.");
4280 if (!p_ptr->oppose_cold)
4282 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4284 msg_print("You feel less resistant to cold.");
4286 if (!p_ptr->oppose_pois)
4288 msg_print("ÆǤؤÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
4290 msg_print("You feel less resistant to pois.");
4296 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
4298 msg_print("You feel yourself slow down.");
4305 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
4307 msg_print("The heroism wears off.");
4309 /* Recalculate hitpoints */
4310 p_ptr->update |= (PU_HP);
4315 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
4317 msg_print("You feel yourself slow down.");
4324 msg_print("̵Ũ¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£");
4326 msg_print("The invulnerability wears off.");
4329 p_ptr->redraw |= (PR_MAP);
4331 /* Update monsters */
4332 p_ptr->update |= (PU_MONSTERS);
4335 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4339 p_ptr->magic_num1[0] = MUSIC_NONE;
4340 p_ptr->magic_num2[0] = 0;
4342 /* Recalculate bonuses */
4343 p_ptr->update |= (PU_BONUS | PU_HP);
4345 /* Redraw status bar */
4346 p_ptr->redraw |= (PR_STATUS);
4350 static bool cast_music_spell(int spell)
4352 int plev = p_ptr->lev;
4355 if(p_ptr->magic_num1[0])
4360 p_ptr->magic_num2[0] = spell;
4364 case 0: /* Song of Holding ÃÙÆߤβΠ*/
4366 msg_print("¤æ¤Ã¤¯¤ê¤È¤·¤¿¥á¥í¥Ç¥£¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4368 msg_print("You start humming a slow, steady melody...");
4370 p_ptr->magic_num1[0] = MUSIC_SLOW;
4372 case 1: /* Song of Blessing ½ËÊ¡¤Î²Î */
4374 msg_print("¸·¤«¤Ê¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4376 msg_print("The holy power of the Music of the Ainur enters you...");
4378 p_ptr->magic_num1[0] = MUSIC_BLESS;
4381 case 2: /* Wrecking Note Êø²õ¤Î²»¿§ */
4382 if (!get_aim_dir(&dir)) return FALSE;
4383 fire_bolt(GF_SOUND, dir,
4384 damroll(4 + ((plev - 1) / 5), 4));
4386 case 3: /* Stun Pattern Û¯Û°¤ÎÀûΧ */
4388 msg_print("âÁÏǤµ¤»¤ë¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4390 msg_print("You weave a pattern of sounds to bewilder and daze...");
4392 p_ptr->magic_num1[0] = MUSIC_STUN;
4394 case 4: /* Flow of life À¸Ì¿¤Îή¤ì */
4396 msg_print("²Î¤òÄ̤·¤ÆÂΤ˳赤¤¬Ìá¤Ã¤Æ¤¤¿¡¥¡¥¡¥");
4398 msg_print("Life flows through you as you sing a song of healing...");
4400 p_ptr->magic_num1[0] = MUSIC_L_LIFE;
4402 case 5: /* Song of the Sun ÂÀÍۤβΠ*/
4404 msg_print("¸÷¤êµ±¤¯²Î¤¬ÊÕ¤ê¤ò¾È¤é¤·¤¿¡£");
4406 msg_print("Your uplifting song brings brightness to dark places...");
4408 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
4410 case 6: /* Song of fear ¶²ÉݤβΠ*/
4412 msg_print("¤ª¤É¤í¤ª¤É¤í¤·¤¤¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4414 msg_print("You start weaving a fearful pattern...");
4416 p_ptr->magic_num1[0] = MUSIC_FEAR;
4418 case 7: /* Heroic Ballad À襤¤Î²Î */
4420 msg_print("·ã¤·¤¤À襤¤Î²Î¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4422 msg_print("You start singing a song of intense fighting...");
4424 p_ptr->magic_num1[0] = MUSIC_HERO;
4426 case 8: /* Clairaudience ÎîŪÃγР*/
4428 msg_print("ÀŤ«¤Ê²»³Ú¤¬´¶³Ð¤ò¸¦¤®À¡¤Þ¤µ¤»¤¿¡¥¡¥¡¥");
4430 msg_print("Your quiet music sharpens your sense of hearing...");
4432 p_ptr->magic_num1[0] = MUSIC_DETECT;
4434 case 9: /* º²¤Î²Î */
4436 msg_print("Àº¿À¤òDZ¤¸¶Ê¤²¤ë²Î¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4438 msg_print("You start singing a song of soul in pain...");
4440 p_ptr->magic_num1[0] = MUSIC_PSI;
4442 case 10: /* Song of Lore Ãμ±¤Î²Î */
4444 msg_print("¤³¤ÎÀ¤³¦¤ÎÃ챤¬Î®¤ì¹þ¤ó¤Ç¤¤¿¡¥¡¥¡¥");
4446 msg_print("You recall the rich lore of the world...");
4448 p_ptr->magic_num1[0] = MUSIC_ID;
4450 case 11: /* hidding song ±£ÆۤβΠ*/
4452 msg_print("¤¢¤Ê¤¿¤Î»Ñ¤¬·Ê¿§¤Ë¤È¤±¤³¤ó¤Ç¤¤¤Ã¤¿¡¥¡¥¡¥");
4454 msg_print("Your song carries you beyond the sight of mortal eyes...");
4456 p_ptr->magic_num1[0] = MUSIC_STEALTH;
4458 case 12: /* Illusion Pattern ¸¸±Æ¤ÎÀûΧ */
4460 msg_print("ÊÕ¤ê°ìÌ̤˸¸±Æ¤¬¸½¤ì¤¿¡¥¡¥¡¥");
4462 msg_print("You weave a pattern of sounds to beguile and confuse...");
4464 p_ptr->magic_num1[0] = MUSIC_CONF;
4466 case 13: /* Doomcall (vibration song) ÇËÌǤζ«¤Ó */
4468 msg_print("¹ì²»¤¬¶Á¤¤¤¿¡¥¡¥¡¥");
4470 msg_print("The fury of the Downfall of Numenor lashes out...");
4472 p_ptr->magic_num1[0] = MUSIC_SOUND;
4474 case 14: /* Firiel's Song (song of the Undeads) ¥Õ¥£¥ê¥¨¥ë¤Î²Î */
4476 msg_print("À¸Ì¿¤ÈÉü³è¤Î¥Æ¡¼¥Þ¤òÁդǻϤ᤿¡¥¡¥¡¥");
4478 msg_print("The themes of life and revival are woven into your song...");
4480 animate_dead(0, py, px);
4482 case 15: /* Fellowship Chant (charming song) ι¤ÎÃç´Ö */
4484 msg_print("°Â¤é¤«¤Ê¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4486 msg_print("You weave a slow, soothing melody of imploration...");
4488 p_ptr->magic_num1[0] = MUSIC_CHARM;
4490 case 16: /* (wall breaking song) ʬ²ò²»ÇÈ */
4492 msg_print("Ê´ºÕ¤¹¤ë¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4494 msg_print("You weave a violent pattern of sounds to break wall.");
4496 p_ptr->magic_num1[0] = MUSIC_WALL;
4497 project(0, 0, py, px,
4498 0, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM | PROJECT_HIDE, -1);
4500 case 17: /* Finrod's Resistance (song of resistance) ¸µÁÇÂÑÀ */
4502 msg_print("¸µÁǤÎÎϤËÂФ¹¤ëǦÂѤβΤò²Î¤Ã¤¿¡£");
4504 msg_print("You sing a song of perseverance against powers...");
4506 p_ptr->magic_num1[0] = MUSIC_RESIST;
4508 case 18: /* Hobbit Melodies (song of time) ¥Û¥Ó¥Ã¥È¤Î¥á¥í¥Ç¥£ */
4510 msg_print("·Ú²÷¤Ê²Î¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4512 msg_print("You start singing joyful pop song...");
4514 p_ptr->magic_num1[0] = MUSIC_SPEED;
4516 case 19: /* World Contortion ÏĤó¤ÀÀ¤³¦ */
4518 msg_print("²Î¤¬¶õ´Ö¤òÏĤ᤿¡¥¡¥¡¥");
4520 msg_print("Reality whirls wildly as you sing a dizzying melody...");
4522 project(0, plev/15 + 1, py, px, plev * 3 + 1, GF_AWAY_ALL , PROJECT_KILL, -1);
4524 case 20: /* Â໶¤Î²Î */
4526 msg_print("ÂѤ¨¤é¤ì¤Ê¤¤ÉÔ¶¨Ï²»¤¬Å¨¤òÀÕ¤áΩ¤Æ¤¿¡¥¡¥¡¥");
4528 msg_print("You cry out in an ear-wracking voice...");
4530 p_ptr->magic_num1[0] = MUSIC_DISPEL;
4532 case 21: /* The Voice of Saruman ¥µ¥ë¥Þ¥ó¤Î´Å¸À */
4534 msg_print("Í¥¤·¤¯¡¢Ì¥ÎÏŪ¤Ê²Î¤ò¸ý¤º¤µ¤ß»Ï¤á¤¿¡¥¡¥¡¥");
4536 msg_print("You start humming a gentle and attractive song...");
4538 p_ptr->magic_num1[0] = MUSIC_SARUMAN;
4540 case 22: /* Song of Tempest (song of death) Íò¤Î²»¿§ */
4541 if (!get_aim_dir(&dir)) return FALSE;
4542 fire_beam(GF_SOUND, dir,
4543 damroll(15 + ((plev - 1) / 2), 10));
4545 case 23: /* (song of disruption) ¤â¤¦°ì¤Ä¤ÎÀ¤³¦ */
4547 msg_print("¼þ°Ï¤¬ÊѲ½¤·»Ï¤á¤¿¡¥¡¥¡¥");
4549 msg_print("You sing of the primeval shaping of Middle-earth...");
4553 case 24: /* Wrecking Pattern (destruction shriek) Ç˲õ¤ÎÀûΧ */
4555 msg_print("Ç˲õŪ¤Ê²Î¤¬¶Á¤¤ï¤¿¤Ã¤¿¡¥¡¥¡¥");
4557 msg_print("You weave a pattern of sounds to contort and shatter...");
4559 p_ptr->magic_num1[0] = MUSIC_QUAKE;
4561 case 25: /* ÄäÂڤβΠ*/
4563 msg_print("¤æ¤Ã¤¯¤ê¤È¤·¤¿¥á¥í¥Ç¥£¤òÁդǻϤ᤿¡¥¡¥¡¥");
4565 msg_print("You weave a very slow pattern which is almost likely to stop...");
4567 p_ptr->magic_num1[0] = MUSIC_STASIS;
4569 case 26: /* ¼é¤ê¤Î²Î */
4571 msg_print("²Î¤¬¿ÀÀ»¤Ê¾ì¤òºî¤ê½Ð¤·¤¿¡¥¡¥¡¥");
4573 msg_print("The holy power of the Music is creating sacred field...");
4577 case 27: /* ±Ñͺ¤Î»í */
4579 msg_print("±Ñͺ¤Î²Î¤ò¸ý¤º¤µ¤ó¤À¡¥¡¥¡¥");
4581 msg_print("You chant a powerful, heroic call to arms...");
4583 p_ptr->magic_num1[0] = MUSIC_SHERO;
4584 (void)hp_player(10);
4585 (void)set_afraid(0);
4587 case 28: /* ¥ä¥ô¥¡¥ó¥Ê¤Î½õ¤± */
4589 msg_print("²Î¤òÄ̤·¤ÆÂΤ˳赤¤¬Ìá¤Ã¤Æ¤¤¿¡¥¡¥¡¥");
4591 msg_print("Life flows through you as you sing the song...");
4593 p_ptr->magic_num1[0] = MUSIC_H_LIFE;
4595 case 29: /* ºÆÀ¸¤Î²Î */
4597 msg_print("°Å¹õ¤ÎÃæ¤Ë¸÷¤ÈÈþ¤ò¤Õ¤ê¤Þ¤¤¤¿¡£ÂΤ¬¸µ¤Î³èÎϤò¼è¤êÌᤷ¤¿¡£");
4599 msg_print("You strewed light and beauty in the dark as you sing. You feel refreshed.");
4601 (void)do_res_stat(A_STR);
4602 (void)do_res_stat(A_INT);
4603 (void)do_res_stat(A_WIS);
4604 (void)do_res_stat(A_DEX);
4605 (void)do_res_stat(A_CON);
4606 (void)do_res_stat(A_CHR);
4607 (void)restore_level();
4609 case 30: /* shriek of death ¥µ¥¦¥í¥ó¤ÎËâ½Ñ */
4610 if (!get_aim_dir(&dir)) return FALSE;
4611 fire_ball(GF_SOUND, dir, damroll(50 + plev, 10), 0);
4613 case 31: /* song of liberty ¥Õ¥£¥ó¥´¥ë¥Õ¥£¥ó¤ÎÄ©Àï */
4615 msg_print("¥Õ¥£¥ó¥´¥ë¥Õ¥£¥ó¤Î̽²¦¤Ø¤ÎÄ©Àï¤ò²Î¤Ã¤¿¡¥¡¥¡¥");
4617 msg_print("You recall the valor of Fingolfin's challenge to the Dark Lord...");
4619 p_ptr->magic_num1[0] = MUSIC_INVULN;
4622 p_ptr->redraw |= (PR_MAP);
4624 /* Update monsters */
4625 p_ptr->update |= (PU_MONSTERS);
4628 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4632 msg_format("̤ÃΤβÎ(%d)¤ò²Î¤Ã¤¿¡£", spell);
4634 msg_format("You sing an unknown song: %d.", spell);
4639 if (p_ptr->magic_num1[0]) set_action(ACTION_SING);
4641 /* Recalculate bonuses */
4642 p_ptr->update |= (PU_BONUS | PU_HP);
4644 /* Redraw status bar */
4645 p_ptr->redraw |= (PR_STATUS);
4653 void do_cmd_cast(void)
4655 int item, sval, spell, realm;
4670 /* Require spell ability */
4671 if (!p_ptr->realm1 && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE))
4674 msg_print("¼öʸ¤ò¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4676 msg_print("You cannot cast spells!");
4683 if (p_ptr->blind || no_lite())
4686 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡ª");
4688 msg_print("You cannot see!");
4690 if (p_ptr->pclass == CLASS_FORCETRAINER)
4697 /* Not when confused */
4698 if (p_ptr->confused)
4701 msg_print("º®Í𤷤Ƥ¤¤Æ¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4703 msg_print("You are too confused!");
4709 prayer = spell_category_name(mp_ptr->spell_book);
4711 /* Restrict choices to spell books */
4712 item_tester_tval = mp_ptr->spell_book;
4716 q = "¤É¤Î¼öʸ½ñ¤ò»È¤¤¤Þ¤¹¤«? ";
4718 q = "Use which book? ";
4722 s = "¼öʸ½ñ¤¬¤Ê¤¤¡ª";
4724 s = "You have no spell books!";
4727 if (p_ptr->pclass == CLASS_FORCETRAINER)
4728 select_the_force = TRUE;
4729 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))){
4730 select_the_force = FALSE;
4733 select_the_force = FALSE;
4735 if (item == INVEN_FORCE) { /* the_force */
4739 /* Get the item (in the pack) */
4742 o_ptr = &inventory[item];
4745 /* Get the item (on the floor) */
4748 o_ptr = &o_list[0 - item];
4751 /* Access the item's sval */
4754 if ((p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE) && (o_ptr->tval == REALM2_BOOK)) increment = 32;
4757 /* Track the object kind */
4758 object_kind_track(o_ptr->k_idx);
4760 /* Hack -- Handle stuff */
4763 if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
4764 realm = o_ptr->tval - TV_LIFE_BOOK + 1;
4765 else if (increment) realm = p_ptr->realm2;
4766 else realm = p_ptr->realm1;
4768 /* Ask for a spell */
4770 if (!get_spell(&spell,
4771 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "±Ó¾§¤¹¤ë" : (mp_ptr->spell_book == TV_MUSIC_BOOK) ? "²Î¤¦" : "¾§¤¨¤ë"),
4774 if (spell == -2) msg_format("¤½¤ÎËܤˤÏÃΤäƤ¤¤ë%s¤¬¤Ê¤¤¡£", prayer);
4778 if (!get_spell(&spell, ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "recite" : "cast"),
4782 msg_format("You don't know any %ss in that book.", prayer);
4788 use_realm = tval2realm(o_ptr->tval);
4790 if (!is_magic(use_realm))
4792 s_ptr = &technic_info[use_realm - MIN_TECHNIC][spell];
4796 s_ptr = &mp_ptr->info[realm - 1][spell];
4799 /* Extract mana consumption rate */
4800 need_mana = mod_need_mana(s_ptr->smana, spell, realm);
4802 /* Verify "dangerous" spells */
4803 if (need_mana > p_ptr->csp)
4805 if (flush_failure) flush();
4809 msg_format("¤½¤Î%s¤ò%s¤Î¤Ë½½Ê¬¤Ê¥Þ¥¸¥Ã¥¯¥Ý¥¤¥ó¥È¤¬¤Ê¤¤¡£",prayer,
4810 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "±Ó¾§¤¹¤ë" : (mp_ptr->spell_book == TV_LIFE_BOOK) ? "²Î¤¦" : "¾§¤¨¤ë"));
4812 msg_format("You do not have enough mana to %s this %s.",
4813 ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "recite" : "cast"),
4818 if (!over_exert) return;
4822 if (!get_check_strict("¤½¤ì¤Ç¤âÄ©À路¤Þ¤¹¤«? ", CHECK_OKAY_CANCEL)) return;
4824 if (!get_check_strict("Attempt it anyway? ", CHECK_OKAY_CANCEL)) return;
4830 /* Spell failure chance */
4831 chance = spell_chance(spell, use_realm);
4834 if (randint0(100) < chance)
4836 if (flush_failure) flush();
4839 msg_format("%s¤ò¤¦¤Þ¤¯¾§¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡ª", prayer);
4841 msg_format("You failed to get the %s off!", prayer);
4849 if (randint1(100) < chance) chg_virtue(V_VITALITY, -1);
4852 if (randint1(100) < chance) chg_virtue(V_UNLIFE, -1);
4855 if (randint1(100) < chance) chg_virtue(V_NATURE, -1);
4858 if (randint1(100) < chance) chg_virtue(V_JUSTICE, 1);
4861 if (randint1(100) < chance) chg_virtue(V_JUSTICE, -1);
4864 if (randint1(100) < chance) chg_virtue(V_KNOWLEDGE, -1);
4868 if (realm == REALM_TRUMP)
4870 cast_trump_spell(spell, FALSE);
4872 else if ((o_ptr->tval == TV_CHAOS_BOOK) && (randint1(100) < spell))
4875 msg_print("¥«¥ª¥¹Åª¤Ê¸ú²Ì¤òȯÀ¸¤·¤¿¡ª");
4877 msg_print("You produce a chaotic effect!");
4882 else if ((o_ptr->tval == TV_DEATH_BOOK) && (randint1(100) < spell))
4884 if ((sval == 3) && one_in_(2))
4886 sanity_blast(0, TRUE);
4891 msg_print("Äˤ¤¡ª");
4893 msg_print("It hurts!");
4897 take_hit(DAMAGE_LOSELIFE, damroll(o_ptr->sval + 1, 6), "°Å¹õËâË¡¤ÎµÕή", -1);
4899 take_hit(DAMAGE_LOSELIFE, damroll(o_ptr->sval + 1, 6), "a miscast Death spell", -1);
4902 if ((spell > 15) && one_in_(6) && !p_ptr->hold_life)
4903 lose_exp(spell * 250);
4906 else if ((o_ptr->tval == TV_MUSIC_BOOK) && (randint1(200) < spell))
4909 msg_print("¤¤¤ä¤Ê²»¤¬¶Á¤¤¤¿");
4911 msg_print("An infernal sound echoed.");
4914 aggravate_monsters(0);
4916 if (randint1(100) >= chance)
4917 chg_virtue(V_CHANCE,-1);
4926 case REALM_LIFE: /* * LIFE * */
4927 cast = cast_life_spell(spell);
4929 case REALM_SORCERY: /* * SORCERY * */
4930 cast = cast_sorcery_spell(spell);
4932 case REALM_NATURE: /* * NATURE * */
4933 cast = cast_nature_spell(spell);
4935 case REALM_CHAOS: /* * CHAOS * */
4936 cast = cast_chaos_spell(spell);
4938 case REALM_DEATH: /* * DEATH * */
4939 cast = cast_death_spell(spell);
4941 case REALM_TRUMP: /* TRUMP */
4942 cast = cast_trump_spell(spell, TRUE);
4944 case REALM_ARCANE: /* ARCANE */
4945 cast = cast_arcane_spell(spell);
4947 case REALM_ENCHANT: /* ENCHANT */
4948 cast = cast_enchant_spell(spell);
4950 case REALM_DAEMON: /* DAEMON */
4951 cast = cast_daemon_spell(spell);
4953 case REALM_CRUSADE: /* CRUSADE */
4954 cast = cast_crusade_spell(spell);
4956 case REALM_MUSIC: /* MUSIC */
4957 cast = cast_music_spell(spell);
4961 msg_format("You cast a spell from an unknown realm: realm %d, spell %d.", realm, spell);
4965 /* Canceled spells cost neither a turn nor mana */
4968 if (randint1(100) < chance)
4969 chg_virtue(V_CHANCE,1);
4971 /* A spell was cast */
4973 (p_ptr->spell_worked2 & (1L << spell)) :
4974 (p_ptr->spell_worked1 & (1L << spell)))
4975 && (p_ptr->pclass != CLASS_SORCERER)
4976 && (p_ptr->pclass != CLASS_RED_MAGE))
4978 int e = s_ptr->sexp;
4980 /* The spell worked */
4981 if (realm == p_ptr->realm1)
4983 p_ptr->spell_worked1 |= (1L << spell);
4987 p_ptr->spell_worked2 |= (1L << spell);
4990 /* Gain experience */
4991 gain_exp(e * s_ptr->slevel);
4993 /* Redraw object recall */
4994 p_ptr->window |= (PW_OBJECT);
4999 chg_virtue(V_TEMPERANCE, 1);
5000 chg_virtue(V_COMPASSION, 1);
5001 chg_virtue(V_VITALITY, 1);
5002 chg_virtue(V_DILIGENCE, 1);
5005 chg_virtue(V_UNLIFE, 1);
5006 chg_virtue(V_JUSTICE, -1);
5007 chg_virtue(V_FAITH, -1);
5008 chg_virtue(V_VITALITY, -1);
5011 chg_virtue(V_JUSTICE, -1);
5012 chg_virtue(V_FAITH, -1);
5013 chg_virtue(V_HONOUR, -1);
5014 chg_virtue(V_TEMPERANCE, -1);
5017 chg_virtue(V_FAITH, 1);
5018 chg_virtue(V_JUSTICE, 1);
5019 chg_virtue(V_SACRIFICE, 1);
5020 chg_virtue(V_HONOUR, 1);
5023 chg_virtue(V_NATURE, 1);
5024 chg_virtue(V_HARMONY, 1);
5027 chg_virtue(V_KNOWLEDGE, 1);
5034 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_TEMPERANCE, 1);
5035 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_COMPASSION, 1);
5036 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_VITALITY, 1);
5037 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_DILIGENCE, 1);
5040 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_UNLIFE, 1);
5041 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_JUSTICE, -1);
5042 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_FAITH, -1);
5043 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_VITALITY, -1);
5046 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_JUSTICE, -1);
5047 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_FAITH, -1);
5048 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_HONOUR, -1);
5049 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_TEMPERANCE, -1);
5052 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_FAITH, 1);
5053 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_JUSTICE, 1);
5054 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_SACRIFICE, 1);
5055 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_HONOUR, 1);
5058 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_NATURE, 1);
5059 if (randint1(100 + p_ptr->lev) < need_mana) chg_virtue(V_HARMONY, 1);
5062 if (mp_ptr->spell_xtra & MAGIC_GAIN_EXP)
5064 s16b cur_exp = p_ptr->spell_exp[(increment ? 32 : 0)+spell];
5067 if (cur_exp < SPELL_EXP_BEGINNER)
5069 else if (cur_exp < SPELL_EXP_SKILLED)
5071 if ((dun_level > 4) && ((dun_level + 10) > p_ptr->lev))
5074 else if (cur_exp < SPELL_EXP_EXPERT)
5076 if (((dun_level + 5) > p_ptr->lev) && ((dun_level + 5) > s_ptr->slevel))
5079 else if ((cur_exp < SPELL_EXP_MASTER) && !increment)
5081 if (((dun_level + 5) > p_ptr->lev) && (dun_level > s_ptr->slevel))
5084 p_ptr->spell_exp[(increment ? 32 : 0) + spell] += exp_gain;
5091 /* Sufficient mana */
5092 if (need_mana <= p_ptr->csp)
5095 p_ptr->csp -= need_mana;
5098 /* Over-exert the player */
5101 int oops = need_mana;
5105 p_ptr->csp_frac = 0;
5109 msg_print("Àº¿À¤ò½¸Ã椷¤¹¤®¤Æµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
5111 msg_print("You faint from the effort!");
5115 /* Hack -- Bypass free action */
5116 (void)set_paralyzed(p_ptr->paralyzed + randint1(5 * oops + 1));
5121 chg_virtue(V_VITALITY, -10);
5124 chg_virtue(V_UNLIFE, -10);
5127 chg_virtue(V_JUSTICE, 10);
5130 chg_virtue(V_NATURE, -10);
5133 chg_virtue(V_JUSTICE, -10);
5136 chg_virtue(V_KNOWLEDGE, -10);
5140 /* Damage CON (possibly permanently) */
5141 if (randint0(100) < 50)
5143 bool perm = (randint0(100) < 25);
5147 msg_print("ÂΤò°¤¯¤·¤Æ¤·¤Þ¤Ã¤¿¡ª");
5149 msg_print("You have damaged your health!");
5153 /* Reduce constitution */
5154 (void)dec_stat(A_CON, 15 + randint1(10), perm);
5159 p_ptr->redraw |= (PR_MANA);
5162 p_ptr->window |= (PW_PLAYER);
5163 p_ptr->window |= (PW_SPELL);
5168 * Pray a prayer -- Unused in Hengband
5170 void do_cmd_pray(void)
5172 msg_print("Praying is not used in Hengband. Use magic spell casting instead.");
5175 static bool ang_sort_comp_pet_dismiss(vptr u, vptr v, int a, int b)
5177 u16b *who = (u16b*)(u);
5182 monster_type *m_ptr1 = &m_list[w1];
5183 monster_type *m_ptr2 = &m_list[w2];
5184 monster_race *r_ptr1 = &r_info[m_ptr1->r_idx];
5185 monster_race *r_ptr2 = &r_info[m_ptr2->r_idx];
5190 if (w1 == p_ptr->riding) return TRUE;
5191 if (w2 == p_ptr->riding) return FALSE;
5193 if (m_ptr1->nickname && !m_ptr2->nickname) return TRUE;
5194 if (m_ptr2->nickname && !m_ptr1->nickname) return FALSE;
5196 if (!m_ptr1->parent_m_idx && m_ptr2->parent_m_idx) return TRUE;
5197 if (!m_ptr2->parent_m_idx && m_ptr1->parent_m_idx) return FALSE;
5199 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return TRUE;
5200 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return FALSE;
5202 if (r_ptr1->level > r_ptr2->level) return TRUE;
5203 if (r_ptr2->level > r_ptr1->level) return FALSE;
5205 if (m_ptr1->hp > m_ptr2->hp) return TRUE;
5206 if (m_ptr2->hp > m_ptr1->hp) return FALSE;
5211 int calculate_upkeep(void)
5213 s32b old_friend_align = friend_align;
5215 bool have_a_unique = FALSE;
5218 total_friend_levels = 0;
5221 for (m_idx = m_max - 1; m_idx >=1; m_idx--)
5223 monster_type *m_ptr;
5224 monster_race *r_ptr;
5226 m_ptr = &m_list[m_idx];
5227 if (!m_ptr->r_idx) continue;
5228 r_ptr = &r_info[m_ptr->r_idx];
5233 if (r_ptr->flags1 & RF1_UNIQUE)
5235 if (p_ptr->pclass == CLASS_CAVALRY)
5237 if (p_ptr->riding == m_idx)
5238 total_friend_levels += (r_ptr->level+5)*2;
5239 else if (!have_a_unique && (r_info[m_ptr->r_idx].flags7 & RF7_RIDING))
5240 total_friend_levels += (r_ptr->level+5)*7/2;
5242 total_friend_levels += (r_ptr->level+5)*10;
5243 have_a_unique = TRUE;
5246 total_friend_levels += (r_ptr->level+5)*10;
5249 total_friend_levels += r_ptr->level;
5251 /* Determine pet alignment */
5252 if (r_ptr->flags3 & RF3_GOOD) friend_align += r_ptr->level;
5253 if (r_ptr->flags3 & RF3_EVIL) friend_align -= r_ptr->level;
5256 if (old_friend_align != friend_align) p_ptr->update |= (PU_BONUS);
5260 upkeep_factor = (total_friend_levels - (p_ptr->lev * 80 / (cp_ptr->pet_upkeep_div)));
5261 if (upkeep_factor < 0) upkeep_factor = 0;
5262 if (upkeep_factor > 1000) upkeep_factor = 1000;
5263 return upkeep_factor;
5269 void do_cmd_pet_dismiss(void)
5271 monster_type *m_ptr;
5272 bool all_pets = FALSE;
5286 /* Allocate the "who" array */
5287 C_MAKE(who, max_m_idx, u16b);
5289 /* Process the monsters (backwards) */
5290 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
5292 if (is_pet(&m_list[pet_ctr]))
5293 who[max_pet++] = pet_ctr;
5296 /* Select the sort method */
5297 ang_sort_comp = ang_sort_comp_pet_dismiss;
5298 ang_sort_swap = ang_sort_swap_hook;
5300 ang_sort(who, &dummy_why, max_pet);
5302 /* Process the monsters (backwards) */
5303 for (i = 0; i < max_pet; i++)
5306 char friend_name[80];
5310 /* Access the monster */
5312 m_ptr = &m_list[pet_ctr];
5314 delete_this = FALSE;
5315 kakunin = ((pet_ctr == p_ptr->riding) || (m_ptr->nickname));
5316 monster_desc(friend_name, m_ptr, MD_ASSUME_VISIBLE);
5320 /* Hack -- health bar for this monster */
5321 health_track(pet_ctr);
5323 /* Hack -- handle stuff */
5327 sprintf(buf, "%s¤òÊü¤·¤Þ¤¹¤«¡© [Yes/No/Unnamed (%dɤ)]", friend_name, max_pet-i);
5329 sprintf(buf, "Dismiss %s? [Yes/No/Unnamed (%d remain)]", friend_name, max_pet-i);
5334 move_cursor_relative(m_ptr->fy, m_ptr->fx);
5340 if (ch == 'Y' || ch == 'y')
5347 sprintf(buf, "ËÜÅö¤Ë¤è¤í¤·¤¤¤Ç¤¹¤«¡© (%s) ", friend_name);
5349 sprintf(buf, "Are you sure? (%s) ", friend_name);
5351 if (!get_check(buf))
5352 delete_this = FALSE;
5357 if (ch == 'U' || ch == 'u')
5363 if (ch == ESCAPE || ch == 'N' || ch == 'n')
5370 if ((all_pets && !kakunin) || (!all_pets && delete_this))
5372 if (record_named_pet && m_ptr->nickname)
5376 monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
5377 do_cmd_write_nikki(NIKKI_NAMED_PET, 2, m_name);
5380 if (pet_ctr == p_ptr->riding)
5383 msg_format("%s¤«¤é¹ß¤ê¤¿¡£", friend_name);
5385 msg_format("You have got off %s. ", friend_name);
5390 /* Update the monsters */
5391 p_ptr->update |= (PU_BONUS | PU_MONSTERS);
5392 p_ptr->redraw |= (PR_EXTRA | PR_UHEALTH);
5395 /* HACK : Add the line to message buffer */
5397 sprintf(buf, "%s ¤òÊü¤·¤¿¡£", friend_name);
5399 sprintf(buf, "Dismissed %s.", friend_name);
5402 p_ptr->window |= (PW_MESSAGE);
5405 delete_monster_idx(pet_ctr);
5414 C_KILL(who, max_m_idx, u16b);
5417 msg_format("%d ɤ¤Î¥Ú¥Ã¥È¤òÊü¤·¤Þ¤·¤¿¡£", Dismissed);
5419 msg_format("You have dismissed %d pet%s.", Dismissed,
5420 (Dismissed == 1 ? "" : "s"));
5422 if (Dismissed == 0 && all_pets)
5424 msg_print("'U'nnamed ¤Ï¡¢¾èÇϰʳ°¤Î̾Á°¤Î¤Ê¤¤¥Ú¥Ã¥È¤À¤±¤òÁ´¤Æ²òÊü¤·¤Þ¤¹¡£");
5426 msg_print("'U'nnamed means all your pets except named pets and your mount.");
5429 p_ptr->update |= (PU_MON_LITE);
5432 static bool player_can_ride_aux(cave_type *c_ptr, bool now_riding)
5435 bool old_character_xtra = character_xtra;
5436 int old_riding = p_ptr->riding;
5437 bool old_riding_ryoute = p_ptr->riding_ryoute;
5438 bool old_old_riding_ryoute = p_ptr->old_riding_ryoute;
5439 bool old_pf_ryoute = (p_ptr->pet_extra_flags & PF_RYOUTE) ? TRUE : FALSE;
5441 /* Hack -- prevent "icky" message */
5442 character_xtra = TRUE;
5444 if (now_riding) p_ptr->riding = c_ptr->m_idx;
5448 p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5449 p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE;
5454 p_can_enter = player_can_enter(c_ptr->feat, CEM_P_CAN_ENTER_PATTERN);
5456 p_ptr->riding = old_riding;
5457 if (old_pf_ryoute) p_ptr->pet_extra_flags |= (PF_RYOUTE);
5458 else p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5459 p_ptr->riding_ryoute = old_riding_ryoute;
5460 p_ptr->old_riding_ryoute = old_old_riding_ryoute;
5464 character_xtra = old_character_xtra;
5469 bool rakuba(int dam, bool force)
5471 int i, y, x, oy, ox;
5472 int sn = 0, sy = 0, sx = 0;
5474 monster_type *m_ptr = &m_list[p_ptr->riding];
5475 monster_race *r_ptr = &r_info[m_ptr->r_idx];
5476 bool fall_dam = FALSE;
5478 if (!p_ptr->riding) return FALSE;
5479 if (p_ptr->wild_mode) return FALSE;
5481 if (dam >= 0 || force)
5485 int cur = p_ptr->skill_exp[GINOU_RIDING];
5486 int max = s_info[p_ptr->pclass].s_max[GINOU_RIDING];
5487 int ridinglevel = r_ptr->level;
5489 /* ÍîÇϤΤ·¤ä¤¹¤µ */
5490 int rakubalevel = r_ptr->level;
5491 if (p_ptr->riding_ryoute) rakubalevel += 20;
5493 if ((cur < max) && (max > 1000) &&
5494 (dam / 2 + ridinglevel) > (cur / 30 + 10))
5498 if (ridinglevel > (cur / 100 + 15))
5499 inc += 1 + (ridinglevel - cur / 100 - 15);
5503 p_ptr->skill_exp[GINOU_RIDING] = MIN(max, cur + inc);
5506 /* ¥ì¥Ù¥ë¤ÎÄ㤤¾èÇϤ«¤é¤ÏÍîÇϤ·¤Ë¤¯¤¤ */
5507 if (randint0(dam / 2 + rakubalevel * 2) < cur / 30 + 10)
5509 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))
5516 /* Check around the player */
5517 for (i = 0; i < 8; i++)
5521 /* Access the location */
5522 y = py + ddy_ddd[i];
5523 x = px + ddx_ddd[i];
5525 c_ptr = &cave[y][x];
5527 if (c_ptr->m_idx) continue;
5529 /* Skip non-empty grids */
5530 if (!cave_have_flag_grid(c_ptr, FF_MOVE) && !cave_have_flag_grid(c_ptr, FF_CAN_FLY))
5532 if (!player_can_ride_aux(c_ptr, FALSE)) continue;
5535 if (cave_have_flag_grid(c_ptr, FF_PATTERN)) continue;
5537 /* Count "safe" grids */
5540 /* Randomize choice */
5541 if (randint0(sn) > 0) continue;
5543 /* Save the safe location */
5548 monster_desc(m_name, m_ptr, 0);
5550 msg_format("%s¤«¤é¿¶¤êÍî¤È¤µ¤ì¤½¤¦¤Ë¤Ê¤Ã¤Æ¡¢Êɤˤ֤Ĥ«¤Ã¤¿¡£",m_name);
5551 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "Êɤؤξ×ÆÍ", -1);
5553 msg_format("You have nearly fallen from %s, but bumped into wall.",m_name);
5554 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "bumping into wall", -1);
5565 /* Redraw the old spot */
5568 /* Redraw the new spot */
5571 /* Check for new panel */
5576 p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5577 p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE;
5581 p_ptr->update |= (PU_BONUS);
5584 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
5586 /* Update the monsters */
5587 p_ptr->update |= (PU_DISTANCE);
5590 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5592 p_ptr->redraw |= (PR_EXTRA);
5594 /* Update health track of mount */
5595 p_ptr->redraw |= (PR_UHEALTH);
5597 if (p_ptr->levitation && !force)
5599 monster_desc(m_name, m_ptr, 0);
5601 msg_format("%s¤«¤éÍî¤Á¤¿¤¬¡¢¶õÃæ¤Ç¤¦¤Þ¤¯ÂÎÀª¤òΩ¤Æľ¤·¤ÆÃåÃϤ·¤¿¡£",m_name);
5603 msg_format("You are thrown from %s, but make a good landing.",m_name);
5609 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "ÍîÇÏ", -1);
5611 take_hit(DAMAGE_NOESCAPE, r_ptr->level+3, "Falling from riding", -1);
5616 /* Move the player */
5617 if (sy && !p_ptr->is_dead)
5618 (void)move_player_effect(py, px, MPE_DONT_PICKUP | MPE_DONT_SWAP_MON);
5623 bool do_riding(bool force)
5627 monster_type *m_ptr;
5629 if (!get_rep_dir2(&dir)) return FALSE;
5632 c_ptr = &cave[y][x];
5636 /* Skip non-empty grids */
5637 if (!player_can_ride_aux(c_ptr, FALSE))
5640 msg_print("¤½¤Á¤é¤Ë¤Ï¹ß¤ê¤é¤ì¤Þ¤»¤ó¡£");
5642 msg_print("You cannot go to that direction.");
5647 if (!pattern_seq(py, px, y, x)) return FALSE;
5656 msg_print("¥â¥ó¥¹¥¿¡¼¤¬Î©¤Á¤Õ¤µ¤¬¤Ã¤Æ¤¤¤ë¡ª");
5658 msg_print("There is a monster in the way!");
5666 p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
5667 p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE;
5671 if (p_ptr->confused)
5674 msg_print("º®Í𤷤Ƥ¤¤Æ¾è¤ì¤Ê¤¤¡ª");
5676 msg_print("You are too confused!");
5681 m_ptr = &m_list[c_ptr->m_idx];
5683 if (!c_ptr->m_idx || !m_ptr->ml)
5686 msg_print("¤½¤Î¾ì½ê¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
5688 msg_print("Here is no monster.");
5693 if (!is_pet(m_ptr) && !force)
5696 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï¥Ú¥Ã¥È¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£");
5698 msg_print("That monster is not a pet.");
5703 if (!(r_info[m_ptr->r_idx].flags7 & RF7_RIDING))
5706 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ë¤Ï¾è¤ì¤Ê¤µ¤½¤¦¤À¡£");
5708 msg_print("This monster doesn't seem suitable for riding.");
5714 if (!pattern_seq(py, px, y, x)) return FALSE;
5716 if (!player_can_ride_aux(c_ptr, TRUE))
5718 /* Feature code (applying "mimic" field) */
5719 feature_type *f_ptr = &f_info[get_feat_mimic(c_ptr)];
5721 msg_format("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï%s¤Î%s¤Ë¤¤¤ë¡£", f_name + f_ptr->name,
5722 ((!have_flag(f_ptr->flags, FF_MOVE) && !have_flag(f_ptr->flags, FF_CAN_FLY)) ||
5723 (!have_flag(f_ptr->flags, FF_LOS) && !have_flag(f_ptr->flags, FF_TREE))) ?
5726 msg_format("This monster is %s the %s.",
5727 ((!have_flag(f_ptr->flags, FF_MOVE) && !have_flag(f_ptr->flags, FF_CAN_FLY)) ||
5728 (!have_flag(f_ptr->flags, FF_LOS) && !have_flag(f_ptr->flags, FF_TREE))) ?
5729 "in" : "on", f_name + f_ptr->name);
5734 if (r_info[m_ptr->r_idx].level > randint1((p_ptr->skill_exp[GINOU_RIDING] / 50 + p_ptr->lev / 2 + 20)))
5737 msg_print("¤¦¤Þ¤¯¾è¤ì¤Ê¤«¤Ã¤¿¡£");
5739 msg_print("You failed to ride.");
5750 monster_desc(m_name, m_ptr, 0);
5753 msg_format("%s¤òµ¯¤³¤·¤¿¡£", m_name);
5755 msg_format("You have waked %s up.", m_name);
5759 p_ptr->riding = c_ptr->m_idx;
5761 /* Hack -- remove tracked monster */
5762 if (p_ptr->riding == p_ptr->health_who) health_track(0);
5767 /* Mega-Hack -- Forget the view and lite */
5768 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
5770 /* Update the monsters */
5771 p_ptr->update |= (PU_BONUS);
5774 p_ptr->redraw |= (PR_MAP | PR_EXTRA);
5776 p_ptr->redraw |= (PR_UHEALTH);
5778 /* Move the player */
5779 (void)move_player_effect(y, x, MPE_HANDLE_STUFF | MPE_ENERGY_USE | MPE_DONT_PICKUP | MPE_DONT_SWAP_MON);
5784 static void do_name_pet(void)
5786 monster_type *m_ptr;
5789 bool old_name = FALSE;
5790 bool old_target_pet = target_pet;
5793 if (!target_set(TARGET_KILL))
5795 target_pet = old_target_pet;
5798 target_pet = old_target_pet;
5800 if (cave[target_row][target_col].m_idx)
5802 m_ptr = &m_list[cave[target_row][target_col].m_idx];
5808 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï¥Ú¥Ã¥È¤Ç¤Ï¤Ê¤¤¡£");
5810 msg_format("This monster is not a pet.");
5814 if (r_info[m_ptr->r_idx].flags1 & RF1_UNIQUE)
5817 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Î̾Á°¤ÏÊѤ¨¤é¤ì¤Ê¤¤¡ª");
5819 msg_format("You cannot change name of this monster!");
5823 monster_desc(m_name, m_ptr, 0);
5827 msg_format("%s¤Ë̾Á°¤ò¤Ä¤±¤ë¡£", m_name);
5829 msg_format("Name %s.", m_name);
5834 /* Start with nothing */
5835 strcpy(out_val, "");
5837 /* Use old inscription */
5838 if (m_ptr->nickname)
5840 /* Start with the old inscription */
5841 strcpy(out_val, quark_str(m_ptr->nickname));
5845 /* Get a new inscription (possibly empty) */
5847 if (get_string("̾Á°: ", out_val, 15))
5849 if (get_string("Name: ", out_val, 15))
5855 /* Save the inscription */
5856 m_ptr->nickname = quark_add(out_val);
5857 if (record_named_pet)
5861 monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
5862 do_cmd_write_nikki(NIKKI_NAMED_PET, 0, m_name);
5867 if (record_named_pet && old_name)
5871 monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
5872 do_cmd_write_nikki(NIKKI_NAMED_PET, 1, m_name);
5874 m_ptr->nickname = 0;
5881 * Issue a pet command
5883 void do_cmd_pet(void)
5888 cptr power_desc[36];
5894 monster_type *m_ptr;
5901 char target_buf[160];
5906 power_desc[num] = "¥Ú¥Ã¥È¤òÊü¤¹";
5908 power_desc[num] = "dismiss pets";
5911 powers[num++] = PET_DISMISS;
5914 sprintf(target_buf,"¥Ú¥Ã¥È¤Î¥¿¡¼¥²¥Ã¥È¤ò»ØÄê (¸½ºß¡§%s)",
5915 (pet_t_m_idx ? r_name + r_info[m_list[pet_t_m_idx].r_idx].name : "»ØÄê¤Ê¤·"));
5917 sprintf(target_buf,"specify a targert of pet (now:%s)",
5918 (pet_t_m_idx ? r_name + r_info[m_list[pet_t_m_idx].r_idx].name : "nothing"));
5920 power_desc[num] = target_buf;
5922 powers[num++] = PET_TARGET;
5925 power_desc[num] = "¶á¤¯¤Ë¤¤¤í";
5927 power_desc[num] = "stay close";
5930 if (p_ptr->pet_follow_distance == PET_CLOSE_DIST) mode = num;
5931 powers[num++] = PET_STAY_CLOSE;
5934 power_desc[num] = "¤Ä¤¤¤ÆÍ褤";
5936 power_desc[num] = "follow me";
5939 if (p_ptr->pet_follow_distance == PET_FOLLOW_DIST) mode = num;
5940 powers[num++] = PET_FOLLOW_ME;
5943 power_desc[num] = "Ũ¤ò¸«¤Ä¤±¤ÆÅݤ»";
5945 power_desc[num] = "seek and destroy";
5948 if (p_ptr->pet_follow_distance == PET_DESTROY_DIST) mode = num;
5949 powers[num++] = PET_SEEK_AND_DESTROY;
5952 power_desc[num] = "¾¯¤·Î¥¤ì¤Æ¤¤¤í";
5954 power_desc[num] = "give me space";
5957 if (p_ptr->pet_follow_distance == PET_SPACE_DIST) mode = num;
5958 powers[num++] = PET_ALLOW_SPACE;
5961 power_desc[num] = "Î¥¤ì¤Æ¤¤¤í";
5963 power_desc[num] = "stay away";
5966 if (p_ptr->pet_follow_distance == PET_AWAY_DIST) mode = num;
5967 powers[num++] = PET_STAY_AWAY;
5969 if (p_ptr->pet_extra_flags & PF_OPEN_DOORS)
5972 power_desc[num] = "¥É¥¢¤ò³«¤±¤ë (¸½ºß:ON)";
5974 power_desc[num] = "pets open doors (now On)";
5981 power_desc[num] = "¥É¥¢¤ò³«¤±¤ë (¸½ºß:OFF)";
5983 power_desc[num] = "pets open doors (now Off)";
5987 powers[num++] = PET_OPEN_DOORS;
5989 if (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS)
5992 power_desc[num] = "¥¢¥¤¥Æ¥à¤ò½¦¤¦ (¸½ºß:ON)";
5994 power_desc[num] = "pets pick up items (now On)";
6001 power_desc[num] = "¥¢¥¤¥Æ¥à¤ò½¦¤¦ (¸½ºß:OFF)";
6003 power_desc[num] = "pets pick up items (now Off)";
6007 powers[num++] = PET_TAKE_ITEMS;
6009 if (p_ptr->pet_extra_flags & PF_TELEPORT)
6012 power_desc[num] = "¥Æ¥ì¥Ý¡¼¥È·ÏËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6014 power_desc[num] = "allow teleport (now On)";
6021 power_desc[num] = "¥Æ¥ì¥Ý¡¼¥È·ÏËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6023 power_desc[num] = "allow teleport (now Off)";
6027 powers[num++] = PET_TELEPORT;
6029 if (p_ptr->pet_extra_flags & PF_ATTACK_SPELL)
6032 power_desc[num] = "¹¶·âËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6034 power_desc[num] = "allow cast attack spell (now On)";
6041 power_desc[num] = "¹¶·âËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6043 power_desc[num] = "allow cast attack spell (now Off)";
6047 powers[num++] = PET_ATTACK_SPELL;
6049 if (p_ptr->pet_extra_flags & PF_SUMMON_SPELL)
6052 power_desc[num] = "¾¤´ËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6054 power_desc[num] = "allow cast summon spell (now On)";
6061 power_desc[num] = "¾¤´ËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6063 power_desc[num] = "allow cast summon spell (now Off)";
6067 powers[num++] = PET_SUMMON_SPELL;
6069 if (p_ptr->pet_extra_flags & PF_BALL_SPELL)
6072 power_desc[num] = "¥×¥ì¥¤¥ä¡¼¤ò´¬¤¹þ¤àÈÏ°ÏËâË¡¤ò»È¤¦ (¸½ºß:ON)";
6074 power_desc[num] = "allow involve player in area spell (now On)";
6081 power_desc[num] = "¥×¥ì¥¤¥ä¡¼¤ò´¬¤¹þ¤àÈÏ°ÏËâË¡¤ò»È¤¦ (¸½ºß:OFF)";
6083 power_desc[num] = "allow involve player in area spell (now Off)";
6087 powers[num++] = PET_BALL_SPELL;
6092 power_desc[num] = "¥Ú¥Ã¥È¤«¤é¹ß¤ê¤ë";
6094 power_desc[num] = "get off a pet";
6101 power_desc[num] = "¥Ú¥Ã¥È¤Ë¾è¤ë";
6103 power_desc[num] = "ride a pet";
6107 powers[num++] = PET_RIDING;
6110 power_desc[num] = "¥Ú¥Ã¥È¤Ë̾Á°¤ò¤Ä¤±¤ë";
6112 power_desc[num] = "name pets";
6115 powers[num++] = PET_NAME;
6119 if ((p_ptr->migite && (empty_hands(FALSE) == EMPTY_HAND_LARM) &&
6120 object_allow_two_hands_wielding(&inventory[INVEN_RARM])) ||
6121 (p_ptr->hidarite && (empty_hands(FALSE) == EMPTY_HAND_RARM) &&
6122 object_allow_two_hands_wielding(&inventory[INVEN_LARM])))
6124 if (p_ptr->pet_extra_flags & PF_RYOUTE)
6127 power_desc[num] = "Éð´ï¤òÊÒ¼ê¤Ç»ý¤Ä";
6129 power_desc[num] = "use one hand to control a riding pet";
6135 power_desc[num] = "Éð´ï¤òξ¼ê¤Ç»ý¤Ä";
6137 power_desc[num] = "use both hands for a weapon";
6141 powers[num++] = PET_RYOUTE;
6145 switch (p_ptr->pclass)
6148 case CLASS_FORCETRAINER:
6149 case CLASS_BERSERKER:
6150 if (empty_hands(FALSE) == (EMPTY_HAND_RARM | EMPTY_HAND_LARM))
6152 if (p_ptr->pet_extra_flags & PF_RYOUTE)
6155 power_desc[num] = "ÊÒ¼ê¤Ç³ÊÆ®¤¹¤ë";
6157 power_desc[num] = "use one hand to control a riding pet";
6163 power_desc[num] = "ξ¼ê¤Ç³ÊÆ®¤¹¤ë";
6165 power_desc[num] = "use both hands for melee";
6169 powers[num++] = PET_RYOUTE;
6171 else if ((empty_hands(FALSE) != EMPTY_HAND_NONE) && !buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
6173 if (p_ptr->pet_extra_flags & PF_RYOUTE)
6176 power_desc[num] = "³ÊÆ®¤ò¹Ô¤ï¤Ê¤¤";
6178 power_desc[num] = "use one hand to control a riding pet";
6184 power_desc[num] = "³ÊÆ®¤ò¹Ô¤¦";
6186 power_desc[num] = "use one hand for melee";
6190 powers[num++] = PET_RYOUTE;
6197 /* Nothing chosen yet */
6200 /* Build a prompt (accept all spells) */
6203 /* Build a prompt (accept all spells) */
6205 strnfmt(out_val, 78, "(¥³¥Þ¥ó¥É %c-%c¡¢'*'=°ìÍ÷¡¢ESC=½ªÎ») ¥³¥Þ¥ó¥É¤òÁª¤ó¤Ç¤¯¤À¤µ¤¤:",
6207 strnfmt(out_val, 78, "(Command %c-%c, *=List, ESC=exit) Select a command: ",
6210 I2A(0), I2A(num - 1));
6215 strnfmt(out_val, 78, "(¥³¥Þ¥ó¥É %c-%c¡¢'*'=°ìÍ÷¡¢ESC=½ªÎ») ¥³¥Þ¥ó¥É¤òÁª¤ó¤Ç¤¯¤À¤µ¤¤:",
6217 strnfmt(out_val, 78, "(Command %c-%c, *=List, ESC=exit) Select a command: ",
6220 I2A(0), '0' + num - 27);
6226 /* Save the screen */
6233 prt(format("%s%c) %s", (ctr == mode) ? "*" : " ", I2A(ctr), power_desc[ctr]), y + ctr, x);
6239 prt("", y + ctr, x);
6246 /* Get a command from the user */
6247 while (!flag && get_com(out_val, &choice, TRUE))
6249 /* Request redraw */
6250 if ((choice == ' ') || (choice == '*') || (choice == '?'))
6262 /* Save the screen */
6269 sprintf(buf, "%s%c) %s", (ctr == mode) ? "*" : " ", I2A(ctr), power_desc[ctr]);
6270 prt(buf, y + ctr, x);
6276 prt("", y + ctr, x);
6290 /* Restore the screen */
6298 if (isalpha(choice))
6301 ask = (isupper(choice));
6304 if (ask) choice = tolower(choice);
6306 /* Extract request */
6307 i = (islower(choice) ? A2I(choice) : -1);
6311 ask = FALSE; /* Can't uppercase digits */
6313 i = choice - '0' + 26;
6316 /* Totally Illegal */
6317 if ((i < 0) || (i >= num))
6328 strnfmt(buf, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡© ", power_desc[i]);
6330 strnfmt(buf, 78, "Use %s? ", power_desc[i]);
6334 /* Belay that order */
6335 if (!get_check(buf)) continue;
6342 /* Restore the screen */
6343 if (redraw) Term_load();
6345 /* Abort if needed */
6354 case PET_DISMISS: /* Dismiss pets */
6356 /* Check pets (backwards) */
6357 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
6359 /* Player has pet */
6360 if (is_pet(&m_list[pet_ctr])) break;
6366 msg_print("¥Ú¥Ã¥È¤¬¤¤¤Ê¤¤¡ª");
6368 msg_print("You have no pets!");
6372 do_cmd_pet_dismiss();
6373 (void)calculate_upkeep();
6378 project_length = -1;
6379 if (!target_set(TARGET_KILL)) pet_t_m_idx = 0;
6382 cave_type *c_ptr = &cave[target_row][target_col];
6383 if (c_ptr->m_idx && (m_list[c_ptr->m_idx].ml))
6385 pet_t_m_idx = cave[target_row][target_col].m_idx;
6386 p_ptr->pet_follow_distance = PET_DESTROY_DIST;
6388 else pet_t_m_idx = 0;
6395 case PET_STAY_CLOSE:
6397 p_ptr->pet_follow_distance = PET_CLOSE_DIST;
6404 p_ptr->pet_follow_distance = PET_FOLLOW_DIST;
6408 /* "Seek and destoy" */
6409 case PET_SEEK_AND_DESTROY:
6411 p_ptr->pet_follow_distance = PET_DESTROY_DIST;
6414 /* "Give me space" */
6415 case PET_ALLOW_SPACE:
6417 p_ptr->pet_follow_distance = PET_SPACE_DIST;
6423 p_ptr->pet_follow_distance = PET_AWAY_DIST;
6426 /* flag - allow pets to open doors */
6427 case PET_OPEN_DOORS:
6429 if (p_ptr->pet_extra_flags & PF_OPEN_DOORS) p_ptr->pet_extra_flags &= ~(PF_OPEN_DOORS);
6430 else p_ptr->pet_extra_flags |= (PF_OPEN_DOORS);
6433 /* flag - allow pets to pickup items */
6434 case PET_TAKE_ITEMS:
6436 if (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS)
6438 p_ptr->pet_extra_flags &= ~(PF_PICKUP_ITEMS);
6439 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
6441 /* Access the monster */
6442 m_ptr = &m_list[pet_ctr];
6446 monster_drop_carried_objects(m_ptr);
6450 else p_ptr->pet_extra_flags |= (PF_PICKUP_ITEMS);
6454 /* flag - allow pets to teleport */
6457 if (p_ptr->pet_extra_flags & PF_TELEPORT) p_ptr->pet_extra_flags &= ~(PF_TELEPORT);
6458 else p_ptr->pet_extra_flags |= (PF_TELEPORT);
6461 /* flag - allow pets to cast attack spell */
6462 case PET_ATTACK_SPELL:
6464 if (p_ptr->pet_extra_flags & PF_ATTACK_SPELL) p_ptr->pet_extra_flags &= ~(PF_ATTACK_SPELL);
6465 else p_ptr->pet_extra_flags |= (PF_ATTACK_SPELL);
6468 /* flag - allow pets to cast attack spell */
6469 case PET_SUMMON_SPELL:
6471 if (p_ptr->pet_extra_flags & PF_SUMMON_SPELL) p_ptr->pet_extra_flags &= ~(PF_SUMMON_SPELL);
6472 else p_ptr->pet_extra_flags |= (PF_SUMMON_SPELL);
6475 /* flag - allow pets to cast attack spell */
6476 case PET_BALL_SPELL:
6478 if (p_ptr->pet_extra_flags & PF_BALL_SPELL) p_ptr->pet_extra_flags &= ~(PF_BALL_SPELL);
6479 else p_ptr->pet_extra_flags |= (PF_BALL_SPELL);
6485 (void)do_riding(FALSE);
6497 if (p_ptr->pet_extra_flags & PF_RYOUTE) p_ptr->pet_extra_flags &= ~(PF_RYOUTE);
6498 else p_ptr->pet_extra_flags |= (PF_RYOUTE);
6499 p_ptr->update |= (PU_BONUS);