3 /* Purpose: Interface commands */
6 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research, and
9 * not for profit purposes provided that this copyright and statement are
10 * included in all such copies.
17 * mark strings for auto dump
19 static char auto_dump_header[] = "# vvvvvvv== %s ==vvvvvvv";
20 static char auto_dump_footer[] = "# ^^^^^^^== %s ==^^^^^^^";
23 * Remove old lines automatically generated before.
25 static void remove_auto_dump(cptr orig_file, cptr mark)
27 FILE *tmp_fff, *orig_fff;
31 bool between_mark = FALSE;
34 long header_location = 0;
35 char header_mark_str[80];
36 char footer_mark_str[80];
39 sprintf(header_mark_str, auto_dump_header, mark);
40 sprintf(footer_mark_str, auto_dump_footer, mark);
42 mark_len = strlen(footer_mark_str);
44 /* If original file is not exist, nothing to do */
45 orig_fff = my_fopen(orig_file, "r");
52 tmp_fff = my_fopen_temp(tmp_file, 1024);
55 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", tmp_file);
57 msg_format("Failed to create temporary file %s.", tmp_file);
65 if (my_fgets(orig_fff, buf, 1024))
69 fseek(orig_fff, header_location, SEEK_SET);
81 if (!strcmp(buf, header_mark_str))
83 header_location = ftell(orig_fff);
90 fprintf(tmp_fff, "%s\n", buf);
95 if (!strncmp(buf, footer_mark_str, mark_len))
99 if (!sscanf(buf + mark_len, " (%d)", &tmp)
102 fseek(orig_fff, header_location, SEEK_SET);
105 between_mark = FALSE;
118 /* copy contents of temporally file */
120 fd_copy(tmp_file, orig_file);
128 * Open file to append auto dump.
130 static FILE *open_auto_dump(cptr buf, cptr mark, int *line)
134 char header_mark_str[80];
139 sprintf(header_mark_str, auto_dump_header, mark);
141 /* Remove old macro dumps */
142 remove_auto_dump(buf, mark);
144 /* Append to the file */
145 fff = my_fopen(buf, "a");
150 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
152 msg_format("Failed to open %s.", buf);
163 fprintf(fff, "%s\n", header_mark_str);
166 fprintf(fff, "# *·Ù¹ð!!* °Ê¹ß¤Î¹Ô¤Ï¼«Æ°À¸À®¤µ¤ì¤¿¤â¤Î¤Ç¤¹¡£\n");
167 fprintf(fff, "# *·Ù¹ð!!* ¸å¤Ç¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¤Î¤ÇÊÔ½¸¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£\n");
169 fprintf(fff, "# *Warning!!* The lines below are automatic dump.\n");
170 fprintf(fff, "# *Warning!!* Don't edit these! These lines will be deleted automaticaly.\n");
178 * Append foot part and close auto dump.
180 static void close_auto_dump(FILE *fff, cptr mark, int line_num)
182 char footer_mark_str[80];
184 sprintf(footer_mark_str, auto_dump_footer, mark);
188 fprintf(fff, "# *·Ù¹ð!!* °Ê¾å¤Î¹Ô¤Ï¼«Æ°À¸À®¤µ¤ì¤¿¤â¤Î¤Ç¤¹¡£\n");
189 fprintf(fff, "# *·Ù¹ð!!* ¸å¤Ç¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¤Î¤ÇÊÔ½¸¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£\n");
191 fprintf(fff, "# *Warning!!* The lines above are automatic dump.\n");
192 fprintf(fff, "# *Warning!!* Don't edit these! These lines will be deleted automaticaly.\n");
196 fprintf(fff, "%s (%d)\n", footer_mark_str, line_num);
208 * Take note to the dialy.
211 errr do_cmd_write_nikki(int type, int num, cptr note)
217 cptr note_level = "";
218 bool do_level = TRUE;
220 s32b len = 20L * TOWN_DAWN;
221 s32b tick = turn % len + len / 4;
223 static bool disable_nikki = FALSE;
225 if (disable_nikki) return(-1);
227 if ((p_ptr->prace == RACE_VAMPIRE) ||
228 (p_ptr->prace == RACE_SKELETON) ||
229 (p_ptr->prace == RACE_ZOMBIE) ||
230 (p_ptr->prace == RACE_SPECTRE))
231 day = (turn - (15L * TOWN_DAWN))/ len + 1;
233 day = (turn + (5L * TOWN_DAWN))/ len + 1;
235 hour = (24 * tick / len) % 24;
236 min = (1440 * tick / len) % 60;
238 if (type == NIKKI_FIX_QUEST_C ||
239 type == NIKKI_FIX_QUEST_F ||
240 type == NIKKI_RAND_QUEST_C ||
241 type == NIKKI_RAND_QUEST_F ||
242 type == NIKKI_TO_QUEST)
246 old_quest = p_ptr->inside_quest;
247 p_ptr->inside_quest = (quest[num].type == QUEST_TYPE_RANDOM) ? 0 : num;
249 /* Get the quest text */
250 init_flags = INIT_ASSIGN;
252 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
254 /* Reset the old quest number */
255 p_ptr->inside_quest = old_quest;
259 sprintf(file_name,"playrecord-%s.txt",savefile_base);
261 /* different filne name to avoid mixing */
262 sprintf(file_name,"playrec-%s.txt",savefile_base);
265 /* Hack -- drop permissions */
268 /* Build the filename */
269 path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
271 /* File type is "TEXT" */
272 FILE_TYPE(FILE_TYPE_TEXT);
274 fff = my_fopen(buf, "a");
279 /* Hack -- grab permissions */
282 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£¥×¥ì¥¤µÏ¿¤ò°ì»þÄä»ß¤·¤Þ¤¹¡£", buf);
284 msg_format("Failed to open %s. Play-Record is disabled temporally.", buf);
293 if (p_ptr->inside_arena)
295 note_level = "¥¢¥ê¡¼¥Ê:";
297 note_level = "Arane:";
301 note_level = "ÃϾå:";
303 note_level = "Surface:";
305 else if (quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT)))
307 note_level = "¥¯¥¨¥¹¥È:";
309 note_level = "Quest:";
313 note_level = format("%d³¬(%s):", dun_level, d_name+d_info[dungeon_type].name);
315 note_level = format("%s L%d:", d_name+d_info[dungeon_type].name, dun_level);
324 fprintf(fff, "%dÆüÌÜ\n",day);
326 fprintf(fff, "Day %d\n",day);
335 fprintf(fff, "%s\n",note);
339 fprintf(fff, " %2d:%02d %20s %s\n",hour, min, note_level, note);
345 fprintf(fff, " %2d:%02d %20s %s¤òȯ¸«¤·¤¿¡£\n", hour, min, note_level, note);
347 fprintf(fff, " %2d:%02d %20s discover %s.\n", hour, min, note_level, note);
354 fprintf(fff, " %2d:%02d %20s %s¤òÅݤ·¤¿¡£\n", hour, min, note_level, note);
356 fprintf(fff, " %2d:%02d %20s defeated %s.\n", hour, min, note_level, note);
360 case NIKKI_FIX_QUEST_C:
362 if (quest[num].flags & QUEST_FLAG_SILENT) break;
364 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤òãÀ®¤·¤¿¡£\n", hour, min, note_level, quest[num].name);
366 fprintf(fff, " %2d:%02d %20s completed quest '%s'.\n", hour, min, note_level, quest[num].name);
370 case NIKKI_FIX_QUEST_F:
372 if (quest[num].flags & QUEST_FLAG_SILENT) break;
374 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤«¤éÌ¿¤«¤é¤¬¤éƨ¤²µ¢¤Ã¤¿¡£\n", hour, min, note_level, quest[num].name);
376 fprintf(fff, " %2d:%02d %20s run away from quest '%s'.\n", hour, min, note_level, quest[num].name);
380 case NIKKI_RAND_QUEST_C:
383 strcpy(name, r_name+r_info[quest[num].r_idx].name);
385 fprintf(fff, " %2d:%02d %20s ¥é¥ó¥À¥à¥¯¥¨¥¹¥È(%s)¤òãÀ®¤·¤¿¡£\n", hour, min, note_level, name);
387 fprintf(fff, " %2d:%02d %20s completed randome quest '%s'\n", hour, min, note_level, name);
391 case NIKKI_RAND_QUEST_F:
394 strcpy(name, r_name+r_info[quest[num].r_idx].name);
396 fprintf(fff, " %2d:%02d %20s ¥é¥ó¥À¥à¥¯¥¨¥¹¥È(%s)¤«¤éƨ¤²½Ð¤·¤¿¡£\n", hour, min, note_level, name);
398 fprintf(fff, " %2d:%02d %20s ran away from quest '%s'.\n", hour, min, note_level, name);
402 case NIKKI_MAXDEAPTH:
405 fprintf(fff, " %2d:%02d %20s %s¤ÎºÇ¿¼³¬%d³¬¤ËÅþ㤷¤¿¡£\n", hour, min, note_level, d_name+d_info[dungeon_type].name, num);
407 fprintf(fff, " %2d:%02d %20s reached level %d of %s for the first time.\n", hour, min, note_level, num, d_name+d_info[dungeon_type].name);
414 fprintf(fff, " %2d:%02d %20s %s%s¤ÎºÇ¿¼³¬¤ò%d³¬¤Ë¥»¥Ã¥È¤·¤¿¡£\n", hour, min, note_level, note, d_name + d_info[num].name, max_dlv[num]);
416 fprintf(fff, " %2d:%02d %20s reset recall level of %s to %d %s.\n", hour, min, note_level, d_name + d_info[num].name, max_dlv[num], note);
423 if (quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT)))
434 if (!(dun_level+num)) to = "ÃϾå";
435 else to = format("%d³¬", dun_level+num);
437 if (!(dun_level+num)) to = "the surfice";
438 else to = format("level %d", dun_level+num);
443 fprintf(fff, " %2d:%02d %20s %s¤Ø%s¡£\n", hour, min, note_level, to, note);
445 fprintf(fff, " %2d:%02d %20s %s %s.\n", hour, min, note_level, note, to);
453 fprintf(fff, " %2d:%02d %20s µ¢´Ô¤ò»È¤Ã¤Æ%s¤Î%d³¬¤Ø²¼¤ê¤¿¡£\n", hour, min, note_level, d_name+d_info[dungeon_type].name, max_dlv[dungeon_type]);
455 fprintf(fff, " %2d:%02d %20s recall to dungeon level %d of %s.\n", hour, min, note_level, max_dlv[dungeon_type], d_name+d_info[dungeon_type].name);
459 fprintf(fff, " %2d:%02d %20s µ¢´Ô¤ò»È¤Ã¤ÆÃϾå¤Ø¤ÈÌá¤Ã¤¿¡£\n", hour, min, note_level);
461 fprintf(fff, " %2d:%02d %20s recall from dungeon to surface.\n", hour, min, note_level);
467 if (quest[num].flags & QUEST_FLAG_SILENT) break;
469 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤Ø¤ÈÆÍÆþ¤·¤¿¡£\n", hour, min, note_level, quest[num].name);
471 fprintf(fff, " %2d:%02d %20s enter quest '%s'.\n", hour, min, note_level, quest[num].name);
486 else if (quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT)))
497 if (!(dun_level+num)) to = "ÃϾå";
498 else to = format("%d³¬", dun_level+num);
500 if (!(dun_level+num)) to = "surface";
501 else to = format("level %d", dun_level+num);
506 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥Æ¥ì¥Ý¡¼¥È¤Ç°ÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
508 fprintf(fff, " %2d:%02d %20s teleport level to %s.\n", hour, min, note_level, to);
515 fprintf(fff, " %2d:%02d %20s %s¤ò¹ØÆþ¤·¤¿¡£\n", hour, min, note_level, note);
517 fprintf(fff, " %2d:%02d %20s buy %s.\n", hour, min, note_level, note);
524 fprintf(fff, " %2d:%02d %20s %s¤òÇäµÑ¤·¤¿¡£\n", hour, min, note_level, note);
526 fprintf(fff, " %2d:%02d %20s sell %s.\n", hour, min, note_level, note);
533 fprintf(fff, " %2d:%02d %20s Æ®µ»¾ì¤Î%d²óÀï(%s)¤Ë¾¡Íø¤·¤¿¡£\n", hour, min, note_level, num, note);
535 fprintf(fff, " %2d:%02d %20s win the %d%s fight (%s).\n", hour, min, note_level, num, (num%10==1?"st":num%10==2?"nd":num%10==3?"rd":"th"), note);
537 if (num == MAX_ARENA_MONS)
540 fprintf(fff, " Æ®µ»¾ì¤Î¤¹¤Ù¤Æ¤ÎŨ¤Ë¾¡Íø¤·¡¢¥Á¥ã¥ó¥Ô¥ª¥ó¤È¤Ê¤Ã¤¿¡£\n");
542 fprintf(fff, " win all fight to become a Chanpion.\n");
551 fprintf(fff, " %2d:%02d %20s %s¤ò¼±Ê̤·¤¿¡£\n", hour, min, note_level, note);
553 fprintf(fff, " %2d:%02d %20s identify %s.\n", hour, min, note_level, note);
568 to = format("%d³¬(%s)", dun_level, d_name+d_info[dungeon_type].name);
570 to = format("level %d of %s", dun_level, d_name+d_info[dungeon_type].name);
574 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥¦¥£¥¶¡¼¥É¡¦¥Æ¥ì¥Ý¡¼¥È¤Ç°ÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
576 fprintf(fff, " %2d:%02d %20s wizard-teleport to %s.\n", hour, min, note_level, to);
583 fprintf(fff, " %2d:%02d %20s ¥ì¥Ù¥ë¤¬%d¤Ë¾å¤¬¤Ã¤¿¡£\n", hour, min, note_level, num);
585 fprintf(fff, " %2d:%02d %20s reach player level %d.\n", hour, min, note_level, num);
589 case NIKKI_GAMESTART:
591 time_t ct = time((time_t*)0);
595 fprintf(fff, "%s %s",note, ctime(&ct));
598 fprintf(fff, " %2d:%02d %20s %s %s",hour, min, note_level, note, ctime(&ct));
601 case NIKKI_NAMED_PET:
603 fprintf(fff, " %2d:%02d %20s ", hour, min, note_level);
608 fprintf(fff, "%s¤òι¤Îͧ¤Ë¤¹¤ë¤³¤È¤Ë·è¤á¤¿¡£\n", note);
610 fprintf(fff, "decide to travel together with %s.\n", note);
615 fprintf(fff, "%s¤Î̾Á°¤ò¾Ã¤·¤¿¡£\n", note);
617 fprintf(fff, "unname %s.\n", note);
622 fprintf(fff, "%s¤ò²òÊü¤·¤¿¡£\n", note);
624 fprintf(fff, "dismiss %s.\n", note);
629 fprintf(fff, "%s¤¬»à¤ó¤Ç¤·¤Þ¤Ã¤¿¡£\n", note);
631 fprintf(fff, "%s die.\n", note);
636 fprintf(fff, "%s¤ò¤ª¤¤¤ÆÊ̤ΥޥåפذÜÆ°¤·¤¿¡£\n", note);
638 fprintf(fff, "move to other map leaving %s behind.\n", note);
643 fprintf(fff, "%s¤È¤Ï¤°¤ì¤Æ¤·¤Þ¤Ã¤¿¡£\n", note);
645 fprintf(fff, "lose sight of %s.\n", note);
650 fprintf(fff, "%s¤¬*Ç˲õ*¤Ë¤è¤Ã¤Æ¾Ã¤¨µî¤Ã¤¿¡£\n", note);
652 fprintf(fff, "%s is made disappeared by *destruction*.\n", note);
657 fprintf(fff, "%s¤¬´äÀФ˲¡¤·ÄÙ¤µ¤ì¤¿¡£\n", note);
659 fprintf(fff, "%s is crushed by falling rocks.\n", note);
674 /* Hack -- grab permissions */
677 if (do_level) write_level = FALSE;
683 #define MAX_SUBTITLE (sizeof(subtitle)/sizeof(subtitle[0]))
685 static void do_cmd_disp_nikki(void)
687 char nikki_title[256];
692 static const char subtitle[][30] = {"ºÇ¶¯¤ÎÆùÂΤòµá¤á¤Æ",
693 "¿ÍÀ¸¤½¤ì¤Ï¤Ï¤«¤Ê¤¤",
704 "Åݤ¹¤Ù¤Å¨¤Ï¥²¡û¥Ä",
705 "¤ó¡Á¡©Ê¹¤³¤¨¤ó¤Ê¤¡",
706 "¥ª¥ì¤Î̾¤ò¸À¤Ã¤Æ¤ß¤í",
707 "Ƭ¤¬ÊѤˤʤäÁ¤ã¤Ã¤¿",
712 "¤³¤ó¤Ê¤â¤ó¤¸¤ã¤Ê¤¤",
721 "ºÇ¹â¤ÎƬǾ¤òµá¤á¤Æ"};
723 static const char subtitle[][51] ={"Quest of The World's Toughest Body",
724 "Attack is the best form of defence.",
726 "An unexpected windfall",
727 "A drowning man will catch at a straw",
728 "Don't count your chickens before they are hatched.",
729 "It is no use crying over spilt milk.",
730 "Seeing is believing.",
731 "Strike the iron while it is hot.",
732 "I don't care what follows.",
733 "To dig a well to put out a house on fire.",
734 "Tomorrow is another day.",
735 "Easy come, easy go.",
736 "The more haste, the less speed.",
737 "Where there is life, there is hope.",
738 "There is no royal road to *WINNER*.",
739 "Danger past, God forgotten.",
740 "The best thing to do now is to run away.",
741 "Life is but an empty dream.",
742 "Dead men tell no tales.",
743 "A book that remains shut is but a block.",
744 "Misfortunes never come singly.",
745 "A little knowledge is a dangerous thing.",
746 "History repeats itself.",
747 "*WINNER* was not built in a day.",
748 "Ignorance is bliss.",
749 "To lose is to win?",
750 "No medicine can cure folly.",
751 "All good things come to an end.",
752 "M$ Empire strikes back.",
753 "To see is to believe",
755 "Quest of The World's Greatest Brain"};
758 sprintf(file_name,"playrecord-%s.txt",savefile_base);
760 sprintf(file_name,"playrec-%s.txt",savefile_base);
763 /* Hack -- drop permissions */
766 /* Build the filename */
767 path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
769 if (p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_MONK || p_ptr->pclass == CLASS_SAMURAI || p_ptr->pclass == CLASS_BERSERKER)
770 strcpy(tmp,subtitle[rand_int(MAX_SUBTITLE-1)]);
771 else if (p_ptr->pclass == CLASS_MAGE || p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER)
772 strcpy(tmp,subtitle[rand_int(MAX_SUBTITLE-1)+1]);
773 else strcpy(tmp,subtitle[rand_int(MAX_SUBTITLE-2)+1]);
776 sprintf(nikki_title, "¡Ö%s%s%s¤ÎÅÁÀâ -%s-¡×",
777 ap_ptr->title, ap_ptr->no ? "¤Î" : "", player_name, tmp);
779 sprintf(nikki_title, "Legend of %s %s '%s'",
780 ap_ptr->title, player_name, tmp);
783 /* Display the file contents */
784 show_file(FALSE, buf, nikki_title, -1, 0);
786 /* Hack -- grab permissions */
790 static void do_cmd_bunshou(void)
793 char bunshou[80] = "\0";
796 if (get_string("ÆâÍÆ: ", tmp, 79))
798 if (get_string("diary note: ", tmp, 79))
801 strcpy(bunshou, tmp);
803 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, bunshou);
807 static void do_cmd_last_get(void)
812 if (record_o_name[0] == '\0') return;
815 sprintf(buf,"%s¤ÎÆþ¼ê¤òµÏ¿¤·¤Þ¤¹¡£",record_o_name);
817 sprintf(buf,"Do you really want to record getting %s? ",record_o_name);
819 if (!get_check(buf)) return;
824 sprintf(buf,"%s¤ò¼ê¤ËÆþ¤ì¤¿¡£", record_o_name);
826 sprintf(buf,"descover %s.", record_o_name);
828 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, buf);
832 static void do_cmd_erase_nikki(void)
839 if (!get_check("ËÜÅö¤ËµÏ¿¤ò¾Ãµî¤·¤Þ¤¹¤«¡©")) return;
841 if (!get_check("Do you really want to delete all your record? ")) return;
845 sprintf(file_name,"playrecord-%s.txt",savefile_base);
847 sprintf(file_name,"playrec-%s.txt",savefile_base);
850 /* Hack -- drop permissions */
853 /* Build the filename */
854 path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
856 /* Remove the file */
859 fff = my_fopen(buf, "w");
863 msg_format("µÏ¿¤ò¾Ãµî¤·¤Þ¤·¤¿¡£");
865 msg_format("deleted record.");
869 msg_format("%s ¤Î¾Ãµî¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£", buf);
871 msg_format("failed to delete %s.", buf);
876 /* Hack -- grab permissions */
883 msg_format("%d %d %d:%d",py,px, p_ptr->energy, p_ptr->skill_dis);
889 void do_cmd_nikki(void)
893 /* File type is "TEXT" */
894 FILE_TYPE(FILE_TYPE_TEXT);
896 /* Save the screen */
899 /* Interact until done */
905 /* Ask for a choice */
907 prt("[ µÏ¿¤ÎÀßÄê ]", 2, 0);
909 prt("[ Play Record ]", 2, 0);
913 /* Give some choices */
915 prt("(1) µÏ¿¤ò¸«¤ë", 4, 5);
916 prt("(2) ʸ¾Ï¤òµÏ¿¤¹¤ë", 5, 5);
917 prt("(3) ľÁ°¤ËÆþ¼êËô¤Ï´ÕÄꤷ¤¿¤â¤Î¤òµÏ¿¤¹¤ë", 6, 5);
918 prt("(4) µÏ¿¤ò¾Ãµî¤¹¤ë", 7, 5);
920 prt("(1) Display your record", 4, 5);
921 prt("(2) Add record", 5, 5);
922 prt("(3) Record item you last get/identify", 6, 5);
923 prt("(4) Delete your record", 7, 5);
929 prt("¥³¥Þ¥ó¥É:", 18, 0);
931 prt("Command: ", 18, 0);
939 if (i == ESCAPE) break;
953 do_cmd_erase_nikki();
960 default: /* Unknown option */
968 /* Restore the screen */
973 * Hack -- redraw the screen
975 * This command performs various low level updates, clears all the "extra"
976 * windows, does a total redraw of the main window, and requests all of the
977 * interesting updates and redraws that I can think of.
979 * This command is also used to "instantiate" the results of the user
980 * selecting various things, such as graphics mode, so it must call
981 * the "TERM_XTRA_REACT" hook before redrawing the windows.
983 void do_cmd_redraw(void)
990 /* Hack -- react to changes */
991 Term_xtra(TERM_XTRA_REACT, 0);
994 /* Combine and Reorder the pack (later) */
995 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
999 p_ptr->update |= (PU_TORCH);
1002 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
1004 /* Forget lite/view */
1005 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
1007 /* Update lite/view */
1008 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
1010 /* Update monsters */
1011 p_ptr->update |= (PU_MONSTERS);
1013 /* Redraw everything */
1014 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1017 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
1020 p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
1024 /* Hack -- update */
1027 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
1030 /* Redraw every window */
1031 for (j = 0; j < 8; j++)
1034 if (!angband_term[j]) continue;
1037 Term_activate(angband_term[j]);
1052 * Hack -- change name
1054 void do_cmd_change_name(void)
1063 /* Save the screen */
1071 /* Display the player */
1072 display_player(mode);
1077 display_player(mode);
1082 Term_putstr(2, 23, -1, TERM_WHITE,
1083 "['c'¤Ç̾Á°Êѹ¹, 'f'¤Ç¥Õ¥¡¥¤¥ë¤Ø½ñ½Ð, 'h'¤Ç¥â¡¼¥ÉÊѹ¹, ESC¤Ç½ªÎ»]");
1085 Term_putstr(2, 23, -1, TERM_WHITE,
1086 "['c' to change name, 'f' to file, 'h' to change mode, or ESC]");
1094 if (c == ESCAPE) break;
1105 sprintf(tmp, "%s.txt", player_base);
1107 if (get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
1109 if (get_string("File name: ", tmp, 80))
1113 if (tmp[0] && (tmp[0] != ' '))
1115 file_character(tmp, TRUE);
1132 /* Flush messages */
1136 /* Restore the screen */
1139 /* Redraw everything */
1140 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1147 * Recall the most recent message
1149 void do_cmd_message_one(void)
1151 /* Recall one message XXX XXX XXX */
1152 prt(format("> %s", message_str(0)), 0, 0);
1157 * Show previous messages to the user -BEN-
1159 * The screen format uses line 0 and 23 for headers and prompts,
1160 * skips line 1 and 22, and uses line 2 thru 21 for old messages.
1162 * This command shows you which commands you are viewing, and allows
1163 * you to "search" for strings in the recall.
1165 * Note that messages may be longer than 80 characters, but they are
1166 * displayed using "infinite" length, with a special sub-command to
1167 * "slide" the virtual display to the left or right.
1169 * Attempt to only hilite the matching portions of the string.
1171 void do_cmd_messages(int num_now)
1187 /* Total messages */
1190 /* Start on first message */
1193 /* Start at leftmost edge */
1196 /* Save the screen */
1199 /* Process requests until done */
1205 /* Dump up to 20 lines of messages */
1206 for (j = 0; (j < 20) && (i + j < n); j++)
1208 cptr msg = message_str(i+j);
1210 /* Apply horizontal scroll */
1211 msg = (strlen(msg) >= q) ? (msg + q) : "";
1213 /* Dump the messages, bottom to top */
1214 Term_putstr(0, 21-j, -1, (bool)(i+j < num_now ? TERM_WHITE : TERM_SLATE), msg);
1216 /* Hilite "shower" */
1221 /* Display matches */
1222 while ((str = strstr(str, shower)) != NULL)
1224 int len = strlen(shower);
1226 /* Display the match */
1227 Term_putstr(str-msg, 21-j, len, TERM_YELLOW, shower);
1235 /* Display header XXX XXX XXX */
1238 prt(format("°ÊÁ°¤Î¥á¥Ã¥»¡¼¥¸ %d-%d Á´Éô¤Ç(%d) ¥ª¥Õ¥»¥Ã¥È(%d)",
1239 i, i+j-1, n, q), 0, 0);
1241 prt(format("Message Recall (%d-%d of %d), Offset %d",
1242 i, i+j-1, n, q), 0, 0);
1246 /* Display prompt (not very informative) */
1248 prt("[ 'p' ¤Ç¹¹¤Ë¸Å¤¤¤â¤Î, 'n' ¤Ç¹¹¤Ë¿·¤·¤¤¤â¤Î, '/' ¤Ç¸¡º÷, ESC ¤ÇÃæÃÇ ]", 23, 0);
1250 prt("[Press 'p' for older, 'n' for newer, ..., or ESCAPE]", 23, 0);
1257 /* Exit on Escape */
1258 if (k == ESCAPE) break;
1260 /* Hack -- Save the old index */
1263 /* Horizontal scroll */
1267 q = (q >= 40) ? (q - 40) : 0;
1273 /* Horizontal scroll */
1283 /* Hack -- handle show */
1288 prt("¶¯Ä´: ", 23, 0);
1290 prt("Show: ", 23, 0);
1294 /* Get a "shower" string, or continue */
1295 if (!askfor_aux(shower, 80)) continue;
1301 /* Hack -- handle find */
1308 prt("¸¡º÷: ", 23, 0);
1310 prt("Find: ", 23, 0);
1314 /* Get a "finder" string, or continue */
1315 if (!askfor_aux(finder, 80)) continue;
1318 strcpy(shower, finder);
1321 for (z = i + 1; z < n; z++)
1323 cptr msg = message_str(z);
1326 if (strstr(msg, finder))
1337 /* Recall 1 older message */
1338 if ((k == '8') || (k == '\n') || (k == '\r'))
1340 /* Go newer if legal */
1341 if (i + 1 < n) i += 1;
1344 /* Recall 10 older messages */
1347 /* Go older if legal */
1348 if (i + 10 < n) i += 10;
1351 /* Recall 20 older messages */
1352 if ((k == 'p') || (k == KTRL('P')) || (k == ' '))
1354 /* Go older if legal */
1355 if (i + 20 < n) i += 20;
1358 /* Recall 20 newer messages */
1359 if ((k == 'n') || (k == KTRL('N')))
1361 /* Go newer (if able) */
1362 i = (i >= 20) ? (i - 20) : 0;
1365 /* Recall 10 newer messages */
1368 /* Go newer (if able) */
1369 i = (i >= 20) ? (i - 20) : 0;
1372 /* Recall 1 newer messages */
1375 /* Go newer (if able) */
1376 i = (i >= 1) ? (i - 1) : 0;
1379 /* Hack -- Error of some kind */
1383 /* Restore the screen */
1390 * Number of cheating options
1397 static option_type cheat_info[CHEAT_MAX] =
1399 { &cheat_peek, FALSE, 255, 0x01, 0x00,
1401 "cheat_peek", "¥¢¥¤¥Æ¥à¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1403 "cheat_peek", "Peek into object creation" },
1407 { &cheat_hear, FALSE, 255, 0x02, 0x00,
1409 "cheat_hear", "¥â¥ó¥¹¥¿¡¼¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1411 "cheat_hear", "Peek into monster creation" },
1415 { &cheat_room, FALSE, 255, 0x04, 0x00,
1417 "cheat_room", "¥À¥ó¥¸¥ç¥ó¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1419 "cheat_room", "Peek into dungeon creation" },
1423 { &cheat_xtra, FALSE, 255, 0x08, 0x00,
1425 "cheat_xtra", "¤½¤Î¾¤Î»ö¤ò¤Î¤¾¤¸«¤ë" },
1427 "cheat_xtra", "Peek into something else" },
1431 { &cheat_know, FALSE, 255, 0x10, 0x00,
1433 "cheat_know", "´°Á´¤Ê¥â¥ó¥¹¥¿¡¼¤Î»×¤¤½Ð¤òÃΤë" },
1435 "cheat_know", "Know complete monster info" },
1439 { &cheat_live, FALSE, 255, 0x20, 0x00,
1441 "cheat_live", "»à¤ò²óÈò¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë" }
1443 "cheat_live", "Allow player to avoid death" }
1449 * Interact with some options for cheating
1451 static void do_cmd_options_cheat(cptr info)
1455 int i, k = 0, n = CHEAT_MAX;
1463 /* Interact with the player */
1466 /* Prompt XXX XXX XXX */
1468 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê )", info);
1470 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1476 /* º¾µ½¥ª¥×¥·¥ç¥ó¤ò¤¦¤Ã¤«¤ê¤¤¤¸¤Ã¤Æ¤·¤Þ¤¦¿Í¤¬¤¤¤ë¤è¤¦¤Ê¤Î¤ÇÃí°Õ */
1477 prt(" << Ãí°Õ >>", 11, 0);
1478 prt(" º¾µ½¥ª¥×¥·¥ç¥ó¤ò°ìÅ٤ǤâÀßÄꤹ¤ë¤È¡¢¥¹¥³¥¢µÏ¿¤¬»Ä¤é¤Ê¤¯¤Ê¤ê¤Þ¤¹¡ª", 12, 0);
1479 prt(" ¸å¤Ë²ò½ü¤·¤Æ¤â¥À¥á¤Ç¤¹¤Î¤Ç¡¢¾¡Íø¼Ô¤òÌܻؤ¹Êý¤Ï¤³¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤¤", 13, 0);
1480 prt(" ¤¸¤é¤Ê¤¤¤è¤¦¤Ë¤·¤Æ²¼¤µ¤¤¡£", 14, 0);
1482 /* Display the options */
1483 for (i = 0; i < n; i++)
1485 byte a = TERM_WHITE;
1487 /* Color current option */
1488 if (i == k) a = TERM_L_BLUE;
1490 /* Display the option text */
1491 sprintf(buf, "%-48s: %s (%s)",
1492 cheat_info[i].o_desc,
1494 (*cheat_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1496 (*cheat_info[i].o_var ? "yes" : "no "),
1499 cheat_info[i].o_text);
1500 c_prt(a, buf, i + 2, 0);
1503 /* Hilite current option */
1504 move_cursor(k + 2, 50);
1520 k = (n + k - 1) % n;
1539 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "º¾µ½¥ª¥×¥·¥ç¥ó¤òON¤Ë¤·¤Æ¡¢¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
1541 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use cheating options.");
1543 noscore |= (cheat_info[k].o_set * 256 + cheat_info[k].o_bit);
1544 (*cheat_info[k].o_var) = TRUE;
1553 (*cheat_info[k].o_var) = FALSE;
1568 static option_type autosave_info[2] =
1570 { &autosave_l, FALSE, 255, 0x01, 0x00,
1572 "autosave_l", "¿·¤·¤¤³¬¤ËÆþ¤ëÅ٤˼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1574 "autosave_l", "Autosave when entering new levels" },
1578 { &autosave_t, FALSE, 255, 0x02, 0x00,
1580 "autosave_t", "°ìÄ꥿¡¼¥óËè¤Ë¼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1582 "autosave_t", "Timed autosave" },
1588 static s16b toggle_frequency(s16b current)
1590 if (current == 0) return 50;
1591 if (current == 50) return 100;
1592 if (current == 100) return 250;
1593 if (current == 250) return 500;
1594 if (current == 500) return 1000;
1595 if (current == 1000) return 2500;
1596 if (current == 2500) return 5000;
1597 if (current == 5000) return 10000;
1598 if (current == 10000) return 25000;
1605 * Interact with some options for cheating
1607 static void do_cmd_options_autosave(cptr info)
1611 int i, k = 0, n = 2;
1619 /* Interact with the player */
1622 /* Prompt XXX XXX XXX */
1624 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, F ¤ÇÉÑÅÙ¤òÆþÎÏ, ESC ¤Ç·èÄê ) ", info);
1626 sprintf(buf, "%s (RET to advance, y/n to set, 'F' for frequency, ESC to accept) ", info);
1631 /* Display the options */
1632 for (i = 0; i < n; i++)
1634 byte a = TERM_WHITE;
1636 /* Color current option */
1637 if (i == k) a = TERM_L_BLUE;
1639 /* Display the option text */
1640 sprintf(buf, "%-48s: %s (%s)",
1641 autosave_info[i].o_desc,
1643 (*autosave_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1645 (*autosave_info[i].o_var ? "yes" : "no "),
1648 autosave_info[i].o_text);
1649 c_prt(a, buf, i + 2, 0);
1653 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè", autosave_freq), 5, 0);
1655 prt(format("Timed autosave frequency: every %d turns", autosave_freq), 5, 0);
1660 /* Hilite current option */
1661 move_cursor(k + 2, 50);
1677 k = (n + k - 1) % n;
1695 (*autosave_info[k].o_var) = TRUE;
1704 (*autosave_info[k].o_var) = FALSE;
1712 autosave_freq = toggle_frequency(autosave_freq);
1714 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè",
1716 prt(format("Timed autosave frequency: every %d turns",
1719 autosave_freq), 5, 0);
1732 #define PAGE_AUTODESTROY 7
1735 * Interact with some options
1737 void do_cmd_options_aux(int page, cptr info)
1740 int i, k = 0, n = 0, l;
1745 /* Lookup the options */
1746 for (i = 0; i < 24; i++) opt[i] = 0;
1748 /* Scan the options */
1749 for (i = 0; option_info[i].o_desc; i++)
1751 /* Notice options on this "page" */
1752 if (option_info[i].o_page == page) opt[n++] = i;
1760 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢´Ê°×¼«Æ°Ç˲õ¤ò»ÈÍѤ¹¤ë¤È¤¤Î¤ß͸ú", 4, 6);
1762 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "Following options will protect items from easy auto-destroyer.", 4, 3);
1765 /* Interact with the player */
1768 /* Prompt XXX XXX XXX */
1770 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê ) ", info);
1772 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1777 /* Display the options */
1778 for (i = 0; i < n; i++)
1780 byte a = TERM_WHITE;
1782 /* Color current option */
1783 if (i == k) a = TERM_L_BLUE;
1785 /* Display the option text */
1786 sprintf(buf, "%-48s: %s (%.19s)",
1787 option_info[opt[i]].o_desc,
1789 (*option_info[opt[i]].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1791 (*option_info[opt[i]].o_var ? "yes" : "no "),
1794 option_info[opt[i]].o_text);
1795 if ((page == PAGE_AUTODESTROY) && i > 0) c_prt(a, buf, i + 5, 0);
1796 else c_prt(a, buf, i + 2, 0);
1799 if ((page == PAGE_AUTODESTROY) && (k > 0)) l = 3;
1801 /* Hilite current option */
1802 move_cursor(k + 2 + l, 50);
1820 k = (n + k - 1) % n;
1841 (*option_info[opt[k]].o_var) = TRUE;
1852 (*option_info[opt[k]].o_var) = FALSE;
1860 (*option_info[opt[k]].o_var) = !(*option_info[opt[k]].o_var);
1875 * Modify the "window" options
1877 static void do_cmd_options_win(void)
1891 /* Memorize old flags */
1892 for (j = 0; j < 8; j++)
1894 /* Acquire current flags */
1895 old_flag[j] = window_flag[j];
1905 /* Prompt XXX XXX XXX */
1907 prt("¥¦¥£¥ó¥É¥¦¡¦¥Õ¥é¥° (<Êý¸þ>¤Ç°ÜÆ°, t¤Ç¥Á¥§¥ó¥¸, y/n ¤Ç¥»¥Ã¥È, ESC)", 0, 0);
1909 prt("Window Flags (<dir>, t, y, n, ESC) ", 0, 0);
1913 /* Display the windows */
1914 for (j = 0; j < 8; j++)
1916 byte a = TERM_WHITE;
1918 cptr s = angband_term_name[j];
1921 if (j == x) a = TERM_L_BLUE;
1923 /* Window name, staggered, centered */
1924 Term_putstr(35 + j * 5 - strlen(s) / 2, 2 + j % 2, -1, a, s);
1927 /* Display the options */
1928 for (i = 0; i < 16; i++)
1930 byte a = TERM_WHITE;
1932 cptr str = window_flag_desc[i];
1935 if (i == y) a = TERM_L_BLUE;
1939 if (!str) str = "(̤»ÈÍÑ)";
1941 if (!str) str = "(Unused option)";
1946 Term_putstr(0, i + 5, -1, a, str);
1948 /* Display the windows */
1949 for (j = 0; j < 8; j++)
1951 byte a = TERM_WHITE;
1956 if ((i == y) && (j == x)) a = TERM_L_BLUE;
1959 if (window_flag[j] & (1L << i)) c = 'X';
1962 Term_putch(35 + j * 5, i + 5, a, c);
1967 Term_gotoxy(35 + x * 5, y + 5);
1985 for (j = 0; j < 8; j++)
1987 window_flag[j] &= ~(1L << y);
1991 for (i = 0; i < 16; i++)
1993 window_flag[x] &= ~(1L << i);
2006 window_flag[x] |= (1L << y);
2014 window_flag[x] &= ~(1L << y);
2020 d = get_keymap_dir(ch);
2022 x = (x + ddx[d] + 8) % 8;
2023 y = (y + ddy[d] + 16) % 16;
2030 /* Notice changes */
2031 for (j = 0; j < 8; j++)
2036 if (!angband_term[j]) continue;
2038 /* Ignore non-changes */
2039 if (window_flag[j] == old_flag[j]) continue;
2042 Term_activate(angband_term[j]);
2059 * Set or unset various options.
2061 * The user must use the "Ctrl-R" command to "adapt" to changes
2062 * in any options which control "visual" aspects of the game.
2064 void do_cmd_options(void)
2069 /* Save the screen */
2079 /* Why are we here */
2081 prt("[ ¥ª¥×¥·¥ç¥ó¤ÎÀßÄê ]", 2, 0);
2083 prt("Options", 2, 0);
2087 /* Give some choices */
2089 prt("(1) ¥¡¼ÆþÎÏ ¥ª¥×¥·¥ç¥ó", 4, 5);
2090 prt("(2) ²èÌ̽ÐÎÏ ¥ª¥×¥·¥ç¥ó", 5, 5);
2091 prt("(3) ¥²¡¼¥à¥×¥ì¥¤ ¥ª¥×¥·¥ç¥ó", 6, 5);
2092 prt("(4) ¹ÔÆ°Ãæ»ß´Ø·¸ ¥ª¥×¥·¥ç¥ó", 7, 5);
2093 prt("(5) ¸úΨ²½ ¥ª¥×¥·¥ç¥ó", 8, 5);
2094 prt("(6) ´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ ¥ª¥×¥·¥ç¥ó", 9, 5);
2095 prt("(R) ¥×¥ì¥¤µÏ¿ ¥ª¥×¥·¥ç¥ó", 10, 5);
2096 /* Special choices */
2097 prt("(D) ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 12, 5);
2098 prt("(H) Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 13, 5);
2099 prt("(A) ¼«Æ°¥»¡¼¥Ö ¥ª¥×¥·¥ç¥ó", 14, 5);
2101 prt("(W) ¥¦¥¤¥ó¥É¥¦¥Õ¥é¥°", 15, 5);
2103 prt("(C) º¾µ½ ¥ª¥×¥·¥ç¥ó", 16, 5);
2105 prt("(1) Input Options", 4, 5);
2106 prt("(2) Output Options", 5, 5);
2107 prt("(3) Game-Play Options", 6, 5);
2108 prt("(4) Disturbance Options", 7, 5);
2109 prt("(5) Efficiency Options", 8, 5);
2110 prt("(6) Easy Auto-Destroyer Options", 9, 5);
2111 prt("(R) Play-record Options", 10, 5);
2113 /* Special choices */
2114 prt("(D) Base Delay Factor", 12, 5);
2115 prt("(H) Hitpoint Warning", 13, 5);
2116 prt("(A) Autosave Options", 14, 5);
2120 prt("(W) Window Flags", 15, 5);
2123 prt("(C) Cheating Options", 16, 5);
2129 prt("¥³¥Þ¥ó¥É:", 18, 0);
2131 prt("Command: ", 18, 0);
2139 if (k == ESCAPE) break;
2144 /* General Options */
2147 /* Process the general options */
2149 do_cmd_options_aux(1, "¥¡¼ÆþÎÏ¥ª¥×¥·¥ç¥ó");
2151 do_cmd_options_aux(1, "Input Options");
2157 /* General Options */
2160 /* Process the general options */
2162 do_cmd_options_aux(2, "²èÌ̽ÐÎÏ¥ª¥×¥·¥ç¥ó");
2164 do_cmd_options_aux(2, "Output Options");
2170 /* Inventory Options */
2175 do_cmd_options_aux(3, "¥²¡¼¥à¥×¥ì¥¤¡¦¥ª¥×¥·¥ç¥ó");
2177 do_cmd_options_aux(3, "Game-Play Options");
2183 /* Disturbance Options */
2188 do_cmd_options_aux(4, "¹ÔÆ°Ãæ»ß´Ø·¸¤Î¥ª¥×¥·¥ç¥ó");
2190 do_cmd_options_aux(4, "Disturbance Options");
2196 /* Efficiency Options */
2201 do_cmd_options_aux(5, "¸úΨ²½¥ª¥×¥·¥ç¥ó");
2203 do_cmd_options_aux(5, "Efficiency Options");
2209 /* Object auto-destruction Options */
2214 do_cmd_options_aux(7, "´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ¥ª¥×¥·¥ç¥ó");
2216 do_cmd_options_aux(7, "Easy Auto-Destroyer Options");
2221 /* Play-record Options */
2227 do_cmd_options_aux(10, "¥×¥ì¥¤µÏ¿¥ª¥×¥·¥ç¥ó");
2229 do_cmd_options_aux(10, "Play-record Option");
2234 /* Cheating Options */
2239 do_cmd_options_cheat("º¾µ½»Õ¤Ï·è¤·¤Æ¾¡Íø¤Ç¤¤Ê¤¤¡ª");
2241 do_cmd_options_cheat("Cheaters never win");
2251 do_cmd_options_autosave("¼«Æ°¥»¡¼¥Ö");
2253 do_cmd_options_autosave("Autosave");
2264 do_cmd_options_win();
2265 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL |
2266 PW_PLAYER | PW_MESSAGE | PW_OVERHEAD |
2267 PW_MONSTER | PW_OBJECT | PW_SNAPSHOT |
2268 PW_BORG_1 | PW_BORG_2 | PW_DUNGEON);
2272 /* Hack -- Delay Speed */
2278 prt("¥³¥Þ¥ó¥É: ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 18, 0);
2280 prt("Command: Base Delay Factor", 18, 0);
2284 /* Get a new value */
2287 int msec = delay_factor * delay_factor * delay_factor;
2289 prt(format("¸½ºß¤Î¥¦¥§¥¤¥È: %d (%d¥ß¥êÉÃ)",
2291 prt(format("Current base delay factor: %d (%d msec)",
2294 delay_factor, msec), 22, 0);
2296 prt("¥¦¥§¥¤¥È (0-9) ESC¤Ç·èÄê: ", 20, 0);
2298 prt("Delay Factor (0-9 or ESC to accept): ", 20, 0);
2302 if (k == ESCAPE) break;
2303 if (isdigit(k)) delay_factor = D2I(k);
2310 /* Hack -- hitpoint warning factor */
2316 prt("¥³¥Þ¥ó¥É: Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 18, 0);
2318 prt("Command: Hitpoint Warning", 18, 0);
2322 /* Get a new value */
2326 prt(format("¸½ºß¤ÎÄã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð: %d0%%",
2327 hitpoint_warn), 22, 0);
2329 prt(format("Current hitpoint warning: %d0%%",
2330 hitpoint_warn), 22, 0);
2334 prt("Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð (0-9) ESC¤Ç·èÄê: ", 20, 0);
2336 prt("Hitpoint Warning (0-9 or ESC to accept): ", 20, 0);
2340 if (k == ESCAPE) break;
2341 if (isdigit(k)) hitpoint_warn = D2I(k);
2348 /* Unknown option */
2357 /* Flush messages */
2362 /* Restore the screen */
2365 /* Hack - Redraw equippy chars */
2366 p_ptr->redraw |= (PR_EQUIPPY);
2372 * Ask for a "user pref line" and process it
2374 * XXX XXX XXX Allow absolute file names?
2376 void do_cmd_pref(void)
2383 /* Ask for a "user pref command" */
2385 if (!get_string("ÀßÄêÊѹ¹¥³¥Þ¥ó¥É: ", buf, 80)) return;
2387 if (!get_string("Pref: ", buf, 80)) return;
2391 /* Process that pref command */
2392 (void)process_pref_file_command(buf);
2395 void do_cmd_pickpref(void)
2402 if(!get_check("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹¤«? ")) return;
2404 if(!get_check("Reload auto-pick preference file? ")) return;
2406 /* ¤¤¤Þ¤Þ¤Ç»È¤Ã¤Æ¤¤¤¿¥á¥â¥ê²òÊü */
2407 for( i = 0; i < max_autopick; i++){
2408 string_free(autopick_name[i]);
2409 string_free(autopick_insc[i]);
2413 /* ¥¥ã¥éËè¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß */
2415 sprintf(buf, "picktype-%s.prf", player_name);
2417 sprintf(buf, "pickpref-%s.prf", player_name);
2419 if( process_pickpref_file(buf) == 0 ){
2422 msg_format("%s¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", buf);
2424 msg_format("loaded '%s'.", buf);
2428 /* ¶¦Ä̤ÎÀßÄê¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß */
2430 if( process_pickpref_file("picktype.prf") == 0 )
2432 if( process_pickpref_file("pickpref.prf") == 0 )
2437 msg_print("picktype.prf¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£");
2439 msg_print("loaded 'pickpref.prf'.");
2444 if(err) msg_print("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£");
2446 if(err) msg_print("Failed to reload autopick preference.");
2453 * Hack -- append all current macros to the given file
2455 static errr macro_dump(cptr fname)
2457 static cptr mark = "Macro Dump";
2465 /* Build the filename */
2466 path_build(buf, 1024, ANGBAND_DIR_USER, fname);
2468 /* File type is "TEXT" */
2469 FILE_TYPE(FILE_TYPE_TEXT);
2471 /* Append to the file */
2472 fff = open_auto_dump(buf, mark, &line_num);
2473 if (!fff) return (-1);
2477 fprintf(fff, "\n# ¼«Æ°¥Þ¥¯¥í¥»¡¼¥Ö\n\n");
2479 fprintf(fff, "\n# Automatic macro dump\n\n");
2484 for (i = 0; i < macro__num; i++)
2486 /* Extract the action */
2487 ascii_to_text(buf, macro__act[i]);
2489 /* Dump the macro */
2490 fprintf(fff, "A:%s\n", buf);
2492 /* Extract the action */
2493 ascii_to_text(buf, macro__pat[i]);
2495 /* Dump normal macros */
2496 fprintf(fff, "P:%s\n", buf);
2501 /* count number of lines */
2506 close_auto_dump(fff, mark, line_num);
2514 * Hack -- ask for a "trigger" (see below)
2516 * Note the complex use of the "inkey()" function from "util.c".
2518 * Note that both "flush()" calls are extremely important.
2520 static void do_cmd_macro_aux(char *buf)
2530 /* Do not process macros */
2536 /* Read the pattern */
2542 /* Do not process macros */
2545 /* Do not wait for keys */
2548 /* Attempt to read a key */
2559 /* Convert the trigger */
2560 ascii_to_text(tmp, buf);
2562 /* Hack -- display the trigger */
2563 Term_addstr(-1, TERM_WHITE, tmp);
2570 * Hack -- ask for a keymap "trigger" (see below)
2572 * Note that both "flush()" calls are extremely important. This may
2573 * no longer be true, since "util.c" is much simpler now. XXX XXX XXX
2575 static void do_cmd_macro_aux_keymap(char *buf)
2589 /* Convert to ascii */
2590 ascii_to_text(tmp, buf);
2592 /* Hack -- display the trigger */
2593 Term_addstr(-1, TERM_WHITE, tmp);
2602 * Hack -- append all keymaps to the given file
2604 static errr keymap_dump(cptr fname)
2606 static cptr mark = "Keymap Dump";
2618 if (rogue_like_commands)
2620 mode = KEYMAP_MODE_ROGUE;
2626 mode = KEYMAP_MODE_ORIG;
2630 /* Build the filename */
2631 path_build(buf, 1024, ANGBAND_DIR_USER, fname);
2633 /* File type is "TEXT" */
2634 FILE_TYPE(FILE_TYPE_TEXT);
2636 /* Append to the file */
2637 fff = open_auto_dump(buf, mark, &line_num);
2638 if (!fff) return -1;
2642 fprintf(fff, "\n# ¼«Æ°¥¡¼ÇÛÃÖ¥»¡¼¥Ö\n\n");
2644 fprintf(fff, "\n# Automatic keymap dump\n\n");
2649 for (i = 0; i < 256; i++)
2653 /* Loop up the keymap */
2654 act = keymap_act[mode][i];
2656 /* Skip empty keymaps */
2659 /* Encode the key */
2662 ascii_to_text(key, buf);
2664 /* Encode the action */
2665 ascii_to_text(buf, act);
2667 /* Dump the macro */
2668 fprintf(fff, "A:%s\n", buf);
2669 fprintf(fff, "C:%d:%s\n", mode, key);
2674 close_auto_dump(fff, mark, line_num);
2683 * Interact with "macros"
2685 * Note that the macro "action" must be defined before the trigger.
2687 * Could use some helpful instructions on this page. XXX XXX XXX
2689 void do_cmd_macros(void)
2701 if (rogue_like_commands)
2703 mode = KEYMAP_MODE_ROGUE;
2709 mode = KEYMAP_MODE_ORIG;
2712 /* File type is "TEXT" */
2713 FILE_TYPE(FILE_TYPE_TEXT);
2720 /* Process requests until done */
2728 prt("[ ¥Þ¥¯¥í¤ÎÀßÄê ]", 2, 0);
2730 prt("Interact with Macros", 2, 0);
2735 /* Describe that action */
2737 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2739 prt("Current action (if any) shown below:", 20, 0);
2743 /* Analyze the current action */
2744 ascii_to_text(buf, macro__buf);
2746 /* Display the current action */
2752 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2754 prt("(1) Load a user pref file", 4, 5);
2759 prt("(2) ¥Õ¥¡¥¤¥ë¤Ë¥Þ¥¯¥í¤òÄɲÃ", 5, 5);
2760 prt("(3) ¥Þ¥¯¥í¤Î³Îǧ", 6, 5);
2761 prt("(4) ¥Þ¥¯¥í¤ÎºîÀ®", 7, 5);
2762 prt("(5) ¥Þ¥¯¥í¤Îºï½ü", 8, 5);
2763 prt("(6) ¥Õ¥¡¥¤¥ë¤Ë¥¡¼ÇÛÃÖ¤òÄɲÃ", 9, 5);
2764 prt("(7) ¥¡¼ÇÛÃ֤γÎǧ", 10, 5);
2765 prt("(8) ¥¡¼ÇÛÃ֤κîÀ®", 11, 5);
2766 prt("(9) ¥¡¼ÇÛÃ֤κï½ü", 12, 5);
2767 prt("(0) ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 13, 5);
2769 prt("(2) Append macros to a file", 5, 5);
2770 prt("(3) Query a macro", 6, 5);
2771 prt("(4) Create a macro", 7, 5);
2772 prt("(5) Remove a macro", 8, 5);
2773 prt("(6) Append keymaps to a file", 9, 5);
2774 prt("(7) Query a keymap", 10, 5);
2775 prt("(8) Create a keymap", 11, 5);
2776 prt("(9) Remove a keymap", 12, 5);
2777 prt("(0) Enter a new action", 13, 5);
2780 #endif /* ALLOW_MACROS */
2784 prt("¥³¥Þ¥ó¥É: ", 16, 0);
2786 prt("Command: ", 16, 0);
2794 if (i == ESCAPE) break;
2796 /* Load a 'macro' file */
2801 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 16, 0);
2803 prt("Command: Load a user pref file", 16, 0);
2809 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
2811 prt("File: ", 18, 0);
2815 /* Default filename */
2816 sprintf(tmp, "%s.prf", player_name);
2818 /* Ask for a file */
2819 if (!askfor_aux(tmp, 80)) continue;
2821 /* Process the given filename */
2822 if (0 != process_pref_file(tmp))
2826 msg_print("¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤á¤Þ¤»¤ó¤Ç¤·¤¿¡ª");
2828 msg_print("Could not load file!");
2841 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
2843 prt("Command: Append macros to a file", 16, 0);
2849 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
2851 prt("File: ", 18, 0);
2855 /* Default filename */
2856 sprintf(tmp, "%s.prf", player_name);
2858 /* Ask for a file */
2859 if (!askfor_aux(tmp, 80)) continue;
2861 /* Dump the macros */
2862 (void)macro_dump(tmp);
2866 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
2868 msg_print("Appended macros.");
2880 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Î³Îǧ", 16, 0);
2882 prt("Command: Query a macro", 16, 0);
2888 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
2890 prt("Trigger: ", 18, 0);
2894 /* Get a macro trigger */
2895 do_cmd_macro_aux(buf);
2897 /* Acquire action */
2898 k = macro_find_exact(buf);
2905 msg_print("¤½¤Î¥¡¼¤Ë¤Ï¥Þ¥¯¥í¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
2907 msg_print("Found no macro.");
2915 /* Obtain the action */
2916 strcpy(macro__buf, macro__act[k]);
2918 /* Analyze the current action */
2919 ascii_to_text(buf, macro__buf);
2921 /* Display the current action */
2926 msg_print("¥Þ¥¯¥í¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
2928 msg_print("Found a macro.");
2934 /* Create a macro */
2939 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ÎºîÀ®", 16, 0);
2941 prt("Command: Create a macro", 16, 0);
2947 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
2949 prt("Trigger: ", 18, 0);
2953 /* Get a macro trigger */
2954 do_cmd_macro_aux(buf);
2961 prt("¥Þ¥¯¥í¹ÔÆ°: ", 20, 0);
2963 prt("Action: ", 20, 0);
2967 /* Convert to text */
2968 ascii_to_text(tmp, macro__buf);
2970 /* Get an encoded action */
2971 if (askfor_aux(tmp, 80))
2973 /* Convert to ascii */
2974 text_to_ascii(macro__buf, tmp);
2976 /* Link the macro */
2977 macro_add(buf, macro__buf);
2981 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
2983 msg_print("Added a macro.");
2989 /* Remove a macro */
2994 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Îºï½ü", 16, 0);
2996 prt("Command: Remove a macro", 16, 0);
3002 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3004 prt("Trigger: ", 18, 0);
3008 /* Get a macro trigger */
3009 do_cmd_macro_aux(buf);
3011 /* Link the macro */
3012 macro_add(buf, buf);
3016 msg_print("¥Þ¥¯¥í¤òºï½ü¤·¤Þ¤·¤¿¡£");
3018 msg_print("Removed a macro.");
3028 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃÖ¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
3030 prt("Command: Append keymaps to a file", 16, 0);
3036 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3038 prt("File: ", 18, 0);
3042 /* Default filename */
3043 sprintf(tmp, "%s.prf", player_name);
3045 /* Ask for a file */
3046 if (!askfor_aux(tmp, 80)) continue;
3048 /* Dump the macros */
3049 (void)keymap_dump(tmp);
3053 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3055 msg_print("Appended keymaps.");
3060 /* Query a keymap */
3067 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤γÎǧ", 16, 0);
3069 prt("Command: Query a keymap", 16, 0);
3075 prt("²¡¤¹¥¡¼: ", 18, 0);
3077 prt("Keypress: ", 18, 0);
3081 /* Get a keymap trigger */
3082 do_cmd_macro_aux_keymap(buf);
3084 /* Look up the keymap */
3085 act = keymap_act[mode][(byte)(buf[0])];
3092 msg_print("¥¡¼ÇÛÃÖ¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
3094 msg_print("Found no keymap.");
3102 /* Obtain the action */
3103 strcpy(macro__buf, act);
3105 /* Analyze the current action */
3106 ascii_to_text(buf, macro__buf);
3108 /* Display the current action */
3113 msg_print("¥¡¼ÇÛÃÖ¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
3115 msg_print("Found a keymap.");
3121 /* Create a keymap */
3126 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κîÀ®", 16, 0);
3128 prt("Command: Create a keymap", 16, 0);
3134 prt("²¡¤¹¥¡¼: ", 18, 0);
3136 prt("Keypress: ", 18, 0);
3140 /* Get a keymap trigger */
3141 do_cmd_macro_aux_keymap(buf);
3148 prt("¹ÔÆ°: ", 20, 0);
3150 prt("Action: ", 20, 0);
3154 /* Convert to text */
3155 ascii_to_text(tmp, macro__buf);
3157 /* Get an encoded action */
3158 if (askfor_aux(tmp, 80))
3160 /* Convert to ascii */
3161 text_to_ascii(macro__buf, tmp);
3163 /* Free old keymap */
3164 string_free(keymap_act[mode][(byte)(buf[0])]);
3166 /* Make new keymap */
3167 keymap_act[mode][(byte)(buf[0])] = string_make(macro__buf);
3171 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3173 msg_print("Added a keymap.");
3179 /* Remove a keymap */
3184 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κï½ü", 16, 0);
3186 prt("Command: Remove a keymap", 16, 0);
3192 prt("²¡¤¹¥¡¼: ", 18, 0);
3194 prt("Keypress: ", 18, 0);
3198 /* Get a keymap trigger */
3199 do_cmd_macro_aux_keymap(buf);
3201 /* Free old keymap */
3202 string_free(keymap_act[mode][(byte)(buf[0])]);
3204 /* Make new keymap */
3205 keymap_act[mode][(byte)(buf[0])] = NULL;
3209 msg_print("¥¡¼ÇÛÃÖ¤òºï½ü¤·¤Þ¤·¤¿¡£");
3211 msg_print("Removed a keymap.");
3216 /* Enter a new action */
3221 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 16, 0);
3223 prt("Command: Enter a new action", 16, 0);
3227 /* Go to the correct location */
3230 /* Hack -- limit the value */
3233 /* Get an encoded action */
3234 if (!askfor_aux(buf, 80)) continue;
3236 /* Extract an action */
3237 text_to_ascii(macro__buf, buf);
3240 #endif /* ALLOW_MACROS */
3249 /* Flush messages */
3259 * Interact with "visuals"
3261 void do_cmd_visuals(void)
3272 /* File type is "TEXT" */
3273 FILE_TYPE(FILE_TYPE_TEXT);
3276 /* Save the screen */
3280 /* Interact until done */
3286 /* Ask for a choice */
3288 prt("²èÌÌɽ¼¨¤ÎÀßÄê", 2, 0);
3290 prt("Interact with Visuals", 2, 0);
3294 /* Give some choices */
3296 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
3298 prt("(1) Load a user pref file", 4, 5);
3301 #ifdef ALLOW_VISUALS
3303 prt("(2) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
3304 prt("(3) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 6, 5);
3305 prt("(4) ÃÏ·Á¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 7, 5);
3306 prt("(5) (̤»ÈÍÑ)", 8, 5);
3307 prt("(6) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 9, 5);
3308 prt("(7) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 10, 5);
3309 prt("(8) ÃÏ·Á¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 11, 5);
3310 prt("(9) (̤»ÈÍÑ)", 12, 5);
3312 prt("(2) Dump monster attr/chars", 5, 5);
3313 prt("(3) Dump object attr/chars", 6, 5);
3314 prt("(4) Dump feature attr/chars", 7, 5);
3315 prt("(5) (unused)", 8, 5);
3316 prt("(6) Change monster attr/chars", 9, 5);
3317 prt("(7) Change object attr/chars", 10, 5);
3318 prt("(8) Change feature attr/chars", 11, 5);
3319 prt("(9) (unused)", 12, 5);
3324 prt("(0) ²èÌÌɽ¼¨ÊýË¡¤Î½é´ü²½", 13, 5);
3326 prt("(0) Reset visuals", 13, 5);
3332 prt("¥³¥Þ¥ó¥É:", 18, 0);
3334 prt("Command: ", 15, 0);
3342 if (i == ESCAPE) break;
3344 /* Load a 'pref' file */
3349 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 15, 0);
3351 prt("Command: Load a user pref file", 15, 0);
3357 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3359 prt("File: ", 17, 0);
3363 /* Default filename */
3364 sprintf(tmp, "%s.prf", player_name);
3367 if (!askfor_aux(tmp, 70)) continue;
3369 /* Process the given filename */
3370 (void)process_pref_file(tmp);
3373 #ifdef ALLOW_VISUALS
3375 /* Dump monster attr/chars */
3378 static cptr mark = "Monster attr/chars";
3383 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3385 prt("Command: Dump monster attr/chars", 15, 0);
3391 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3393 prt("File: ", 17, 0);
3397 /* Default filename */
3398 sprintf(tmp, "%s.prf", player_name);
3400 /* Get a filename */
3401 if (!askfor_aux(tmp, 70)) continue;
3403 /* Build the filename */
3404 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
3406 /* Append to the file */
3407 fff = open_auto_dump(buf, mark, &line_num);
3412 fprintf(fff, "\n# ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3414 fprintf(fff, "\n# Monster attr/char definitions\n\n");
3419 for (i = 0; i < max_r_idx; i++)
3421 monster_race *r_ptr = &r_info[i];
3423 /* Skip non-entries */
3424 if (!r_ptr->name) continue;
3426 /* Dump a comment */
3427 fprintf(fff, "# %s\n", (r_name + r_ptr->name));
3430 /* Dump the monster attr/char info */
3431 fprintf(fff, "R:%d:0x%02X:0x%02X\n\n", i,
3432 (byte)(r_ptr->x_attr), (byte)(r_ptr->x_char));
3437 close_auto_dump(fff, mark, line_num);
3441 msg_print("¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3443 msg_print("Dumped monster attr/chars.");
3448 /* Dump object attr/chars */
3451 static cptr mark = "Object attr/chars";
3456 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3458 prt("Command: Dump object attr/chars", 15, 0);
3464 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3466 prt("File: ", 17, 0);
3470 /* Default filename */
3471 sprintf(tmp, "%s.prf", player_name);
3473 /* Get a filename */
3474 if (!askfor_aux(tmp, 70)) continue;
3476 /* Build the filename */
3477 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
3479 /* Append to the file */
3480 fff = open_auto_dump(buf, mark, &line_num);
3485 fprintf(fff, "\n# ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3487 fprintf(fff, "\n# Object attr/char definitions\n\n");
3492 for (i = 0; i < max_k_idx; i++)
3494 object_kind *k_ptr = &k_info[i];
3496 /* Skip non-entries */
3497 if (!k_ptr->name) continue;
3499 /* Dump a comment */
3500 fprintf(fff, "# %s\n", (k_name + k_ptr->name));
3503 /* Dump the object attr/char info */
3504 fprintf(fff, "K:%d:0x%02X:0x%02X\n\n", i,
3505 (byte)(k_ptr->x_attr), (byte)(k_ptr->x_char));
3510 close_auto_dump(fff, mark, line_num);
3514 msg_print("¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3516 msg_print("Dumped object attr/chars.");
3521 /* Dump feature attr/chars */
3524 static cptr mark = "Feature attr/chars";
3529 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3531 prt("Command: Dump feature attr/chars", 15, 0);
3537 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3539 prt("File: ", 17, 0);
3543 /* Default filename */
3544 sprintf(tmp, "%s.prf", player_name);
3546 /* Get a filename */
3547 if (!askfor_aux(tmp, 70)) continue;
3549 /* Build the filename */
3550 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
3552 /* Append to the file */
3553 fff = open_auto_dump(buf, mark, &line_num);
3558 fprintf(fff, "\n# ÃÏ·Á¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3560 fprintf(fff, "\n# Feature attr/char definitions\n\n");
3565 for (i = 0; i < max_f_idx; i++)
3567 feature_type *f_ptr = &f_info[i];
3569 /* Skip non-entries */
3570 if (!f_ptr->name) continue;
3572 /* Dump a comment */
3573 fprintf(fff, "# %s\n", (f_name + f_ptr->name));
3576 /* Dump the feature attr/char info */
3577 fprintf(fff, "F:%d:0x%02X:0x%02X\n\n", i,
3578 (byte)(f_ptr->x_attr), (byte)(f_ptr->x_char));
3583 close_auto_dump(fff, mark, line_num);
3587 msg_print("ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3589 msg_print("Dumped feature attr/chars.");
3594 /* Modify monster attr/chars */
3601 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3603 prt("Command: Change monster attr/chars", 15, 0);
3607 /* Hack -- query until done */
3610 monster_race *r_ptr = &r_info[r];
3612 byte da = (r_ptr->d_attr);
3613 byte dc = (r_ptr->d_char);
3614 byte ca = (r_ptr->x_attr);
3615 byte cc = (r_ptr->x_char);
3617 /* Label the object */
3619 Term_putstr(5, 17, -1, TERM_WHITE,
3620 format("¥â¥ó¥¹¥¿¡¼ = %d, ̾Á° = %-40.40s",
3621 r, (r_name + r_ptr->name)));
3623 Term_putstr(5, 17, -1, TERM_WHITE,
3624 format("Monster = %d, Name = %-40.40s",
3625 r, (r_name + r_ptr->name)));
3629 /* Label the Default values */
3631 Term_putstr(10, 19, -1, TERM_WHITE,
3632 format("½é´üÃÍ ¿§ / ʸ»ú = %3u / %3u", da, dc));
3634 Term_putstr(10, 19, -1, TERM_WHITE,
3635 format("Default attr/char = %3u / %3u", da, dc));
3638 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3639 Term_putch(43, 19, da, dc);
3641 /* Label the Current values */
3643 Term_putstr(10, 20, -1, TERM_WHITE,
3644 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3u / %3u", ca, cc));
3646 Term_putstr(10, 20, -1, TERM_WHITE,
3647 format("Current attr/char = %3u / %3u", ca, cc));
3650 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3651 Term_putch(43, 20, ca, cc);
3655 Term_putstr(0, 22, -1, TERM_WHITE,
3656 "¥³¥Þ¥ó¥É (n/N/a/A/c/C): ");
3658 Term_putstr(0, 22, -1, TERM_WHITE,
3659 "Command (n/N/a/A/c/C): ");
3667 if (i == ESCAPE) break;
3670 if (i == 'n') r = (r + max_r_idx + 1) % max_r_idx;
3671 if (i == 'N') r = (r + max_r_idx - 1) % max_r_idx;
3672 if (i == 'a') r_ptr->x_attr = (byte)(ca + 1);
3673 if (i == 'A') r_ptr->x_attr = (byte)(ca - 1);
3674 if (i == 'c') r_ptr->x_char = (byte)(cc + 1);
3675 if (i == 'C') r_ptr->x_char = (byte)(cc - 1);
3679 /* Modify object attr/chars */
3686 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3688 prt("Command: Change object attr/chars", 15, 0);
3692 /* Hack -- query until done */
3695 object_kind *k_ptr = &k_info[k];
3697 byte da = (byte)k_ptr->d_attr;
3698 byte dc = (byte)k_ptr->d_char;
3699 byte ca = (byte)k_ptr->x_attr;
3700 byte cc = (byte)k_ptr->x_char;
3702 /* Label the object */
3704 Term_putstr(5, 17, -1, TERM_WHITE,
3705 format("¥¢¥¤¥Æ¥à = %d, ̾Á° = %-40.40s",
3706 k, (k_name + k_ptr->name)));
3708 Term_putstr(5, 17, -1, TERM_WHITE,
3709 format("Object = %d, Name = %-40.40s",
3710 k, (k_name + k_ptr->name)));
3714 /* Label the Default values */
3716 Term_putstr(10, 19, -1, TERM_WHITE,
3717 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
3719 Term_putstr(10, 19, -1, TERM_WHITE,
3720 format("Default attr/char = %3d / %3d", da, dc));
3723 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3724 Term_putch(43, 19, da, dc);
3726 /* Label the Current values */
3728 Term_putstr(10, 20, -1, TERM_WHITE,
3729 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
3731 Term_putstr(10, 20, -1, TERM_WHITE,
3732 format("Current attr/char = %3d / %3d", ca, cc));
3735 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3736 Term_putch(43, 20, ca, cc);
3740 Term_putstr(0, 22, -1, TERM_WHITE,
3741 "¥³¥Þ¥ó¥É (n/N/a/A/c/C): ");
3743 Term_putstr(0, 22, -1, TERM_WHITE,
3744 "Command (n/N/a/A/c/C): ");
3752 if (i == ESCAPE) break;
3755 if (i == 'n') k = (k + max_k_idx + 1) % max_k_idx;
3756 if (i == 'N') k = (k + max_k_idx - 1) % max_k_idx;
3757 if (i == 'a') k_info[k].x_attr = (byte)(ca + 1);
3758 if (i == 'A') k_info[k].x_attr = (byte)(ca - 1);
3759 if (i == 'c') k_info[k].x_char = (byte)(cc + 1);
3760 if (i == 'C') k_info[k].x_char = (byte)(cc - 1);
3764 /* Modify feature attr/chars */
3771 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3773 prt("Command: Change feature attr/chars", 15, 0);
3777 /* Hack -- query until done */
3780 feature_type *f_ptr = &f_info[f];
3782 byte da = (byte)f_ptr->d_attr;
3783 byte dc = (byte)f_ptr->d_char;
3784 byte ca = (byte)f_ptr->x_attr;
3785 byte cc = (byte)f_ptr->x_char;
3787 /* Label the object */
3789 Term_putstr(5, 17, -1, TERM_WHITE,
3790 format("ÃÏ·Á = %d, ̾Á° = %-40.40s",
3791 f, (f_name + f_ptr->name)));
3793 Term_putstr(5, 17, -1, TERM_WHITE,
3794 format("Terrain = %d, Name = %-40.40s",
3795 f, (f_name + f_ptr->name)));
3799 /* Label the Default values */
3801 Term_putstr(10, 19, -1, TERM_WHITE,
3802 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
3804 Term_putstr(10, 19, -1, TERM_WHITE,
3805 format("Default attr/char = %3d / %3d", da, dc));
3808 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3809 Term_putch(43, 19, da, dc);
3811 /* Label the Current values */
3813 Term_putstr(10, 20, -1, TERM_WHITE,
3814 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
3816 Term_putstr(10, 20, -1, TERM_WHITE,
3817 format("Current attr/char = %3d / %3d", ca, cc));
3820 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3821 Term_putch(43, 20, ca, cc);
3825 Term_putstr(0, 22, -1, TERM_WHITE,
3826 "¥³¥Þ¥ó¥É (n/N/a/A/c/C): ");
3828 Term_putstr(0, 22, -1, TERM_WHITE,
3829 "Command (n/N/a/A/c/C): ");
3837 if (i == ESCAPE) break;
3840 if (i == 'n') f = (f + max_f_idx + 1) % max_f_idx;
3841 if (i == 'N') f = (f + max_f_idx - 1) % max_f_idx;
3842 if (i == 'a') f_info[f].x_attr = (byte)(ca + 1);
3843 if (i == 'A') f_info[f].x_attr = (byte)(ca - 1);
3844 if (i == 'c') f_info[f].x_char = (byte)(cc + 1);
3845 if (i == 'C') f_info[f].x_char = (byte)(cc - 1);
3859 msg_print("²èÌ̾å¤Î[¿§/ʸ»ú]¤ò½é´üÃͤ˥ꥻ¥Ã¥È¤·¤Þ¤·¤¿¡£");
3861 msg_print("Visual attr/char tables reset.");
3866 /* Unknown option */
3872 /* Flush messages */
3877 /* Restore the screen */
3883 * Interact with "colors"
3885 void do_cmd_colors(void)
3896 /* File type is "TEXT" */
3897 FILE_TYPE(FILE_TYPE_TEXT);
3900 /* Save the screen */
3904 /* Interact until done */
3910 /* Ask for a choice */
3912 prt("[ ¥«¥é¡¼¤ÎÀßÄê ]", 2, 0);
3914 prt("Interact with Colors", 2, 0);
3918 /* Give some choices */
3920 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
3922 prt("(1) Load a user pref file", 4, 5);
3927 prt("(2) ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
3928 prt("(3) ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤¹¤ë", 6, 5);
3930 prt("(2) Dump colors", 5, 5);
3931 prt("(3) Modify colors", 6, 5);
3938 prt("¥³¥Þ¥ó¥É: ", 8, 0);
3940 prt("Command: ", 8, 0);
3948 if (i == ESCAPE) break;
3950 /* Load a 'pref' file */
3955 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹", 8, 0);
3957 prt("Command: Load a user pref file", 8, 0);
3963 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
3965 prt("File: ", 10, 0);
3970 sprintf(tmp, "%s.prf", player_name);
3973 if (!askfor_aux(tmp, 70)) continue;
3975 /* Process the given filename */
3976 (void)process_pref_file(tmp);
3978 /* Mega-Hack -- react to changes */
3979 Term_xtra(TERM_XTRA_REACT, 0);
3981 /* Mega-Hack -- redraw */
3990 static cptr mark = "Colors";
3995 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 8, 0);
3997 prt("Command: Dump colors", 8, 0);
4003 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4005 prt("File: ", 10, 0);
4009 /* Default filename */
4010 sprintf(tmp, "%s.prf", player_name);
4012 /* Get a filename */
4013 if (!askfor_aux(tmp, 70)) continue;
4015 /* Build the filename */
4016 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
4018 /* Append to the file */
4019 fff = open_auto_dump(buf, mark, &line_num);
4024 fprintf(fff, "\n# ¥«¥é¡¼¤ÎÀßÄê\n\n");
4026 fprintf(fff, "\n# Color redefinitions\n\n");
4031 for (i = 0; i < 256; i++)
4033 int kv = angband_color_table[i][0];
4034 int rv = angband_color_table[i][1];
4035 int gv = angband_color_table[i][2];
4036 int bv = angband_color_table[i][3];
4041 cptr name = "unknown";
4045 /* Skip non-entries */
4046 if (!kv && !rv && !gv && !bv) continue;
4048 /* Extract the color name */
4049 if (i < 16) name = color_names[i];
4051 /* Dump a comment */
4053 fprintf(fff, "# ¥«¥é¡¼ '%s'\n", name);
4055 fprintf(fff, "# Color '%s'\n", name);
4059 /* Dump the monster attr/char info */
4060 fprintf(fff, "V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n",
4066 close_auto_dump(fff, mark, line_num);
4070 msg_print("¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
4072 msg_print("Dumped color redefinitions.");
4084 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤·¤Þ¤¹", 8, 0);
4086 prt("Command: Modify colors", 8, 0);
4090 /* Hack -- query until done */
4099 /* Exhibit the normal colors */
4100 for (j = 0; j < 16; j++)
4102 /* Exhibit this color */
4103 Term_putstr(j*4, 20, -1, a, "###");
4105 /* Exhibit all colors */
4106 Term_putstr(j*4, 22, -1, j, format("%3d", j));
4109 /* Describe the color */
4111 name = ((a < 16) ? color_names[a] : "̤ÄêµÁ");
4113 name = ((a < 16) ? color_names[a] : "undefined");
4117 /* Describe the color */
4119 Term_putstr(5, 10, -1, TERM_WHITE,
4120 format("¥«¥é¡¼ = %d, ̾Á° = %s", a, name));
4122 Term_putstr(5, 10, -1, TERM_WHITE,
4123 format("Color = %d, Name = %s", a, name));
4127 /* Label the Current values */
4128 Term_putstr(5, 12, -1, TERM_WHITE,
4129 format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x",
4130 angband_color_table[a][0],
4131 angband_color_table[a][1],
4132 angband_color_table[a][2],
4133 angband_color_table[a][3]));
4137 Term_putstr(0, 14, -1, TERM_WHITE,
4138 "¥³¥Þ¥ó¥É (n/N/k/K/r/R/g/G/b/B): ");
4140 Term_putstr(0, 14, -1, TERM_WHITE,
4141 "Command (n/N/k/K/r/R/g/G/b/B): ");
4149 if (i == ESCAPE) break;
4152 if (i == 'n') a = (byte)(a + 1);
4153 if (i == 'N') a = (byte)(a - 1);
4154 if (i == 'k') angband_color_table[a][0] = (byte)(angband_color_table[a][0] + 1);
4155 if (i == 'K') angband_color_table[a][0] = (byte)(angband_color_table[a][0] - 1);
4156 if (i == 'r') angband_color_table[a][1] = (byte)(angband_color_table[a][1] + 1);
4157 if (i == 'R') angband_color_table[a][1] = (byte)(angband_color_table[a][1] - 1);
4158 if (i == 'g') angband_color_table[a][2] = (byte)(angband_color_table[a][2] + 1);
4159 if (i == 'G') angband_color_table[a][2] = (byte)(angband_color_table[a][2] - 1);
4160 if (i == 'b') angband_color_table[a][3] = (byte)(angband_color_table[a][3] + 1);
4161 if (i == 'B') angband_color_table[a][3] = (byte)(angband_color_table[a][3] - 1);
4163 /* Hack -- react to changes */
4164 Term_xtra(TERM_XTRA_REACT, 0);
4166 /* Hack -- redraw */
4173 /* Unknown option */
4179 /* Flush messages */
4184 /* Restore the screen */
4190 * Note something in the message recall
4192 void do_cmd_note(void)
4201 if (!get_string("¥á¥â: ", buf, 60)) return;
4203 if (!get_string("Note: ", buf, 60)) return;
4207 /* Ignore empty notes */
4208 if (!buf[0] || (buf[0] == ' ')) return;
4210 /* Add the note to the message recall */
4212 msg_format("¥á¥â: %s", buf);
4214 msg_format("Note: %s", buf);
4221 * Mention the current version
4223 void do_cmd_version(void)
4227 #ifndef FAKE_VERSION
4228 msg_format("You are playing Angband %d.%d.%d.",
4229 VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH);
4232 msg_format("ÊѶòÈÚÅÜ(Hengband) %d.%d.%d",
4233 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4235 msg_format("You are playing Hengband %d.%d.%d.",
4236 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4246 * Array of feeling strings
4248 static cptr do_cmd_feeling_text[11] =
4251 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4253 "Looks like any other level.",
4257 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4259 "You feel there is something special about this level.",
4263 "¶²¤í¤·¤¤»à¤Î¸¸¤¬ÌܤËÉ⤫¤Ó¡¢µ¤À䤷¤½¤¦¤Ë¤Ê¤Ã¤¿¡ª",
4265 "You nearly faint as horrible visions of death fill your mind!",
4269 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4271 "This level looks very dangerous.",
4275 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4277 "You have a very bad feeling...",
4281 "°¤¤Í½´¶¤¬¤¹¤ë...",
4283 "You have a bad feeling...",
4289 "You feel nervous.",
4293 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4295 "You feel your luck is turning...",
4299 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4301 "You don't like the look of this place.",
4305 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4307 "This level looks reasonably safe.",
4311 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4313 "What a boring place..."
4318 static cptr do_cmd_feeling_text_combat[11] =
4321 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4323 "Looks like any other level.",
4327 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4329 "You feel there is something special about this level.",
4333 "º£Ìë¤â¤Þ¤¿¡¢Ã¯¤«¤¬Ì¿¤òÍî¤È¤¹...",
4335 "You nearly faint as horrible visions of death fill your mind!",
4339 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4341 "This level looks very dangerous.",
4345 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4347 "You have a very bad feeling...",
4351 "°¤¤Í½´¶¤¬¤¹¤ë...",
4353 "You have a bad feeling...",
4359 "You feel nervous.",
4363 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4365 "You feel your luck is turning...",
4369 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4371 "You don't like the look of this place.",
4375 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4377 "This level looks reasonably safe.",
4381 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4383 "What a boring place..."
4388 static cptr do_cmd_feeling_text_lucky[11] =
4391 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4392 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4393 "¤³¤Î³¬¤Ï¤³¤Î¾å¤Ê¤¯ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë¡£",
4394 "ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë...",
4395 "¤È¤Æ¤âÎɤ¤´¶¤¸¤¬¤¹¤ë...",
4396 "Îɤ¤´¶¤¸¤¬¤¹¤ë...",
4397 "¤Á¤ç¤Ã¤È¹¬±¿¤Ê´¶¤¸¤¬¤¹¤ë...",
4398 "¿¾¯¤Ï±¿¤¬¸þ¤¤¤Æ¤¤¿¤«...",
4399 "¸«¤¿´¶¤¸°¤¯¤Ï¤Ê¤¤...",
4400 "Á´Á³ÂÌÌܤȤ¤¤¦¤³¤È¤Ï¤Ê¤¤¤¬...",
4401 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4403 "Looks like any other level.",
4404 "You feel there is something special about this level.",
4405 "You have a superb feeling about this level.",
4406 "You have an excellent feeling...",
4407 "You have a very good feeling...",
4408 "You have a good feeling...",
4409 "You feel strangely lucky...",
4410 "You feel your luck is turning...",
4411 "You like the look of this place...",
4412 "This level can't be all bad...",
4413 "What a boring place..."
4419 * Note that "feeling" is set to zero unless some time has passed.
4420 * Note that this is done when the level is GENERATED, not entered.
4422 void do_cmd_feeling(void)
4424 /* Verify the feeling */
4425 if (feeling > 10) feeling = 10;
4428 if (cmd_feeling_callback(feeling)) return;
4429 #endif /* USE_SCRIPT */
4431 /* No useful feeling in quests */
4432 if (p_ptr->inside_quest && !random_quest_number(dun_level))
4435 msg_print("ŵ·¿Åª¤Ê¥¯¥¨¥¹¥È¤Î¥À¥ó¥¸¥ç¥ó¤Î¤è¤¦¤À¡£");
4437 msg_print("Looks like a typical quest level.");
4443 /* No useful feeling in town */
4444 else if (p_ptr->town_num && !dun_level)
4447 if (!strcmp(town[p_ptr->town_num].name, "¹ÓÌî"))
4449 if (!strcmp(town[p_ptr->town_num].name, "wilderness"))
4453 msg_print("²¿¤«¤¢¤ê¤½¤¦¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4455 msg_print("Looks like a strange wilderness.");
4463 msg_print("ŵ·¿Åª¤ÊÄ®¤Î¤è¤¦¤À¡£");
4465 msg_print("Looks like a typical town.");
4472 /* No useful feeling in the wilderness */
4473 else if (!dun_level)
4476 msg_print("ŵ·¿Åª¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4478 msg_print("Looks like a typical wilderness.");
4484 /* Display the feeling */
4485 if (turn - old_turn >= (3000 - dun_level*20) || cheat_xtra)
4487 if (p_ptr->muta3 & MUT3_GOOD_LUCK) msg_print(do_cmd_feeling_text_lucky[feeling]);
4489 if((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)){
4490 msg_print(do_cmd_feeling_text_combat[feeling]);
4492 msg_print(do_cmd_feeling_text[feeling]);
4497 msg_print(do_cmd_feeling_text[0]);
4506 * Encode the screen colors
4508 static char hack[17] = "dwsorgbuDWvyRGBU";
4511 static errr photo_fgets(FILE *fff, char *buf, huge n)
4520 if (fgets(tmp, 1024, fff))
4522 /* Convert weirdness */
4523 for (s = tmp; *s; s++)
4525 /* Handle newline */
4536 else if (*s == '\t')
4538 /* Hack -- require room */
4539 if (i + 8 >= n) break;
4541 /* Append a space */
4544 /* Append some more spaces */
4545 while (!(i % 8)) buf[i++] = ' ';
4549 else if (iskanji(*s))
4556 /* Ⱦ³Ñ¤«¤Ê¤ËÂбþ */
4557 else if ((((int)*s & 0xff) > 0xa1) && (((int)*s & 0xff ) < 0xdf))
4564 /* Handle printables */
4585 * Hack -- load a screen dump from a file
4587 void do_cmd_load_screen(void)
4601 /* Hack -- drop permissions */
4604 /* Build the filename */
4605 path_build(buf, 1024, ANGBAND_DIR_USER, "dump.txt");
4607 /* Append to the file */
4608 fff = my_fopen(buf, "r");
4613 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
4615 msg_format("Failed to open %s.", buf);
4622 /* Save the screen */
4625 /* Clear the screen */
4629 /* Load the screen */
4630 for (y = 0; okay && (y < 24); y++)
4632 /* Get a line of data */
4633 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
4636 for (x = 0; x < 79; x++)
4638 /* Put the attr/char */
4639 Term_draw(x, y, TERM_WHITE, buf[x]);
4643 /* Get the blank line */
4644 if (my_fgets(fff, buf, 1024)) okay = FALSE;
4647 /* Dump the screen */
4648 for (y = 0; okay && (y < 24); y++)
4650 /* Get a line of data */
4651 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
4654 for (x = 0; x < 79; x++)
4656 /* Get the attr/char */
4657 (void)(Term_what(x, y, &a, &c));
4659 /* Look up the attr */
4660 for (i = 0; i < 16; i++)
4662 /* Use attr matches */
4663 if (hack[i] == buf[x]) a = i;
4666 /* Put the attr/char */
4667 Term_draw(x, y, a, c);
4672 /* Get the blank line */
4673 if (my_fgets(fff, buf, 1024)) okay = FALSE;
4679 /* Hack -- grab permissions */
4685 prt("¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤µ¤ì¤¿²èÌÌ(µÇ°»£±Æ)¤ò¥í¡¼¥É¤·¤Þ¤·¤¿¡£", 0, 0);
4687 msg_print("Screen dump loaded.");
4694 /* Restore the screen */
4701 cptr inven_res_label =
4703 " »ÀÅŲÐÎäÆǸ÷°ÇÇ˹ì¹ö°øÆÙÎô ÌÕÉÝÍðáãÆ©Ì¿´¶¾ÃÉüÉâ";
4705 " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv";
4708 /* XTRA HACK RESLIST */
4709 static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr,
4710 int *j, byte tval, char *where)
4712 char o_name[MAX_NLEN];
4715 if (!o_ptr->k_idx)return;
4716 if (o_ptr->tval != tval)return;
4719 * HACK:Ring of Lordly protection and Dragon shield/helm
4720 * have random resistances.
4722 if ( ((o_ptr->tval >= TV_BOW && o_ptr->tval<= TV_DRAG_ARMOR && o_ptr->name2)
4723 || (o_ptr->tval == TV_RING && o_ptr->sval == SV_RING_LORDLY)
4724 || (o_ptr->tval == TV_SHIELD && o_ptr->sval == SV_DRAGON_SHIELD)
4725 || (o_ptr->tval == TV_HELM && o_ptr->sval == SV_DRAGON_HELM)
4726 || (o_ptr->tval == TV_GLOVES && o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)
4727 || (o_ptr->tval == TV_BOOTS && o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)
4728 || o_ptr->art_name || o_ptr->name1) && object_known_p(o_ptr))
4731 object_desc(o_name, o_ptr, TRUE, 0);
4733 while ( o_name[i] && i < 26 ){
4735 if (iskanji(o_name[i])) i++;
4739 if(i<28) while(i<28){o_name[i]=' ';i++;}
4742 fprintf(fff,"%s %s", where, o_name);
4744 if (!(o_ptr->ident & (IDENT_MENTAL)))
4747 fprintf(fff, "-------ÉÔÌÀ--------------- -------ÉÔÌÀ---------\n");
4749 fprintf(fff, "-------unknown------------ -------unknown------\n");
4753 object_flags_known(o_ptr, &f[0], &f[1], &f[2]);
4756 if (f[1] & TR2_IM_ACID) fprintf(fff,"¡ö");
4757 else if (f[1] & TR2_RES_ACID) fprintf(fff,"¡Ü");
4758 else fprintf(fff,"¡¦");
4760 if (f[1] & TR2_IM_ELEC) fprintf(fff,"¡ö");
4761 else if (f[1] & TR2_RES_ELEC) fprintf(fff,"¡Ü");
4762 else fprintf(fff,"¡¦");
4764 if (f[1] & TR2_IM_FIRE) fprintf(fff,"¡ö");
4765 else if (f[1] & TR2_RES_FIRE) fprintf(fff,"¡Ü");
4766 else fprintf(fff,"¡¦");
4768 if (f[1] & TR2_IM_COLD) fprintf(fff,"¡ö");
4769 else if (f[1] & TR2_RES_COLD) fprintf(fff,"¡Ü");
4770 else fprintf(fff,"¡¦");
4772 if (f[1] & TR2_RES_POIS) fprintf(fff,"¡Ü");
4773 else fprintf(fff,"¡¦");
4775 if (f[1] & TR2_RES_LITE) fprintf(fff,"¡Ü");
4776 else fprintf(fff,"¡¦");
4778 if (f[1] & TR2_RES_DARK) fprintf(fff,"¡Ü");
4779 else fprintf(fff,"¡¦");
4781 if (f[1] & TR2_RES_SHARDS) fprintf(fff,"¡Ü");
4782 else fprintf(fff,"¡¦");
4784 if (f[1] & TR2_RES_SOUND) fprintf(fff,"¡Ü");
4785 else fprintf(fff,"¡¦");
4787 if (f[1] & TR2_RES_NETHER) fprintf(fff,"¡Ü");
4788 else fprintf(fff,"¡¦");
4790 if (f[1] & TR2_RES_NEXUS) fprintf(fff,"¡Ü");
4791 else fprintf(fff,"¡¦");
4793 if (f[1] & TR2_RES_CHAOS) fprintf(fff,"¡Ü");
4794 else fprintf(fff,"¡¦");
4796 if (f[1] & TR2_RES_DISEN) fprintf(fff,"¡Ü");
4797 else fprintf(fff,"¡¦");
4801 if (f[1] & TR2_RES_BLIND) fprintf(fff,"¡Ü");
4802 else fprintf(fff,"¡¦");
4804 if (f[1] & TR2_RES_FEAR) fprintf(fff,"¡Ü");
4805 else fprintf(fff,"¡¦");
4807 if (f[1] & TR2_RES_CONF) fprintf(fff,"¡Ü");
4808 else fprintf(fff,"¡¦");
4810 if (f[1] & TR2_FREE_ACT) fprintf(fff,"¡Ü");
4811 else fprintf(fff,"¡¦");
4813 if (f[2] & TR3_SEE_INVIS) fprintf(fff,"¡Ü");
4814 else fprintf(fff,"¡¦");
4816 if (f[1] & TR2_HOLD_LIFE) fprintf(fff,"¡Ü");
4817 else fprintf(fff,"¡¦");
4819 if (f[2] & TR3_TELEPATHY) fprintf(fff,"¡Ü");
4820 else fprintf(fff,"¡¦");
4822 if (f[2] & TR3_SLOW_DIGEST) fprintf(fff,"¡Ü");
4823 else fprintf(fff,"¡¦");
4826 if (f[2] & TR3_REGEN) fprintf(fff,"¡Ü");
4827 else fprintf(fff,"¡¦");
4829 if (f[2] & TR3_FEATHER) fprintf(fff,"¡Ü");
4830 else fprintf(fff,"¡¦");
4832 if (f[1] & TR2_IM_ACID) fprintf(fff,"* ");
4833 else if (f[1] & TR2_RES_ACID) fprintf(fff,"+ ");
4834 else fprintf(fff,". ");
4836 if (f[1] & TR2_IM_ELEC) fprintf(fff,"* ");
4837 else if (f[1] & TR2_RES_ELEC) fprintf(fff,"+ ");
4838 else fprintf(fff,". ");
4840 if (f[1] & TR2_IM_FIRE) fprintf(fff,"* ");
4841 else if (f[1] & TR2_RES_FIRE) fprintf(fff,"+ ");
4842 else fprintf(fff,". ");
4844 if (f[1] & TR2_IM_COLD) fprintf(fff,"* ");
4845 else if (f[1] & TR2_RES_COLD) fprintf(fff,"+ ");
4846 else fprintf(fff,". ");
4848 if (f[1] & TR2_RES_POIS) fprintf(fff,"+ ");
4849 else fprintf(fff,". ");
4851 if (f[1] & TR2_RES_LITE) fprintf(fff,"+ ");
4852 else fprintf(fff,". ");
4854 if (f[1] & TR2_RES_DARK) fprintf(fff,"+ ");
4855 else fprintf(fff,". ");
4857 if (f[1] & TR2_RES_SHARDS) fprintf(fff,"+ ");
4858 else fprintf(fff,". ");
4860 if (f[1] & TR2_RES_SOUND) fprintf(fff,"+ ");
4861 else fprintf(fff,". ");
4863 if (f[1] & TR2_RES_NETHER) fprintf(fff,"+ ");
4864 else fprintf(fff,". ");
4866 if (f[1] & TR2_RES_NEXUS) fprintf(fff,"+ ");
4867 else fprintf(fff,". ");
4869 if (f[1] & TR2_RES_CHAOS) fprintf(fff,"+ ");
4870 else fprintf(fff,". ");
4872 if (f[1] & TR2_RES_DISEN) fprintf(fff,"+ ");
4873 else fprintf(fff,". ");
4877 if (f[1] & TR2_RES_BLIND) fprintf(fff,"+ ");
4878 else fprintf(fff,". ");
4880 if (f[1] & TR2_RES_FEAR) fprintf(fff,"+ ");
4881 else fprintf(fff,". ");
4883 if (f[1] & TR2_RES_CONF) fprintf(fff,"+ ");
4884 else fprintf(fff,". ");
4886 if (f[1] & TR2_FREE_ACT) fprintf(fff,"+ ");
4887 else fprintf(fff,". ");
4889 if (f[2] & TR3_SEE_INVIS) fprintf(fff,"+ ");
4890 else fprintf(fff,". ");
4892 if (f[1] & TR2_HOLD_LIFE) fprintf(fff,"+ ");
4893 else fprintf(fff,". ");
4895 if (f[2] & TR3_TELEPATHY) fprintf(fff,"+ ");
4896 else fprintf(fff,". ");
4898 if (f[2] & TR3_SLOW_DIGEST) fprintf(fff,"+ ");
4899 else fprintf(fff,". ");
4902 if (f[2] & TR3_REGEN) fprintf(fff,"+ ");
4903 else fprintf(fff,". ");
4905 if (f[2] & TR3_FEATHER) fprintf(fff,"+ ");
4906 else fprintf(fff,". ");
4914 fprintf(fff,"%s\n", inven_res_label);
4920 * Display *ID* ed weapons/armors's resistances
4922 static void do_cmd_knowledge_inven(void)
4927 char file_name[1024];
4938 /* Open a new file */
4939 fff = my_fopen_temp(file_name, 1024);
4942 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
4944 msg_format("Failed to create temporally file %s.", file_name);
4949 fprintf(fff,"%s\n",inven_res_label);
4951 for (tval=TV_BOW; tval <= TV_RING; tval++){
4954 for (;j<9;j++) fprintf(fff, "\n");
4956 fprintf(fff,"%s\n",inven_res_label);
4960 strcpy(where, "Áõ");
4962 strcpy(where, "E ");
4964 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
4966 o_ptr = &inventory[i];
4967 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
4971 strcpy(where, "»ý");
4973 strcpy(where, "I ");
4975 for (i = 0; i < INVEN_PACK; i++)
4977 o_ptr = &inventory[i];
4978 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
4982 /* Print all homes in the different towns */
4983 st_ptr = &town[1].store[STORE_HOME];
4985 strcpy(where, "²È");
4987 strcpy(where, "H ");/*nanka*/
4990 /* Dump all available items */
4991 for (i = 0; i < st_ptr->stock_num; i++)
4993 o_ptr = &st_ptr->stock[i];
4994 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
4998 /* Close the file */
5001 /* Display the file contents */
5003 show_file(TRUE, file_name, "*´ÕÄê*ºÑ¤ßÉð´ï/Ëɶñ¤ÎÂÑÀ¥ê¥¹¥È", 0, 0);
5005 show_file(TRUE, file_name, "Resistances of *identified* equipment", 0, 0);
5008 /* Remove the file */
5013 void do_cmd_save_screen_html_aux(char *filename, int message)
5017 byte a = 0, old_a = 0;
5031 char *html_head[] = {
5032 "<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
5036 char *html_foot[] = {
5038 "</body>\n</html>\n",
5042 /* File type is "TEXT" */
5043 FILE_TYPE(FILE_TYPE_TEXT);
5045 /* Append to the file */
5046 fff = my_fopen(filename, "w");
5052 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", filename);
5054 msg_format("Failed to open file %s.", filename);
5062 /* Save the screen */
5066 /* Build the filename */
5067 path_build(buf, 1024, ANGBAND_DIR_USER, "htmldump.prf");
5068 tmpfff = my_fopen(buf, "r");
5070 for (i = 0; html_head[i]; i++)
5071 fprintf(fff, html_head[i]);
5075 while (!my_fgets(tmpfff, buf, 1024)) {
5077 if (strncmp(buf, tags[0], strlen(tags[0])) == 0)
5081 if (strncmp(buf, tags[1], strlen(tags[1])) == 0)
5083 fprintf(fff, "%s\n", buf);
5088 /* Dump the screen */
5089 for (y = 0; y < 24; y++)
5096 for (x = 0; x < 79; x++)
5100 /* Get the attr/char */
5101 (void)(Term_what(x, y, &a, &c));
5105 case '&': cc = "&"; break;
5106 case '<': cc = "<"; break;
5107 case '>': cc = ">"; break;
5109 case 0x1f: c = '.'; break;
5110 case 0x7f: c = (a == 0x09) ? '%' : '#'; break;
5115 if ((y == 0 && x == 0) || a != old_a) {
5116 rv = angband_color_table[a][1];
5117 gv = angband_color_table[a][2];
5118 bv = angband_color_table[a][3];
5119 fprintf(fff, "%s<font color=\"#%02x%02x%02x\">",
5120 ((y == 0 && x == 0) ? "" : "</font>"), rv, gv, bv);
5124 fprintf(fff, "%s", cc);
5126 fprintf(fff, "%c", c);
5129 fprintf(fff, "</font>");
5132 for (i = 0; html_foot[i]; i++)
5133 fprintf(fff, html_foot[i]);
5138 while (!my_fgets(tmpfff, buf, 1024)) {
5140 if (strncmp(buf, tags[2], strlen(tags[2])) == 0)
5144 if (strncmp(buf, tags[3], strlen(tags[3])) == 0)
5146 fprintf(fff, "%s\n", buf);
5161 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
5163 msg_print("Screen dump saved.");
5168 /* Restore the screen */
5174 * Hack -- save a screen dump to a file
5176 void do_cmd_save_screen_html(void)
5178 char buf[1024], tmp[256] = "screen.html";
5181 if (!get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
5183 if (!get_string("File name: ", tmp, 80))
5187 /* Build the filename */
5188 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
5192 /* Hack -- drop permissions */
5195 do_cmd_save_screen_html_aux(buf, 1);
5197 /* Hack -- grab permissions */
5203 * Redefinable "save_screen" action
5205 void (*screendump_aux)(void) = NULL;
5209 * Hack -- save a screen dump to a file
5211 void do_cmd_save_screen(void)
5214 if (get_check("HTML¤Ç½ÐÎϤ·¤Þ¤¹¤«¡©"))
5216 if (get_check("Save screen dump as HTML? "))
5219 do_cmd_save_screen_html();
5223 /* Do we use a special screendump function ? */
5226 /* Dump the screen to a graphics file */
5227 (*screendump_aux)();
5229 else /* Dump the screen as text */
5241 /* Hack -- drop permissions */
5244 /* Build the filename */
5245 path_build(buf, 1024, ANGBAND_DIR_USER, "dump.txt");
5247 /* File type is "TEXT" */
5248 FILE_TYPE(FILE_TYPE_TEXT);
5250 /* Append to the file */
5251 fff = my_fopen(buf, "w");
5256 /* Hack -- grab permissions */
5259 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
5261 msg_format("Failed to open file %s.", buf);
5268 /* Save the screen */
5272 /* Dump the screen */
5273 for (y = 0; y < 24; y++)
5276 for (x = 0; x < 79; x++)
5278 /* Get the attr/char */
5279 (void)(Term_what(x, y, &a, &c));
5289 fprintf(fff, "%s\n", buf);
5296 /* Dump the screen */
5297 for (y = 0; y < 24; y++)
5300 for (x = 0; x < 79; x++)
5302 /* Get the attr/char */
5303 (void)(Term_what(x, y, &a, &c));
5306 buf[x] = hack[a&0x0F];
5313 fprintf(fff, "%s\n", buf);
5323 /* Hack -- grab permissions */
5328 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
5330 msg_print("Screen dump saved.");
5336 /* Restore the screen */
5343 * Sorting hook -- Comp function -- see below
5345 * We use "u" to point to array of monster indexes,
5346 * and "v" to select the type of sorting to perform on "u".
5348 static bool ang_sort_art_comp(vptr u, vptr v, int a, int b)
5350 u16b *who = (u16b*)(u);
5352 u16b *why = (u16b*)(v);
5360 /* Sort by total kills */
5363 /* Extract total kills */
5364 z1 = a_info[w1].tval;
5365 z2 = a_info[w2].tval;
5367 /* Compare total kills */
5368 if (z1 < z2) return (TRUE);
5369 if (z1 > z2) return (FALSE);
5373 /* Sort by monster level */
5376 /* Extract levels */
5377 z1 = a_info[w1].sval;
5378 z2 = a_info[w2].sval;
5380 /* Compare levels */
5381 if (z1 < z2) return (TRUE);
5382 if (z1 > z2) return (FALSE);
5386 /* Sort by monster experience */
5389 /* Extract experience */
5390 z1 = a_info[w1].level;
5391 z2 = a_info[w2].level;
5393 /* Compare experience */
5394 if (z1 < z2) return (TRUE);
5395 if (z1 > z2) return (FALSE);
5399 /* Compare indexes */
5405 * Sorting hook -- Swap function -- see below
5407 * We use "u" to point to array of monster indexes,
5408 * and "v" to select the type of sorting to perform.
5410 static void ang_sort_art_swap(vptr u, vptr v, int a, int b)
5412 u16b *who = (u16b*)(u);
5424 * Check the status of "artifacts"
5426 void do_cmd_knowledge_artifacts(void)
5428 int i, k, z, x, y, n = 0;
5434 char file_name[1024];
5436 char base_name[MAX_NLEN];
5440 /* Open a new file */
5441 fff = my_fopen_temp(file_name, 1024);
5445 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5447 msg_format("Failed to create temporary file %s.", file_name);
5453 /* Allocate the "who" array */
5454 C_MAKE(who, max_r_idx, s16b);
5456 /* Allocate the "okay" array */
5457 C_MAKE(okay, max_a_idx, bool);
5459 /* Scan the artifacts */
5460 for (k = 0; k < max_a_idx; k++)
5462 artifact_type *a_ptr = &a_info[k];
5467 /* Skip "empty" artifacts */
5468 if (!a_ptr->name) continue;
5470 /* Skip "uncreated" artifacts */
5471 if (!a_ptr->cur_num) continue;
5477 /* Check the dungeon */
5478 for (y = 0; y < cur_hgt; y++)
5480 for (x = 0; x < cur_wid; x++)
5482 cave_type *c_ptr = &cave[y][x];
5484 s16b this_o_idx, next_o_idx = 0;
5486 /* Scan all objects in the grid */
5487 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
5491 /* Acquire object */
5492 o_ptr = &o_list[this_o_idx];
5494 /* Acquire next object */
5495 next_o_idx = o_ptr->next_o_idx;
5497 /* Ignore non-artifacts */
5498 if (!artifact_p(o_ptr)) continue;
5500 /* Ignore known items */
5501 if (object_known_p(o_ptr)) continue;
5503 /* Note the artifact */
5504 okay[o_ptr->name1] = FALSE;
5509 /* Check the inventory and equipment */
5510 for (i = 0; i < INVEN_TOTAL; i++)
5512 object_type *o_ptr = &inventory[i];
5514 /* Ignore non-objects */
5515 if (!o_ptr->k_idx) continue;
5517 /* Ignore non-artifacts */
5518 if (!artifact_p(o_ptr)) continue;
5520 /* Ignore known items */
5521 if (object_known_p(o_ptr)) continue;
5523 /* Note the artifact */
5524 okay[o_ptr->name1] = FALSE;
5527 for (k = 0; k < max_a_idx; k++)
5529 if (okay[k]) who[n++] = k;
5532 /* Select the sort method */
5533 ang_sort_comp = ang_sort_art_comp;
5534 ang_sort_swap = ang_sort_art_swap;
5536 /* Sort the array by dungeon depth of monsters */
5537 ang_sort(who, &why, n);
5539 /* Scan the artifacts */
5540 for (k = 0; k < n; k++)
5542 artifact_type *a_ptr = &a_info[who[k]];
5546 strcpy(base_name, "̤ÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à");
5548 strcpy(base_name, "Unknown Artifact");
5552 /* Obtain the base object type */
5553 z = lookup_kind(a_ptr->tval, a_ptr->sval);
5561 /* Get local object */
5564 /* Create fake object */
5565 object_prep(q_ptr, z);
5567 /* Make it an artifact */
5568 q_ptr->name1 = (byte)who[k];
5570 /* Describe the artifact */
5571 object_desc_store(base_name, q_ptr, FALSE, 0);
5574 /* Hack -- Build the artifact name */
5576 fprintf(fff, " %s\n", base_name);
5578 fprintf(fff, " The %s\n", base_name);
5583 /* Free the "who" array */
5584 C_KILL(who, max_r_idx, s16b);
5586 /* Free the "okay" array */
5587 C_KILL(okay, max_a_idx, bool);
5589 /* Close the file */
5592 /* Display the file contents */
5594 show_file(TRUE, file_name, "´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à", 0, 0);
5596 show_file(TRUE, file_name, "Artifacts Seen", 0, 0);
5600 /* Remove the file */
5606 * Display known uniques
5608 static void do_cmd_knowledge_uniques(void)
5616 char file_name[1024];
5618 /* Open a new file */
5619 fff = my_fopen_temp(file_name, 1024);
5623 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5625 msg_format("Failed to create temporary file %s.", file_name);
5631 /* Allocate the "who" array */
5632 C_MAKE(who, max_r_idx, s16b);
5634 /* Scan the monsters */
5635 for (i = 1; i < max_r_idx; i++)
5637 monster_race *r_ptr = &r_info[i];
5639 /* Use that monster */
5640 if (r_ptr->name) who[n++] = i;
5643 /* Select the sort method */
5644 ang_sort_comp = ang_sort_comp_hook;
5645 ang_sort_swap = ang_sort_swap_hook;
5647 /* Sort the array by dungeon depth of monsters */
5648 ang_sort(who, &why, n);
5650 /* Scan the monster races */
5651 for (k = 0; k < n; k++)
5653 monster_race *r_ptr = &r_info[who[k]];
5655 /* Only print Uniques */
5656 if (r_ptr->flags1 & (RF1_UNIQUE))
5658 bool dead = (r_ptr->max_num == 0);
5662 /* Only display "known" uniques */
5663 if (dead || cheat_know || r_ptr->r_sights)
5665 /* Print a message */
5667 fprintf(fff, " %s¤Ï¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¡£\n",
5668 (r_name + r_ptr->name));
5670 fprintf(fff, " %s is alive\n",
5671 (r_name + r_ptr->name));
5678 /* Free the "who" array */
5679 C_KILL(who, max_r_idx, s16b);
5681 /* Close the file */
5684 /* Display the file contents */
5686 show_file(TRUE, file_name, "¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
5688 show_file(TRUE, file_name, "Alive Uniques", 0, 0);
5692 /* Remove the file */
5698 * Display dead uniques
5700 static void do_cmd_knowledge_uniques_dead(void)
5708 char file_name[1024];
5710 /* Open a new file */
5711 fff = my_fopen_temp(file_name, 1024);
5715 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5717 msg_format("Failed to create temporary file %s.", file_name);
5723 /* Allocate the "who" array */
5724 C_MAKE(who, max_r_idx, s16b);
5726 /* Scan the monsters */
5727 for (i = 1; i < max_r_idx; i++)
5729 monster_race *r_ptr = &r_info[i];
5731 /* Use that monster */
5732 if (r_ptr->name) who[n++] = i;
5735 /* Select the sort method */
5736 ang_sort_comp = ang_sort_comp_hook;
5737 ang_sort_swap = ang_sort_swap_hook;
5739 /* Sort the array by dungeon depth of monsters */
5740 ang_sort(who, &why, n);
5742 /* Scan the monster races */
5743 for (k = 0; k < n; k++)
5745 monster_race *r_ptr = &r_info[who[k]];
5747 /* Only print Uniques */
5748 if (r_ptr->flags1 & (RF1_UNIQUE))
5750 bool dead = (r_ptr->max_num == 0);
5752 if (!dead) continue;
5754 /* Only display "known" uniques */
5755 if (dead || cheat_know || r_ptr->r_sights)
5757 /* Print a message */
5759 fprintf(fff, " %s¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡£\n",
5760 (r_name + r_ptr->name));
5762 fprintf(fff, " %s is dead\n",
5763 (r_name + r_ptr->name));
5770 /* Free the "who" array */
5771 C_KILL(who, max_r_idx, s16b);
5773 /* Close the file */
5776 /* Display the file contents */
5778 show_file(TRUE, file_name, "Åݤ·¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
5780 show_file(TRUE, file_name, "Dead Uniques", 0, 0);
5784 /* Remove the file */
5790 * Display weapon-exp
5792 static void do_cmd_knowledge_weapon_exp(void)
5794 int i,j, num, shougou;
5798 char file_name[1024];
5801 /* Open a new file */
5802 fff = my_fopen_temp(file_name, 1024);
5805 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5807 msg_format("Failed to create temporary file %s.", file_name);
5813 for(i = 0; i < 5; i++)
5815 for (num = 0; num < 64; num++)
5817 for (j = 0; j < max_k_idx; j++)
5819 object_kind *k_ptr = &k_info[j];
5821 if ((k_ptr->tval == TV_SWORD-i) && (k_ptr->sval == num))
5823 if((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON)) continue;
5825 if(weapon_exp[4-i][num]<4000) shougou=0;
5826 else if(weapon_exp[4-i][num]<6000) shougou=1;
5827 else if(weapon_exp[4-i][num]<7000) shougou=2;
5828 else if(weapon_exp[4-i][num]<8000) shougou=3;
5831 fprintf(fff,"%-25s ",tmp);
5832 if (weapon_exp[4-i][num] >= s_info[p_ptr->pclass].w_max[4-i][num]) fprintf(fff,"!");
5833 else fprintf(fff," ");
5834 fprintf(fff,"%s",shougou_moji[shougou]);
5835 if (cheat_xtra) fprintf(fff," %d",weapon_exp[4-i][num]);
5843 /* Close the file */
5846 /* Display the file contents */
5848 show_file(TRUE, file_name, "Éð´ï¤Î·Ð¸³ÃÍ", 0, 0);
5850 show_file(TRUE, file_name, "Weapon Proficiency", 0, 0);
5854 /* Remove the file */
5862 static void do_cmd_knowledge_spell_exp(void)
5869 char file_name[1024];
5871 /* Open a new file */
5872 fff = my_fopen_temp(file_name, 1024);
5875 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5877 msg_format("Failed to create temporary file %s.", file_name);
5883 if(p_ptr->realm1 != REALM_NONE)
5886 fprintf(fff,"%s¤ÎËâË¡½ñ\n",realm_names[p_ptr->realm1]);
5888 fprintf(fff,"%s Spellbook\n",realm_names[p_ptr->realm1]);
5890 for (i = 0; i < 32; i++)
5892 if (!is_magic(p_ptr->realm1))
5894 s_ptr = &technic_info[p_ptr->realm1 - MIN_TECHNIC - 1][i];
5898 s_ptr = &mp_ptr->info[p_ptr->realm1 - 1][i];
5900 if(s_ptr->slevel == 99) continue;
5901 if(spell_exp[i]<900) shougou=0;
5902 else if(spell_exp[i]<1200) shougou=1;
5903 else if(spell_exp[i]<1400) shougou=2;
5904 else if(spell_exp[i]<1600) shougou=3;
5906 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm1)-1][i]);
5907 if (p_ptr->realm1 == REALM_HISSATSU)
5908 fprintf(fff,"[--]");
5911 if (shougou == 4) fprintf(fff,"!");
5912 else fprintf(fff," ");
5913 fprintf(fff,"%s",shougou_moji[shougou]);
5915 if (cheat_xtra) fprintf(fff," %d",spell_exp[i]);
5920 if(p_ptr->realm2 != REALM_NONE)
5922 fprintf(fff,"\n%s Spellbook\n",realm_names[p_ptr->realm2]);
5923 for (i = 0; i < 32; i++)
5925 if (!is_magic(p_ptr->realm1))
5927 s_ptr = &technic_info[p_ptr->realm2 - MIN_TECHNIC - 1][i];
5931 s_ptr = &mp_ptr->info[p_ptr->realm2 - 1][i];
5933 if(s_ptr->slevel == 99) continue;
5935 if(spell_exp[i+32]<900) shougou=0;
5936 else if(spell_exp[i+32]<1200) shougou=1;
5937 else if(spell_exp[i+32]<1400) shougou=2;
5939 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm2)-1][i]);
5940 if (shougou == 3) fprintf(fff,"!");
5941 else fprintf(fff," ");
5942 fprintf(fff,"%s",shougou_moji[shougou]);
5943 if (cheat_xtra) fprintf(fff," %d",spell_exp[i+32]);
5948 /* Close the file */
5951 /* Display the file contents */
5953 show_file(TRUE, file_name, "ËâË¡¤Î·Ð¸³ÃÍ", 0, 0);
5955 show_file(TRUE, file_name, "Spell Proficiency", 0, 0);
5959 /* Remove the file */
5967 static void do_cmd_knowledge_skill_exp(void)
5973 char file_name[1024];
5975 char skill_name[3][17]={"¥Þ¡¼¥·¥ã¥ë¥¢¡¼¥Ä", "ÆóÅáή ", "¾èÇÏ "};
5977 char skill_name[3][20]={"Martial Arts ", "Dual Wielding ", "Riding "};
5980 /* Open a new file */
5981 fff = my_fopen_temp(file_name, 1024);
5984 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5986 msg_format("Failed to create temporary file %s.", file_name);
5992 for (i = 0; i < 3; i++)
5994 if(i == GINOU_RIDING)
5996 if(skill_exp[i]<500) shougou=0;
5997 else if(skill_exp[i]<2000) shougou=1;
5998 else if(skill_exp[i]<5000) shougou=2;
5999 else if(skill_exp[i]<8000) shougou=3;
6004 if(skill_exp[i]<4000) shougou=0;
6005 else if(skill_exp[i]<6000) shougou=1;
6006 else if(skill_exp[i]<7000) shougou=2;
6007 else if(skill_exp[i]<8000) shougou=3;
6010 fprintf(fff,"%-20s ",skill_name[i]);
6011 if (skill_exp[i] == s_info[p_ptr->pclass].s_max[i]) fprintf(fff,"!");
6012 else fprintf(fff," ");
6013 fprintf(fff,"%s",shougou_moji[shougou]);
6014 if (cheat_xtra) fprintf(fff," %d",skill_exp[i]);
6018 /* Close the file */
6021 /* Display the file contents */
6023 show_file(TRUE, file_name, "µ»Ç½¤Î·Ð¸³ÃÍ", 0, 0);
6025 show_file(TRUE, file_name, "Miscellaneous Proficiency", 0, 0);
6029 /* Remove the file */
6035 * Pluralize a monster name
6037 void plural_aux(char *Name)
6039 int NameLen = strlen(Name);
6041 if (strstr(Name, "Disembodied hand"))
6043 strcpy(Name, "Disembodied hands that strangled people");
6045 else if (strstr(Name, "Colour out of space"))
6047 strcpy(Name, "Colours out of space");
6049 else if (strstr(Name, "stairway to hell"))
6051 strcpy(Name, "stairways to hell");
6053 else if (strstr(Name, "Dweller on the threshold"))
6055 strcpy(Name, "Dwellers on the threshold");
6057 else if (strstr(Name, " of "))
6059 cptr aider = strstr(Name, " of ");
6070 if (dummy[i-1] == 's')
6072 strcpy(&(dummy[i]), "es");
6077 strcpy(&(dummy[i]), "s");
6080 strcpy(&(dummy[i+1]), aider);
6081 strcpy(Name, dummy);
6083 else if (strstr(Name, "coins"))
6086 strcpy(dummy, "piles of ");
6087 strcat(dummy, Name);
6088 strcpy(Name, dummy);
6091 else if (strstr(Name, "Manes"))
6095 else if (streq(&(Name[NameLen - 2]), "ey"))
6097 strcpy(&(Name[NameLen - 2]), "eys");
6099 else if (Name[NameLen - 1] == 'y')
6101 strcpy(&(Name[NameLen - 1]), "ies");
6103 else if (streq(&(Name[NameLen - 4]), "ouse"))
6105 strcpy(&(Name[NameLen - 4]), "ice");
6107 else if (streq(&(Name[NameLen - 2]), "us"))
6109 strcpy(&(Name[NameLen - 2]), "i");
6111 else if (streq(&(Name[NameLen - 6]), "kelman"))
6113 strcpy(&(Name[NameLen - 6]), "kelmen");
6115 else if (streq(&(Name[NameLen - 8]), "wordsman"))
6117 strcpy(&(Name[NameLen - 8]), "wordsmen");
6119 else if (streq(&(Name[NameLen - 7]), "oodsman"))
6121 strcpy(&(Name[NameLen - 7]), "oodsmen");
6123 else if (streq(&(Name[NameLen - 7]), "eastman"))
6125 strcpy(&(Name[NameLen - 7]), "eastmen");
6127 else if (streq(&(Name[NameLen - 8]), "izardman"))
6129 strcpy(&(Name[NameLen - 8]), "izardmen");
6131 else if (streq(&(Name[NameLen - 5]), "geist"))
6133 strcpy(&(Name[NameLen - 5]), "geister");
6135 else if (streq(&(Name[NameLen - 2]), "ex"))
6137 strcpy(&(Name[NameLen - 2]), "ices");
6139 else if (streq(&(Name[NameLen - 2]), "lf"))
6141 strcpy(&(Name[NameLen - 2]), "lves");
6143 else if (suffix(Name, "ch") ||
6144 suffix(Name, "sh") ||
6145 suffix(Name, "nx") ||
6146 suffix(Name, "s") ||
6149 strcpy(&(Name[NameLen]), "es");
6153 strcpy(&(Name[NameLen]), "s");
6158 * Display current pets
6160 static void do_cmd_knowledge_pets(void)
6164 monster_type *m_ptr;
6166 int show_upkeep = 0;
6167 char file_name[1024];
6170 /* Open a new file */
6171 fff = my_fopen_temp(file_name, 1024);
6174 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6176 msg_format("Failed to create temporary file %s.", file_name);
6182 /* Process the monsters (backwards) */
6183 for (i = m_max - 1; i >= 1; i--)
6185 monster_race *r_ptr;
6186 /* Access the monster */
6189 /* Ignore "dead" monsters */
6190 if (!m_ptr->r_idx) continue;
6191 r_ptr = &r_info[m_ptr->r_idx];
6193 /* Calculate "upkeep" for pets */
6198 monster_desc(pet_name, m_ptr, 0x88);
6199 fprintf(fff, "%s (%s)", pet_name, look_mon_desc(i));
6200 if (p_ptr->riding == i)
6202 fprintf(fff, " ¾èÇÏÃæ");
6204 fprintf(fff, " Riding");
6210 show_upkeep = calculate_upkeep();
6212 fprintf(fff, "----------------------------------------------\n");
6214 fprintf(fff, " ¹ç·×: %d ɤ¤Î¥Ú¥Ã¥È\n", t_friends);
6215 fprintf(fff, " °Ý»ý¥³¥¹¥È: %d%% MP\n", show_upkeep);
6217 fprintf(fff, " Total: %d pet%s.\n",
6218 t_friends, (t_friends == 1 ? "" : "s"));
6219 fprintf(fff, " Upkeep: %d%% mana.\n", show_upkeep);
6224 /* Close the file */
6227 /* Display the file contents */
6229 show_file(TRUE, file_name, "¸½ºß¤Î¥Ú¥Ã¥È", 0, 0);
6231 show_file(TRUE, file_name, "Current Pets", 0, 0);
6235 /* Remove the file */
6243 * Note that the player ghosts are ignored. XXX XXX XXX
6245 static void do_cmd_knowledge_kill_count(void)
6253 char file_name[1024];
6258 /* Open a new file */
6259 fff = my_fopen_temp(file_name, 1024);
6263 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6265 msg_format("Failed to create temporary file %s.", file_name);
6271 /* Allocate the "who" array */
6272 C_MAKE(who, max_r_idx, s16b);
6275 /* Monsters slain */
6278 for (kk = 1; kk < max_r_idx; kk++)
6280 monster_race *r_ptr = &r_info[kk];
6282 if (r_ptr->flags1 & (RF1_UNIQUE))
6284 bool dead = (r_ptr->max_num == 0);
6293 s16b This = r_ptr->r_pkills;
6304 fprintf(fff,"¤¢¤Ê¤¿¤Ï¤Þ¤ÀŨ¤òÅݤ·¤Æ¤¤¤Ê¤¤¡£\n\n");
6306 fprintf(fff,"You have defeated no enemies yet.\n\n");
6309 else if (Total == 1)
6311 fprintf(fff,"¤¢¤Ê¤¿¤Ï°ìɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n");
6313 fprintf(fff,"You have defeated one enemy.\n\n");
6318 fprintf(fff,"¤¢¤Ê¤¿¤Ï %lu ɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n", Total);
6320 fprintf(fff,"You have defeated %lu enemies.\n\n", Total);
6327 /* Scan the monsters */
6328 for (i = 1; i < max_r_idx; i++)
6330 monster_race *r_ptr = &r_info[i];
6332 /* Use that monster */
6333 if (r_ptr->name) who[n++] = i;
6336 /* Select the sort method */
6337 ang_sort_comp = ang_sort_comp_hook;
6338 ang_sort_swap = ang_sort_swap_hook;
6340 /* Sort the array by dungeon depth of monsters */
6341 ang_sort(who, &why, n);
6343 /* Scan the monster races */
6344 for (k = 0; k < n; k++)
6346 monster_race *r_ptr = &r_info[who[k]];
6348 if (r_ptr->flags1 & (RF1_UNIQUE))
6350 bool dead = (r_ptr->max_num == 0);
6354 /* Print a message */
6355 fprintf(fff, " %s\n",
6356 (r_name + r_ptr->name));
6362 s16b This = r_ptr->r_pkills;
6367 /* p,t¤Ï¿Í¤È¿ô¤¨¤ë by ita*/
6368 if(strchr("pt",r_ptr->d_char))
6369 fprintf(fff, " %3d ¿Í¤Î %s\n", This, r_name + r_ptr->name);
6371 fprintf(fff, " %3d ɤ¤Î %s\n", This, r_name + r_ptr->name);
6375 if (strstr(r_name + r_ptr->name, "coins"))
6377 fprintf(fff, " 1 pile of %s\n", (r_name + r_ptr->name));
6381 fprintf(fff, " 1 %s\n", (r_name + r_ptr->name));
6387 strcpy(ToPlural, (r_name + r_ptr->name));
6388 plural_aux(ToPlural);
6389 fprintf(fff, " %d %s\n", This, ToPlural);
6399 fprintf(fff,"----------------------------------------------\n");
6401 fprintf(fff," ¹ç·×: %lu ɤ¤òÅݤ·¤¿¡£\n", Total);
6403 fprintf(fff," Total: %lu creature%s killed.\n",
6404 Total, (Total == 1 ? "" : "s"));
6408 /* Free the "who" array */
6409 C_KILL(who, max_r_idx, s16b);
6411 /* Close the file */
6414 /* Display the file contents */
6416 show_file(TRUE, file_name, "Åݤ·¤¿Å¨¤Î¿ô", 0, 0);
6418 show_file(TRUE, file_name, "Kill Count", 0, 0);
6422 /* Remove the file */
6428 * Display known objects
6430 static void do_cmd_knowledge_objects(void)
6436 char o_name[MAX_NLEN];
6438 char file_name[1024];
6441 /* Open a new file */
6442 fff = my_fopen_temp(file_name, 1024);
6445 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6447 msg_format("Failed to create temporary file %s.", file_name);
6453 /* Scan the object kinds */
6454 for (k = 1; k < max_k_idx; k++)
6456 object_kind *k_ptr = &k_info[k];
6458 /* Hack -- skip artifacts */
6459 if (k_ptr->flags3 & (TR3_INSTA_ART)) continue;
6461 /* List known flavored objects */
6462 if (k_ptr->flavor && k_ptr->aware)
6465 object_type object_type_body;
6467 /* Get local object */
6468 i_ptr = &object_type_body;
6470 /* Create fake object */
6471 object_prep(i_ptr, k);
6473 /* Describe the object */
6474 object_desc_store(o_name, i_ptr, FALSE, 0);
6476 /* Print a message */
6477 fprintf(fff, " %s\n", o_name);
6481 /* Close the file */
6484 /* Display the file contents */
6486 show_file(TRUE, file_name, "´ûÃΤΥ¢¥¤¥Æ¥à", 0, 0);
6488 show_file(TRUE, file_name, "Known Objects", 0, 0);
6492 /* Remove the file */
6498 * List virtues & status
6501 void do_cmd_knowledge_kubi(void)
6506 char file_name[1024];
6509 /* Open a new file */
6510 fff = my_fopen_temp(file_name, 1024);
6513 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6515 msg_format("Failed to create temporary file %s.", file_name);
6524 fprintf(fff, "º£Æü¤Î¥¿¡¼¥²¥Ã¥È : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "ÉÔÌÀ"));
6526 fprintf(fff, "¾Þ¶â¼ó¥ê¥¹¥È\n");
6528 fprintf(fff, "Today target : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "unknown"));
6530 fprintf(fff, "List of wanted monsters\n");
6532 for (i = 0; i < MAX_KUBI; i++)
6534 fprintf(fff,"%-40s ---- ",r_name + r_info[(kubi_r_idx[i] > 10000 ? kubi_r_idx[i] - 10000 : kubi_r_idx[i])].name);
6535 if (kubi_r_idx[i] > 10000)
6537 fprintf(fff, "ºÑ\n");
6539 fprintf(fff, "done\n");
6542 fprintf(fff, "$%d\n", 300 * (r_info[kubi_r_idx[i]].level + 1));
6546 /* Close the file */
6549 /* Display the file contents */
6551 show_file(TRUE, file_name, "¾Þ¶â¼ó¤Î°ìÍ÷", 0, 0);
6553 show_file(TRUE, file_name, "Wanted monsters", 0, 0);
6557 /* Remove the file */
6562 * List virtues & status
6565 void do_cmd_knowledge_virtues(void)
6569 char file_name[1024];
6572 /* Open a new file */
6573 fff = my_fopen_temp(file_name, 1024);
6576 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6578 msg_format("Failed to create temporary file %s.", file_name);
6587 fprintf(fff, "¸½ºß¤Î°À : %s\n\n", your_alignment());
6589 fprintf(fff, "Your alighnment : %s\n\n", your_alignment());
6594 /* Close the file */
6597 /* Display the file contents */
6599 show_file(TRUE, file_name, "Ȭ¤Ä¤ÎÆÁ", 0, 0);
6601 show_file(TRUE, file_name, "Virtues", 0, 0);
6605 /* Remove the file */
6613 void do_cmd_knowledge_dungeon(void)
6617 char file_name[1024];
6621 /* Open a new file */
6622 fff = my_fopen_temp(file_name, 1024);
6625 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6627 msg_format("Failed to create temporary file %s.", file_name);
6635 for (i = 1; i < max_d_idx; i++)
6639 if (!d_info[i].maxdepth) continue;
6640 if (!max_dlv[i]) continue;
6641 if (d_info[i].final_guardian)
6643 if (!r_info[d_info[i].final_guardian].max_num) seiha = TRUE;
6645 else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
6647 fprintf(fff,"%c%-12s : %3d ³¬\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
6649 fprintf(fff,"%c%-16s : level %3d\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
6654 /* Close the file */
6657 /* Display the file contents */
6659 show_file(TRUE, file_name, "º£¤Þ¤Ç¤ËÆþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó", 0, 0);
6661 show_file(TRUE, file_name, "Dungeon", 0, 0);
6665 /* Remove the file */
6670 * List virtues & status
6673 static void do_cmd_knowledge_stat(void)
6677 char file_name[1024];
6680 /* Open a new file */
6681 fff = my_fopen_temp(file_name, 1024);
6684 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6686 msg_format("Failed to create temporary file %s.", file_name);
6694 percent = (int)(((long)player_hp[PY_MAX_LEVEL - 1] * 200L) /
6695 (2 * p_ptr->hitdie +
6696 ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
6699 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : %d/100\n\n", percent);
6700 else fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : ???\n\n");
6701 fprintf(fff, "ǽÎϤκÇÂçÃÍ\n\n");
6703 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "Your current Life Rating is %d/100.\n\n", percent);
6704 else fprintf(fff, "Your current Life Rating is ???.\n\n");
6705 fprintf(fff, "Limits of maximum stats\n\n");
6707 for (v_nr = 0; v_nr < 6; v_nr++)
6709 if ((p_ptr->knowledge & KNOW_STAT) || p_ptr->stat_max[v_nr] == p_ptr->stat_max_max[v_nr]) fprintf(fff, "%s 18/%d\n", stat_names[v_nr], p_ptr->stat_max_max[v_nr]-18);
6710 else fprintf(fff, "%s ???\n", stat_names[v_nr]);
6716 /* Close the file */
6719 /* Display the file contents */
6721 show_file(TRUE, file_name, "¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó", 0, 0);
6723 show_file(TRUE, file_name, "HP-rate & Max stat", 0, 0);
6727 /* Remove the file */
6732 * Print quest status of all active quests
6734 static void do_cmd_knowledge_quests(void)
6737 char file_name[1024];
6739 char rand_tmp_str[120] = "\0";
6741 monster_race *r_ptr;
6743 int rand_level = 100;
6746 /* Open a new file */
6747 fff = my_fopen_temp(file_name, 1024);
6750 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6752 msg_format("Failed to create temporary file %s.", file_name);
6759 fprintf(fff, "¡Ô¿ë¹ÔÃæ¤Î¥¯¥¨¥¹¥È¡Õ\n");
6761 fprintf(fff, "< Current Quest >\n");
6764 for (i = 1; i < max_quests; i++)
6766 /* No info from "silent" quests */
6767 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
6769 if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_COMPLETED)
6774 /* Clear the text */
6775 for (j = 0; j < 10; j++)
6777 quest_text[j][0] = '\0';
6780 quest_text_line = 0;
6784 /* Set the quest number temporary */
6785 old_quest = p_ptr->inside_quest;
6786 p_ptr->inside_quest = i;
6788 /* Get the quest text */
6789 init_flags = INIT_SHOW_TEXT;
6791 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
6793 /* Reset the old quest number */
6794 p_ptr->inside_quest = old_quest;
6796 if (quest[i].type != QUEST_TYPE_RANDOM)
6798 char note[80] = "\0";
6800 if (quest[i].status == QUEST_STATUS_TAKEN)
6802 if (quest[i].type == QUEST_TYPE_KILL_LEVEL || quest[i].type == QUEST_TYPE_KILL_ANY_LEVEL)
6804 r_ptr = &r_info[quest[i].r_idx];
6805 strcpy(name, r_name + r_ptr->name);
6806 if (quest[i].max_num > 1)
6809 sprintf(note," - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
6812 sprintf(note," - kill %d %s, have killed %d.",quest[i].max_num, name, quest[i].cur_num);
6817 sprintf(note," - %s¤òÅݤ¹¡£",name);
6819 sprintf(note," - kill %s.",name);
6822 else if (quest[i].type == QUEST_TYPE_KILL_NUMBER)
6825 sprintf(note," - %d ÂΤΥâ¥ó¥¹¥¿¡¼¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, quest[i].max_num-quest[i].cur_num);
6827 sprintf(note," - Kill %d monsters, have killed %d.",quest[i].max_num, quest[i].cur_num);
6830 else if (quest[i].type == QUEST_TYPE_FIND_ARTIFACT)
6832 strcpy(name, a_name + a_info[quest[i].k_idx].name);
6834 sprintf(note," - %s¤ò¸«¤Ä¤±½Ð¤¹¡£", name);
6836 sprintf(note," - Find out %s.", name);
6839 else if (quest[i].type == QUEST_TYPE_FIND_EXIT)
6841 sprintf(note," - õº÷¤¹¤ë¡£");
6843 sprintf(note," - Search.");
6845 else if (quest[i].type == QUEST_TYPE_KILL_ALL)
6847 sprintf(note," - Á´¤Æ¤Î¥â¥ó¥¹¥¿¡¼¤òÅݤ¹¡£");
6849 sprintf(note," - Kill all monsters.");
6853 /* Print the quest info */
6855 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö)%s\n",
6857 sprintf(tmp_str, "%s (Danger level: %d)%s\n",
6860 quest[i].name, quest[i].level, note);
6862 fprintf(fff, tmp_str);
6864 if (quest[i].status == QUEST_STATUS_COMPLETED)
6867 sprintf(tmp_str, " ¥¯¥¨¥¹¥ÈãÀ® - ¤Þ¤ÀÊó½·¤ò¼õ¤±¤È¤Ã¤Æ¤Ê¤¤¡£\n");
6869 sprintf(tmp_str, " Quest Completed - Unrewarded\n");
6873 fprintf(fff, tmp_str);
6879 while (quest_text[j][0] && j < 10)
6881 fprintf(fff, " %s\n", quest_text[j]);
6886 else if ((quest[i].type == QUEST_TYPE_RANDOM) &&
6887 (quest[i].level < rand_level))
6890 rand_level = quest[i].level;
6892 if (max_dlv[DUNGEON_ANGBAND] >= rand_level)
6894 /* Print the quest info */
6895 r_ptr = &r_info[quest[i].r_idx];
6896 strcpy(name, r_name + r_ptr->name);
6898 if (quest[i].max_num > 1)
6901 sprintf(rand_tmp_str,"%s (%d ³¬) - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)\n",
6902 quest[i].name, quest[i].level,
6903 quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
6907 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %d %s, have killed %d.\n",
6908 quest[i].name, quest[i].level,
6909 quest[i].max_num, name, quest[i].cur_num);
6916 sprintf(rand_tmp_str,"%s (%d ³¬) - %s¤òÅݤ¹¡£\n",
6918 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %s.\n",
6921 quest[i].name, quest[i].level, name);
6928 /* Print the current random quest */
6929 if (rand_tmp_str[0]) fprintf(fff, rand_tmp_str);
6932 if (!total) fprintf(fff, "¤Ê¤·\n");
6934 if (!total) fprintf(fff, "Nothing.\n");
6938 fprintf(fff, "\n¡ÔãÀ®¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
6940 fprintf(fff, "\n< Completed Quest >\n");
6943 for (i = 1; i < max_quests; i++)
6945 /* No info from "silent" quests */
6946 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
6948 if (quest[i].status == QUEST_STATUS_FINISHED)
6954 if (i < MIN_RANDOM_QUEST)
6956 /* Set the quest number temporary */
6957 old_quest = p_ptr->inside_quest;
6958 p_ptr->inside_quest = i;
6961 init_flags = INIT_ASSIGN;
6963 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
6965 /* Reset the old quest number */
6966 p_ptr->inside_quest = old_quest;
6969 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
6971 /* Print the quest info */
6973 sprintf(tmp_str, "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
6975 sprintf(tmp_str, "%s (Dungeon level: %d) - level %d\n",
6978 r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev);
6982 /* Print the quest info */
6984 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
6986 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
6989 quest[i].name, quest[i].level, quest[i].complev);
6992 fprintf(fff, tmp_str);
6996 if (!total) fprintf(fff, "¤Ê¤·\n");
6998 if (!total) fprintf(fff, "Nothing.\n");
7002 fprintf(fff, "\n¡Ô¼ºÇÔ¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
7004 fprintf(fff, "\n< Failed Quest >\n");
7007 for (i = 1; i < max_quests; i++)
7009 /* No info from "silent" quests */
7010 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7012 if ((quest[i].status == QUEST_STATUS_FAILED_DONE) || (quest[i].status == QUEST_STATUS_FAILED))
7018 if (i < MIN_RANDOM_QUEST)
7020 /* Set the quest number temporary */
7021 old_quest = p_ptr->inside_quest;
7022 p_ptr->inside_quest = i;
7024 /* Get the quest text */
7025 init_flags = INIT_ASSIGN;
7027 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
7029 /* Reset the old quest number */
7030 p_ptr->inside_quest = old_quest;
7033 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
7035 /* Print the quest info */
7037 sprintf(tmp_str, "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
7039 sprintf(tmp_str, "%s (Dungeon level: %d) - level %d\n",
7042 r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev);
7046 /* Print the quest info */
7048 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
7050 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
7053 quest[i].name, quest[i].level, quest[i].complev);
7055 fprintf(fff, tmp_str);
7059 if (!total) fprintf(fff, "¤Ê¤·\n");
7061 if (!total) fprintf(fff, "Nothing.\n");
7066 fprintf(fff, "\n¡Ô»Ä¤ê¤Î¥é¥ó¥À¥à¥¯¥¨¥¹¥È¡Õ\n");
7068 fprintf(fff, "\n< Remaining Random Quest >\n");
7071 for (i = 1; i < max_quests; i++)
7073 /* No info from "silent" quests */
7074 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7076 if ((quest[i].type == QUEST_TYPE_RANDOM) && (quest[i].status == QUEST_STATUS_TAKEN))
7080 /* Print the quest info */
7082 sprintf(tmp_str, "%s (%d³¬, %s)\n",
7084 sprintf(tmp_str, "%s (%d, %s)\n",
7087 quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
7088 fprintf(fff, tmp_str);
7092 if (!total) fprintf(fff, "¤Ê¤·\n");
7094 if (!total) fprintf(fff, "Nothing.\n");
7098 /* Close the file */
7101 /* Display the file contents */
7103 show_file(TRUE, file_name, "¥¯¥¨¥¹¥ÈãÀ®¾õ¶·", 0, 0);
7105 show_file(TRUE, file_name, "Quest status", 0, 0);
7109 /* Remove the file */
7119 void do_cmd_knowledge_home(void)
7124 char file_name[1024];
7126 char o_name[MAX_NLEN];
7129 process_dungeon_file("w_info_j.txt", 0, 0, max_wild_y, max_wild_x);
7131 /* Open a new file */
7132 fff = my_fopen_temp(file_name, 1024);
7135 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7137 msg_format("Failed to create temporary file %s.", file_name);
7145 /* Print all homes in the different towns */
7146 st_ptr = &town[1].store[STORE_HOME];
7148 /* Home -- if anything there */
7149 if (st_ptr->stock_num)
7151 /* Header with name of the town */
7153 fprintf(fff, " [ ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ]\n");
7155 fprintf(fff, " [Home Inventory]\n");
7159 /* Dump all available items */
7160 for (i = 0; i < st_ptr->stock_num; i++)
7163 if ((i % 12) == 0) fprintf(fff, "\n ( %d ¥Ú¡¼¥¸ )\n", x++);
7164 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
7165 if (strlen(o_name) <= 80-3)
7167 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
7173 for (n = 0, t = o_name; n < 80-3; n++, t++)
7174 if(iskanji(*t)) {t++; n++;}
7175 if (n == 81-3) n = 79-3; /* ºÇ¸å¤¬´Á»úȾʬ */
7177 fprintf(fff, "%c%s %.*s\n", I2A(i%12), paren, n, o_name);
7178 fprintf(fff, " %.77s\n", o_name+n);
7181 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
7182 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
7187 /* Add an empty line */
7188 fprintf(fff, "\n\n");
7192 /* Close the file */
7195 /* Display the file contents */
7197 show_file(TRUE, file_name, "²æ¤¬²È¤Î¥¢¥¤¥Æ¥à", 0, 0);
7199 show_file(TRUE, file_name, "Home Inventory", 0, 0);
7203 /* Remove the file */
7209 * Check the status of "autopick"
7211 static void do_cmd_knowledge_autopick(void)
7215 char file_name[1024];
7217 /* Open a new file */
7218 fff = my_fopen_temp(file_name, 1024);
7223 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7225 msg_format("Failed to create temporary file %s.", file_name);
7234 fprintf(fff, "¼«Æ°Ç˲õ/½¦¤¤¤Ë¤Ï²¿¤âÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
7236 fprintf(fff, "No preference for auto picker/destroyer.");
7242 fprintf(fff, " ¼«Æ°½¦¤¤/Ç˲õ¤Ë¤Ï¸½ºß %d¹ÔÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£\n\n", max_autopick);
7244 fprintf(fff, " There are %d registered lines for auto picker/destroyer.\n\n", max_autopick);
7248 for (k = 0; k < max_autopick; k++)
7250 if (!(autopick_action[k] & DO_AUTOPICK))
7253 fprintf(fff, " [ÊüÃÖ]");
7255 fprintf(fff, " [Leave]");
7258 else if ((autopick_action[k] & DO_AUTODESTROY))
7261 fprintf(fff, " [Ç˲õ]");
7263 fprintf(fff, " [Destroy]");
7269 fprintf(fff, " [½¦¤¦]");
7271 fprintf(fff, " [Pickup]");
7275 fprintf(fff, " %s", autopick_name[k]);
7276 if(autopick_insc[k] != NULL)
7277 fprintf(fff, " {%s}", autopick_insc[k]);
7280 /* Close the file */
7282 /* Display the file contents */
7284 show_file(TRUE, file_name, "¼«Æ°½¦¤¤/Ç˲õ ÀßÄê¥ê¥¹¥È", 0, 0);
7286 show_file(TRUE, file_name, "Auto-picker/Destroyer", 0, 0);
7289 /* Remove the file */
7296 * Interact with "knowledge"
7298 void do_cmd_knowledge(void)
7301 /* File type is "TEXT" */
7302 FILE_TYPE(FILE_TYPE_TEXT);
7303 /* Save the screen */
7305 /* Interact until done */
7310 /* Ask for a choice */
7312 prt(format("%d/2 ¥Ú¡¼¥¸", (p+1)), 2, 65);
7313 prt("¸½ºß¤ÎÃ챤ò³Îǧ¤¹¤ë", 3, 0);
7315 prt(format("page %d/2", (p+1)), 2, 65);
7316 prt("Display current knowledge", 3, 0);
7319 /* Give some choices */
7322 prt("(1) ´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 6, 5);
7323 prt("(2) ´ûÃΤΥ¢¥¤¥Æ¥à ¤Î°ìÍ÷", 7, 5);
7324 prt("(3) ´ûÃΤÎÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 8, 5);
7325 prt("(4) Åݤ·¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 9, 5);
7326 prt("(5) Åݤ·¤¿Å¨¤Î¿ô ¤Î°ìÍ÷", 10, 5);
7327 prt("(6) ¾Þ¶â¼ó ¤Î°ìÍ÷", 11, 5);
7328 prt("(7) ¸½ºß¤Î¥Ú¥Ã¥È ¤Î°ìÍ÷", 12, 5);
7329 prt("(8) ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 13, 5);
7330 prt("(9) *´ÕÄê*ºÑ¤ßÁõÈ÷¤ÎÂÑÀ ¤Î°ìÍ÷", 14, 5);
7332 prt("(a) ¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó ¤Î°ìÍ÷", 6, 5);
7333 prt("(b) ÆÍÁ³ÊÑ°Û ¤Î°ìÍ÷", 7, 5);
7334 prt("(c) Éð´ï¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 8, 5);
7335 prt("(d) ËâË¡¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 9, 5);
7336 prt("(e) µ»Ç½¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 10, 5);
7337 prt("(f) ¥×¥ì¥¤¥ä¡¼¤ÎÆÁ ¤Î°ìÍ÷", 11, 5);
7338 prt("(g) Æþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó ¤Î°ìÍ÷", 12, 5);
7339 prt("(h) ¼Â¹ÔÃæ¤Î¥¯¥¨¥¹¥È ¤Î°ìÍ÷", 13, 5);
7340 prt("(i) ¸½ºß¤Î¼«Æ°½¦¤¤/Ç˲õÀßÄê ¤Î°ìÍ÷", 14, 5);
7344 prt("(1) Display known artifacts", 6, 5);
7345 prt("(2) Display known objects", 7, 5);
7346 prt("(3) Display remaining uniques", 8, 5);
7347 prt("(4) Display dead uniques", 9, 5);
7348 prt("(5) Display kill count", 10, 5);
7349 prt("(6) Display wanted monsters", 11, 5);
7350 prt("(7) Display current pets", 12, 5);
7351 prt("(8) Display home inventory", 13, 5);
7352 prt("(9) Display *identified* equip.", 14, 5);
7354 prt("(a) Display about yourself", 6, 5);
7355 prt("(b) Display mutations", 7, 5);
7356 prt("(c) Display weapon proficiency", 8, 5);
7357 prt("(d) Display spell proficiency", 9, 5);
7358 prt("(e) Display misc. proficiency", 10, 5);
7359 prt("(f) Display virtues", 11, 5);
7360 prt("(g) Display dungeons", 12, 5);
7361 prt("(h) Display current quests", 13, 5);
7362 prt("(i) Display auto pick/destroy", 14, 5);
7367 prt("-³¤¯-", 16, 8);
7368 prt("ESC) È´¤±¤ë", 21, 1);
7369 prt("SPACE) ¼¡¥Ú¡¼¥¸", 21, 30);
7370 /*prt("-) Á°¥Ú¡¼¥¸", 21, 60);*/
7371 prt("¥³¥Þ¥ó¥É:", 20, 0);
7373 prt("-more-", 16, 8);
7374 prt("ESC) Exit menu", 21, 1);
7375 prt("SPACE) Next page", 21, 30);
7376 /*prt("-) Previous page", 21, 60);*/
7377 prt("Command: ", 20, 0);
7383 if (i == ESCAPE) break;
7386 case ' ': /* Page change */
7390 case '1': /* Artifacts */
7391 do_cmd_knowledge_artifacts();
7393 case '2': /* Objects */
7394 do_cmd_knowledge_objects();
7396 case '3': /* Uniques */
7397 do_cmd_knowledge_uniques();
7399 case '4': /* Uniques */
7400 do_cmd_knowledge_uniques_dead();
7402 case '5': /* Kill count */
7403 do_cmd_knowledge_kill_count();
7405 case '6': /* wanted */
7406 do_cmd_knowledge_kubi();
7408 case '7': /* Pets */
7409 do_cmd_knowledge_pets();
7411 case '8': /* Home */
7412 do_cmd_knowledge_home();
7414 case '9': /* Resist list */
7415 do_cmd_knowledge_inven();
7418 case 'a': /* Max stat */
7419 do_cmd_knowledge_stat();
7421 case 'b': /* Mutations */
7422 do_cmd_knowledge_mutations();
7424 case 'c': /* weapon-exp */
7425 do_cmd_knowledge_weapon_exp();
7427 case 'd': /* spell-exp */
7428 do_cmd_knowledge_spell_exp();
7430 case 'e': /* skill-exp */
7431 do_cmd_knowledge_skill_exp();
7433 case 'f': /* Virtues */
7434 do_cmd_knowledge_virtues();
7436 case 'g': /* Dungeon */
7437 do_cmd_knowledge_dungeon();
7439 case 'h': /* Quests */
7440 do_cmd_knowledge_quests();
7442 case 'i': /* Autopick */
7443 do_cmd_knowledge_autopick();
7445 default: /* Unknown option */
7448 /* Flush messages */
7451 /* Restore the screen */
7457 * Check on the status of an active quest
7459 void do_cmd_checkquest(void)
7461 /* File type is "TEXT" */
7462 FILE_TYPE(FILE_TYPE_TEXT);
7464 /* Save the screen */
7468 do_cmd_knowledge_quests();
7470 /* Restore the screen */
7476 * Display the time and date
7478 void do_cmd_time(void)
7480 int day, hour, min, full, start, end, num;
7487 s32b len = 20L * TOWN_DAWN;
7488 s32b tick = turn % len + len / 4;
7490 if ((p_ptr->prace == RACE_VAMPIRE) ||
7491 (p_ptr->prace == RACE_SKELETON) ||
7492 (p_ptr->prace == RACE_ZOMBIE) ||
7493 (p_ptr->prace == RACE_SPECTRE))
7494 day = (turn - (15L * TOWN_DAWN))/ len + 1;
7496 day = (turn + (5L * TOWN_DAWN))/ len + 1;
7497 hour = (24 * tick / len) % 24;
7498 min = (1440 * tick / len) % 60;
7499 full = hour * 100 + min;
7507 strcpy(desc, "ÊѤʻþ¹ï¤À¡£");
7509 strcpy(desc, "It is a strange time.");
7515 msg_format("%d ÆüÌÜ,»þ¹ï¤Ï%d:%02d %s¤Ç¤¹¡£",
7517 msg_format("This is day %d. The time is %d:%02d %s.",
7520 day, (hour % 12 == 0) ? 12 : (hour % 12),
7521 min, (hour < 12) ? "AM" : "PM");
7524 if (!rand_int(10) || p_ptr->image)
7527 path_build(buf, 1024, ANGBAND_DIR_FILE, "timefun_j.txt");
7529 path_build(buf, 1024, ANGBAND_DIR_FILE, "timefun.txt");
7536 path_build(buf, 1024, ANGBAND_DIR_FILE, "timenorm_j.txt");
7538 path_build(buf, 1024, ANGBAND_DIR_FILE, "timenorm.txt");
7543 /* Open this file */
7544 fff = my_fopen(buf, "rt");
7549 /* Find this time */
7550 while (!my_fgets(fff, buf, 1024))
7552 /* Ignore comments */
7553 if (!buf[0] || (buf[0] == '#')) continue;
7555 /* Ignore invalid lines */
7556 if (buf[1] != ':') continue;
7558 /* Process 'Start' */
7561 /* Extract the starting time */
7562 start = atoi(buf + 2);
7564 /* Assume valid for an hour */
7574 /* Extract the ending time */
7575 end = atoi(buf + 2);
7581 /* Ignore incorrect range */
7582 if ((start > full) || (full > end)) continue;
7584 /* Process 'Description' */
7589 /* Apply the randomizer */
7590 if (!rand_int(num)) strcpy(desc, buf + 2);
7600 /* Close the file */