4 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
6 * This software may be copied and distributed for educational, research,
7 * and not for profit purposes provided that this copyright and statement
8 * are included in all such copies. Other copyrights may also apply.
11 /* Purpose: Interface commands */
18 * A set of functions to maintain automatic dumps of various kinds.
21 * remove_auto_dump(orig_file, mark)
22 * Remove the old automatic dump of type "mark".
23 * auto_dump_printf(fmt, ...)
24 * Dump a formatted string using fprintf().
25 * open_auto_dump(buf, mark)
26 * Open a file, remove old dump, and add new header.
27 * close_auto_dump(void)
28 * Add a footer, and close the file.
30 * The dump commands of original Angband simply add new lines to
31 * existing files; these files will become bigger and bigger unless
32 * an user deletes some or all of these files by hand at some
35 * These three functions automatically delete old dumped lines
36 * before adding new ones. Since there are various kinds of automatic
37 * dumps in a single file, we add a header and a footer with a type
38 * name for every automatic dump, and kill old lines only when the
39 * lines have the correct type of header and footer.
41 * We need to be quite paranoid about correctness; the user might
42 * (mistakenly) edit the file by hand, and see all their work come
43 * to nothing on the next auto dump otherwise. The current code only
44 * detects changes by noting inconsistencies between the actual number
45 * of lines and the number written in the footer. Note that this will
46 * not catch single-line edits.
50 * Mark strings for auto dump
52 static char auto_dump_header[] = "# vvvvvvv== %s ==vvvvvvv";
53 static char auto_dump_footer[] = "# ^^^^^^^== %s ==^^^^^^^";
56 * Variables for auto dump
58 static FILE *auto_dump_stream;
59 static cptr auto_dump_mark;
60 static int auto_dump_line_num;
63 * Remove old lines automatically generated before.
65 static void remove_auto_dump(cptr orig_file)
67 FILE *tmp_fff, *orig_fff;
71 bool between_mark = FALSE;
74 long header_location = 0;
75 char header_mark_str[80];
76 char footer_mark_str[80];
79 /* Prepare a header/footer mark string */
80 sprintf(header_mark_str, auto_dump_header, auto_dump_mark);
81 sprintf(footer_mark_str, auto_dump_footer, auto_dump_mark);
83 mark_len = strlen(footer_mark_str);
85 /* Open an old dump file in read-only mode */
86 orig_fff = my_fopen(orig_file, "r");
88 /* If original file does not exist, nothing to do */
89 if (!orig_fff) return;
91 /* Open a new (temporary) file */
92 tmp_fff = my_fopen_temp(tmp_file, 1024);
97 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", tmp_file);
99 msg_format("Failed to create temporary file %s.", tmp_file);
105 /* Loop for every line */
109 if (my_fgets(orig_fff, buf, sizeof(buf)))
111 /* Read error: Assume End of File */
114 * Was looking for the footer, but not found.
116 * Since automatic dump might be edited by hand,
117 * it's dangerous to kill these lines.
118 * Seek back to the next line of the (pseudo) header,
123 fseek(orig_fff, header_location, SEEK_SET);
124 between_mark = FALSE;
128 /* Success -- End the loop */
135 /* We are looking for the header mark of automatic dump */
138 /* Is this line a header? */
139 if (!strcmp(buf, header_mark_str))
141 /* Memorise seek point of this line */
142 header_location = ftell(orig_fff);
144 /* Initialize counter for number of lines */
147 /* Look for the footer from now */
150 /* There are some changes */
157 /* Copy orginally lines */
158 fprintf(tmp_fff, "%s\n", buf);
162 /* We are looking for the footer mark of automatic dump */
165 /* Is this line a footer? */
166 if (!strncmp(buf, footer_mark_str, mark_len))
171 * Compare the number of lines
173 * If there is an inconsistency between
174 * actual number of lines and the
175 * number here, the automatic dump
176 * might be edited by hand. So it's
177 * dangerous to kill these lines.
178 * Seek back to the next line of the
179 * (pseudo) header, and read again.
181 if (!sscanf(buf + mark_len, " (%d)", &tmp)
184 fseek(orig_fff, header_location, SEEK_SET);
187 /* Look for another header */
188 between_mark = FALSE;
194 /* Ignore old line, and count number of lines */
204 /* If there are some changes, overwrite the original file with new one */
207 /* Copy contents of temporary file */
209 tmp_fff = my_fopen(tmp_file, "r");
210 orig_fff = my_fopen(orig_file, "w");
212 while (!my_fgets(tmp_fff, buf, sizeof(buf)))
213 fprintf(orig_fff, "%s\n", buf);
219 /* Kill the temporary file */
227 * Dump a formatted line, using "vstrnfmt()".
229 static void auto_dump_printf(cptr fmt, ...)
236 /* Begin the Varargs Stuff */
239 /* Format the args, save the length */
240 (void)vstrnfmt(buf, sizeof(buf), fmt, vp);
242 /* End the Varargs Stuff */
245 /* Count number of lines */
246 for (p = buf; *p; p++)
248 if (*p == '\n') auto_dump_line_num++;
252 fprintf(auto_dump_stream, "%s", buf);
257 * Open file to append auto dump.
259 static bool open_auto_dump(cptr buf, cptr mark)
262 char header_mark_str[80];
264 /* Save the mark string */
265 auto_dump_mark = mark;
267 /* Prepare a header mark string */
268 sprintf(header_mark_str, auto_dump_header, auto_dump_mark);
270 /* Remove old macro dumps */
271 remove_auto_dump(buf);
273 /* Append to the file */
274 auto_dump_stream = my_fopen(buf, "a");
277 if (!auto_dump_stream) {
279 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
281 msg_format("Failed to open %s.", buf);
290 fprintf(auto_dump_stream, "%s\n", header_mark_str);
292 /* Initialize counter */
293 auto_dump_line_num = 0;
296 auto_dump_printf("# *·Ù¹ð!!* °Ê¹ß¤Î¹Ô¤Ï¼«Æ°À¸À®¤µ¤ì¤¿¤â¤Î¤Ç¤¹¡£\n");
297 auto_dump_printf("# *·Ù¹ð!!* ¸å¤Ç¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¤Î¤ÇÊÔ½¸¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£\n");
299 auto_dump_printf("# *Warning!* The lines below are an automatic dump.\n");
300 auto_dump_printf("# Don't edit them; changes will be deleted and replaced automatically.\n");
308 * Append foot part and close auto dump.
310 static void close_auto_dump(void)
312 char footer_mark_str[80];
314 /* Prepare a footer mark string */
315 sprintf(footer_mark_str, auto_dump_footer, auto_dump_mark);
318 auto_dump_printf("# *·Ù¹ð!!* °Ê¾å¤Î¹Ô¤Ï¼«Æ°À¸À®¤µ¤ì¤¿¤â¤Î¤Ç¤¹¡£\n");
319 auto_dump_printf("# *·Ù¹ð!!* ¸å¤Ç¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¤Î¤ÇÊÔ½¸¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£\n");
321 auto_dump_printf("# *Warning!* The lines above are an automatic dump.\n");
322 auto_dump_printf("# Don't edit them; changes will be deleted and replaced automatically.\n");
326 fprintf(auto_dump_stream, "%s (%d)\n", footer_mark_str, auto_dump_line_num);
329 my_fclose(auto_dump_stream);
337 * Return suffix of ordinal number
339 cptr get_ordinal_number_suffix(int num)
341 num = ABS(num) % 100;
345 return (num == 11) ? "th" : "st";
347 return (num == 12) ? "th" : "nd";
349 return (num == 13) ? "th" : "rd";
358 * Take note to the diary.
360 errr do_cmd_write_nikki(int type, int num, cptr note)
366 cptr note_level = "";
367 bool do_level = TRUE;
368 char note_level_buf[40];
371 static bool disable_nikki = FALSE;
373 extract_day_hour_min(&day, &hour, &min);
375 if (disable_nikki) return(-1);
377 if (type == NIKKI_FIX_QUEST_C ||
378 type == NIKKI_FIX_QUEST_F ||
379 type == NIKKI_RAND_QUEST_C ||
380 type == NIKKI_RAND_QUEST_F ||
381 type == NIKKI_TO_QUEST)
385 old_quest = p_ptr->inside_quest;
386 p_ptr->inside_quest = (quest[num].type == QUEST_TYPE_RANDOM) ? 0 : num;
388 /* Get the quest text */
389 init_flags = INIT_ASSIGN;
391 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
393 /* Reset the old quest number */
394 p_ptr->inside_quest = old_quest;
398 sprintf(file_name,"playrecord-%s.txt",savefile_base);
400 /* different filne name to avoid mixing */
401 sprintf(file_name,"playrec-%s.txt",savefile_base);
404 /* Build the filename */
405 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
407 /* File type is "TEXT" */
408 FILE_TYPE(FILE_TYPE_TEXT);
410 fff = my_fopen(buf, "a");
416 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£¥×¥ì¥¤µÏ¿¤ò°ì»þÄä»ß¤·¤Þ¤¹¡£", buf);
418 msg_format("Failed to open %s. Play-Record is disabled temporally.", buf);
425 q_idx = quest_number(dun_level);
429 if (p_ptr->inside_arena)
431 note_level = "¥¢¥ê¡¼¥Ê:";
433 note_level = "Arane:";
437 note_level = "ÃϾå:";
439 note_level = "Surface:";
441 else if (q_idx && (is_fixed_quest_idx(q_idx)
442 && !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
444 note_level = "¥¯¥¨¥¹¥È:";
446 note_level = "Quest:";
451 sprintf(note_level_buf, "%d³¬(%s):", dun_level, d_name+d_info[dungeon_type].name);
453 sprintf(note_level_buf, "%s L%d:", d_name+d_info[dungeon_type].name, dun_level);
455 note_level = note_level_buf;
464 if (day < MAX_DAYS) fprintf(fff, "%dÆüÌÜ\n", day);
465 else fputs("*****ÆüÌÜ\n", fff);
467 if (day < MAX_DAYS) fprintf(fff, "Day %d\n", day);
468 else fputs("Day *****\n", fff);
477 fprintf(fff, "%s\n",note);
481 fprintf(fff, " %2d:%02d %20s %s\n",hour, min, note_level, note);
487 fprintf(fff, " %2d:%02d %20s %s¤òȯ¸«¤·¤¿¡£\n", hour, min, note_level, note);
489 fprintf(fff, " %2d:%02d %20s discovered %s.\n", hour, min, note_level, note);
496 fprintf(fff, " %2d:%02d %20s %s¤òÅݤ·¤¿¡£\n", hour, min, note_level, note);
498 fprintf(fff, " %2d:%02d %20s defeated %s.\n", hour, min, note_level, note);
502 case NIKKI_FIX_QUEST_C:
504 if (quest[num].flags & QUEST_FLAG_SILENT) break;
506 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤òãÀ®¤·¤¿¡£\n", hour, min, note_level, quest[num].name);
508 fprintf(fff, " %2d:%02d %20s completed quest '%s'.\n", hour, min, note_level, quest[num].name);
512 case NIKKI_FIX_QUEST_F:
514 if (quest[num].flags & QUEST_FLAG_SILENT) break;
516 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤«¤éÌ¿¤«¤é¤¬¤éƨ¤²µ¢¤Ã¤¿¡£\n", hour, min, note_level, quest[num].name);
518 fprintf(fff, " %2d:%02d %20s run away from quest '%s'.\n", hour, min, note_level, quest[num].name);
522 case NIKKI_RAND_QUEST_C:
525 strcpy(name, r_name+r_info[quest[num].r_idx].name);
527 fprintf(fff, " %2d:%02d %20s ¥é¥ó¥À¥à¥¯¥¨¥¹¥È(%s)¤òãÀ®¤·¤¿¡£\n", hour, min, note_level, name);
529 fprintf(fff, " %2d:%02d %20s completed random quest '%s'\n", hour, min, note_level, name);
533 case NIKKI_RAND_QUEST_F:
536 strcpy(name, r_name+r_info[quest[num].r_idx].name);
538 fprintf(fff, " %2d:%02d %20s ¥é¥ó¥À¥à¥¯¥¨¥¹¥È(%s)¤«¤éƨ¤²½Ð¤·¤¿¡£\n", hour, min, note_level, name);
540 fprintf(fff, " %2d:%02d %20s ran away from quest '%s'.\n", hour, min, note_level, name);
544 case NIKKI_MAXDEAPTH:
547 fprintf(fff, " %2d:%02d %20s %s¤ÎºÇ¿¼³¬%d³¬¤ËÅþ㤷¤¿¡£\n", hour, min, note_level, d_name+d_info[dungeon_type].name, num);
549 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);
556 fprintf(fff, " %2d:%02d %20s %s%s¤ÎºÇ¿¼³¬¤ò%d³¬¤Ë¥»¥Ã¥È¤·¤¿¡£\n", hour, min, note_level, note, d_name + d_info[num].name, max_dlv[num]);
558 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);
565 if (q_idx && (is_fixed_quest_idx(q_idx)
566 && !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
577 if (!(dun_level+num)) to = "ÃϾå";
578 else to = format("%d³¬", dun_level+num);
580 if (!(dun_level+num)) to = "the surface";
581 else to = format("level %d", dun_level+num);
586 fprintf(fff, " %2d:%02d %20s %s¤Ø%s¡£\n", hour, min, note_level, to, note);
588 fprintf(fff, " %2d:%02d %20s %s %s.\n", hour, min, note_level, note, to);
596 fprintf(fff, " %2d:%02d %20s µ¢´Ô¤ò»È¤Ã¤Æ%s¤Î%d³¬¤Ø²¼¤ê¤¿¡£\n", hour, min, note_level, d_name+d_info[dungeon_type].name, max_dlv[dungeon_type]);
598 fprintf(fff, " %2d:%02d %20s recalled to dungeon level %d of %s.\n", hour, min, note_level, max_dlv[dungeon_type], d_name+d_info[dungeon_type].name);
602 fprintf(fff, " %2d:%02d %20s µ¢´Ô¤ò»È¤Ã¤ÆÃϾå¤Ø¤ÈÌá¤Ã¤¿¡£\n", hour, min, note_level);
604 fprintf(fff, " %2d:%02d %20s recalled from dungeon to surface.\n", hour, min, note_level);
610 if (quest[num].flags & QUEST_FLAG_SILENT) break;
612 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤Ø¤ÈÆÍÆþ¤·¤¿¡£\n", hour, min, note_level, quest[num].name);
614 fprintf(fff, " %2d:%02d %20s entered the quest '%s'.\n", hour, min, note_level, quest[num].name);
621 fprintf(fff, " %2d:%02d %20s ¥ì¥Ù¥ë¡¦¥Æ¥ì¥Ý¡¼¥È¤Çæ½Ð¤·¤¿¡£\n", hour, min, note_level);
623 fprintf(fff, " %2d:%02d %20s Got out using teleport level.\n", hour, min, note_level);
630 fprintf(fff, " %2d:%02d %20s %s¤ò¹ØÆþ¤·¤¿¡£\n", hour, min, note_level, note);
632 fprintf(fff, " %2d:%02d %20s bought %s.\n", hour, min, note_level, note);
639 fprintf(fff, " %2d:%02d %20s %s¤òÇäµÑ¤·¤¿¡£\n", hour, min, note_level, note);
641 fprintf(fff, " %2d:%02d %20s sold %s.\n", hour, min, note_level, note);
650 fprintf(fff, " %2d:%02d %20s Æ®µ»¾ì¤Î%d²óÀï¤Ç¡¢%s¤ÎÁ°¤ËÇÔ¤ìµî¤Ã¤¿¡£\n", hour, min, note_level, -num, note);
653 fprintf(fff, " %2d:%02d %20s beaten by %s in the %d%s fight.\n", hour, min, note_level, note, n, get_ordinal_number_suffix(n));
658 fprintf(fff, " %2d:%02d %20s Æ®µ»¾ì¤Î%d²óÀï(%s)¤Ë¾¡Íø¤·¤¿¡£\n", hour, min, note_level, num, note);
660 fprintf(fff, " %2d:%02d %20s won the %d%s fight (%s).\n", hour, min, note_level, num, get_ordinal_number_suffix(num), note);
662 if (num == MAX_ARENA_MONS)
665 fprintf(fff, " Æ®µ»¾ì¤Î¤¹¤Ù¤Æ¤ÎŨ¤Ë¾¡Íø¤·¡¢¥Á¥ã¥ó¥Ô¥ª¥ó¤È¤Ê¤Ã¤¿¡£\n");
667 fprintf(fff, " won all fight to become a Chanpion.\n");
676 fprintf(fff, " %2d:%02d %20s %s¤ò¼±Ê̤·¤¿¡£\n", hour, min, note_level, note);
678 fprintf(fff, " %2d:%02d %20s identified %s.\n", hour, min, note_level, note);
693 to = format("%d³¬(%s)", dun_level, d_name+d_info[dungeon_type].name);
695 to = format("level %d of %s", dun_level, d_name+d_info[dungeon_type].name);
699 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥¦¥£¥¶¡¼¥É¡¦¥Æ¥ì¥Ý¡¼¥È¤Ç°ÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
701 fprintf(fff, " %2d:%02d %20s wizard-teleport to %s.\n", hour, min, note_level, to);
716 to = format("%d³¬(%s)", dun_level, d_name+d_info[dungeon_type].name);
718 to = format("level %d of %s", dun_level, d_name+d_info[dungeon_type].name);
722 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥Ñ¥¿¡¼¥ó¤ÎÎϤǰÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
724 fprintf(fff, " %2d:%02d %20s used Pattern to teleport to %s.\n", hour, min, note_level, to);
731 fprintf(fff, " %2d:%02d %20s ¥ì¥Ù¥ë¤¬%d¤Ë¾å¤¬¤Ã¤¿¡£\n", hour, min, note_level, num);
733 fprintf(fff, " %2d:%02d %20s reached player level %d.\n", hour, min, note_level, num);
737 case NIKKI_GAMESTART:
739 time_t ct = time((time_t*)0);
743 fprintf(fff, "%s %s",note, ctime(&ct));
746 fprintf(fff, " %2d:%02d %20s %s %s",hour, min, note_level, note, ctime(&ct));
749 case NIKKI_NAMED_PET:
751 fprintf(fff, " %2d:%02d %20s ", hour, min, note_level);
756 fprintf(fff, "%s¤òι¤Îͧ¤Ë¤¹¤ë¤³¤È¤Ë·è¤á¤¿¡£\n", note);
758 fprintf(fff, "decided to travel together with %s.\n", note);
763 fprintf(fff, "%s¤Î̾Á°¤ò¾Ã¤·¤¿¡£\n", note);
765 fprintf(fff, "unnamed %s.\n", note);
770 fprintf(fff, "%s¤ò²òÊü¤·¤¿¡£\n", note);
772 fprintf(fff, "dismissed %s.\n", note);
777 fprintf(fff, "%s¤¬»à¤ó¤Ç¤·¤Þ¤Ã¤¿¡£\n", note);
779 fprintf(fff, "%s died.\n", note);
784 fprintf(fff, "%s¤ò¤ª¤¤¤ÆÊ̤ΥޥåפذÜÆ°¤·¤¿¡£\n", note);
786 fprintf(fff, "moved to another map leaving %s behind.\n", note);
791 fprintf(fff, "%s¤È¤Ï¤°¤ì¤Æ¤·¤Þ¤Ã¤¿¡£\n", note);
793 fprintf(fff, "lost sight of %s.\n", note);
798 fprintf(fff, "%s¤¬*Ç˲õ*¤Ë¤è¤Ã¤Æ¾Ã¤¨µî¤Ã¤¿¡£\n", note);
800 fprintf(fff, "%s was made disappeared by *destruction*.\n", note);
805 fprintf(fff, "%s¤¬´äÀФ˲¡¤·ÄÙ¤µ¤ì¤¿¡£\n", note);
807 fprintf(fff, "%s was crushed by falling rocks.\n", note);
812 fprintf(fff, "%s¤¬¥Æ¥ì¥Ý¡¼¥È¡¦¥ì¥Ù¥ë¤Ë¤è¤Ã¤Æ¾Ã¤¨µî¤Ã¤¿¡£\n", note);
814 fprintf(fff, "%s was made disappeared by teleport level.\n", note);
829 if (do_level) write_level = FALSE;
835 #define MAX_SUBTITLE (sizeof(subtitle)/sizeof(subtitle[0]))
837 static void do_cmd_disp_nikki(void)
839 char nikki_title[256];
844 static const char subtitle[][30] = {"ºÇ¶¯¤ÎÆùÂΤòµá¤á¤Æ",
845 "¿ÍÀ¸¤½¤ì¤Ï¤Ï¤«¤Ê¤¤",
856 "Åݤ¹¤Ù¤Å¨¤Ï¥²¡û¥Ä",
857 "¤ó¡Á¡©Ê¹¤³¤¨¤ó¤Ê¤¡",
858 "¥ª¥ì¤Î̾¤ò¸À¤Ã¤Æ¤ß¤í",
859 "Ƭ¤¬ÊѤˤʤäÁ¤ã¤Ã¤¿",
864 "¤³¤ó¤Ê¤â¤ó¤¸¤ã¤Ê¤¤",
873 "ºÇ¹â¤ÎƬǾ¤òµá¤á¤Æ"};
875 static const char subtitle[][51] ={"Quest of The World's Toughest Body",
876 "Attack is the best form of defence.",
878 "An unexpected windfall",
879 "A drowning man will catch at a straw",
880 "Don't count your chickens before they are hatched.",
881 "It is no use crying over spilt milk.",
882 "Seeing is believing.",
883 "Strike the iron while it is hot.",
884 "I don't care what follows.",
885 "To dig a well to put out a house on fire.",
886 "Tomorrow is another day.",
887 "Easy come, easy go.",
888 "The more haste, the less speed.",
889 "Where there is life, there is hope.",
890 "There is no royal road to *WINNER*.",
891 "Danger past, God forgotten.",
892 "The best thing to do now is to run away.",
893 "Life is but an empty dream.",
894 "Dead men tell no tales.",
895 "A book that remains shut is but a block.",
896 "Misfortunes never come singly.",
897 "A little knowledge is a dangerous thing.",
898 "History repeats itself.",
899 "*WINNER* was not built in a day.",
900 "Ignorance is bliss.",
901 "To lose is to win?",
902 "No medicine can cure folly.",
903 "All good things come to an end.",
904 "M$ Empire strikes back.",
905 "To see is to believe",
907 "Quest of The World's Greatest Brain"};
910 sprintf(file_name,"playrecord-%s.txt",savefile_base);
912 sprintf(file_name,"playrec-%s.txt",savefile_base);
915 /* Build the filename */
916 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
918 if (p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_MONK || p_ptr->pclass == CLASS_SAMURAI || p_ptr->pclass == CLASS_BERSERKER)
919 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)]);
920 else if (p_ptr->pclass == CLASS_MAGE || p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER)
921 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)+1]);
922 else strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-2)+1]);
925 sprintf(nikki_title, "¡Ö%s%s%s¤ÎÅÁÀâ -%s-¡×",
926 ap_ptr->title, ap_ptr->no ? "¤Î" : "", player_name, tmp);
928 sprintf(nikki_title, "Legend of %s %s '%s'",
929 ap_ptr->title, player_name, tmp);
932 /* Display the file contents */
933 show_file(FALSE, buf, nikki_title, -1, 0);
936 static void do_cmd_bunshou(void)
939 char bunshou[80] = "\0";
942 if (get_string("ÆâÍÆ: ", tmp, 79))
944 if (get_string("diary note: ", tmp, 79))
947 strcpy(bunshou, tmp);
949 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, bunshou);
953 static void do_cmd_last_get(void)
958 if (record_o_name[0] == '\0') return;
961 sprintf(buf,"%s¤ÎÆþ¼ê¤òµÏ¿¤·¤Þ¤¹¡£",record_o_name);
963 sprintf(buf,"Do you really want to record getting %s? ",record_o_name);
965 if (!get_check(buf)) return;
970 sprintf(buf,"%s¤ò¼ê¤ËÆþ¤ì¤¿¡£", record_o_name);
972 sprintf(buf,"descover %s.", record_o_name);
974 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, buf);
978 static void do_cmd_erase_nikki(void)
985 if (!get_check("ËÜÅö¤ËµÏ¿¤ò¾Ãµî¤·¤Þ¤¹¤«¡©")) return;
987 if (!get_check("Do you really want to delete all your record? ")) return;
991 sprintf(file_name,"playrecord-%s.txt",savefile_base);
993 sprintf(file_name,"playrec-%s.txt",savefile_base);
996 /* Build the filename */
997 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
999 /* Remove the file */
1002 fff = my_fopen(buf, "w");
1006 msg_format("µÏ¿¤ò¾Ãµî¤·¤Þ¤·¤¿¡£");
1008 msg_format("deleted record.");
1012 msg_format("%s ¤Î¾Ãµî¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£", buf);
1014 msg_format("failed to delete %s.", buf);
1021 void do_cmd_nikki(void)
1025 /* File type is "TEXT" */
1026 FILE_TYPE(FILE_TYPE_TEXT);
1028 /* Save the screen */
1031 /* Interact until done */
1037 /* Ask for a choice */
1039 prt("[ µÏ¿¤ÎÀßÄê ]", 2, 0);
1041 prt("[ Play Record ]", 2, 0);
1045 /* Give some choices */
1047 prt("(1) µÏ¿¤ò¸«¤ë", 4, 5);
1048 prt("(2) ʸ¾Ï¤òµÏ¿¤¹¤ë", 5, 5);
1049 prt("(3) ľÁ°¤ËÆþ¼êËô¤Ï´ÕÄꤷ¤¿¤â¤Î¤òµÏ¿¤¹¤ë", 6, 5);
1050 prt("(4) µÏ¿¤ò¾Ãµî¤¹¤ë", 7, 5);
1052 prt("(1) Display your record", 4, 5);
1053 prt("(2) Add record", 5, 5);
1054 prt("(3) Record item you last get/identify", 6, 5);
1055 prt("(4) Delete your record", 7, 5);
1061 prt("¥³¥Þ¥ó¥É:", 18, 0);
1063 prt("Command: ", 18, 0);
1071 if (i == ESCAPE) break;
1076 do_cmd_disp_nikki();
1085 do_cmd_erase_nikki();
1087 default: /* Unknown option */
1091 /* Flush messages */
1095 /* Restore the screen */
1100 * Hack -- redraw the screen
1102 * This command performs various low level updates, clears all the "extra"
1103 * windows, does a total redraw of the main window, and requests all of the
1104 * interesting updates and redraws that I can think of.
1106 * This command is also used to "instantiate" the results of the user
1107 * selecting various things, such as graphics mode, so it must call
1108 * the "TERM_XTRA_REACT" hook before redrawing the windows.
1110 void do_cmd_redraw(void)
1117 /* Hack -- react to changes */
1118 Term_xtra(TERM_XTRA_REACT, 0);
1121 /* Combine and Reorder the pack (later) */
1122 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1126 p_ptr->update |= (PU_TORCH);
1129 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
1131 /* Forget lite/view */
1132 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
1134 /* Update lite/view */
1135 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
1137 /* Update monsters */
1138 p_ptr->update |= (PU_MONSTERS);
1140 /* Redraw everything */
1141 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1144 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
1147 p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
1151 /* Hack -- update */
1154 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
1157 /* Redraw every window */
1158 for (j = 0; j < 8; j++)
1161 if (!angband_term[j]) continue;
1164 Term_activate(angband_term[j]);
1179 * Hack -- change name
1181 void do_cmd_change_name(void)
1190 /* Save the screen */
1198 /* Display the player */
1199 display_player(mode);
1204 display_player(mode);
1209 Term_putstr(2, 23, -1, TERM_WHITE,
1210 "['c'¤Ç̾Á°Êѹ¹, 'f'¤Ç¥Õ¥¡¥¤¥ë¤Ø½ñ½Ð, 'h'¤Ç¥â¡¼¥ÉÊѹ¹, ESC¤Ç½ªÎ»]");
1212 Term_putstr(2, 23, -1, TERM_WHITE,
1213 "['c' to change name, 'f' to file, 'h' to change mode, or ESC]");
1221 if (c == ESCAPE) break;
1228 /* Process the player name */
1229 process_player_name(FALSE);
1235 sprintf(tmp, "%s.txt", player_base);
1237 if (get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
1239 if (get_string("File name: ", tmp, 80))
1243 if (tmp[0] && (tmp[0] != ' '))
1245 file_character(tmp);
1262 /* Flush messages */
1266 /* Restore the screen */
1269 /* Redraw everything */
1270 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1277 * Recall the most recent message
1279 void do_cmd_message_one(void)
1281 /* Recall one message XXX XXX XXX */
1282 prt(format("> %s", message_str(0)), 0, 0);
1287 * Show previous messages to the user -BEN-
1289 * The screen format uses line 0 and 23 for headers and prompts,
1290 * skips line 1 and 22, and uses line 2 thru 21 for old messages.
1292 * This command shows you which commands you are viewing, and allows
1293 * you to "search" for strings in the recall.
1295 * Note that messages may be longer than 80 characters, but they are
1296 * displayed using "infinite" length, with a special sub-command to
1297 * "slide" the virtual display to the left or right.
1299 * Attempt to only hilite the matching portions of the string.
1301 void do_cmd_messages(int num_now)
1312 Term_get_size(&wid, &hgt);
1321 /* Total messages */
1324 /* Start on first message */
1327 /* Start at leftmost edge */
1330 /* Save the screen */
1333 /* Process requests until done */
1339 /* Dump up to 20 lines of messages */
1340 for (j = 0; (j < hgt - 4) && (i + j < n); j++)
1342 cptr msg = message_str(i+j);
1344 /* Apply horizontal scroll */
1345 msg = (strlen(msg) >= q) ? (msg + q) : "";
1347 /* Dump the messages, bottom to top */
1348 Term_putstr(0, hgt-j-3, -1, (bool)(i+j < num_now ? TERM_WHITE : TERM_SLATE), msg);
1350 /* Hilite "shower" */
1355 /* Display matches */
1356 while ((str = strstr(str, shower)) != NULL)
1358 int len = strlen(shower);
1360 /* Display the match */
1361 Term_putstr(str-msg, hgt-j-3, len, TERM_YELLOW, shower);
1369 /* Display header XXX XXX XXX */
1372 prt(format("°ÊÁ°¤Î¥á¥Ã¥»¡¼¥¸ %d-%d Á´Éô¤Ç(%d) ¥ª¥Õ¥»¥Ã¥È(%d)",
1373 i, i+j-1, n, q), 0, 0);
1375 prt(format("Message Recall (%d-%d of %d), Offset %d",
1376 i, i+j-1, n, q), 0, 0);
1380 /* Display prompt (not very informative) */
1382 prt("[ 'p' ¤Ç¹¹¤Ë¸Å¤¤¤â¤Î, 'n' ¤Ç¹¹¤Ë¿·¤·¤¤¤â¤Î, '/' ¤Ç¸¡º÷, ESC ¤ÇÃæÃÇ ]", hgt - 1, 0);
1384 prt("[Press 'p' for older, 'n' for newer, ..., or ESCAPE]", hgt - 1, 0);
1391 /* Exit on Escape */
1392 if (k == ESCAPE) break;
1394 /* Hack -- Save the old index */
1397 /* Horizontal scroll */
1401 q = (q >= 40) ? (q - 40) : 0;
1407 /* Horizontal scroll */
1417 /* Hack -- handle show */
1422 prt("¶¯Ä´: ", hgt - 1, 0);
1424 prt("Show: ", hgt - 1, 0);
1428 /* Get a "shower" string, or continue */
1429 if (!askfor_aux(shower, 80)) continue;
1435 /* Hack -- handle find */
1442 prt("¸¡º÷: ", hgt - 1, 0);
1444 prt("Find: ", hgt - 1, 0);
1448 /* Get a "finder" string, or continue */
1449 if (!askfor_aux(finder, 80)) continue;
1452 strcpy(shower, finder);
1455 for (z = i + 1; z < n; z++)
1457 cptr msg = message_str(z);
1460 if (strstr(msg, finder))
1471 /* Recall 1 older message */
1472 if ((k == '8') || (k == '\n') || (k == '\r'))
1474 /* Go newer if legal */
1475 if (i + 1 < n) i += 1;
1478 /* Recall 10 older messages */
1481 /* Go older if legal */
1482 if (i + 10 < n) i += 10;
1485 /* Recall 20 older messages */
1486 if ((k == 'p') || (k == KTRL('P')) || (k == ' '))
1488 /* Go older if legal */
1489 if (i + 20 < n) i += 20;
1492 /* Recall 20 newer messages */
1493 if ((k == 'n') || (k == KTRL('N')))
1495 /* Go newer (if able) */
1496 i = (i >= 20) ? (i - 20) : 0;
1499 /* Recall 10 newer messages */
1502 /* Go newer (if able) */
1503 i = (i >= 20) ? (i - 20) : 0;
1506 /* Recall 1 newer messages */
1509 /* Go newer (if able) */
1510 i = (i >= 1) ? (i - 1) : 0;
1513 /* Hack -- Error of some kind */
1517 /* Restore the screen */
1524 * Number of cheating options
1531 static option_type cheat_info[CHEAT_MAX] =
1533 { &cheat_peek, FALSE, 255, 0x01, 0x00,
1535 "cheat_peek", "¥¢¥¤¥Æ¥à¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë"
1537 "cheat_peek", "Peek into object creation"
1541 { &cheat_hear, FALSE, 255, 0x02, 0x00,
1543 "cheat_hear", "¥â¥ó¥¹¥¿¡¼¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë"
1545 "cheat_hear", "Peek into monster creation"
1549 { &cheat_room, FALSE, 255, 0x04, 0x00,
1551 "cheat_room", "¥À¥ó¥¸¥ç¥ó¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë"
1553 "cheat_room", "Peek into dungeon creation"
1557 { &cheat_xtra, FALSE, 255, 0x08, 0x00,
1559 "cheat_xtra", "¤½¤Î¾¤Î»ö¤ò¤Î¤¾¤¸«¤ë"
1561 "cheat_xtra", "Peek into something else"
1565 { &cheat_know, FALSE, 255, 0x10, 0x00,
1567 "cheat_know", "´°Á´¤Ê¥â¥ó¥¹¥¿¡¼¤Î»×¤¤½Ð¤òÃΤë"
1569 "cheat_know", "Know complete monster info"
1573 { &cheat_live, FALSE, 255, 0x20, 0x00,
1575 "cheat_live", "»à¤ò²óÈò¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë"
1577 "cheat_live", "Allow player to avoid death"
1581 { &cheat_save, FALSE, 255, 0x40, 0x00,
1583 "cheat_save", "»à¤ó¤À»þ¥»¡¼¥Ö¤¹¤ë¤«³Îǧ¤¹¤ë"
1585 "cheat_save", "Ask for saving death"
1591 * Interact with some options for cheating
1593 static void do_cmd_options_cheat(cptr info)
1597 int i, k = 0, n = CHEAT_MAX;
1605 /* Interact with the player */
1610 /* Prompt XXX XXX XXX */
1612 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê )", info);
1614 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1620 /* º¾µ½¥ª¥×¥·¥ç¥ó¤ò¤¦¤Ã¤«¤ê¤¤¤¸¤Ã¤Æ¤·¤Þ¤¦¿Í¤¬¤¤¤ë¤è¤¦¤Ê¤Î¤ÇÃí°Õ */
1621 prt(" << Ãí°Õ >>", 11, 0);
1622 prt(" º¾µ½¥ª¥×¥·¥ç¥ó¤ò°ìÅ٤ǤâÀßÄꤹ¤ë¤È¡¢¥¹¥³¥¢µÏ¿¤¬»Ä¤é¤Ê¤¯¤Ê¤ê¤Þ¤¹¡ª", 12, 0);
1623 prt(" ¸å¤Ë²ò½ü¤·¤Æ¤â¥À¥á¤Ç¤¹¤Î¤Ç¡¢¾¡Íø¼Ô¤òÌܻؤ¹Êý¤Ï¤³¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤¤", 13, 0);
1624 prt(" ¤¸¤é¤Ê¤¤¤è¤¦¤Ë¤·¤Æ²¼¤µ¤¤¡£", 14, 0);
1626 /* Display the options */
1627 for (i = 0; i < n; i++)
1629 byte a = TERM_WHITE;
1631 /* Color current option */
1632 if (i == k) a = TERM_L_BLUE;
1634 /* Display the option text */
1635 sprintf(buf, "%-48s: %s (%s)",
1636 cheat_info[i].o_desc,
1638 (*cheat_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1640 (*cheat_info[i].o_var ? "yes" : "no "),
1643 cheat_info[i].o_text);
1644 c_prt(a, buf, i + 2, 0);
1647 /* Hilite current option */
1648 move_cursor(k + 2, 50);
1654 * HACK - Try to translate the key into a direction
1655 * to allow using the roguelike keys for navigation.
1657 dir = get_keymap_dir(ch);
1658 if ((dir == 2) || (dir == 4) || (dir == 6) || (dir == 8))
1672 k = (n + k - 1) % n;
1691 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "º¾µ½¥ª¥×¥·¥ç¥ó¤òON¤Ë¤·¤Æ¡¢¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
1693 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use cheating options.");
1695 p_ptr->noscore |= (cheat_info[k].o_set * 256 + cheat_info[k].o_bit);
1696 (*cheat_info[k].o_var) = TRUE;
1705 (*cheat_info[k].o_var) = FALSE;
1713 strnfmt(buf, sizeof(buf), "joption.txt#%s", cheat_info[k].o_text);
1715 strnfmt(buf, sizeof(buf), "option.txt#%s", cheat_info[k].o_text);
1717 /* Peruse the help file */
1718 (void)show_file(TRUE, buf, NULL, 0, 0);
1734 static option_type autosave_info[2] =
1736 { &autosave_l, FALSE, 255, 0x01, 0x00,
1738 "autosave_l", "¿·¤·¤¤³¬¤ËÆþ¤ëÅ٤˼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1740 "autosave_l", "Autosave when entering new levels" },
1744 { &autosave_t, FALSE, 255, 0x02, 0x00,
1746 "autosave_t", "°ìÄ꥿¡¼¥óËè¤Ë¼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1748 "autosave_t", "Timed autosave" },
1754 static s16b toggle_frequency(s16b current)
1759 case 50: return 100;
1760 case 100: return 250;
1761 case 250: return 500;
1762 case 500: return 1000;
1763 case 1000: return 2500;
1764 case 2500: return 5000;
1765 case 5000: return 10000;
1766 case 10000: return 25000;
1773 * Interact with some options for cheating
1775 static void do_cmd_options_autosave(cptr info)
1779 int i, k = 0, n = 2;
1787 /* Interact with the player */
1790 /* Prompt XXX XXX XXX */
1792 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, F ¤ÇÉÑÅÙ¤òÆþÎÏ, ESC ¤Ç·èÄê ) ", info);
1794 sprintf(buf, "%s (RET to advance, y/n to set, 'F' for frequency, ESC to accept) ", info);
1799 /* Display the options */
1800 for (i = 0; i < n; i++)
1802 byte a = TERM_WHITE;
1804 /* Color current option */
1805 if (i == k) a = TERM_L_BLUE;
1807 /* Display the option text */
1808 sprintf(buf, "%-48s: %s (%s)",
1809 autosave_info[i].o_desc,
1811 (*autosave_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1813 (*autosave_info[i].o_var ? "yes" : "no "),
1816 autosave_info[i].o_text);
1817 c_prt(a, buf, i + 2, 0);
1821 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè", autosave_freq), 5, 0);
1823 prt(format("Timed autosave frequency: every %d turns", autosave_freq), 5, 0);
1828 /* Hilite current option */
1829 move_cursor(k + 2, 50);
1845 k = (n + k - 1) % n;
1863 (*autosave_info[k].o_var) = TRUE;
1872 (*autosave_info[k].o_var) = FALSE;
1880 autosave_freq = toggle_frequency(autosave_freq);
1882 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè",
1883 autosave_freq), 5, 0);
1885 prt(format("Timed autosave frequency: every %d turns",
1886 autosave_freq), 5, 0);
1894 (void)show_file(TRUE, "joption.txt#Autosave", NULL, 0, 0);
1896 (void)show_file(TRUE, "option.txt#Autosave", NULL, 0, 0);
1914 #define PAGE_AUTODESTROY 7
1917 * Interact with some options
1919 void do_cmd_options_aux(int page, cptr info)
1922 int i, k = 0, n = 0, l;
1927 /* Lookup the options */
1928 for (i = 0; i < 24; i++) opt[i] = 0;
1930 /* Scan the options */
1931 for (i = 0; option_info[i].o_desc; i++)
1933 /* Notice options on this "page" */
1934 if (option_info[i].o_page == page) opt[n++] = i;
1941 /* Interact with the player */
1946 /* Prompt XXX XXX XXX */
1948 sprintf(buf, "%s (¥ê¥¿¡¼¥ó:¼¡, y/n:Êѹ¹, ESC:½ªÎ», ?:¥Ø¥ë¥×) ", info);
1950 sprintf(buf, "%s (RET:next, y/n:change, ESC:accept, ?:help) ", info);
1956 /* HACK -- description for easy-auto-destroy options */
1958 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢´Ê°×¼«Æ°Ç˲õ¤ò»ÈÍѤ¹¤ë¤È¤¤Î¤ß͸ú", 6, 6);
1960 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "Following options will protect items from easy auto-destroyer.", 6, 3);
1963 /* Display the options */
1964 for (i = 0; i < n; i++)
1966 byte a = TERM_WHITE;
1968 /* Color current option */
1969 if (i == k) a = TERM_L_BLUE;
1971 /* Display the option text */
1972 sprintf(buf, "%-48s: %s (%.19s)",
1973 option_info[opt[i]].o_desc,
1975 (*option_info[opt[i]].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1977 (*option_info[opt[i]].o_var ? "yes" : "no "),
1980 option_info[opt[i]].o_text);
1981 if ((page == PAGE_AUTODESTROY) && i > 2) c_prt(a, buf, i + 5, 0);
1982 else c_prt(a, buf, i + 2, 0);
1985 if ((page == PAGE_AUTODESTROY) && (k > 2)) l = 3;
1988 /* Hilite current option */
1989 move_cursor(k + 2 + l, 50);
1995 * HACK - Try to translate the key into a direction
1996 * to allow using the roguelike keys for navigation.
1998 dir = get_keymap_dir(ch);
1999 if ((dir == 2) || (dir == 4) || (dir == 6) || (dir == 8))
2013 k = (n + k - 1) % n;
2030 (*option_info[opt[k]].o_var) = TRUE;
2039 (*option_info[opt[k]].o_var) = FALSE;
2047 (*option_info[opt[k]].o_var) = !(*option_info[opt[k]].o_var);
2054 strnfmt(buf, sizeof(buf), "joption.txt#%s", option_info[opt[k]].o_text);
2056 strnfmt(buf, sizeof(buf), "option.txt#%s", option_info[opt[k]].o_text);
2058 /* Peruse the help file */
2059 (void)show_file(TRUE, buf, NULL, 0, 0);
2076 * Modify the "window" options
2078 static void do_cmd_options_win(void)
2092 /* Memorize old flags */
2093 for (j = 0; j < 8; j++)
2095 /* Acquire current flags */
2096 old_flag[j] = window_flag[j];
2106 /* Prompt XXX XXX XXX */
2108 prt("¥¦¥£¥ó¥É¥¦¡¦¥Õ¥é¥° (<Êý¸þ>¤Ç°ÜÆ°, t¤Ç¥Á¥§¥ó¥¸, y/n ¤Ç¥»¥Ã¥È, ESC)", 0, 0);
2110 prt("Window Flags (<dir>, t, y, n, ESC) ", 0, 0);
2114 /* Display the windows */
2115 for (j = 0; j < 8; j++)
2117 byte a = TERM_WHITE;
2119 cptr s = angband_term_name[j];
2122 if (j == x) a = TERM_L_BLUE;
2124 /* Window name, staggered, centered */
2125 Term_putstr(35 + j * 5 - strlen(s) / 2, 2 + j % 2, -1, a, s);
2128 /* Display the options */
2129 for (i = 0; i < 16; i++)
2131 byte a = TERM_WHITE;
2133 cptr str = window_flag_desc[i];
2136 if (i == y) a = TERM_L_BLUE;
2140 if (!str) str = "(̤»ÈÍÑ)";
2142 if (!str) str = "(Unused option)";
2147 Term_putstr(0, i + 5, -1, a, str);
2149 /* Display the windows */
2150 for (j = 0; j < 8; j++)
2152 byte a = TERM_WHITE;
2157 if ((i == y) && (j == x)) a = TERM_L_BLUE;
2160 if (window_flag[j] & (1L << i)) c = 'X';
2163 Term_putch(35 + j * 5, i + 5, a, c);
2168 Term_gotoxy(35 + x * 5, y + 5);
2186 for (j = 0; j < 8; j++)
2188 window_flag[j] &= ~(1L << y);
2192 for (i = 0; i < 16; i++)
2194 window_flag[x] &= ~(1L << i);
2207 window_flag[x] |= (1L << y);
2215 window_flag[x] &= ~(1L << y);
2222 (void)show_file(TRUE, "joption.txt#Window", NULL, 0, 0);
2224 (void)show_file(TRUE, "option.txt#Window", NULL, 0, 0);
2234 d = get_keymap_dir(ch);
2236 x = (x + ddx[d] + 8) % 8;
2237 y = (y + ddy[d] + 16) % 16;
2244 /* Notice changes */
2245 for (j = 0; j < 8; j++)
2250 if (!angband_term[j]) continue;
2252 /* Ignore non-changes */
2253 if (window_flag[j] == old_flag[j]) continue;
2256 Term_activate(angband_term[j]);
2273 * Set or unset various options.
2275 * The user must use the "Ctrl-R" command to "adapt" to changes
2276 * in any options which control "visual" aspects of the game.
2278 void do_cmd_options(void)
2283 /* Save the screen */
2292 /* Why are we here */
2294 prt("[ ¥ª¥×¥·¥ç¥ó¤ÎÀßÄê ]", 2, 0);
2296 prt("Options", 2, 0);
2300 /* Give some choices */
2302 prt("(1) ¥¡¼ÆþÎÏ ¥ª¥×¥·¥ç¥ó", 4, 5);
2303 prt("(2) ²èÌ̽ÐÎÏ ¥ª¥×¥·¥ç¥ó", 5, 5);
2304 prt("(3) ¥²¡¼¥à¥×¥ì¥¤ ¥ª¥×¥·¥ç¥ó", 6, 5);
2305 prt("(4) ¹ÔÆ°Ãæ»ß´Ø·¸ ¥ª¥×¥·¥ç¥ó", 7, 5);
2306 prt("(5) ¸úΨ²½ ¥ª¥×¥·¥ç¥ó", 8, 5);
2307 prt("(6) ´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ ¥ª¥×¥·¥ç¥ó", 9, 5);
2308 prt("(R) ¥×¥ì¥¤µÏ¿ ¥ª¥×¥·¥ç¥ó", 10, 5);
2309 /* Special choices */
2310 prt("(D) ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 12, 5);
2311 prt("(H) Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 13, 5);
2312 prt("(A) ¼«Æ°¥»¡¼¥Ö ¥ª¥×¥·¥ç¥ó", 14, 5);
2314 prt("(W) ¥¦¥¤¥ó¥É¥¦¥Õ¥é¥°", 15, 5);
2316 prt("(1) Input Options", 4, 5);
2317 prt("(2) Output Options", 5, 5);
2318 prt("(3) Game-Play Options", 6, 5);
2319 prt("(4) Disturbance Options", 7, 5);
2320 prt("(5) Efficiency Options", 8, 5);
2321 prt("(6) Easy Auto-Destroyer Options", 9, 5);
2322 prt("(R) Play-record Options", 10, 5);
2324 /* Special choices */
2325 prt("(D) Base Delay Factor", 12, 5);
2326 prt("(H) Hitpoint Warning", 13, 5);
2327 prt("(A) Autosave Options", 14, 5);
2331 prt("(W) Window Flags", 15, 5);
2334 if (p_ptr->noscore || allow_debug_opts)
2338 prt("(C) º¾µ½ ¥ª¥×¥·¥ç¥ó", 16, 5);
2340 prt("(C) Cheating Options", 16, 5);
2347 prt("¥³¥Þ¥ó¥É:", 18, 0);
2349 prt("Command: ", 18, 0);
2357 if (k == ESCAPE) break;
2362 /* General Options */
2365 /* Process the general options */
2367 do_cmd_options_aux(1, "¥¡¼ÆþÎÏ¥ª¥×¥·¥ç¥ó");
2369 do_cmd_options_aux(1, "Input Options");
2375 /* General Options */
2378 /* Process the general options */
2380 do_cmd_options_aux(2, "²èÌ̽ÐÎÏ¥ª¥×¥·¥ç¥ó");
2382 do_cmd_options_aux(2, "Output Options");
2388 /* Inventory Options */
2393 do_cmd_options_aux(3, "¥²¡¼¥à¥×¥ì¥¤¡¦¥ª¥×¥·¥ç¥ó");
2395 do_cmd_options_aux(3, "Game-Play Options");
2401 /* Disturbance Options */
2406 do_cmd_options_aux(4, "¹ÔÆ°Ãæ»ß´Ø·¸¤Î¥ª¥×¥·¥ç¥ó");
2408 do_cmd_options_aux(4, "Disturbance Options");
2414 /* Efficiency Options */
2419 do_cmd_options_aux(5, "¸úΨ²½¥ª¥×¥·¥ç¥ó");
2421 do_cmd_options_aux(5, "Efficiency Options");
2427 /* Object auto-destruction Options */
2432 do_cmd_options_aux(7, "´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ¥ª¥×¥·¥ç¥ó");
2434 do_cmd_options_aux(7, "Easy Auto-Destroyer Options");
2439 /* Play-record Options */
2445 do_cmd_options_aux(10, "¥×¥ì¥¤µÏ¿¥ª¥×¥·¥ç¥ó");
2447 do_cmd_options_aux(10, "Play-record Option");
2452 /* Cheating Options */
2455 if (!p_ptr->noscore && !allow_debug_opts)
2457 /* Cheat options are not permitted */
2464 do_cmd_options_cheat("º¾µ½»Õ¤Ï·è¤·¤Æ¾¡Íø¤Ç¤¤Ê¤¤¡ª");
2466 do_cmd_options_cheat("Cheaters never win");
2476 do_cmd_options_autosave("¼«Æ°¥»¡¼¥Ö");
2478 do_cmd_options_autosave("Autosave");
2489 do_cmd_options_win();
2490 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL |
2491 PW_PLAYER | PW_MESSAGE | PW_OVERHEAD |
2492 PW_MONSTER | PW_OBJECT | PW_SNAPSHOT |
2493 PW_BORG_1 | PW_BORG_2 | PW_DUNGEON);
2497 /* Hack -- Delay Speed */
2503 prt("¥³¥Þ¥ó¥É: ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 18, 0);
2505 prt("Command: Base Delay Factor", 18, 0);
2509 /* Get a new value */
2512 int msec = delay_factor * delay_factor * delay_factor;
2514 prt(format("¸½ºß¤Î¥¦¥§¥¤¥È: %d (%d¥ß¥êÉÃ)",
2515 delay_factor, msec), 22, 0);
2517 prt(format("Current base delay factor: %d (%d msec)",
2518 delay_factor, msec), 22, 0);
2522 prt("¥¦¥§¥¤¥È (0-9) ESC¤Ç·èÄê: ", 20, 0);
2524 prt("Delay Factor (0-9 or ESC to accept): ", 20, 0);
2528 if (k == ESCAPE) break;
2532 (void)show_file(TRUE, "joption.txt#BaseDelay", NULL, 0, 0);
2534 (void)show_file(TRUE, "option.txt#BaseDelay", NULL, 0, 0);
2538 else if (isdigit(k)) delay_factor = D2I(k);
2545 /* Hack -- hitpoint warning factor */
2551 prt("¥³¥Þ¥ó¥É: Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 18, 0);
2553 prt("Command: Hitpoint Warning", 18, 0);
2557 /* Get a new value */
2561 prt(format("¸½ºß¤ÎÄã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð: %d0%%",
2562 hitpoint_warn), 22, 0);
2564 prt(format("Current hitpoint warning: %d0%%",
2565 hitpoint_warn), 22, 0);
2569 prt("Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð (0-9) ESC¤Ç·èÄê: ", 20, 0);
2571 prt("Hitpoint Warning (0-9 or ESC to accept): ", 20, 0);
2575 if (k == ESCAPE) break;
2579 (void)show_file(TRUE, "joption.txt#Hitpoint", NULL, 0, 0);
2581 (void)show_file(TRUE, "option.txt#Hitpoint", NULL, 0, 0);
2585 else if (isdigit(k)) hitpoint_warn = D2I(k);
2594 (void)show_file(TRUE, "joption.txt", NULL, 0, 0);
2596 (void)show_file(TRUE, "option.txt", NULL, 0, 0);
2601 /* Unknown option */
2610 /* Flush messages */
2615 /* Restore the screen */
2618 /* Hack - Redraw equippy chars */
2619 p_ptr->redraw |= (PR_EQUIPPY);
2625 * Ask for a "user pref line" and process it
2627 * XXX XXX XXX Allow absolute file names?
2629 void do_cmd_pref(void)
2636 /* Ask for a "user pref command" */
2638 if (!get_string("ÀßÄêÊѹ¹¥³¥Þ¥ó¥É: ", buf, 80)) return;
2640 if (!get_string("Pref: ", buf, 80)) return;
2644 /* Process that pref command */
2645 (void)process_pref_file_command(buf);
2648 void do_cmd_pickpref(void)
2654 if(!get_check("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹¤«? ")) return;
2656 if(!get_check("Reload auto-pick preference file? ")) return;
2659 /* Free old entries */
2662 /* ¥¥ã¥éËè¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß */
2664 sprintf(buf, "picktype-%s.prf", player_name);
2666 sprintf(buf, "pickpref-%s.prf", player_name);
2668 err = process_pickpref_file(buf);
2673 msg_format("%s¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", buf);
2675 msg_format("loaded '%s'.", buf);
2679 /* ¶¦Ä̤ÎÀßÄê¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß */
2681 /* Process 'pick????.prf' if 'pick????-<name>.prf' doesn't exist */
2685 err = process_pickpref_file("picktype.prf");
2687 err = process_pickpref_file("pickpref.prf");
2693 msg_print("picktype.prf¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£");
2695 msg_print("loaded 'pickpref.prf'.");
2702 if(err) msg_print("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£");
2704 if(err) msg_print("Failed to reload autopick preference.");
2711 * Hack -- append all current macros to the given file
2713 static errr macro_dump(cptr fname)
2715 static cptr mark = "Macro Dump";
2721 /* Build the filename */
2722 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
2724 /* File type is "TEXT" */
2725 FILE_TYPE(FILE_TYPE_TEXT);
2727 /* Append to the file */
2728 if (!open_auto_dump(buf, mark)) return (-1);
2732 auto_dump_printf("\n# ¼«Æ°¥Þ¥¯¥í¥»¡¼¥Ö\n\n");
2734 auto_dump_printf("\n# Automatic macro dump\n\n");
2738 for (i = 0; i < macro__num; i++)
2740 /* Extract the action */
2741 ascii_to_text(buf, macro__act[i]);
2743 /* Dump the macro */
2744 auto_dump_printf("A:%s\n", buf);
2746 /* Extract the action */
2747 ascii_to_text(buf, macro__pat[i]);
2749 /* Dump normal macros */
2750 auto_dump_printf("P:%s\n", buf);
2753 auto_dump_printf("\n");
2765 * Hack -- ask for a "trigger" (see below)
2767 * Note the complex use of the "inkey()" function from "util.c".
2769 * Note that both "flush()" calls are extremely important.
2771 static void do_cmd_macro_aux(char *buf)
2781 /* Do not process macros */
2787 /* Read the pattern */
2793 /* Do not process macros */
2796 /* Do not wait for keys */
2799 /* Attempt to read a key */
2810 /* Convert the trigger */
2811 ascii_to_text(tmp, buf);
2813 /* Hack -- display the trigger */
2814 Term_addstr(-1, TERM_WHITE, tmp);
2821 * Hack -- ask for a keymap "trigger" (see below)
2823 * Note that both "flush()" calls are extremely important. This may
2824 * no longer be true, since "util.c" is much simpler now. XXX XXX XXX
2826 static void do_cmd_macro_aux_keymap(char *buf)
2840 /* Convert to ascii */
2841 ascii_to_text(tmp, buf);
2843 /* Hack -- display the trigger */
2844 Term_addstr(-1, TERM_WHITE, tmp);
2853 * Hack -- append all keymaps to the given file
2855 static errr keymap_dump(cptr fname)
2857 static cptr mark = "Keymap Dump";
2866 if (rogue_like_commands)
2868 mode = KEYMAP_MODE_ROGUE;
2874 mode = KEYMAP_MODE_ORIG;
2878 /* Build the filename */
2879 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
2881 /* File type is "TEXT" */
2882 FILE_TYPE(FILE_TYPE_TEXT);
2884 /* Append to the file */
2885 if (!open_auto_dump(buf, mark)) return -1;
2889 auto_dump_printf("\n# ¼«Æ°¥¡¼ÇÛÃÖ¥»¡¼¥Ö\n\n");
2891 auto_dump_printf("\n# Automatic keymap dump\n\n");
2895 for (i = 0; i < 256; i++)
2899 /* Loop up the keymap */
2900 act = keymap_act[mode][i];
2902 /* Skip empty keymaps */
2905 /* Encode the key */
2908 ascii_to_text(key, buf);
2910 /* Encode the action */
2911 ascii_to_text(buf, act);
2913 /* Dump the macro */
2914 auto_dump_printf("A:%s\n", buf);
2915 auto_dump_printf("C:%d:%s\n", mode, key);
2928 * Interact with "macros"
2930 * Note that the macro "action" must be defined before the trigger.
2932 * Could use some helpful instructions on this page. XXX XXX XXX
2934 void do_cmd_macros(void)
2946 if (rogue_like_commands)
2948 mode = KEYMAP_MODE_ROGUE;
2954 mode = KEYMAP_MODE_ORIG;
2957 /* File type is "TEXT" */
2958 FILE_TYPE(FILE_TYPE_TEXT);
2965 /* Process requests until done */
2973 prt("[ ¥Þ¥¯¥í¤ÎÀßÄê ]", 2, 0);
2975 prt("Interact with Macros", 2, 0);
2980 /* Describe that action */
2982 prt("¥Þ¥¯¥í¹ÔÆ°¤¬(¤â¤·¤¢¤ì¤Ð)²¼¤Ëɽ¼¨¤µ¤ì¤Þ¤¹:", 20, 0);
2984 prt("Current action (if any) shown below:", 20, 0);
2988 /* Analyze the current action */
2989 ascii_to_text(buf, macro__buf);
2991 /* Display the current action */
2997 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2999 prt("(1) Load a user pref file", 4, 5);
3004 prt("(2) ¥Õ¥¡¥¤¥ë¤Ë¥Þ¥¯¥í¤òÄɲÃ", 5, 5);
3005 prt("(3) ¥Þ¥¯¥í¤Î³Îǧ", 6, 5);
3006 prt("(4) ¥Þ¥¯¥í¤ÎºîÀ®", 7, 5);
3007 prt("(5) ¥Þ¥¯¥í¤Îºï½ü", 8, 5);
3008 prt("(6) ¥Õ¥¡¥¤¥ë¤Ë¥¡¼ÇÛÃÖ¤òÄɲÃ", 9, 5);
3009 prt("(7) ¥¡¼ÇÛÃ֤γÎǧ", 10, 5);
3010 prt("(8) ¥¡¼ÇÛÃ֤κîÀ®", 11, 5);
3011 prt("(9) ¥¡¼ÇÛÃ֤κï½ü", 12, 5);
3012 prt("(0) ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 13, 5);
3014 prt("(2) Append macros to a file", 5, 5);
3015 prt("(3) Query a macro", 6, 5);
3016 prt("(4) Create a macro", 7, 5);
3017 prt("(5) Remove a macro", 8, 5);
3018 prt("(6) Append keymaps to a file", 9, 5);
3019 prt("(7) Query a keymap", 10, 5);
3020 prt("(8) Create a keymap", 11, 5);
3021 prt("(9) Remove a keymap", 12, 5);
3022 prt("(0) Enter a new action", 13, 5);
3025 #endif /* ALLOW_MACROS */
3029 prt("¥³¥Þ¥ó¥É: ", 16, 0);
3031 prt("Command: ", 16, 0);
3039 if (i == ESCAPE) break;
3041 /* Load a 'macro' file */
3048 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 16, 0);
3050 prt("Command: Load a user pref file", 16, 0);
3056 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3058 prt("File: ", 18, 0);
3062 /* Default filename */
3063 sprintf(tmp, "%s.prf", player_name);
3065 /* Ask for a file */
3066 if (!askfor_aux(tmp, 80)) continue;
3068 /* Process the given filename */
3069 err = process_pref_file(tmp);
3073 msg_format("ɸ½à¤ÎÀßÄê¥Õ¥¡¥¤¥ë'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
3075 msg_format("Loaded default '%s'.", tmp);
3082 msg_format("'%s'¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡ª", tmp);
3084 msg_format("Failed to load '%s'!");
3090 msg_format("'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
3092 msg_format("Loaded '%s'.", tmp);
3104 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
3106 prt("Command: Append macros to a file", 16, 0);
3112 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3114 prt("File: ", 18, 0);
3118 /* Default filename */
3119 sprintf(tmp, "%s.prf", player_name);
3121 /* Ask for a file */
3122 if (!askfor_aux(tmp, 80)) continue;
3124 /* Dump the macros */
3125 (void)macro_dump(tmp);
3129 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
3131 msg_print("Appended macros.");
3143 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Î³Îǧ", 16, 0);
3145 prt("Command: Query a macro", 16, 0);
3151 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3153 prt("Trigger: ", 18, 0);
3157 /* Get a macro trigger */
3158 do_cmd_macro_aux(buf);
3160 /* Acquire action */
3161 k = macro_find_exact(buf);
3168 msg_print("¤½¤Î¥¡¼¤Ë¤Ï¥Þ¥¯¥í¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
3170 msg_print("Found no macro.");
3178 /* Obtain the action */
3179 strcpy(macro__buf, macro__act[k]);
3181 /* Analyze the current action */
3182 ascii_to_text(buf, macro__buf);
3184 /* Display the current action */
3189 msg_print("¥Þ¥¯¥í¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
3191 msg_print("Found a macro.");
3197 /* Create a macro */
3202 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ÎºîÀ®", 16, 0);
3204 prt("Command: Create a macro", 16, 0);
3210 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3212 prt("Trigger: ", 18, 0);
3216 /* Get a macro trigger */
3217 do_cmd_macro_aux(buf);
3224 prt("¥Þ¥¯¥í¹ÔÆ°: ", 20, 0);
3226 prt("Action: ", 20, 0);
3230 /* Convert to text */
3231 ascii_to_text(tmp, macro__buf);
3233 /* Get an encoded action */
3234 if (askfor_aux(tmp, 80))
3236 /* Convert to ascii */
3237 text_to_ascii(macro__buf, tmp);
3239 /* Link the macro */
3240 macro_add(buf, macro__buf);
3244 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
3246 msg_print("Added a macro.");
3252 /* Remove a macro */
3257 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Îºï½ü", 16, 0);
3259 prt("Command: Remove a macro", 16, 0);
3265 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3267 prt("Trigger: ", 18, 0);
3271 /* Get a macro trigger */
3272 do_cmd_macro_aux(buf);
3274 /* Link the macro */
3275 macro_add(buf, buf);
3279 msg_print("¥Þ¥¯¥í¤òºï½ü¤·¤Þ¤·¤¿¡£");
3281 msg_print("Removed a macro.");
3291 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃÖ¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
3293 prt("Command: Append keymaps to a file", 16, 0);
3299 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3301 prt("File: ", 18, 0);
3305 /* Default filename */
3306 sprintf(tmp, "%s.prf", player_name);
3308 /* Ask for a file */
3309 if (!askfor_aux(tmp, 80)) continue;
3311 /* Dump the macros */
3312 (void)keymap_dump(tmp);
3316 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3318 msg_print("Appended keymaps.");
3323 /* Query a keymap */
3330 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤γÎǧ", 16, 0);
3332 prt("Command: Query a keymap", 16, 0);
3338 prt("²¡¤¹¥¡¼: ", 18, 0);
3340 prt("Keypress: ", 18, 0);
3344 /* Get a keymap trigger */
3345 do_cmd_macro_aux_keymap(buf);
3347 /* Look up the keymap */
3348 act = keymap_act[mode][(byte)(buf[0])];
3355 msg_print("¥¡¼ÇÛÃÖ¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
3357 msg_print("Found no keymap.");
3365 /* Obtain the action */
3366 strcpy(macro__buf, act);
3368 /* Analyze the current action */
3369 ascii_to_text(buf, macro__buf);
3371 /* Display the current action */
3376 msg_print("¥¡¼ÇÛÃÖ¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
3378 msg_print("Found a keymap.");
3384 /* Create a keymap */
3389 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κîÀ®", 16, 0);
3391 prt("Command: Create a keymap", 16, 0);
3397 prt("²¡¤¹¥¡¼: ", 18, 0);
3399 prt("Keypress: ", 18, 0);
3403 /* Get a keymap trigger */
3404 do_cmd_macro_aux_keymap(buf);
3411 prt("¹ÔÆ°: ", 20, 0);
3413 prt("Action: ", 20, 0);
3417 /* Convert to text */
3418 ascii_to_text(tmp, macro__buf);
3420 /* Get an encoded action */
3421 if (askfor_aux(tmp, 80))
3423 /* Convert to ascii */
3424 text_to_ascii(macro__buf, tmp);
3426 /* Free old keymap */
3427 string_free(keymap_act[mode][(byte)(buf[0])]);
3429 /* Make new keymap */
3430 keymap_act[mode][(byte)(buf[0])] = string_make(macro__buf);
3434 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3436 msg_print("Added a keymap.");
3442 /* Remove a keymap */
3447 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κï½ü", 16, 0);
3449 prt("Command: Remove a keymap", 16, 0);
3455 prt("²¡¤¹¥¡¼: ", 18, 0);
3457 prt("Keypress: ", 18, 0);
3461 /* Get a keymap trigger */
3462 do_cmd_macro_aux_keymap(buf);
3464 /* Free old keymap */
3465 string_free(keymap_act[mode][(byte)(buf[0])]);
3467 /* Make new keymap */
3468 keymap_act[mode][(byte)(buf[0])] = NULL;
3472 msg_print("¥¡¼ÇÛÃÖ¤òºï½ü¤·¤Þ¤·¤¿¡£");
3474 msg_print("Removed a keymap.");
3479 /* Enter a new action */
3484 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 16, 0);
3486 prt("Command: Enter a new action", 16, 0);
3490 /* Go to the correct location */
3493 /* Hack -- limit the value */
3496 /* Get an encoded action */
3497 if (!askfor_aux(buf, 80)) continue;
3499 /* Extract an action */
3500 text_to_ascii(macro__buf, buf);
3503 #endif /* ALLOW_MACROS */
3512 /* Flush messages */
3521 static void cmd_visuals_aux(int i, int *num, int max)
3528 sprintf(str, "%d", *num);
3530 if (!get_string(format("Input new number(0-%d): ", max-1), str, 4))
3533 tmp = strtol(str, NULL, 0);
3534 if (tmp >= 0 && tmp < max)
3538 else if (isupper(i))
3539 *num = (*num + max - 1) % max;
3541 *num = (*num + 1) % max;
3547 * Interact with "visuals"
3549 void do_cmd_visuals(void)
3557 const char *empty_symbol = "<< ? >>";
3559 if (use_bigtile) empty_symbol = "<< ?? >>";
3561 /* File type is "TEXT" */
3562 FILE_TYPE(FILE_TYPE_TEXT);
3565 /* Save the screen */
3569 /* Interact until done */
3575 /* Ask for a choice */
3577 prt("²èÌÌɽ¼¨¤ÎÀßÄê", 2, 0);
3579 prt("Interact with Visuals", 2, 0);
3583 /* Give some choices */
3585 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
3587 prt("(1) Load a user pref file", 4, 5);
3590 #ifdef ALLOW_VISUALS
3592 prt("(2) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
3593 prt("(3) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 6, 5);
3594 prt("(4) ÃÏ·Á¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 7, 5);
3595 prt("(5) (̤»ÈÍÑ)", 8, 5);
3596 prt("(6) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 9, 5);
3597 prt("(7) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 10, 5);
3598 prt("(8) ÃÏ·Á¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 11, 5);
3599 prt("(9) (̤»ÈÍÑ)", 12, 5);
3601 prt("(2) Dump monster attr/chars", 5, 5);
3602 prt("(3) Dump object attr/chars", 6, 5);
3603 prt("(4) Dump feature attr/chars", 7, 5);
3604 prt("(5) (unused)", 8, 5);
3605 prt("(6) Change monster attr/chars", 9, 5);
3606 prt("(7) Change object attr/chars", 10, 5);
3607 prt("(8) Change feature attr/chars", 11, 5);
3608 prt("(9) (unused)", 12, 5);
3613 prt("(0) ²èÌÌɽ¼¨ÊýË¡¤Î½é´ü²½", 13, 5);
3615 prt("(0) Reset visuals", 13, 5);
3621 prt("¥³¥Þ¥ó¥É:", 15, 0);
3623 prt("Command: ", 15, 0);
3631 if (i == ESCAPE) break;
3633 /* Load a 'pref' file */
3638 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 15, 0);
3640 prt("Command: Load a user pref file", 15, 0);
3646 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3648 prt("File: ", 17, 0);
3652 /* Default filename */
3653 sprintf(tmp, "%s.prf", player_name);
3656 if (!askfor_aux(tmp, 70)) continue;
3658 /* Process the given filename */
3659 (void)process_pref_file(tmp);
3662 #ifdef ALLOW_VISUALS
3664 /* Dump monster attr/chars */
3667 static cptr mark = "Monster attr/chars";
3671 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3673 prt("Command: Dump monster attr/chars", 15, 0);
3679 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3681 prt("File: ", 17, 0);
3685 /* Default filename */
3686 sprintf(tmp, "%s.prf", player_name);
3688 /* Get a filename */
3689 if (!askfor_aux(tmp, 70)) continue;
3691 /* Build the filename */
3692 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3694 /* Append to the file */
3695 if (!open_auto_dump(buf, mark)) continue;
3699 auto_dump_printf("\n# ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3701 auto_dump_printf("\n# Monster attr/char definitions\n\n");
3705 for (i = 1; i < max_r_idx; i++)
3707 monster_race *r_ptr = &r_info[i];
3709 /* Skip non-entries */
3710 if (!r_ptr->name) continue;
3712 /* Dump a comment */
3713 auto_dump_printf("# %s\n", (r_name + r_ptr->name));
3715 /* Dump the monster attr/char info */
3716 auto_dump_printf("R:%d:0x%02X/0x%02X\n\n", i,
3717 (byte)(r_ptr->x_attr), (byte)(r_ptr->x_char));
3725 msg_print("¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3727 msg_print("Dumped monster attr/chars.");
3732 /* Dump object attr/chars */
3735 static cptr mark = "Object attr/chars";
3739 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3741 prt("Command: Dump object attr/chars", 15, 0);
3747 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3749 prt("File: ", 17, 0);
3753 /* Default filename */
3754 sprintf(tmp, "%s.prf", player_name);
3756 /* Get a filename */
3757 if (!askfor_aux(tmp, 70)) continue;
3759 /* Build the filename */
3760 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3762 /* Append to the file */
3763 if (!open_auto_dump(buf, mark)) continue;
3767 auto_dump_printf("\n# ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3769 auto_dump_printf("\n# Object attr/char definitions\n\n");
3773 for (i = 1; i < max_k_idx; i++)
3776 object_kind *k_ptr = &k_info[i];
3778 /* Skip non-entries */
3779 if (!k_ptr->name) continue;
3781 /* Skip entries with flavor */
3782 if (k_ptr->flavor) continue;
3785 strip_name(o_name, i);
3787 /* Dump a comment */
3788 auto_dump_printf("# %s\n", o_name);
3790 /* Dump the object attr/char info */
3791 auto_dump_printf("K:%d:0x%02X/0x%02X\n\n", i,
3792 (byte)(k_ptr->x_attr), (byte)(k_ptr->x_char));
3800 msg_print("¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3802 msg_print("Dumped object attr/chars.");
3807 /* Dump feature attr/chars */
3810 static cptr mark = "Feature attr/chars";
3814 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3816 prt("Command: Dump feature attr/chars", 15, 0);
3822 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3824 prt("File: ", 17, 0);
3828 /* Default filename */
3829 sprintf(tmp, "%s.prf", player_name);
3831 /* Get a filename */
3832 if (!askfor_aux(tmp, 70)) continue;
3834 /* Build the filename */
3835 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3837 /* Append to the file */
3838 if (!open_auto_dump(buf, mark)) continue;
3842 auto_dump_printf("\n# ÃÏ·Á¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3844 auto_dump_printf("\n# Feature attr/char definitions\n\n");
3848 for (i = 1; i < max_f_idx; i++)
3850 feature_type *f_ptr = &f_info[i];
3852 /* Skip non-entries */
3853 if (!f_ptr->name) continue;
3855 /* Skip mimiccing features */
3856 if (f_ptr->mimic != i) continue;
3858 /* Dump a comment */
3859 auto_dump_printf("# %s\n", (f_name + f_ptr->name));
3861 /* Dump the feature attr/char info */
3862 auto_dump_printf("F:%d:0x%02X/0x%02X\n\n", i,
3863 (byte)(f_ptr->x_attr), (byte)(f_ptr->x_char));
3871 msg_print("ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3873 msg_print("Dumped feature attr/chars.");
3878 /* Modify monster attr/chars */
3885 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3887 prt("Command: Change monster attr/chars", 15, 0);
3891 /* Hack -- query until done */
3894 monster_race *r_ptr = &r_info[r];
3899 byte da = (r_ptr->d_attr);
3900 byte dc = (r_ptr->d_char);
3901 byte ca = (r_ptr->x_attr);
3902 byte cc = (r_ptr->x_char);
3904 /* Label the object */
3906 Term_putstr(5, 17, -1, TERM_WHITE,
3907 format("¥â¥ó¥¹¥¿¡¼ = %d, ̾Á° = %-40.40s",
3908 r, (r_name + r_ptr->name)));
3910 Term_putstr(5, 17, -1, TERM_WHITE,
3911 format("Monster = %d, Name = %-40.40s",
3912 r, (r_name + r_ptr->name)));
3916 /* Label the Default values */
3918 Term_putstr(10, 19, -1, TERM_WHITE,
3919 format("½é´üÃÍ ¿§ / ʸ»ú = %3u / %3u", da, dc));
3921 Term_putstr(10, 19, -1, TERM_WHITE,
3922 format("Default attr/char = %3u / %3u", da, dc));
3925 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
3929 if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
3931 Term_putch(43, 19, a, c);
3932 if (use_bigtile) Term_putch(43 + 1, 19, a2, c2);
3934 /* Label the Current values */
3936 Term_putstr(10, 20, -1, TERM_WHITE,
3937 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3u / %3u", ca, cc));
3939 Term_putstr(10, 20, -1, TERM_WHITE,
3940 format("Current attr/char = %3u / %3u", ca, cc));
3943 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
3947 if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
3949 Term_putch(43, 20, a, c);
3950 if (use_bigtile) Term_putch(43 + 1, 20, a2, c2);
3955 Term_putstr(0, 22, -1, TERM_WHITE,
3956 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
3958 Term_putstr(0, 22, -1, TERM_WHITE,
3959 "Command (n/N/^N/a/A/^A/c/C/^C): ");
3966 if (i == ESCAPE) break;
3968 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3969 else if (isupper(i)) c = 'a' + i - 'A';
3975 cmd_visuals_aux(i, &r, max_r_idx);
3978 t = (int)r_ptr->x_attr;
3979 cmd_visuals_aux(i, &t, 256);
3980 r_ptr->x_attr = (byte)t;
3983 t = (int)r_ptr->x_char;
3984 cmd_visuals_aux(i, &t, 256);
3985 r_ptr->x_char = (byte)t;
3991 /* Modify object attr/chars */
3998 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
4000 prt("Command: Change object attr/chars", 15, 0);
4004 /* Hack -- query until done */
4007 object_kind *k_ptr = &k_info[k];
4012 byte da = (byte)k_ptr->d_attr;
4013 byte dc = (byte)k_ptr->d_char;
4014 byte ca = (byte)k_ptr->x_attr;
4015 byte cc = (byte)k_ptr->x_char;
4017 /* Label the object */
4019 Term_putstr(5, 17, -1, TERM_WHITE,
4020 format("¥¢¥¤¥Æ¥à = %d, ̾Á° = %-40.40s",
4021 k, (k_name + k_ptr->name)));
4023 Term_putstr(5, 17, -1, TERM_WHITE,
4024 format("Object = %d, Name = %-40.40s",
4025 k, (k_name + k_ptr->name)));
4029 /* Label the Default values */
4031 Term_putstr(10, 19, -1, TERM_WHITE,
4032 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
4034 Term_putstr(10, 19, -1, TERM_WHITE,
4035 format("Default attr/char = %3d / %3d", da, dc));
4038 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
4041 if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
4043 Term_putch(43, 19, a, c);
4044 if (use_bigtile) Term_putch(43 + 1, 19, a2, c2);
4047 /* Label the Current values */
4049 Term_putstr(10, 20, -1, TERM_WHITE,
4050 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
4052 Term_putstr(10, 20, -1, TERM_WHITE,
4053 format("Current attr/char = %3d / %3d", ca, cc));
4056 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
4059 if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
4061 Term_putch(43, 20, a, c);
4062 if (use_bigtile) Term_putch(43 + 1, 20, a2, c2);
4067 Term_putstr(0, 22, -1, TERM_WHITE,
4068 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
4070 Term_putstr(0, 22, -1, TERM_WHITE,
4071 "Command (n/N/^N/a/A/^A/c/C/^C): ");
4078 if (i == ESCAPE) break;
4080 if (iscntrl(i)) c = 'a' + i - KTRL('A');
4081 else if (isupper(i)) c = 'a' + i - 'A';
4087 cmd_visuals_aux(i, &k, max_k_idx);
4090 t = (int)k_info[k].x_attr;
4091 cmd_visuals_aux(i, &t, 256);
4092 k_info[k].x_attr = (byte)t;
4095 t = (int)k_info[k].x_char;
4096 cmd_visuals_aux(i, &t, 256);
4097 k_info[k].x_char = (byte)t;
4103 /* Modify feature attr/chars */
4110 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
4112 prt("Command: Change feature attr/chars", 15, 0);
4116 /* Hack -- query until done */
4119 feature_type *f_ptr = &f_info[f];
4124 byte da = (byte)f_ptr->d_attr;
4125 byte dc = (byte)f_ptr->d_char;
4126 byte ca = (byte)f_ptr->x_attr;
4127 byte cc = (byte)f_ptr->x_char;
4129 /* Label the object */
4131 Term_putstr(5, 17, -1, TERM_WHITE,
4132 format("ÃÏ·Á = %d, ̾Á° = %-40.40s",
4133 f, (f_name + f_ptr->name)));
4135 Term_putstr(5, 17, -1, TERM_WHITE,
4136 format("Terrain = %d, Name = %-40.40s",
4137 f, (f_name + f_ptr->name)));
4141 /* Label the Default values */
4143 Term_putstr(10, 19, -1, TERM_WHITE,
4144 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
4146 Term_putstr(10, 19, -1, TERM_WHITE,
4147 format("Default attr/char = %3d / %3d", da, dc));
4150 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
4153 if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
4155 Term_putch(43, 19, a, c);
4156 if (use_bigtile) Term_putch(43 + 1, 19, a2, c2);
4159 /* Label the Current values */
4161 Term_putstr(10, 20, -1, TERM_WHITE,
4162 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
4164 Term_putstr(10, 20, -1, TERM_WHITE,
4165 format("Current attr/char = %3d / %3d", ca, cc));
4168 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
4171 if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
4173 Term_putch(43, 20, a, c);
4174 if (use_bigtile) Term_putch(43 + 1, 20, a2, c2);
4179 Term_putstr(0, 22, -1, TERM_WHITE,
4180 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
4182 Term_putstr(0, 22, -1, TERM_WHITE,
4183 "Command (n/N/^N/a/A/^A/c/C/^C): ");
4190 if (i == ESCAPE) break;
4192 if (iscntrl(i)) c = 'a' + i - KTRL('A');
4193 else if (isupper(i)) c = 'a' + i - 'A';
4199 cmd_visuals_aux(i, &f, max_f_idx);
4202 t = (int)f_info[f].x_attr;
4203 cmd_visuals_aux(i, &t, 256);
4204 f_info[f].x_attr = (byte)t;
4207 t = (int)f_info[f].x_char;
4208 cmd_visuals_aux(i, &t, 256);
4209 f_info[f].x_char = (byte)t;
4225 msg_print("²èÌ̾å¤Î[¿§/ʸ»ú]¤ò½é´üÃͤ˥ꥻ¥Ã¥È¤·¤Þ¤·¤¿¡£");
4227 msg_print("Visual attr/char tables reset.");
4232 /* Unknown option */
4238 /* Flush messages */
4243 /* Restore the screen */
4249 * Interact with "colors"
4251 void do_cmd_colors(void)
4260 /* File type is "TEXT" */
4261 FILE_TYPE(FILE_TYPE_TEXT);
4264 /* Save the screen */
4268 /* Interact until done */
4274 /* Ask for a choice */
4276 prt("[ ¥«¥é¡¼¤ÎÀßÄê ]", 2, 0);
4278 prt("Interact with Colors", 2, 0);
4282 /* Give some choices */
4284 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
4286 prt("(1) Load a user pref file", 4, 5);
4291 prt("(2) ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
4292 prt("(3) ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤¹¤ë", 6, 5);
4294 prt("(2) Dump colors", 5, 5);
4295 prt("(3) Modify colors", 6, 5);
4302 prt("¥³¥Þ¥ó¥É: ", 8, 0);
4304 prt("Command: ", 8, 0);
4312 if (i == ESCAPE) break;
4314 /* Load a 'pref' file */
4319 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹", 8, 0);
4321 prt("Command: Load a user pref file", 8, 0);
4327 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4329 prt("File: ", 10, 0);
4334 sprintf(tmp, "%s.prf", player_name);
4337 if (!askfor_aux(tmp, 70)) continue;
4339 /* Process the given filename */
4340 (void)process_pref_file(tmp);
4342 /* Mega-Hack -- react to changes */
4343 Term_xtra(TERM_XTRA_REACT, 0);
4345 /* Mega-Hack -- redraw */
4354 static cptr mark = "Colors";
4358 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 8, 0);
4360 prt("Command: Dump colors", 8, 0);
4366 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4368 prt("File: ", 10, 0);
4372 /* Default filename */
4373 sprintf(tmp, "%s.prf", player_name);
4375 /* Get a filename */
4376 if (!askfor_aux(tmp, 70)) continue;
4378 /* Build the filename */
4379 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
4381 /* Append to the file */
4382 if (!open_auto_dump(buf, mark)) continue;
4386 auto_dump_printf("\n# ¥«¥é¡¼¤ÎÀßÄê\n\n");
4388 auto_dump_printf("\n# Color redefinitions\n\n");
4392 for (i = 0; i < 256; i++)
4394 int kv = angband_color_table[i][0];
4395 int rv = angband_color_table[i][1];
4396 int gv = angband_color_table[i][2];
4397 int bv = angband_color_table[i][3];
4402 cptr name = "unknown";
4406 /* Skip non-entries */
4407 if (!kv && !rv && !gv && !bv) continue;
4409 /* Extract the color name */
4410 if (i < 16) name = color_names[i];
4412 /* Dump a comment */
4414 auto_dump_printf("# ¥«¥é¡¼ '%s'\n", name);
4416 auto_dump_printf("# Color '%s'\n", name);
4419 /* Dump the monster attr/char info */
4420 auto_dump_printf("V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n",
4429 msg_print("¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
4431 msg_print("Dumped color redefinitions.");
4443 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤·¤Þ¤¹", 8, 0);
4445 prt("Command: Modify colors", 8, 0);
4449 /* Hack -- query until done */
4458 /* Exhibit the normal colors */
4459 for (j = 0; j < 16; j++)
4461 /* Exhibit this color */
4462 Term_putstr(j*4, 20, -1, a, "###");
4464 /* Exhibit all colors */
4465 Term_putstr(j*4, 22, -1, j, format("%3d", j));
4468 /* Describe the color */
4470 name = ((a < 16) ? color_names[a] : "̤ÄêµÁ");
4472 name = ((a < 16) ? color_names[a] : "undefined");
4476 /* Describe the color */
4478 Term_putstr(5, 10, -1, TERM_WHITE,
4479 format("¥«¥é¡¼ = %d, ̾Á° = %s", a, name));
4481 Term_putstr(5, 10, -1, TERM_WHITE,
4482 format("Color = %d, Name = %s", a, name));
4486 /* Label the Current values */
4487 Term_putstr(5, 12, -1, TERM_WHITE,
4488 format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x",
4489 angband_color_table[a][0],
4490 angband_color_table[a][1],
4491 angband_color_table[a][2],
4492 angband_color_table[a][3]));
4496 Term_putstr(0, 14, -1, TERM_WHITE,
4497 "¥³¥Þ¥ó¥É (n/N/k/K/r/R/g/G/b/B): ");
4499 Term_putstr(0, 14, -1, TERM_WHITE,
4500 "Command (n/N/k/K/r/R/g/G/b/B): ");
4508 if (i == ESCAPE) break;
4511 if (i == 'n') a = (byte)(a + 1);
4512 if (i == 'N') a = (byte)(a - 1);
4513 if (i == 'k') angband_color_table[a][0] = (byte)(angband_color_table[a][0] + 1);
4514 if (i == 'K') angband_color_table[a][0] = (byte)(angband_color_table[a][0] - 1);
4515 if (i == 'r') angband_color_table[a][1] = (byte)(angband_color_table[a][1] + 1);
4516 if (i == 'R') angband_color_table[a][1] = (byte)(angband_color_table[a][1] - 1);
4517 if (i == 'g') angband_color_table[a][2] = (byte)(angband_color_table[a][2] + 1);
4518 if (i == 'G') angband_color_table[a][2] = (byte)(angband_color_table[a][2] - 1);
4519 if (i == 'b') angband_color_table[a][3] = (byte)(angband_color_table[a][3] + 1);
4520 if (i == 'B') angband_color_table[a][3] = (byte)(angband_color_table[a][3] - 1);
4522 /* Hack -- react to changes */
4523 Term_xtra(TERM_XTRA_REACT, 0);
4525 /* Hack -- redraw */
4532 /* Unknown option */
4538 /* Flush messages */
4543 /* Restore the screen */
4549 * Note something in the message recall
4551 void do_cmd_note(void)
4560 if (!get_string("¥á¥â: ", buf, 60)) return;
4562 if (!get_string("Note: ", buf, 60)) return;
4566 /* Ignore empty notes */
4567 if (!buf[0] || (buf[0] == ' ')) return;
4569 /* Add the note to the message recall */
4571 msg_format("¥á¥â: %s", buf);
4573 msg_format("Note: %s", buf);
4580 * Mention the current version
4582 void do_cmd_version(void)
4587 msg_format("ÊѶòÈÚÅÜ(Hengband) %d.%d.%d",
4588 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4590 msg_format("You are playing Hengband %d.%d.%d.",
4591 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4598 * Array of feeling strings
4600 static cptr do_cmd_feeling_text[11] =
4603 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4605 "Looks like any other level.",
4609 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4611 "You feel there is something special about this level.",
4615 "¶²¤í¤·¤¤»à¤Î¸¸¤¬ÌܤËÉ⤫¤Ó¡¢µ¤À䤷¤½¤¦¤Ë¤Ê¤Ã¤¿¡ª",
4617 "You nearly faint as horrible visions of death fill your mind!",
4621 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4623 "This level looks very dangerous.",
4627 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4629 "You have a very bad feeling...",
4633 "°¤¤Í½´¶¤¬¤¹¤ë...",
4635 "You have a bad feeling...",
4641 "You feel nervous.",
4645 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4647 "You feel your luck is turning...",
4651 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4653 "You don't like the look of this place.",
4657 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4659 "This level looks reasonably safe.",
4663 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4665 "What a boring place..."
4670 static cptr do_cmd_feeling_text_combat[11] =
4673 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4675 "Looks like any other level.",
4679 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4681 "You feel there is something special about this level.",
4685 "º£Ìë¤â¤Þ¤¿¡¢Ã¯¤«¤¬Ì¿¤òÍî¤È¤¹...",
4687 "You nearly faint as horrible visions of death fill your mind!",
4691 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4693 "This level looks very dangerous.",
4697 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4699 "You have a very bad feeling...",
4703 "°¤¤Í½´¶¤¬¤¹¤ë...",
4705 "You have a bad feeling...",
4711 "You feel nervous.",
4715 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4717 "You feel your luck is turning...",
4721 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4723 "You don't like the look of this place.",
4727 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4729 "This level looks reasonably safe.",
4733 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4735 "What a boring place..."
4740 static cptr do_cmd_feeling_text_lucky[11] =
4743 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4744 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4745 "¤³¤Î³¬¤Ï¤³¤Î¾å¤Ê¤¯ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë¡£",
4746 "ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë...",
4747 "¤È¤Æ¤âÎɤ¤´¶¤¸¤¬¤¹¤ë...",
4748 "Îɤ¤´¶¤¸¤¬¤¹¤ë...",
4749 "¤Á¤ç¤Ã¤È¹¬±¿¤Ê´¶¤¸¤¬¤¹¤ë...",
4750 "¿¾¯¤Ï±¿¤¬¸þ¤¤¤Æ¤¤¿¤«...",
4751 "¸«¤¿´¶¤¸°¤¯¤Ï¤Ê¤¤...",
4752 "Á´Á³ÂÌÌܤȤ¤¤¦¤³¤È¤Ï¤Ê¤¤¤¬...",
4753 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4755 "Looks like any other level.",
4756 "You feel there is something special about this level.",
4757 "You have a superb feeling about this level.",
4758 "You have an excellent feeling...",
4759 "You have a very good feeling...",
4760 "You have a good feeling...",
4761 "You feel strangely lucky...",
4762 "You feel your luck is turning...",
4763 "You like the look of this place...",
4764 "This level can't be all bad...",
4765 "What a boring place..."
4771 * Note that "feeling" is set to zero unless some time has passed.
4772 * Note that this is done when the level is GENERATED, not entered.
4774 void do_cmd_feeling(void)
4776 /* Verify the feeling */
4777 if (feeling > 10) feeling = 10;
4779 /* No useful feeling in quests */
4780 if (p_ptr->inside_quest && !random_quest_number(dun_level))
4783 msg_print("ŵ·¿Åª¤Ê¥¯¥¨¥¹¥È¤Î¥À¥ó¥¸¥ç¥ó¤Î¤è¤¦¤À¡£");
4785 msg_print("Looks like a typical quest level.");
4791 /* No useful feeling in town */
4792 else if (p_ptr->town_num && !dun_level)
4795 if (!strcmp(town[p_ptr->town_num].name, "¹ÓÌî"))
4797 if (!strcmp(town[p_ptr->town_num].name, "wilderness"))
4801 msg_print("²¿¤«¤¢¤ê¤½¤¦¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4803 msg_print("Looks like a strange wilderness.");
4811 msg_print("ŵ·¿Åª¤ÊÄ®¤Î¤è¤¦¤À¡£");
4813 msg_print("Looks like a typical town.");
4820 /* No useful feeling in the wilderness */
4821 else if (!dun_level)
4824 msg_print("ŵ·¿Åª¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4826 msg_print("Looks like a typical wilderness.");
4832 /* Display the feeling */
4833 if (turn - old_turn >= (150 - dun_level)*TURNS_PER_TICK || cheat_xtra)
4835 if (p_ptr->muta3 & MUT3_GOOD_LUCK) msg_print(do_cmd_feeling_text_lucky[feeling]);
4837 if((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)){
4838 msg_print(do_cmd_feeling_text_combat[feeling]);
4840 msg_print(do_cmd_feeling_text[feeling]);
4845 msg_print(do_cmd_feeling_text[0]);
4852 * Description of each monster group.
4854 static cptr monster_group_text[] =
4857 "¥æ¥Ë¡¼¥¯", /* "Uniques" */
4886 /* "¸ÅÂå¥É¥é¥´¥ó/¥ï¥¤¥¢¡¼¥à", */
4903 /* "¾åµé¥Ç¡¼¥â¥ó", */
4943 /* "Ancient Dragon/Wyrm", */
4952 "Multi-Headed Reptile",
4957 "Reptile/Amphibian",
4958 "Spider/Scorpion/Tick",
4960 /* "Major Demon", */
4976 * Symbols of monsters in each group. Note the "Uniques" group
4977 * is handled differently.
4979 static cptr monster_group_char[] =
5033 "!$&()+./=>?[\\]`{|~",
5042 * hook function to sort monsters by level
5044 static bool ang_sort_comp_monster_level(vptr u, vptr v, int a, int b)
5046 u16b *who = (u16b*)(u);
5051 monster_race *r_ptr1 = &r_info[w1];
5052 monster_race *r_ptr2 = &r_info[w2];
5057 if (r_ptr2->level > r_ptr1->level) return TRUE;
5058 if (r_ptr1->level > r_ptr2->level) return FALSE;
5060 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return TRUE;
5061 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return FALSE;
5066 * Build a list of monster indexes in the given group. Return the number
5067 * of monsters in the group.
5069 * mode & 0x01 : check for non-empty group
5070 * mode & 0x02 : cheat?
5072 static int collect_monsters(int grp_cur, s16b mon_idx[], byte mode)
5077 /* Get a list of x_char in this group */
5078 cptr group_char = monster_group_char[grp_cur];
5080 /* XXX Hack -- Check if this is the "Uniques" group */
5081 bool grp_unique = (monster_group_char[grp_cur] == (char *) -1L);
5083 /* Check every race */
5084 for (i = 0; i < max_r_idx; i++)
5086 /* Access the race */
5087 monster_race *r_ptr = &r_info[i];
5089 /* Skip empty race */
5090 if (!r_ptr->name) continue ;
5092 /* Require known monsters */
5093 if (!(mode & 0x02) && !cheat_know && !r_ptr->r_sights ) continue;
5095 if (grp_unique && !(r_ptr->flags1 & RF1_UNIQUE)) continue;
5097 /* Check for race in the group */
5098 if (grp_unique || strchr(group_char, r_ptr->d_char))
5101 mon_idx[mon_cnt++] = i;
5103 /* XXX Hack -- Just checking for non-empty group */
5104 if (mode & 0x01) break;
5108 /* Terminate the list */
5109 mon_idx[mon_cnt] = 0;
5111 /* Select the sort method */
5112 ang_sort_comp = ang_sort_comp_monster_level;
5113 ang_sort_swap = ang_sort_swap_hook;
5115 /* Sort by monster level */
5116 ang_sort(mon_idx, &dummy_why, mon_cnt);
5118 /* Return the number of races */
5124 * Description of each monster group.
5126 static cptr object_group_text[] =
5129 "¥¥Î¥³", /* "Mushrooms" */
5130 "Ìô", /* "Potions" */
5131 "Ìý¤Ä¤Ü", /* "Flasks" */
5132 "´¬Êª", /* "Scrolls" */
5133 "»ØÎØ", /* "Rings" */
5134 "¥¢¥ß¥å¥ì¥Ã¥È", /* "Amulets" */
5135 "ū", /* "Whistle" */
5136 "¸÷¸»", /* "Lanterns" */
5137 "ËâË¡ËÀ", /* "Wands" */
5138 "¾ó", /* "Staffs" */
5139 "¥í¥Ã¥É", /* "Rods" */
5140 "¥«¡¼¥É", /* "Cards" */
5141 "¥¥ã¥×¥Á¥ã¡¼¡¦¥Ü¡¼¥ë",
5151 "Åá·õÎà", /* "Swords" */
5152 "Æß´ï", /* "Blunt Weapons" */
5153 "ĹÊÁÉð´ï", /* "Polearms" */
5154 "ºÎ·¡Æ»¶ñ", /* "Diggers" */
5155 "Èô¤ÓÆ»¶ñ", /* "Bows" */
5159 "·ÚÁõ³»", /* "Soft Armor" */
5160 "½ÅÁõ³»", /* "Hard Armor" */
5161 "¥É¥é¥´¥ó³»", /* "Dragon Armor" */
5162 "½â", /* "Shields" */
5163 "¥¯¥í¡¼¥¯", /* "Cloaks" */
5164 "äƼê", /* "Gloves" */
5165 "¥Ø¥ë¥á¥Ã¥È", /* "Helms" */
5166 "´§", /* "Crowns" */
5167 "¥Ö¡¼¥Ä", /* "Boots" */
5216 * TVALs of items in each group
5218 static byte object_group_tval[] =
5259 TV_LIFE_BOOK, /* Hack -- all spellbooks */
5265 * Build a list of monster indexes in the given group. Return the number
5266 * of monsters in the group.
5268 static int collect_objects(int grp_cur, int object_idx[])
5270 int i, j, k, object_cnt = 0;
5272 /* Get a list of x_char in this group */
5273 byte group_tval = object_group_tval[grp_cur];
5275 /* Check every object */
5276 for (i = 0; i < max_k_idx; i++)
5278 /* Access the race */
5279 object_kind *k_ptr = &k_info[i];
5281 /* Skip empty objects */
5282 if (!k_ptr->name) continue;
5284 /* Skip non-flavoured objects */
5285 if (!k_ptr->flavor && !p_ptr->wizard) continue;
5287 /* Skip items with no distribution (special artifacts) */
5288 for (j = 0, k = 0; j < 4; j++) k += k_ptr->chance[j];
5291 /* Require objects ever seen*/
5292 if (!k_ptr->aware && !p_ptr->wizard) continue;
5294 /* Check for race in the group */
5295 if (TV_LIFE_BOOK == group_tval)
5297 /* Hack -- All spell books */
5298 if (TV_LIFE_BOOK <= k_ptr->tval && k_ptr->tval <= TV_HISSATSU_BOOK)
5301 object_idx[object_cnt++] = i;
5304 else if (k_ptr->tval == group_tval)
5307 object_idx[object_cnt++] = i;
5311 /* Terminate the list */
5312 object_idx[object_cnt] = 0;
5314 /* Return the number of races */
5320 * Description of each feature group.
5322 static cptr feature_group_text[] =
5330 * Build a list of feature indexes in the given group. Return the number
5331 * of features in the group.
5333 static int collect_features(int grp_cur, int *feat_idx)
5335 int i, feat_cnt = 0;
5337 /* Unused; There is a single group. */
5340 /* Check every feature */
5341 for (i = 1; i < max_f_idx; i++)
5343 /* Access the index */
5344 feature_type *f_ptr = &f_info[i];
5346 /* Skip empty index */
5347 if (!f_ptr->name) continue;
5349 /* Skip mimiccing features */
5350 if (f_ptr->mimic != i) continue;
5353 feat_idx[feat_cnt++] = i;
5356 /* Terminate the list */
5357 feat_idx[feat_cnt] = 0;
5359 /* Return the number of races */
5366 * Build a list of monster indexes in the given group. Return the number
5367 * of monsters in the group.
5369 static int collect_artifacts(int grp_cur, int object_idx[])
5371 int i, object_cnt = 0;
5373 /* Get a list of x_char in this group */
5374 byte group_tval = object_group_tval[grp_cur];
5376 /* Check every object */
5377 for (i = 0; i < max_a_idx; i++)
5379 /* Access the artifact */
5380 artifact_type *a_ptr = &a_info[i];
5382 /* Skip empty artifacts */
5383 if (!a_ptr->name) continue;
5385 /* Skip "uncreated" artifacts */
5386 if (!a_ptr->cur_num) continue;
5388 /* Check for race in the group */
5389 if (a_ptr->tval == group_tval)
5392 object_idx[object_cnt++] = i;
5396 /* Terminate the list */
5397 object_idx[object_cnt] = 0;
5399 /* Return the number of races */
5406 * Encode the screen colors
5408 static char hack[17] = "dwsorgbuDWvyRGBU";
5412 * Hack -- load a screen dump from a file
5414 void do_cmd_load_screen(void)
5429 Term_get_size(&wid, &hgt);
5431 /* Build the filename */
5432 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
5434 /* Append to the file */
5435 fff = my_fopen(buf, "r");
5440 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
5442 msg_format("Failed to open %s.", buf);
5449 /* Save the screen */
5452 /* Clear the screen */
5456 /* Load the screen */
5457 for (y = 0; okay; y++)
5459 /* Get a line of data including control code */
5460 if (!fgets(buf, 1024, fff)) okay = FALSE;
5462 /* Get the blank line */
5463 if (buf[0] == '\n' || buf[0] == '\0') break;
5465 /* Ignore too large screen image */
5466 if (y >= hgt) continue;
5469 for (x = 0; x < wid - 1; x++)
5472 if (buf[x] == '\n' || buf[x] == '\0') break;
5474 /* Put the attr/char */
5475 Term_draw(x, y, TERM_WHITE, buf[x]);
5479 /* Dump the screen */
5480 for (y = 0; okay; y++)
5482 /* Get a line of data including control code */
5483 if (!fgets(buf, 1024, fff)) okay = FALSE;
5485 /* Get the blank line */
5486 if (buf[0] == '\n' || buf[0] == '\0') break;
5488 /* Ignore too large screen image */
5489 if (y >= hgt) continue;
5492 for (x = 0; x < wid - 1; x++)
5495 if (buf[x] == '\n' || buf[x] == '\0') break;
5497 /* Get the attr/char */
5498 (void)(Term_what(x, y, &a, &c));
5500 /* Look up the attr */
5501 for (i = 0; i < 16; i++)
5503 /* Use attr matches */
5504 if (hack[i] == buf[x]) a = i;
5507 /* Put the attr/char */
5508 Term_draw(x, y, a, c);
5519 prt("¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤µ¤ì¤¿²èÌÌ(µÇ°»£±Æ)¤ò¥í¡¼¥É¤·¤Þ¤·¤¿¡£", 0, 0);
5521 msg_print("Screen dump loaded.");
5528 /* Restore the screen */
5535 cptr inven_res_label =
5537 " »ÀÅŲÐÎäÆǸ÷°ÇÇ˹ì¹ö°øÆÙÎô ÌÕÉÝÍðáãÆ©Ì¿´¶¾ÃÉüÉâ";
5539 " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv";
5542 /* XTRA HACK RESLIST */
5543 static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr,
5544 int *j, byte tval, char *where)
5546 char o_name[MAX_NLEN];
5547 u32b flgs[TR_FLAG_SIZE];
5549 if (!o_ptr->k_idx)return;
5550 if (o_ptr->tval != tval)return;
5553 * HACK:Ring of Lordly protection and Dragon shield/helm
5554 * have random resistances.
5556 if ( ((o_ptr->tval >= TV_BOW && o_ptr->tval<= TV_DRAG_ARMOR && o_ptr->name2)
5557 || (o_ptr->tval == TV_RING && o_ptr->sval == SV_RING_LORDLY)
5558 || (o_ptr->tval == TV_SHIELD && o_ptr->sval == SV_DRAGON_SHIELD)
5559 || (o_ptr->tval == TV_HELM && o_ptr->sval == SV_DRAGON_HELM)
5560 || (o_ptr->tval == TV_GLOVES && o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)
5561 || (o_ptr->tval == TV_BOOTS && o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)
5562 || o_ptr->art_name || o_ptr->name1) && object_known_p(o_ptr))
5565 object_desc(o_name, o_ptr, TRUE, 0);
5567 while ( o_name[i] && i < 26 ){
5569 if (iskanji(o_name[i])) i++;
5573 if(i<28) while(i<28){o_name[i]=' ';i++;}
5576 fprintf(fff,"%s %s", where, o_name);
5578 if (!(o_ptr->ident & (IDENT_MENTAL)))
5581 fprintf(fff, "-------ÉÔÌÀ--------------- -------ÉÔÌÀ---------\n");
5583 fprintf(fff, "-------unknown------------ -------unknown------\n");
5587 object_flags_known(o_ptr, flgs);
5590 if (have_flag(flgs, TR_IM_ACID)) fprintf(fff,"¡ö");
5591 else if (have_flag(flgs, TR_RES_ACID)) fprintf(fff,"¡Ü");
5592 else fprintf(fff,"¡¦");
5594 if (have_flag(flgs, TR_IM_ELEC)) fprintf(fff,"¡ö");
5595 else if (have_flag(flgs, TR_RES_ELEC)) fprintf(fff,"¡Ü");
5596 else fprintf(fff,"¡¦");
5598 if (have_flag(flgs, TR_IM_FIRE)) fprintf(fff,"¡ö");
5599 else if (have_flag(flgs, TR_RES_FIRE)) fprintf(fff,"¡Ü");
5600 else fprintf(fff,"¡¦");
5602 if (have_flag(flgs, TR_IM_COLD)) fprintf(fff,"¡ö");
5603 else if (have_flag(flgs, TR_RES_COLD)) fprintf(fff,"¡Ü");
5604 else fprintf(fff,"¡¦");
5606 if (have_flag(flgs, TR_RES_POIS)) fprintf(fff,"¡Ü");
5607 else fprintf(fff,"¡¦");
5609 if (have_flag(flgs, TR_RES_LITE)) fprintf(fff,"¡Ü");
5610 else fprintf(fff,"¡¦");
5612 if (have_flag(flgs, TR_RES_DARK)) fprintf(fff,"¡Ü");
5613 else fprintf(fff,"¡¦");
5615 if (have_flag(flgs, TR_RES_SHARDS)) fprintf(fff,"¡Ü");
5616 else fprintf(fff,"¡¦");
5618 if (have_flag(flgs, TR_RES_SOUND)) fprintf(fff,"¡Ü");
5619 else fprintf(fff,"¡¦");
5621 if (have_flag(flgs, TR_RES_NETHER)) fprintf(fff,"¡Ü");
5622 else fprintf(fff,"¡¦");
5624 if (have_flag(flgs, TR_RES_NEXUS)) fprintf(fff,"¡Ü");
5625 else fprintf(fff,"¡¦");
5627 if (have_flag(flgs, TR_RES_CHAOS)) fprintf(fff,"¡Ü");
5628 else fprintf(fff,"¡¦");
5630 if (have_flag(flgs, TR_RES_DISEN)) fprintf(fff,"¡Ü");
5631 else fprintf(fff,"¡¦");
5635 if (have_flag(flgs, TR_RES_BLIND)) fprintf(fff,"¡Ü");
5636 else fprintf(fff,"¡¦");
5638 if (have_flag(flgs, TR_RES_FEAR)) fprintf(fff,"¡Ü");
5639 else fprintf(fff,"¡¦");
5641 if (have_flag(flgs, TR_RES_CONF)) fprintf(fff,"¡Ü");
5642 else fprintf(fff,"¡¦");
5644 if (have_flag(flgs, TR_FREE_ACT)) fprintf(fff,"¡Ü");
5645 else fprintf(fff,"¡¦");
5647 if (have_flag(flgs, TR_SEE_INVIS)) fprintf(fff,"¡Ü");
5648 else fprintf(fff,"¡¦");
5650 if (have_flag(flgs, TR_HOLD_LIFE)) fprintf(fff,"¡Ü");
5651 else fprintf(fff,"¡¦");
5653 if (have_flag(flgs, TR_TELEPATHY)) fprintf(fff,"¡Ü");
5654 else fprintf(fff,"¡¦");
5656 if (have_flag(flgs, TR_SLOW_DIGEST)) fprintf(fff,"¡Ü");
5657 else fprintf(fff,"¡¦");
5660 if (have_flag(flgs, TR_REGEN)) fprintf(fff,"¡Ü");
5661 else fprintf(fff,"¡¦");
5663 if (have_flag(flgs, TR_FEATHER)) fprintf(fff,"¡Ü");
5664 else fprintf(fff,"¡¦");
5666 if (have_flag(flgs, TR_IM_ACID)) fprintf(fff,"* ");
5667 else if (have_flag(flgs, TR_RES_ACID)) fprintf(fff,"+ ");
5668 else fprintf(fff,". ");
5670 if (have_flag(flgs, TR_IM_ELEC)) fprintf(fff,"* ");
5671 else if (have_flag(flgs, TR_RES_ELEC)) fprintf(fff,"+ ");
5672 else fprintf(fff,". ");
5674 if (have_flag(flgs, TR_IM_FIRE)) fprintf(fff,"* ");
5675 else if (have_flag(flgs, TR_RES_FIRE)) fprintf(fff,"+ ");
5676 else fprintf(fff,". ");
5678 if (have_flag(flgs, TR_IM_COLD)) fprintf(fff,"* ");
5679 else if (have_flag(flgs, TR_RES_COLD)) fprintf(fff,"+ ");
5680 else fprintf(fff,". ");
5682 if (have_flag(flgs, TR_RES_POIS)) fprintf(fff,"+ ");
5683 else fprintf(fff,". ");
5685 if (have_flag(flgs, TR_RES_LITE)) fprintf(fff,"+ ");
5686 else fprintf(fff,". ");
5688 if (have_flag(flgs, TR_RES_DARK)) fprintf(fff,"+ ");
5689 else fprintf(fff,". ");
5691 if (have_flag(flgs, TR_RES_SHARDS)) fprintf(fff,"+ ");
5692 else fprintf(fff,". ");
5694 if (have_flag(flgs, TR_RES_SOUND)) fprintf(fff,"+ ");
5695 else fprintf(fff,". ");
5697 if (have_flag(flgs, TR_RES_NETHER)) fprintf(fff,"+ ");
5698 else fprintf(fff,". ");
5700 if (have_flag(flgs, TR_RES_NEXUS)) fprintf(fff,"+ ");
5701 else fprintf(fff,". ");
5703 if (have_flag(flgs, TR_RES_CHAOS)) fprintf(fff,"+ ");
5704 else fprintf(fff,". ");
5706 if (have_flag(flgs, TR_RES_DISEN)) fprintf(fff,"+ ");
5707 else fprintf(fff,". ");
5711 if (have_flag(flgs, TR_RES_BLIND)) fprintf(fff,"+ ");
5712 else fprintf(fff,". ");
5714 if (have_flag(flgs, TR_RES_FEAR)) fprintf(fff,"+ ");
5715 else fprintf(fff,". ");
5717 if (have_flag(flgs, TR_RES_CONF)) fprintf(fff,"+ ");
5718 else fprintf(fff,". ");
5720 if (have_flag(flgs, TR_FREE_ACT)) fprintf(fff,"+ ");
5721 else fprintf(fff,". ");
5723 if (have_flag(flgs, TR_SEE_INVIS)) fprintf(fff,"+ ");
5724 else fprintf(fff,". ");
5726 if (have_flag(flgs, TR_HOLD_LIFE)) fprintf(fff,"+ ");
5727 else fprintf(fff,". ");
5729 if (have_flag(flgs, TR_TELEPATHY)) fprintf(fff,"+ ");
5730 else fprintf(fff,". ");
5732 if (have_flag(flgs, TR_SLOW_DIGEST)) fprintf(fff,"+ ");
5733 else fprintf(fff,". ");
5736 if (have_flag(flgs, TR_REGEN)) fprintf(fff,"+ ");
5737 else fprintf(fff,". ");
5739 if (have_flag(flgs, TR_FEATHER)) fprintf(fff,"+ ");
5740 else fprintf(fff,". ");
5748 fprintf(fff,"%s\n", inven_res_label);
5754 * Display *ID* ed weapons/armors's resistances
5756 static void do_cmd_knowledge_inven(void)
5761 char file_name[1024];
5772 /* Open a new file */
5773 fff = my_fopen_temp(file_name, 1024);
5776 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5778 msg_format("Failed to create temporary file %s.", file_name);
5783 fprintf(fff,"%s\n",inven_res_label);
5785 for (tval=TV_BOW; tval <= TV_RING; tval++){
5788 for (;j<9;j++) fprintf(fff, "\n");
5790 fprintf(fff,"%s\n",inven_res_label);
5794 strcpy(where, "Áõ");
5796 strcpy(where, "E ");
5798 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
5800 o_ptr = &inventory[i];
5801 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5805 strcpy(where, "»ý");
5807 strcpy(where, "I ");
5809 for (i = 0; i < INVEN_PACK; i++)
5811 o_ptr = &inventory[i];
5812 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5816 /* Print all homes in the different towns */
5817 st_ptr = &town[1].store[STORE_HOME];
5819 strcpy(where, "²È");
5821 strcpy(where, "H ");
5824 /* Dump all available items */
5825 for (i = 0; i < st_ptr->stock_num; i++)
5827 o_ptr = &st_ptr->stock[i];
5828 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5832 /* Close the file */
5835 /* Display the file contents */
5837 show_file(TRUE, file_name, "*´ÕÄê*ºÑ¤ßÉð´ï/Ëɶñ¤ÎÂÑÀ¥ê¥¹¥È", 0, 0);
5839 show_file(TRUE, file_name, "Resistances of *identified* equipment", 0, 0);
5842 /* Remove the file */
5847 void do_cmd_save_screen_html_aux(char *filename, int message)
5851 byte a = 0, old_a = 0;
5865 cptr html_head[] = {
5866 "<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
5870 cptr html_foot[] = {
5872 "</body>\n</html>\n",
5878 Term_get_size(&wid, &hgt);
5880 /* File type is "TEXT" */
5881 FILE_TYPE(FILE_TYPE_TEXT);
5883 /* Append to the file */
5884 fff = my_fopen(filename, "w");
5890 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", filename);
5892 msg_format("Failed to open file %s.", filename);
5900 /* Save the screen */
5904 /* Build the filename */
5905 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "htmldump.prf");
5906 tmpfff = my_fopen(buf, "r");
5908 for (i = 0; html_head[i]; i++)
5909 fputs(html_head[i], fff);
5913 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
5915 if (strncmp(buf, tags[0], strlen(tags[0])) == 0)
5919 if (strncmp(buf, tags[1], strlen(tags[1])) == 0)
5921 fprintf(fff, "%s\n", buf);
5926 /* Dump the screen */
5927 for (y = 0; y < hgt; y++)
5934 for (x = 0; x < wid - 1; x++)
5938 /* Get the attr/char */
5939 (void)(Term_what(x, y, &a, &c));
5943 case '&': cc = "&"; break;
5944 case '<': cc = "<"; break;
5945 case '>': cc = ">"; break;
5947 case 0x1f: c = '.'; break;
5948 case 0x7f: c = (a == 0x09) ? '%' : '#'; break;
5953 if ((y == 0 && x == 0) || a != old_a) {
5954 rv = angband_color_table[a][1];
5955 gv = angband_color_table[a][2];
5956 bv = angband_color_table[a][3];
5957 fprintf(fff, "%s<font color=\"#%02x%02x%02x\">",
5958 ((y == 0 && x == 0) ? "" : "</font>"), rv, gv, bv);
5962 fprintf(fff, "%s", cc);
5964 fprintf(fff, "%c", c);
5967 fprintf(fff, "</font>");
5970 for (i = 0; html_foot[i]; i++)
5971 fputs(html_foot[i], fff);
5976 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
5978 if (strncmp(buf, tags[2], strlen(tags[2])) == 0)
5982 if (strncmp(buf, tags[3], strlen(tags[3])) == 0)
5984 fprintf(fff, "%s\n", buf);
5999 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
6001 msg_print("Screen dump saved.");
6006 /* Restore the screen */
6012 * Hack -- save a screen dump to a file
6014 static void do_cmd_save_screen_html(void)
6016 char buf[1024], tmp[256] = "screen.html";
6019 if (!get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
6021 if (!get_string("File name: ", tmp, 80))
6025 /* Build the filename */
6026 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
6030 do_cmd_save_screen_html_aux(buf, 1);
6035 * Redefinable "save_screen" action
6037 void (*screendump_aux)(void) = NULL;
6041 * Hack -- save a screen dump to a file
6043 void do_cmd_save_screen(void)
6045 bool old_use_graphics = use_graphics;
6046 bool html_dump = FALSE;
6051 prt("µÇ°»£±Æ¤·¤Þ¤¹¤«¡© [(y)es/(h)tml/(n)o] ", 0, 0);
6053 prt("Save screen dump? [(y)es/(h)tml/(n)o] ", 0, 0);
6058 if (c == 'Y' || c == 'y')
6060 else if (c == 'H' || c == 'h')
6072 Term_get_size(&wid, &hgt);
6074 if (old_use_graphics)
6076 use_graphics = FALSE;
6079 /* Redraw everything */
6080 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
6082 /* Hack -- update */
6088 do_cmd_save_screen_html();
6092 /* Do we use a special screendump function ? */
6093 else if (screendump_aux)
6095 /* Dump the screen to a graphics file */
6096 (*screendump_aux)();
6098 else /* Dump the screen as text */
6109 /* Build the filename */
6110 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
6112 /* File type is "TEXT" */
6113 FILE_TYPE(FILE_TYPE_TEXT);
6115 /* Append to the file */
6116 fff = my_fopen(buf, "w");
6122 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
6124 msg_format("Failed to open file %s.", buf);
6131 /* Save the screen */
6135 /* Dump the screen */
6136 for (y = 0; y < hgt; y++)
6139 for (x = 0; x < wid - 1; x++)
6141 /* Get the attr/char */
6142 (void)(Term_what(x, y, &a, &c));
6152 fprintf(fff, "%s\n", buf);
6159 /* Dump the screen */
6160 for (y = 0; y < hgt; y++)
6163 for (x = 0; x < wid - 1; x++)
6165 /* Get the attr/char */
6166 (void)(Term_what(x, y, &a, &c));
6169 buf[x] = hack[a&0x0F];
6176 fprintf(fff, "%s\n", buf);
6188 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
6190 msg_print("Screen dump saved.");
6196 /* Restore the screen */
6200 if (old_use_graphics)
6202 use_graphics = TRUE;
6205 /* Redraw everything */
6206 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
6208 /* Hack -- update */
6215 * Sorting hook -- Comp function -- see below
6217 * We use "u" to point to array of monster indexes,
6218 * and "v" to select the type of sorting to perform on "u".
6220 static bool ang_sort_art_comp(vptr u, vptr v, int a, int b)
6222 u16b *who = (u16b*)(u);
6224 u16b *why = (u16b*)(v);
6231 /* Sort by total kills */
6234 /* Extract total kills */
6235 z1 = a_info[w1].tval;
6236 z2 = a_info[w2].tval;
6238 /* Compare total kills */
6239 if (z1 < z2) return (TRUE);
6240 if (z1 > z2) return (FALSE);
6244 /* Sort by monster level */
6247 /* Extract levels */
6248 z1 = a_info[w1].sval;
6249 z2 = a_info[w2].sval;
6251 /* Compare levels */
6252 if (z1 < z2) return (TRUE);
6253 if (z1 > z2) return (FALSE);
6257 /* Sort by monster experience */
6260 /* Extract experience */
6261 z1 = a_info[w1].level;
6262 z2 = a_info[w2].level;
6264 /* Compare experience */
6265 if (z1 < z2) return (TRUE);
6266 if (z1 > z2) return (FALSE);
6270 /* Compare indexes */
6276 * Sorting hook -- Swap function -- see below
6278 * We use "u" to point to array of monster indexes,
6279 * and "v" to select the type of sorting to perform.
6281 static void ang_sort_art_swap(vptr u, vptr v, int a, int b)
6283 u16b *who = (u16b*)(u);
6298 * Check the status of "artifacts"
6300 static void do_cmd_knowledge_artifacts(void)
6302 int i, k, z, x, y, n = 0;
6308 char file_name[1024];
6310 char base_name[MAX_NLEN];
6314 /* Open a new file */
6315 fff = my_fopen_temp(file_name, 1024);
6319 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6321 msg_format("Failed to create temporary file %s.", file_name);
6327 /* Allocate the "who" array */
6328 C_MAKE(who, max_a_idx, s16b);
6330 /* Allocate the "okay" array */
6331 C_MAKE(okay, max_a_idx, bool);
6333 /* Scan the artifacts */
6334 for (k = 0; k < max_a_idx; k++)
6336 artifact_type *a_ptr = &a_info[k];
6341 /* Skip "empty" artifacts */
6342 if (!a_ptr->name) continue;
6344 /* Skip "uncreated" artifacts */
6345 if (!a_ptr->cur_num) continue;
6351 /* Check the dungeon */
6352 for (y = 0; y < cur_hgt; y++)
6354 for (x = 0; x < cur_wid; x++)
6356 cave_type *c_ptr = &cave[y][x];
6358 s16b this_o_idx, next_o_idx = 0;
6360 /* Scan all objects in the grid */
6361 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
6365 /* Acquire object */
6366 o_ptr = &o_list[this_o_idx];
6368 /* Acquire next object */
6369 next_o_idx = o_ptr->next_o_idx;
6371 /* Ignore non-artifacts */
6372 if (!artifact_p(o_ptr)) continue;
6374 /* Ignore known items */
6375 if (object_known_p(o_ptr)) continue;
6377 /* Note the artifact */
6378 okay[o_ptr->name1] = FALSE;
6383 /* Check the inventory and equipment */
6384 for (i = 0; i < INVEN_TOTAL; i++)
6386 object_type *o_ptr = &inventory[i];
6388 /* Ignore non-objects */
6389 if (!o_ptr->k_idx) continue;
6391 /* Ignore non-artifacts */
6392 if (!artifact_p(o_ptr)) continue;
6394 /* Ignore known items */
6395 if (object_known_p(o_ptr)) continue;
6397 /* Note the artifact */
6398 okay[o_ptr->name1] = FALSE;
6401 for (k = 0; k < max_a_idx; k++)
6403 if (okay[k]) who[n++] = k;
6406 /* Select the sort method */
6407 ang_sort_comp = ang_sort_art_comp;
6408 ang_sort_swap = ang_sort_art_swap;
6410 /* Sort the array by dungeon depth of monsters */
6411 ang_sort(who, &why, n);
6413 /* Scan the artifacts */
6414 for (k = 0; k < n; k++)
6416 artifact_type *a_ptr = &a_info[who[k]];
6420 strcpy(base_name, "̤ÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à");
6422 strcpy(base_name, "Unknown Artifact");
6426 /* Obtain the base object type */
6427 z = lookup_kind(a_ptr->tval, a_ptr->sval);
6435 /* Get local object */
6438 /* Create fake object */
6439 object_prep(q_ptr, z);
6441 /* Make it an artifact */
6442 q_ptr->name1 = (byte)who[k];
6444 /* Describe the artifact */
6445 object_desc_store(base_name, q_ptr, FALSE, 0);
6448 /* Hack -- Build the artifact name */
6450 fprintf(fff, " %s\n", base_name);
6452 fprintf(fff, " The %s\n", base_name);
6457 /* Free the "who" array */
6458 C_KILL(who, max_a_idx, s16b);
6460 /* Free the "okay" array */
6461 C_KILL(okay, max_a_idx, bool);
6463 /* Close the file */
6466 /* Display the file contents */
6468 show_file(TRUE, file_name, "´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à", 0, 0);
6470 show_file(TRUE, file_name, "Artifacts Seen", 0, 0);
6474 /* Remove the file */
6480 * Display known uniques
6482 static void do_cmd_knowledge_uniques(void)
6490 char file_name[1024];
6492 /* Open a new file */
6493 fff = my_fopen_temp(file_name, 1024);
6497 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6499 msg_format("Failed to create temporary file %s.", file_name);
6505 /* Allocate the "who" array */
6506 C_MAKE(who, max_r_idx, s16b);
6508 /* Scan the monsters */
6509 for (i = 1; i < max_r_idx; i++)
6511 monster_race *r_ptr = &r_info[i];
6513 /* Use that monster */
6514 if (r_ptr->name) who[n++] = i;
6517 /* Select the sort method */
6518 ang_sort_comp = ang_sort_comp_hook;
6519 ang_sort_swap = ang_sort_swap_hook;
6521 /* Sort the array by dungeon depth of monsters */
6522 ang_sort(who, &why, n);
6524 /* Scan the monster races */
6525 for (k = 0; k < n; k++)
6527 monster_race *r_ptr = &r_info[who[k]];
6529 /* Only print Uniques */
6530 if (r_ptr->flags1 & (RF1_UNIQUE))
6532 bool dead = (r_ptr->max_num == 0);
6536 /* Only display "known" uniques */
6537 if (dead || cheat_know || r_ptr->r_sights)
6539 /* Print a message */
6541 fprintf(fff, " %s¤Ï¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¡£\n",
6542 (r_name + r_ptr->name));
6544 fprintf(fff, " %s is alive\n",
6545 (r_name + r_ptr->name));
6552 /* Free the "who" array */
6553 C_KILL(who, max_r_idx, s16b);
6555 /* Close the file */
6558 /* Display the file contents */
6560 show_file(TRUE, file_name, "¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
6562 show_file(TRUE, file_name, "Alive Uniques", 0, 0);
6566 /* Remove the file */
6572 * Display weapon-exp
6574 static void do_cmd_knowledge_weapon_exp(void)
6576 int i, j, num, weapon_exp;
6580 char file_name[1024];
6583 /* Open a new file */
6584 fff = my_fopen_temp(file_name, 1024);
6587 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6589 msg_format("Failed to create temporary file %s.", file_name);
6595 for (i = 0; i < 5; i++)
6597 for (num = 0; num < 64; num++)
6599 for (j = 0; j < max_k_idx; j++)
6601 object_kind *k_ptr = &k_info[j];
6603 if ((k_ptr->tval == TV_SWORD - i) && (k_ptr->sval == num))
6605 if ((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON)) continue;
6607 weapon_exp = p_ptr->weapon_exp[4 - i][num];
6609 fprintf(fff, "%-25s ", tmp);
6610 if (weapon_exp >= s_info[p_ptr->pclass].w_max[4 - i][num]) fprintf(fff, "!");
6611 else fprintf(fff, " ");
6612 fprintf(fff, "%s", exp_level_str[weapon_exp_level(weapon_exp)]);
6613 if (cheat_xtra) fprintf(fff, " %d", weapon_exp);
6621 /* Close the file */
6624 /* Display the file contents */
6626 show_file(TRUE, file_name, "Éð´ï¤Î·Ð¸³ÃÍ", 0, 0);
6628 show_file(TRUE, file_name, "Weapon Proficiency", 0, 0);
6632 /* Remove the file */
6640 static void do_cmd_knowledge_spell_exp(void)
6642 int i = 0, spell_exp, exp_level;
6647 char file_name[1024];
6649 /* Open a new file */
6650 fff = my_fopen_temp(file_name, 1024);
6653 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6655 msg_format("Failed to create temporary file %s.", file_name);
6661 if (p_ptr->realm1 != REALM_NONE)
6664 fprintf(fff, "%s¤ÎËâË¡½ñ\n", realm_names[p_ptr->realm1]);
6666 fprintf(fff, "%s Spellbook\n", realm_names[p_ptr->realm1]);
6668 for (i = 0; i < 32; i++)
6670 if (!is_magic(p_ptr->realm1))
6672 s_ptr = &technic_info[p_ptr->realm1 - MIN_TECHNIC][i];
6676 s_ptr = &mp_ptr->info[p_ptr->realm1 - 1][i];
6678 if (s_ptr->slevel >= 99) continue;
6679 spell_exp = p_ptr->spell_exp[i];
6680 exp_level = spell_exp_level(spell_exp);
6681 fprintf(fff, "%-25s ", spell_names[technic2magic(p_ptr->realm1) - 1][i]);
6682 if (p_ptr->realm1 == REALM_HISSATSU)
6683 fprintf(fff, "[--]");
6686 if (exp_level >= EXP_LEVEL_MASTER) fprintf(fff, "!");
6687 else fprintf(fff, " ");
6688 fprintf(fff, "%s", exp_level_str[exp_level]);
6690 if (cheat_xtra) fprintf(fff, " %d", spell_exp);
6695 if (p_ptr->realm2 != REALM_NONE)
6698 fprintf(fff, "%s¤ÎËâË¡½ñ\n", realm_names[p_ptr->realm2]);
6700 fprintf(fff, "\n%s Spellbook\n", realm_names[p_ptr->realm2]);
6702 for (i = 0; i < 32; i++)
6704 if (!is_magic(p_ptr->realm1))
6706 s_ptr = &technic_info[p_ptr->realm2 - MIN_TECHNIC][i];
6710 s_ptr = &mp_ptr->info[p_ptr->realm2 - 1][i];
6712 if (s_ptr->slevel >= 99) continue;
6714 spell_exp = p_ptr->spell_exp[i + 32];
6715 exp_level = spell_exp_level(spell_exp);
6716 fprintf(fff, "%-25s ", spell_names[technic2magic(p_ptr->realm2) - 1][i]);
6717 if (exp_level >= EXP_LEVEL_EXPERT) fprintf(fff, "!");
6718 else fprintf(fff, " ");
6719 fprintf(fff, "%s", exp_level_str[exp_level]);
6720 if (cheat_xtra) fprintf(fff, " %d", spell_exp);
6725 /* Close the file */
6728 /* Display the file contents */
6730 show_file(TRUE, file_name, "ËâË¡¤Î·Ð¸³ÃÍ", 0, 0);
6732 show_file(TRUE, file_name, "Spell Proficiency", 0, 0);
6736 /* Remove the file */
6744 static void do_cmd_knowledge_skill_exp(void)
6746 int i = 0, skill_exp;
6750 char file_name[1024];
6752 char skill_name[3][17]={"¥Þ¡¼¥·¥ã¥ë¥¢¡¼¥Ä", "ÆóÅáή ", "¾èÇÏ "};
6754 char skill_name[3][20]={"Martial Arts ", "Dual Wielding ", "Riding "};
6757 /* Open a new file */
6758 fff = my_fopen_temp(file_name, 1024);
6761 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6763 msg_format("Failed to create temporary file %s.", file_name);
6769 for (i = 0; i < 3; i++)
6771 skill_exp = p_ptr->skill_exp[i];
6772 fprintf(fff, "%-20s ", skill_name[i]);
6773 if (skill_exp >= s_info[p_ptr->pclass].s_max[i]) fprintf(fff, "!");
6774 else fprintf(fff, " ");
6775 fprintf(fff, "%s", exp_level_str[(i == GINOU_RIDING) ? riding_exp_level(skill_exp) : weapon_exp_level(skill_exp)]);
6776 if (cheat_xtra) fprintf(fff, " %d", skill_exp);
6780 /* Close the file */
6783 /* Display the file contents */
6785 show_file(TRUE, file_name, "µ»Ç½¤Î·Ð¸³ÃÍ", 0, 0);
6787 show_file(TRUE, file_name, "Miscellaneous Proficiency", 0, 0);
6791 /* Remove the file */
6797 * Pluralize a monster name
6799 void plural_aux(char *Name)
6801 int NameLen = strlen(Name);
6803 if (strstr(Name, "Disembodied hand"))
6805 strcpy(Name, "Disembodied hands that strangled people");
6807 else if (strstr(Name, "Colour out of space"))
6809 strcpy(Name, "Colours out of space");
6811 else if (strstr(Name, "stairway to hell"))
6813 strcpy(Name, "stairways to hell");
6815 else if (strstr(Name, "Dweller on the threshold"))
6817 strcpy(Name, "Dwellers on the threshold");
6819 else if (strstr(Name, " of "))
6821 cptr aider = strstr(Name, " of ");
6832 if (dummy[i-1] == 's')
6834 strcpy(&(dummy[i]), "es");
6839 strcpy(&(dummy[i]), "s");
6842 strcpy(&(dummy[i+1]), aider);
6843 strcpy(Name, dummy);
6845 else if (strstr(Name, "coins"))
6848 strcpy(dummy, "piles of ");
6849 strcat(dummy, Name);
6850 strcpy(Name, dummy);
6853 else if (strstr(Name, "Manes"))
6857 else if (streq(&(Name[NameLen - 2]), "ey"))
6859 strcpy(&(Name[NameLen - 2]), "eys");
6861 else if (Name[NameLen - 1] == 'y')
6863 strcpy(&(Name[NameLen - 1]), "ies");
6865 else if (streq(&(Name[NameLen - 4]), "ouse"))
6867 strcpy(&(Name[NameLen - 4]), "ice");
6869 else if (streq(&(Name[NameLen - 2]), "us"))
6871 strcpy(&(Name[NameLen - 2]), "i");
6873 else if (streq(&(Name[NameLen - 6]), "kelman"))
6875 strcpy(&(Name[NameLen - 6]), "kelmen");
6877 else if (streq(&(Name[NameLen - 8]), "wordsman"))
6879 strcpy(&(Name[NameLen - 8]), "wordsmen");
6881 else if (streq(&(Name[NameLen - 7]), "oodsman"))
6883 strcpy(&(Name[NameLen - 7]), "oodsmen");
6885 else if (streq(&(Name[NameLen - 7]), "eastman"))
6887 strcpy(&(Name[NameLen - 7]), "eastmen");
6889 else if (streq(&(Name[NameLen - 8]), "izardman"))
6891 strcpy(&(Name[NameLen - 8]), "izardmen");
6893 else if (streq(&(Name[NameLen - 5]), "geist"))
6895 strcpy(&(Name[NameLen - 5]), "geister");
6897 else if (streq(&(Name[NameLen - 2]), "ex"))
6899 strcpy(&(Name[NameLen - 2]), "ices");
6901 else if (streq(&(Name[NameLen - 2]), "lf"))
6903 strcpy(&(Name[NameLen - 2]), "lves");
6905 else if (suffix(Name, "ch") ||
6906 suffix(Name, "sh") ||
6907 suffix(Name, "nx") ||
6908 suffix(Name, "s") ||
6911 strcpy(&(Name[NameLen]), "es");
6915 strcpy(&(Name[NameLen]), "s");
6920 * Display current pets
6922 static void do_cmd_knowledge_pets(void)
6926 monster_type *m_ptr;
6929 int show_upkeep = 0;
6930 char file_name[1024];
6933 /* Open a new file */
6934 fff = my_fopen_temp(file_name, 1024);
6937 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6939 msg_format("Failed to create temporary file %s.", file_name);
6945 /* Process the monsters (backwards) */
6946 for (i = m_max - 1; i >= 1; i--)
6948 /* Access the monster */
6951 /* Ignore "dead" monsters */
6952 if (!m_ptr->r_idx) continue;
6954 /* Calculate "upkeep" for pets */
6958 monster_desc(pet_name, m_ptr, MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
6959 fprintf(fff, "%s (%s)\n", pet_name, look_mon_desc(m_ptr, 0x00));
6963 /* Process the waiting pets (backwards) */
6964 for (i = MAX_PARTY_MON - 1; i >= 0; i--)
6966 /* Access the monster */
6967 m_ptr = &party_mon[i];
6969 /* Ignore "dead" monsters */
6970 if (!m_ptr->r_idx) continue;
6974 /* List waiting pets */
6975 monster_desc(pet_name, m_ptr, MD_ASSUME_OUTSIDE | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
6976 fprintf(fff, "%s (%s)\n", pet_name, look_mon_desc(m_ptr, 0x00));
6979 show_upkeep = calculate_upkeep();
6981 fprintf(fff, "----------------------------------------------\n");
6983 fprintf(fff, " ¹ç·×: %d ÂΤΥڥåÈ\n", t_friends);
6984 fprintf(fff, " °Ý»ý¥³¥¹¥È: %d%% MP\n", show_upkeep);
6986 fprintf(fff, " Total: %d pet%s.\n",
6987 t_friends, (t_friends == 1 ? "" : "s"));
6988 fprintf(fff, " Upkeep: %d%% mana.\n", show_upkeep);
6993 /* Close the file */
6996 /* Display the file contents */
6998 show_file(TRUE, file_name, "¸½ºß¤Î¥Ú¥Ã¥È", 0, 0);
7000 show_file(TRUE, file_name, "Current Pets", 0, 0);
7004 /* Remove the file */
7012 * Note that the player ghosts are ignored. XXX XXX XXX
7014 static void do_cmd_knowledge_kill_count(void)
7022 char file_name[1024];
7027 /* Open a new file */
7028 fff = my_fopen_temp(file_name, 1024);
7032 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7034 msg_format("Failed to create temporary file %s.", file_name);
7040 /* Allocate the "who" array */
7041 C_MAKE(who, max_r_idx, s16b);
7044 /* Monsters slain */
7047 for (kk = 1; kk < max_r_idx; kk++)
7049 monster_race *r_ptr = &r_info[kk];
7051 if (r_ptr->flags1 & (RF1_UNIQUE))
7053 bool dead = (r_ptr->max_num == 0);
7062 s16b This = r_ptr->r_pkills;
7073 fprintf(fff,"¤¢¤Ê¤¿¤Ï¤Þ¤ÀŨ¤òÅݤ·¤Æ¤¤¤Ê¤¤¡£\n\n");
7075 fprintf(fff,"You have defeated no enemies yet.\n\n");
7079 fprintf(fff,"¤¢¤Ê¤¿¤Ï%ldÂΤÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n", Total);
7081 fprintf(fff,"You have defeated %ld %s.\n\n", Total, (Total == 1) ? "enemy" : "enemies");
7087 /* Scan the monsters */
7088 for (i = 1; i < max_r_idx; i++)
7090 monster_race *r_ptr = &r_info[i];
7092 /* Use that monster */
7093 if (r_ptr->name) who[n++] = i;
7096 /* Select the sort method */
7097 ang_sort_comp = ang_sort_comp_hook;
7098 ang_sort_swap = ang_sort_swap_hook;
7100 /* Sort the array by dungeon depth of monsters */
7101 ang_sort(who, &why, n);
7103 /* Scan the monster races */
7104 for (k = 0; k < n; k++)
7106 monster_race *r_ptr = &r_info[who[k]];
7108 if (r_ptr->flags1 & (RF1_UNIQUE))
7110 bool dead = (r_ptr->max_num == 0);
7114 /* Print a message */
7115 fprintf(fff, " %s\n",
7116 (r_name + r_ptr->name));
7122 s16b This = r_ptr->r_pkills;
7127 /* p,t¤Ï¿Í¤È¿ô¤¨¤ë by ita */
7128 if (strchr("pt", r_ptr->d_char))
7129 fprintf(fff, " %3d ¿Í¤Î %s\n", This, r_name + r_ptr->name);
7131 fprintf(fff, " %3d ÂΤΠ%s\n", This, r_name + r_ptr->name);
7135 if (strstr(r_name + r_ptr->name, "coins"))
7137 fprintf(fff, " 1 pile of %s\n", (r_name + r_ptr->name));
7141 fprintf(fff, " 1 %s\n", (r_name + r_ptr->name));
7147 strcpy(ToPlural, (r_name + r_ptr->name));
7148 plural_aux(ToPlural);
7149 fprintf(fff, " %d %s\n", This, ToPlural);
7159 fprintf(fff,"----------------------------------------------\n");
7161 fprintf(fff," ¹ç·×: %lu ÂΤòÅݤ·¤¿¡£\n", Total);
7163 fprintf(fff," Total: %lu creature%s killed.\n",
7164 Total, (Total == 1 ? "" : "s"));
7168 /* Free the "who" array */
7169 C_KILL(who, max_r_idx, s16b);
7171 /* Close the file */
7174 /* Display the file contents */
7176 show_file(TRUE, file_name, "Åݤ·¤¿Å¨¤Î¿ô", 0, 0);
7178 show_file(TRUE, file_name, "Kill Count", 0, 0);
7182 /* Remove the file */
7188 * Display the object groups.
7190 static void display_group_list(int col, int row, int wid, int per_page,
7191 int grp_idx[], cptr group_text[], int grp_cur, int grp_top)
7195 /* Display lines until done */
7196 for (i = 0; i < per_page && (grp_idx[i] >= 0); i++)
7198 /* Get the group index */
7199 int grp = grp_idx[grp_top + i];
7201 /* Choose a color */
7202 byte attr = (grp_top + i == grp_cur) ? TERM_L_BLUE : TERM_WHITE;
7204 /* Erase the entire line */
7205 Term_erase(col, row + i, wid);
7207 /* Display the group label */
7208 c_put_str(attr, group_text[grp], row + i, col);
7214 * Move the cursor in a browser window
7216 static void browser_cursor(char ch, int *column, int *grp_cur, int grp_cnt,
7217 int *list_cur, int list_cnt)
7222 int list = *list_cur;
7224 /* Extract direction */
7227 /* Hack -- scroll up full screen */
7232 /* Hack -- scroll down full screen */
7237 d = get_keymap_dir(ch);
7242 /* Diagonals - hack */
7243 if ((ddx[d] > 0) && ddy[d])
7249 Term_get_size(&wid, &hgt);
7251 browser_rows = hgt - 8;
7253 /* Browse group list */
7258 /* Move up or down */
7259 grp += ddy[d] * (browser_rows - 1);
7262 if (grp >= grp_cnt) grp = grp_cnt - 1;
7263 if (grp < 0) grp = 0;
7264 if (grp != old_grp) list = 0;
7267 /* Browse sub-list list */
7270 /* Move up or down */
7271 list += ddy[d] * browser_rows;
7274 if (list >= list_cnt) list = list_cnt - 1;
7275 if (list < 0) list = 0;
7287 if (col < 0) col = 0;
7288 if (col > 1) col = 1;
7295 /* Browse group list */
7300 /* Move up or down */
7304 if (grp >= grp_cnt) grp = grp_cnt - 1;
7305 if (grp < 0) grp = 0;
7306 if (grp != old_grp) list = 0;
7309 /* Browse sub-list list */
7312 /* Move up or down */
7316 if (list >= list_cnt) list = list_cnt - 1;
7317 if (list < 0) list = 0;
7328 static void display_visual_list(int col, int row, int height, int width, byte attr_top, byte char_left)
7332 /* Clear the display lines */
7333 for (i = 0; i < height; i++)
7335 Term_erase(col, row + i, width);
7338 /* Bigtile mode uses double width */
7339 if (use_bigtile) width /= 2;
7341 /* Display lines until done */
7342 for (i = 0; i < height; i++)
7344 /* Display columns until done */
7345 for (j = 0; j < width; j++)
7353 /* Bigtile mode uses double width */
7354 if (use_bigtile) x += j;
7359 /* Ignore illegal characters */
7360 if (ia > 0x7f || ic > 0xff || ic < ' ' ||
7361 (!use_graphics && ic > 0x7f))
7367 /* Force correct code for both ASCII character and tile */
7368 if (c & 0x80) a |= 0x80;
7370 if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
7372 /* Display symbol */
7373 Term_putch(x, y, a, c);
7376 if (use_bigtile) Term_putch(x + 1, y, a2, c2);
7383 * Place the cursor at the collect position for visual mode
7385 static void place_visual_list_cursor(int col, int row, byte a, byte c, byte attr_top, byte char_left)
7387 int i = (a & 0x7f) - attr_top;
7388 int j = c - char_left;
7393 /* Bigtile mode uses double width */
7394 if (use_bigtile) x += j;
7396 /* Place the cursor */
7402 * Clipboard variables for copy&paste in visual mode
7404 static byte attr_idx = 0;
7405 static byte char_idx = 0;
7408 * Do visual mode command -- Change symbols
7410 static bool visual_mode_command(char ch, bool *visual_list_ptr,
7411 int height, int width,
7412 byte *attr_top_ptr, byte *char_left_ptr,
7413 byte *cur_attr_ptr, byte *cur_char_ptr)
7415 static byte attr_old = 0, char_old = 0;
7420 if (*visual_list_ptr)
7423 *cur_attr_ptr = attr_old;
7424 *cur_char_ptr = char_old;
7425 *visual_list_ptr = FALSE;
7434 if (*visual_list_ptr)
7437 *visual_list_ptr = FALSE;
7445 if (!*visual_list_ptr)
7447 *visual_list_ptr = TRUE;
7449 *attr_top_ptr = MAX(0, (*cur_attr_ptr & 0x7f) - 5);
7450 *char_left_ptr = MAX(0, *cur_char_ptr - 10);
7452 attr_old = *cur_attr_ptr;
7453 char_old = *cur_char_ptr;
7461 /* Set the visual */
7462 attr_idx = *cur_attr_ptr;
7463 char_idx = *cur_char_ptr;
7469 if (attr_idx || (!(char_idx & 0x80) && char_idx)) /* Allow TERM_DARK text */
7472 *cur_attr_ptr = attr_idx;
7473 *attr_top_ptr = MAX(0, (*cur_attr_ptr & 0x7f) - 5);
7479 *cur_char_ptr = char_idx;
7480 *char_left_ptr = MAX(0, *cur_char_ptr - 10);
7486 if (*visual_list_ptr)
7489 int d = get_keymap_dir(ch);
7490 byte a = (*cur_attr_ptr & 0x7f);
7491 byte c = *cur_char_ptr;
7493 if (use_bigtile) eff_width = width / 2;
7494 else eff_width = width;
7496 /* Restrict direction */
7497 if ((a == 0) && (ddy[d] < 0)) d = 0;
7498 if ((c == 0) && (ddx[d] < 0)) d = 0;
7499 if ((a == 0x7f) && (ddy[d] > 0)) d = 0;
7500 if ((c == 0xff) && (ddx[d] > 0)) d = 0;
7505 /* Force correct code for both ASCII character and tile */
7506 if (c & 0x80) a |= 0x80;
7508 /* Set the visual */
7513 /* Move the frame */
7514 if ((ddx[d] < 0) && *char_left_ptr > MAX(0, (int)c - 10)) (*char_left_ptr)--;
7515 if ((ddx[d] > 0) && *char_left_ptr + eff_width < MIN(0xff, (int)c + 10)) (*char_left_ptr)++;
7516 if ((ddy[d] < 0) && *attr_top_ptr > MAX(0, (int)(a & 0x7f) - 4)) (*attr_top_ptr)--;
7517 if ((ddy[d] > 0) && *attr_top_ptr + height < MIN(0x7f, (a & 0x7f) + 4)) (*attr_top_ptr)++;
7524 /* Visual mode command is not used */
7530 * Display the monsters in a group.
7532 static void display_monster_list(int col, int row, int per_page, s16b mon_idx[],
7533 int mon_cur, int mon_top)
7537 /* Display lines until done */
7538 for (i = 0; i < per_page && mon_idx[mon_top + i]; i++)
7544 /* Get the race index */
7545 int r_idx = mon_idx[mon_top + i] ;
7547 /* Access the race */
7548 monster_race *r_ptr = &r_info[r_idx];
7551 /* Choose a color */
7552 attr = ((i + mon_top == mon_cur) ? TERM_L_BLUE : TERM_WHITE);
7554 /* Display the name */
7555 c_prt(attr, (r_name + r_ptr->name), row + i, col);
7557 /* Hack -- visual_list mode */
7560 c_prt(attr, format("%02x/%02x", r_ptr->x_attr, r_ptr->x_char), row + i, 60);
7562 else if (p_ptr->wizard)
7564 c_prt(attr, format("%d", r_idx), row + i, 62);
7569 if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
7571 /* Erase chars before overwritten by the race letter */
7572 Term_erase(69, row + i, 255);
7574 /* Display symbol */
7575 Term_putch(70, row + i, a, c);
7578 if (use_bigtile) Term_putch(70 + 1, row + i, a2, c2);
7581 if (!(r_ptr->flags1 & RF1_UNIQUE)) put_str(format("%5d", r_ptr->r_pkills), row + i, 73);
7583 else c_put_str((r_ptr->max_num == 0 ? TERM_L_DARK : TERM_WHITE), (r_ptr->max_num == 0 ? "»àË´" : "À¸Â¸"), row + i, 74);
7585 else c_put_str((r_ptr->max_num == 0 ? TERM_L_DARK : TERM_WHITE), (r_ptr->max_num == 0 ? " dead" : "alive"), row + i, 73);
7590 /* Clear remaining lines */
7591 for (; i < per_page; i++)
7593 Term_erase(col, row + i, 255);
7599 * Display known monsters.
7601 static void do_cmd_knowledge_monsters(void)
7604 int grp_cur, grp_top, old_grp_cur;
7605 int mon_cur, mon_top;
7606 int grp_cnt, grp_idx[100];
7614 bool visual_list = FALSE;
7615 byte attr_top = 0, char_left = 0;
7621 Term_get_size(&wid, &hgt);
7623 browser_rows = hgt - 8;
7625 /* Allocate the "mon_idx" array */
7626 C_MAKE(mon_idx, max_r_idx, s16b);
7631 /* Check every group */
7632 for (i = 0; monster_group_text[i] != NULL; i++)
7634 /* Measure the label */
7635 len = strlen(monster_group_text[i]);
7637 /* Save the maximum length */
7638 if (len > max) max = len;
7640 /* See if any monsters are known */
7641 if ((monster_group_char[i] == ((char *) -1L)) || collect_monsters(i, mon_idx, 0x01))
7643 /* Build a list of groups with known monsters */
7644 grp_idx[grp_cnt++] = i;
7648 /* Terminate the list */
7649 grp_idx[grp_cnt] = -1;
7652 grp_cur = grp_top = 0;
7653 mon_cur = mon_top = 0;
7662 monster_race *r_ptr;
7669 prt("Ãμ± - ¥â¥ó¥¹¥¿¡¼", 2, 0);
7670 prt("¥°¥ë¡¼¥×", 4, 0);
7671 prt("̾Á°", 4, max + 3);
7672 if (p_ptr->wizard) prt("Idx", 4, 62);
7673 prt("ʸ»ú »¦³²¿ô", 4, 67);
7675 prt("Knowledge - Monsters", 2, 0);
7677 prt("Name", 4, max + 3);
7678 if (p_ptr->wizard) prt("Idx", 4, 62);
7679 prt("Sym Kills", 4, 68);
7682 for (i = 0; i < 78; i++)
7684 Term_putch(i, 5, TERM_WHITE, '=');
7687 for (i = 0; i < browser_rows; i++)
7689 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
7695 /* Scroll group list */
7696 if (grp_cur < grp_top) grp_top = grp_cur;
7697 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
7699 /* Display a list of monster groups */
7700 display_group_list(0, 6, max, browser_rows, grp_idx, monster_group_text, grp_cur, grp_top);
7702 if (old_grp_cur != grp_cur)
7704 old_grp_cur = grp_cur;
7706 /* Get a list of monsters in the current group */
7707 mon_cnt = collect_monsters(grp_idx[grp_cur], mon_idx, 0x00);
7710 /* Scroll monster list */
7711 while (mon_cur < mon_top)
7712 mon_top = MAX(0, mon_top - browser_rows/2);
7713 while (mon_cur >= mon_top + browser_rows)
7714 mon_top = MIN(mon_cnt - browser_rows, mon_top + browser_rows/2);
7718 /* Display a list of monsters in the current group */
7719 display_monster_list(max + 3, 6, browser_rows, mon_idx, mon_cur, mon_top);
7725 /* Display a monster name */
7726 display_monster_list(max + 3, 6, 1, mon_idx, mon_cur, mon_top);
7728 /* Display visual list below first monster */
7729 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
7734 prt(format("<Êý¸þ>, 'r'¤Ç»×¤¤½Ð¤ò¸«¤ë%s%s, ESC", visual_list ? ", ENTER¤Ç·èÄê" : ", 'v'¤Ç¥·¥ó¥Ü¥ëÊѹ¹", (attr_idx||char_idx) ? ", 'c', 'p'¤Ç¥Ú¡¼¥¹¥È" : ", 'c'¤Ç¥³¥Ô¡¼"), hgt - 1, 0);
7736 prt(format("<dir>, 'r' to recall%s%s, ESC", visual_list ? ", ENTER to accept" : ", 'v' for visuals", (attr_idx||char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"), hgt - 1, 0);
7739 /* Get the current monster */
7740 r_ptr = &r_info[mon_idx[mon_cur]];
7742 /* Mega Hack -- track this monster race */
7743 if (mon_cnt) monster_race_track(mon_idx[mon_cur]);
7745 /* Hack -- handle stuff */
7750 place_visual_list_cursor(max + 3, 7, r_ptr->x_attr, r_ptr->x_char, attr_top, char_left);
7754 Term_gotoxy(0, 6 + (grp_cur - grp_top));
7758 Term_gotoxy(max + 3, 6 + (mon_cur - mon_top));
7763 /* Do visual mode command if needed */
7764 if (visual_mode_command(ch, &visual_list, browser_rows-1, wid - (max + 3), &attr_top, &char_left, &r_ptr->x_attr, &r_ptr->x_char)) continue;
7777 /* Recall on screen */
7778 if (mon_idx[mon_cur])
7780 screen_roff(mon_idx[mon_cur], 0);
7791 /* Move the cursor */
7792 browser_cursor(ch, &column, &grp_cur, grp_cnt, &mon_cur, mon_cnt);
7799 /* Free the "mon_idx" array */
7800 C_KILL(mon_idx, max_r_idx, s16b);
7805 * Display the objects in a group.
7807 static void display_object_list(int col, int row, int per_page, int object_idx[],
7808 int object_cur, int object_top)
7812 /* Display lines until done */
7813 for (i = 0; i < per_page && object_idx[object_top + i]; i++)
7819 /* Get the object index */
7820 int k_idx = object_idx[object_top + i];
7822 /* Access the object */
7823 object_kind *k_ptr = &k_info[k_idx];
7825 /* Choose a color */
7826 byte attr = (k_ptr->aware ? TERM_WHITE : TERM_SLATE);
7827 byte cursor = (k_ptr->aware ? TERM_L_BLUE : TERM_BLUE);
7829 attr = ((i + object_top == object_cur) ? cursor : attr);
7832 strip_name(o_name, k_idx);
7834 /* Display the name */
7835 c_prt(attr, o_name, row + i, col);
7837 /* Hack -- visual_list mode */
7840 c_prt(attr, format("%02x/%02x", k_ptr->x_attr, k_ptr->x_char), row + i, 60);
7842 else if (p_ptr->wizard)
7844 c_prt(attr, format ("%d", k_idx), row + i, 70);
7847 a = k_ptr->flavor ? misc_to_attr[k_ptr->flavor] : k_ptr->x_attr;
7848 c = k_ptr->flavor ? misc_to_char[k_ptr->flavor] : k_ptr->x_char;
7850 /* Symbol is unknown */
7851 if (!k_ptr->aware && !p_ptr->wizard)
7857 if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
7859 /* Display symbol */
7860 Term_putch(76, row + i, a, c);
7863 if (use_bigtile) Term_putch(76 + 1, row + i, a2, c2);
7866 /* Clear remaining lines */
7867 for (; i < per_page; i++)
7869 Term_erase(col, row + i, 255);
7874 * Describe fake object
7876 static void desc_obj_fake(int k_idx)
7879 object_type object_type_body;
7881 /* Get local object */
7882 o_ptr = &object_type_body;
7884 /* Wipe the object */
7887 /* Create the artifact */
7888 object_prep(o_ptr, k_idx);
7890 /* It's fully know */
7891 o_ptr->ident |= IDENT_KNOWN;
7893 /* Track the object */
7894 /* object_actual_track(o_ptr); */
7896 /* Hack - mark as fake */
7897 /* term_obj_real = FALSE; */
7899 /* Hack -- Handle stuff */
7902 if (!screen_object(o_ptr, SCROBJ_FAKE_OBJECT | SCROBJ_FORCE_DETAIL))
7905 msg_print("ÆäËÊѤï¤Ã¤¿¤È¤³¤í¤Ï¤Ê¤¤¤è¤¦¤À¡£");
7907 msg_print("You see nothing special.");
7916 * Display known objects
7918 static void do_cmd_knowledge_objects(void)
7921 int grp_cur, grp_top, old_grp_cur;
7922 int object_old, object_cur, object_top;
7923 int grp_cnt, grp_idx[100];
7931 bool visual_list = FALSE;
7932 byte attr_top = 0, char_left = 0;
7938 Term_get_size(&wid, &hgt);
7940 browser_rows = hgt - 8;
7942 /* Allocate the "object_idx" array */
7943 C_MAKE(object_idx, max_k_idx, int);
7948 /* Check every group */
7949 for (i = 0; object_group_text[i] != NULL; i++)
7951 /* Measure the label */
7952 len = strlen(object_group_text[i]);
7954 /* Save the maximum length */
7955 if (len > max) max = len;
7957 /* See if any monsters are known */
7958 if (collect_objects(i, object_idx))
7960 /* Build a list of groups with known monsters */
7961 grp_idx[grp_cnt++] = i;
7965 /* Terminate the list */
7966 grp_idx[grp_cnt] = -1;
7969 grp_cur = grp_top = 0;
7970 object_cur = object_top = 0;
7987 prt("Ãμ± - ¥¢¥¤¥Æ¥à", 2, 0);
7988 prt("¥°¥ë¡¼¥×", 4, 0);
7989 prt("̾Á°", 4, max + 3);
7990 if (p_ptr->wizard) prt("Idx", 4, 70);
7993 prt("Knowledge - objects", 2, 0);
7995 prt("Name", 4, max + 3);
7996 if (p_ptr->wizard) prt("Idx", 4, 70);
8000 for (i = 0; i < 78; i++)
8002 Term_putch(i, 5, TERM_WHITE, '=');
8005 for (i = 0; i < browser_rows; i++)
8007 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
8013 /* Scroll group list */
8014 if (grp_cur < grp_top) grp_top = grp_cur;
8015 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
8017 /* Display a list of object groups */
8018 display_group_list(0, 6, max, browser_rows, grp_idx, object_group_text, grp_cur, grp_top);
8020 if (old_grp_cur != grp_cur)
8022 old_grp_cur = grp_cur;
8024 /* Get a list of objects in the current group */
8025 object_cnt = collect_objects(grp_idx[grp_cur], object_idx);
8028 /* Scroll object list */
8029 while (object_cur < object_top)
8030 object_top = MAX(0, object_top - browser_rows/2);
8031 while (object_cur >= object_top + browser_rows)
8032 object_top = MIN(object_cnt - browser_rows, object_top + browser_rows/2);
8036 /* Display a list of objects in the current group */
8037 display_object_list(max + 3, 6, browser_rows, object_idx, object_cur, object_top);
8041 object_top = object_cur;
8043 /* Display a list of objects in the current group */
8044 display_object_list(max + 3, 6, 1, object_idx, object_cur, object_top);
8046 /* Display visual list below first object */
8047 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
8050 /* Get the current object */
8051 k_ptr = &k_info[object_idx[object_cur]];
8053 /* Mega Hack -- track this object */
8054 if (object_cnt) object_kind_track(object_idx[object_cur]);
8058 prt(format("<Êý¸þ>, 'r'¤Ç¾ÜºÙ¤ò¸«¤ë%s%s, ESC", k_ptr->flavor ? "" : visual_list ? ", ENTER¤Ç·èÄê" : ", 'v'¤Ç¥·¥ó¥Ü¥ëÊѹ¹", (attr_idx||char_idx) ? ", 'c', 'p'¤Ç¥Ú¡¼¥¹¥È" : ", 'c'¤Ç¥³¥Ô¡¼"), hgt - 1, 0);
8060 prt(format("<dir>, 'r' to recall%s%s, ESC", k_ptr->flavor ? "" : visual_list ? ", ENTER to accept" : ", 'v' for visuals", (attr_idx||char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"), hgt - 1, 0);
8063 /* The "current" object changed */
8064 if (object_old != object_idx[object_cur])
8066 /* Hack -- handle stuff */
8069 /* Remember the "current" object */
8070 object_old = object_idx[object_cur];
8075 place_visual_list_cursor(max + 3, 7, k_ptr->x_attr, k_ptr->x_char, attr_top, char_left);
8079 Term_gotoxy(0, 6 + (grp_cur - grp_top));
8083 Term_gotoxy(max + 3, 6 + (object_cur - object_top));
8088 /* Do visual mode command if needed */
8089 /* Symbol of objects with flavor cannot be changed */
8090 if (!k_ptr->flavor && visual_mode_command(ch, &visual_list, browser_rows-1, wid - (max + 3), &attr_top, &char_left, &k_ptr->x_attr, &k_ptr->x_char)) continue;
8103 /* Recall on screen */
8105 desc_obj_fake(object_idx[object_cur]);
8113 /* Move the cursor */
8114 browser_cursor(ch, &column, &grp_cur, grp_cnt, &object_cur, object_cnt);
8120 /* Free the "object_idx" array */
8121 C_KILL(object_idx, max_k_idx, int);
8127 * Display the features in a group.
8129 static void display_feature_list(int col, int row, int per_page, int *feat_idx,
8130 int feat_cur, int feat_top)
8134 /* Display lines until done */
8135 for (i = 0; i < per_page && feat_idx[feat_top + i]; i++)
8142 int f_idx = feat_idx[feat_top + i];
8144 /* Access the index */
8145 feature_type *f_ptr = &f_info[f_idx];
8147 /* Choose a color */
8148 attr = ((i + feat_top == feat_cur) ? TERM_L_BLUE : TERM_WHITE);
8150 /* Display the name */
8151 c_prt(attr, f_name + f_ptr->name, row + i, col);
8153 /* Hack -- visual_list mode */
8156 c_prt(attr, format("%02x/%02x", f_ptr->x_attr, f_ptr->x_char), row + i, 60);
8162 if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
8164 /* Display symbol */
8165 Term_putch(68, row + i, a, c);
8168 if (use_bigtile) Term_putch(68 + 1, row + i, a2, c2);
8171 /* Clear remaining lines */
8172 for (; i < per_page; i++)
8174 Term_erase(col, row + i, 255);
8180 * Interact with feature visuals.
8182 static void do_cmd_knowledge_features(void)
8185 int grp_cur, grp_top, old_grp_cur;
8186 int feat_cur, feat_top;
8187 int grp_cnt, grp_idx[100];
8195 bool visual_list = FALSE;
8196 byte attr_top = 0, char_left = 0;
8202 Term_get_size(&wid, &hgt);
8204 browser_rows = hgt - 8;
8206 /* Allocate the "feat_idx" array */
8207 C_MAKE(feat_idx, max_f_idx, int);
8212 /* Check every group */
8213 for (i = 0; feature_group_text[i] != NULL; i++)
8215 /* Measure the label */
8216 len = strlen(feature_group_text[i]);
8218 /* Save the maximum length */
8219 if (len > max) max = len;
8221 /* See if any features are known */
8222 if (collect_features(i, feat_idx))
8224 /* Build a list of groups with known features */
8225 grp_idx[grp_cnt++] = i;
8229 /* Terminate the list */
8230 grp_idx[grp_cnt] = -1;
8233 grp_cur = grp_top = 0;
8234 feat_cur = feat_top = 0;
8240 while ((!flag) && (grp_cnt))
8243 feature_type *f_ptr;
8250 prt("ɽ¼¨ - ÃÏ·Á", 2, 0);
8251 prt("¥°¥ë¡¼¥×", 4, 0);
8252 prt("̾Á°", 4, max + 3);
8255 prt("Visuals - features", 2, 0);
8257 prt("Name", 4, max + 3);
8261 for (i = 0; i < 78; i++)
8263 Term_putch(i, 5, TERM_WHITE, '=');
8266 for (i = 0; i < browser_rows; i++)
8268 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
8274 /* Scroll group list */
8275 if (grp_cur < grp_top) grp_top = grp_cur;
8276 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
8278 /* Display a list of feature groups */
8279 display_group_list(0, 6, max, browser_rows, grp_idx, feature_group_text, grp_cur, grp_top);
8281 if (old_grp_cur != grp_cur)
8283 old_grp_cur = grp_cur;
8285 /* Get a list of features in the current group */
8286 feat_cnt = collect_features(grp_idx[grp_cur], feat_idx);
8289 /* Scroll feature list */
8290 while (feat_cur < feat_top)
8291 feat_top = MAX(0, feat_top - browser_rows/2);
8292 while (feat_cur >= feat_top + browser_rows)
8293 feat_top = MIN(feat_cnt - browser_rows, feat_top + browser_rows/2);
8297 /* Display a list of features in the current group */
8298 display_feature_list(max + 3, 6, browser_rows, feat_idx, feat_cur, feat_top);
8302 feat_top = feat_cur;
8304 /* Display a list of features in the current group */
8305 display_feature_list(max + 3, 6, 1, feat_idx, feat_cur, feat_top);
8307 /* Display visual list below first object */
8308 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
8313 prt(format("<Êý¸þ>%s%s, ESC", visual_list ? ", ENTER¤Ç·èÄê" : ", 'v'¤Ç¥·¥ó¥Ü¥ëÊѹ¹", (attr_idx||char_idx) ? ", 'c', 'p'¤Ç¥Ú¡¼¥¹¥È" : ", 'c'¤Ç¥³¥Ô¡¼"), hgt - 1, 0);
8315 prt(format("<dir>%s%s, ESC", visual_list ? ", ENTER to accept" : ", 'v' for visuals", (attr_idx||char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"), hgt - 1, 0);
8318 /* Get the current feature */
8319 f_ptr = &f_info[feat_idx[feat_cur]];
8323 place_visual_list_cursor(max + 3, 7, f_ptr->x_attr, f_ptr->x_char, attr_top, char_left);
8327 Term_gotoxy(0, 6 + (grp_cur - grp_top));
8331 Term_gotoxy(max + 3, 6 + (feat_cur - feat_top));
8336 /* Do visual mode command if needed */
8337 if (visual_mode_command(ch, &visual_list, browser_rows-1, wid - (max + 3), &attr_top, &char_left, &f_ptr->x_attr, &f_ptr->x_char)) continue;
8349 /* Move the cursor */
8350 browser_cursor(ch, &column, &grp_cur, grp_cnt, &feat_cur, feat_cnt);
8357 if (!grp_cnt) msg_print("No features known.");
8359 /* Free the "feat_idx" array */
8360 C_KILL(feat_idx, max_f_idx, int);
8365 * List wanted monsters
8367 static void do_cmd_knowledge_kubi(void)
8372 char file_name[1024];
8375 /* Open a new file */
8376 fff = my_fopen_temp(file_name, 1024);
8379 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
8381 msg_format("Failed to create temporary file %s.", file_name);
8389 bool listed = FALSE;
8392 fprintf(fff, "º£Æü¤Î¥¿¡¼¥²¥Ã¥È : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "ÉÔÌÀ"));
8394 fprintf(fff, "¾Þ¶â¼ó¥ê¥¹¥È\n");
8396 fprintf(fff, "Today target : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "unknown"));
8398 fprintf(fff, "List of wanted monsters\n");
8400 fprintf(fff, "----------------------------------------------\n");
8402 for (i = 0; i < MAX_KUBI; i++)
8404 if (kubi_r_idx[i] <= 10000)
8406 fprintf(fff,"%s\n", r_name + r_info[kubi_r_idx[i]].name);
8415 fprintf(fff,"\n%s\n", "¾Þ¶â¼ó¤Ï¤â¤¦»Ä¤Ã¤Æ¤¤¤Þ¤»¤ó¡£");
8417 fprintf(fff,"\n%s\n", "There is no more wanted monster.");
8422 /* Close the file */
8425 /* Display the file contents */
8427 show_file(TRUE, file_name, "¾Þ¶â¼ó¤Î°ìÍ÷", 0, 0);
8429 show_file(TRUE, file_name, "Wanted monsters", 0, 0);
8433 /* Remove the file */
8438 * List virtues & status
8440 static void do_cmd_knowledge_virtues(void)
8444 char file_name[1024];
8447 /* Open a new file */
8448 fff = my_fopen_temp(file_name, 1024);
8451 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
8453 msg_format("Failed to create temporary file %s.", file_name);
8462 fprintf(fff, "¸½ºß¤Î°À : %s\n\n", your_alignment());
8464 fprintf(fff, "Your alighnment : %s\n\n", your_alignment());
8469 /* Close the file */
8472 /* Display the file contents */
8474 show_file(TRUE, file_name, "Ȭ¤Ä¤ÎÆÁ", 0, 0);
8476 show_file(TRUE, file_name, "Virtues", 0, 0);
8480 /* Remove the file */
8488 static void do_cmd_knowledge_dungeon(void)
8492 char file_name[1024];
8496 /* Open a new file */
8497 fff = my_fopen_temp(file_name, 1024);
8500 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
8502 msg_format("Failed to create temporary file %s.", file_name);
8510 for (i = 1; i < max_d_idx; i++)
8514 if (!d_info[i].maxdepth) continue;
8515 if (!max_dlv[i]) continue;
8516 if (d_info[i].final_guardian)
8518 if (!r_info[d_info[i].final_guardian].max_num) seiha = TRUE;
8520 else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
8522 fprintf(fff,"%c%-12s : %3d ³¬\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
8524 fprintf(fff,"%c%-16s : level %3d\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
8529 /* Close the file */
8532 /* Display the file contents */
8534 show_file(TRUE, file_name, "º£¤Þ¤Ç¤ËÆþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó", 0, 0);
8536 show_file(TRUE, file_name, "Dungeon", 0, 0);
8540 /* Remove the file */
8545 * List virtues & status
8548 static void do_cmd_knowledge_stat(void)
8552 char file_name[1024];
8555 /* Open a new file */
8556 fff = my_fopen_temp(file_name, 1024);
8559 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
8561 msg_format("Failed to create temporary file %s.", file_name);
8569 percent = (int)(((long)p_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
8570 (2 * p_ptr->hitdie +
8571 ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
8574 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : %d/100\n\n", percent);
8575 else fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : ???\n\n");
8576 fprintf(fff, "ǽÎϤκÇÂçÃÍ\n\n");
8578 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "Your current Life Rating is %d/100.\n\n", percent);
8579 else fprintf(fff, "Your current Life Rating is ???.\n\n");
8580 fprintf(fff, "Limits of maximum stats\n\n");
8582 for (v_nr = 0; v_nr < 6; v_nr++)
8584 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);
8585 else fprintf(fff, "%s ???\n", stat_names[v_nr]);
8591 /* Close the file */
8594 /* Display the file contents */
8596 show_file(TRUE, file_name, "¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó", 0, 0);
8598 show_file(TRUE, file_name, "HP-rate & Max stat", 0, 0);
8602 /* Remove the file */
8608 * Print all active quests
8610 static void do_cmd_knowledge_quests_current(FILE *fff)
8613 char rand_tmp_str[120] = "\0";
8615 monster_race *r_ptr;
8617 int rand_level = 100;
8621 fprintf(fff, "¡Ô¿ë¹ÔÃæ¤Î¥¯¥¨¥¹¥È¡Õ\n");
8623 fprintf(fff, "< Current Quest >\n");
8626 for (i = 1; i < max_quests; i++)
8628 if ((quest[i].status == QUEST_STATUS_TAKEN) || (quest[i].status == QUEST_STATUS_COMPLETED))
8630 /* Set the quest number temporary */
8631 int old_quest = p_ptr->inside_quest;
8634 /* Clear the text */
8635 for (j = 0; j < 10; j++) quest_text[j][0] = '\0';
8636 quest_text_line = 0;
8638 p_ptr->inside_quest = i;
8640 /* Get the quest text */
8641 init_flags = INIT_SHOW_TEXT;
8643 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
8645 /* Reset the old quest number */
8646 p_ptr->inside_quest = old_quest;
8648 /* No info from "silent" quests */
8649 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
8653 if (quest[i].type != QUEST_TYPE_RANDOM)
8655 char note[80] = "\0";
8657 if (quest[i].status == QUEST_STATUS_TAKEN)
8659 switch (quest[i].type)
8661 case QUEST_TYPE_KILL_LEVEL:
8662 case QUEST_TYPE_KILL_ANY_LEVEL:
8663 r_ptr = &r_info[quest[i].r_idx];
8664 strcpy(name, r_name + r_ptr->name);
8665 if (quest[i].max_num > 1)
8668 sprintf(note," - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",
8669 quest[i].max_num, name, quest[i].max_num - quest[i].cur_num);
8672 sprintf(note," - kill %d %s, have killed %d.",
8673 quest[i].max_num, name, quest[i].cur_num);
8678 sprintf(note," - %s¤òÅݤ¹¡£",name);
8680 sprintf(note," - kill %s.",name);
8684 case QUEST_TYPE_FIND_ARTIFACT:
8685 strcpy(name, a_name + a_info[quest[i].k_idx].name);
8687 sprintf(note," - %s¤ò¸«¤Ä¤±½Ð¤¹¡£", name);
8689 sprintf(note," - Find out %s.", name);
8693 case QUEST_TYPE_FIND_EXIT:
8695 sprintf(note," - õº÷¤¹¤ë¡£");
8697 sprintf(note," - Search.");
8701 case QUEST_TYPE_KILL_NUMBER:
8703 sprintf(note," - %d ÂΤΥâ¥ó¥¹¥¿¡¼¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",
8704 quest[i].max_num, quest[i].max_num - quest[i].cur_num);
8706 sprintf(note," - Kill %d monsters, have killed %d.",
8707 quest[i].max_num, quest[i].cur_num);
8711 case QUEST_TYPE_KILL_ALL:
8713 sprintf(note," - Á´¤Æ¤Î¥â¥ó¥¹¥¿¡¼¤òÅݤ¹¡£");
8715 sprintf(note," - Kill all monsters.");
8721 /* Print the quest info */
8723 sprintf(tmp_str, " %s (´í¸±ÅÙ:%d³¬ÁêÅö)%s\n",
8724 quest[i].name, quest[i].level, note);
8726 sprintf(tmp_str, " %s (Danger level: %d)%s\n",
8727 quest[i].name, quest[i].level, note);
8730 fputs(tmp_str, fff);
8732 if (quest[i].status == QUEST_STATUS_COMPLETED)
8735 sprintf(tmp_str, " ¥¯¥¨¥¹¥ÈãÀ® - ¤Þ¤ÀÊó½·¤ò¼õ¤±¤È¤Ã¤Æ¤Ê¤¤¡£\n");
8737 sprintf(tmp_str, " Quest Completed - Unrewarded\n");
8739 fputs(tmp_str, fff);
8745 while (quest_text[j][0] && j < 10)
8747 fprintf(fff, " %s\n", quest_text[j]);
8752 else if (quest[i].level < rand_level) /* QUEST_TYPE_RANDOM */
8755 rand_level = quest[i].level;
8757 if (max_dlv[DUNGEON_ANGBAND] >= rand_level)
8759 /* Print the quest info */
8760 r_ptr = &r_info[quest[i].r_idx];
8761 strcpy(name, r_name + r_ptr->name);
8763 if (quest[i].max_num > 1)
8766 sprintf(rand_tmp_str," %s (%d ³¬) - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)\n",
8767 quest[i].name, quest[i].level,
8768 quest[i].max_num, name, quest[i].max_num - quest[i].cur_num);
8772 sprintf(rand_tmp_str," %s (Dungeon level: %d)\n Kill %d %s, have killed %d.\n",
8773 quest[i].name, quest[i].level,
8774 quest[i].max_num, name, quest[i].cur_num);
8780 sprintf(rand_tmp_str," %s (%d ³¬) - %s¤òÅݤ¹¡£\n",
8781 quest[i].name, quest[i].level, name);
8783 sprintf(rand_tmp_str," %s (Dungeon level: %d)\n Kill %s.\n",
8784 quest[i].name, quest[i].level, name);
8792 /* Print the current random quest */
8793 if (rand_tmp_str[0]) fputs(rand_tmp_str, fff);
8796 if (!total) fprintf(fff, " ¤Ê¤·\n");
8798 if (!total) fprintf(fff, " Nothing.\n");
8804 * Print all finished quests
8806 void do_cmd_knowledge_quests_completed(FILE *fff, int quest_num[])
8813 fprintf(fff, "¡ÔãÀ®¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
8815 fprintf(fff, "< Completed Quest >\n");
8817 for (i = 1; i < max_quests; i++)
8819 int q_idx = quest_num[i];
8821 if (quest[q_idx].status == QUEST_STATUS_FINISHED)
8823 if (is_fixed_quest_idx(q_idx))
8825 /* Set the quest number temporary */
8826 int old_quest = p_ptr->inside_quest;
8828 p_ptr->inside_quest = q_idx;
8831 init_flags = INIT_ASSIGN;
8833 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
8835 /* Reset the old quest number */
8836 p_ptr->inside_quest = old_quest;
8838 /* No info from "silent" quests */
8839 if (quest[q_idx].flags & QUEST_FLAG_SILENT) continue;
8844 if (!is_fixed_quest_idx(q_idx) && quest[q_idx].r_idx)
8846 /* Print the quest info */
8848 if (quest[q_idx].complev == 0)
8852 " %-40s (%3d³¬) - ÉÔÀᄀ\n",
8854 " %-40s (Dungeon level: %3d) - (Cancelled)\n",
8856 r_name+r_info[quest[q_idx].r_idx].name,
8857 quest[q_idx].level);
8863 " %-40s (%3d³¬) - ¥ì¥Ù¥ë%2d\n",
8865 " %-40s (Dungeon level: %3d) - level %2d\n",
8867 r_name+r_info[quest[q_idx].r_idx].name,
8869 quest[q_idx].complev);
8874 /* Print the quest info */
8876 sprintf(tmp_str, " %-40s (´í¸±ÅÙ:%3d³¬ÁêÅö) - ¥ì¥Ù¥ë%2d\n",
8877 quest[q_idx].name, quest[q_idx].level, quest[q_idx].complev);
8879 sprintf(tmp_str, " %-40s (Danger level: %3d) - level %2d\n",
8880 quest[q_idx].name, quest[q_idx].level, quest[q_idx].complev);
8884 fputs(tmp_str, fff);
8888 if (!total) fprintf(fff, " ¤Ê¤·\n");
8890 if (!total) fprintf(fff, " Nothing.\n");
8896 * Print all failed quests
8898 void do_cmd_knowledge_quests_failed(FILE *fff, int quest_num[])
8905 fprintf(fff, "¡Ô¼ºÇÔ¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
8907 fprintf(fff, "< Failed Quest >\n");
8909 for (i = 1; i < max_quests; i++)
8911 int q_idx = quest_num[i];
8913 if ((quest[q_idx].status == QUEST_STATUS_FAILED_DONE) || (quest[q_idx].status == QUEST_STATUS_FAILED))
8915 if (is_fixed_quest_idx(q_idx))
8917 /* Set the quest number temporary */
8918 int old_quest = p_ptr->inside_quest;
8920 p_ptr->inside_quest = q_idx;
8922 /* Get the quest text */
8923 init_flags = INIT_ASSIGN;
8925 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
8927 /* Reset the old quest number */
8928 p_ptr->inside_quest = old_quest;
8930 /* No info from "silent" quests */
8931 if (quest[q_idx].flags & QUEST_FLAG_SILENT) continue;
8936 if (!is_fixed_quest_idx(q_idx) && quest[q_idx].r_idx)
8938 /* Print the quest info */
8940 sprintf(tmp_str, " %-40s (%3d³¬) - ¥ì¥Ù¥ë%2d\n",
8941 r_name+r_info[quest[q_idx].r_idx].name, quest[q_idx].level, quest[q_idx].complev);
8943 sprintf(tmp_str, " %-40s (Dungeon level: %3d) - level %2d\n",
8944 r_name+r_info[quest[q_idx].r_idx].name, quest[q_idx].level, quest[q_idx].complev);
8949 /* Print the quest info */
8951 sprintf(tmp_str, " %-40s (´í¸±ÅÙ:%3d³¬ÁêÅö) - ¥ì¥Ù¥ë%2d\n",
8952 quest[q_idx].name, quest[q_idx].level, quest[q_idx].complev);
8954 sprintf(tmp_str, " %-40s (Danger level: %3d) - level %2d\n",
8955 quest[q_idx].name, quest[q_idx].level, quest[q_idx].complev);
8958 fputs(tmp_str, fff);
8962 if (!total) fprintf(fff, " ¤Ê¤·\n");
8964 if (!total) fprintf(fff, " Nothing.\n");
8970 * Print all random quests
8972 static void do_cmd_knowledge_quests_wiz_random(FILE *fff)
8979 fprintf(fff, "¡Ô»Ä¤ê¤Î¥é¥ó¥À¥à¥¯¥¨¥¹¥È¡Õ\n");
8981 fprintf(fff, "< Remaining Random Quest >\n");
8983 for (i = 1; i < max_quests; i++)
8985 /* No info from "silent" quests */
8986 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
8988 if ((quest[i].type == QUEST_TYPE_RANDOM) && (quest[i].status == QUEST_STATUS_TAKEN))
8992 /* Print the quest info */
8994 sprintf(tmp_str, " %s (%d³¬, %s)\n",
8995 quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
8997 sprintf(tmp_str, " %s (%d, %s)\n",
8998 quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
9000 fputs(tmp_str, fff);
9004 if (!total) fprintf(fff, " ¤Ê¤·\n");
9006 if (!total) fprintf(fff, " Nothing.\n");
9011 bool ang_sort_comp_quest_num(vptr u, vptr v, int a, int b)
9013 int *q_num = (int *)u;
9014 quest_type *qa = &quest[q_num[a]];
9015 quest_type *qb = &quest[q_num[b]];
9020 if (qa->complev < qb->complev) return TRUE;
9021 if (qa->complev > qb->complev) return FALSE;
9022 if (qa->level <= qb->level) return TRUE;
9026 void ang_sort_swap_quest_num(vptr u, vptr v, int a, int b)
9028 int *q_num = (int *)u;
9035 q_num[a] = q_num[b];
9041 * Print quest status of all active quests
9043 static void do_cmd_knowledge_quests(void)
9046 char file_name[1024];
9047 int *quest_num, dummy, i;
9049 /* Open a new file */
9050 fff = my_fopen_temp(file_name, 1024);
9054 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
9056 msg_format("Failed to create temporary file %s.", file_name);
9062 /* Allocate Memory */
9063 C_MAKE(quest_num, max_quests, int);
9065 /* Sort by compete level */
9066 for (i = 1; i < max_quests; i++) quest_num[i] = i;
9067 ang_sort_comp = ang_sort_comp_quest_num;
9068 ang_sort_swap = ang_sort_swap_quest_num;
9069 ang_sort(quest_num, &dummy, max_quests);
9071 /* Dump Quest Information */
9072 do_cmd_knowledge_quests_current(fff);
9074 do_cmd_knowledge_quests_completed(fff, quest_num);
9076 do_cmd_knowledge_quests_failed(fff, quest_num);
9080 do_cmd_knowledge_quests_wiz_random(fff);
9083 /* Close the file */
9086 /* Display the file contents */
9088 show_file(TRUE, file_name, "¥¯¥¨¥¹¥ÈãÀ®¾õ¶·", 0, 0);
9090 show_file(TRUE, file_name, "Quest status", 0, 0);
9093 /* Remove the file */
9097 C_KILL(quest_num, max_quests, int);
9104 static void do_cmd_knowledge_home(void)
9109 char file_name[1024];
9111 char o_name[MAX_NLEN];
9114 process_dungeon_file("w_info.txt", 0, 0, max_wild_y, max_wild_x);
9116 /* Open a new file */
9117 fff = my_fopen_temp(file_name, 1024);
9120 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
9122 msg_format("Failed to create temporary file %s.", file_name);
9130 /* Print all homes in the different towns */
9131 st_ptr = &town[1].store[STORE_HOME];
9133 /* Home -- if anything there */
9134 if (st_ptr->stock_num)
9139 /* Header with name of the town */
9141 fprintf(fff, " [ ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ]\n");
9143 fprintf(fff, " [Home Inventory]\n");
9146 /* Dump all available items */
9147 for (i = 0; i < st_ptr->stock_num; i++)
9150 if ((i % 12) == 0) fprintf(fff, "\n ( %d ¥Ú¡¼¥¸ )\n", x++);
9151 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
9152 if (strlen(o_name) <= 80-3)
9154 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
9160 for (n = 0, t = o_name; n < 80-3; n++, t++)
9161 if(iskanji(*t)) {t++; n++;}
9162 if (n == 81-3) n = 79-3; /* ºÇ¸å¤¬´Á»úȾʬ */
9164 fprintf(fff, "%c%s %.*s\n", I2A(i%12), paren, n, o_name);
9165 fprintf(fff, " %.77s\n", o_name+n);
9168 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
9169 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
9174 /* Add an empty line */
9175 fprintf(fff, "\n\n");
9179 /* Close the file */
9182 /* Display the file contents */
9184 show_file(TRUE, file_name, "²æ¤¬²È¤Î¥¢¥¤¥Æ¥à", 0, 0);
9186 show_file(TRUE, file_name, "Home Inventory", 0, 0);
9190 /* Remove the file */
9196 * Check the status of "autopick"
9198 static void do_cmd_knowledge_autopick(void)
9202 char file_name[1024];
9204 /* Open a new file */
9205 fff = my_fopen_temp(file_name, 1024);
9210 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
9212 msg_format("Failed to create temporary file %s.", file_name);
9221 fprintf(fff, "¼«Æ°Ç˲õ/½¦¤¤¤Ë¤Ï²¿¤âÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
9223 fprintf(fff, "No preference for auto picker/destroyer.");
9229 fprintf(fff, " ¼«Æ°½¦¤¤/Ç˲õ¤Ë¤Ï¸½ºß %d¹ÔÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£\n\n", max_autopick);
9231 fprintf(fff, " There are %d registered lines for auto picker/destroyer.\n\n", max_autopick);
9235 for (k = 0; k < max_autopick; k++)
9238 byte act = autopick_list[k].action;
9239 if (act & DONT_AUTOPICK)
9247 else if (act & DO_AUTODESTROY)
9255 else if (act & DO_AUTOPICK)
9263 else /* if (act & DO_QUERY_AUTOPICK) */ /* Obvious */
9272 if (act & DO_DISPLAY)
9273 fprintf(fff, "%11s", format("[%s]", tmp));
9275 fprintf(fff, "%11s", format("(%s)", tmp));
9277 tmp = autopick_line_from_entry(&autopick_list[k]);
9278 fprintf(fff, " %s", tmp);
9282 /* Close the file */
9284 /* Display the file contents */
9286 show_file(TRUE, file_name, "¼«Æ°½¦¤¤/Ç˲õ ÀßÄê¥ê¥¹¥È", 0, 0);
9288 show_file(TRUE, file_name, "Auto-picker/Destroyer", 0, 0);
9291 /* Remove the file */
9297 * Interact with "knowledge"
9299 void do_cmd_knowledge(void)
9302 /* File type is "TEXT" */
9303 FILE_TYPE(FILE_TYPE_TEXT);
9304 /* Save the screen */
9306 /* Interact until done */
9311 /* Ask for a choice */
9313 prt(format("%d/2 ¥Ú¡¼¥¸", (p+1)), 2, 65);
9314 prt("¸½ºß¤ÎÃ챤ò³Îǧ¤¹¤ë", 3, 0);
9316 prt(format("page %d/2", (p+1)), 2, 65);
9317 prt("Display current knowledge", 3, 0);
9320 /* Give some choices */
9323 prt("(1) ´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 6, 5);
9324 prt("(2) ´ûÃΤΥ¢¥¤¥Æ¥à ¤Î°ìÍ÷", 7, 5);
9325 prt("(3) ´ûÃΤÎÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 8, 5);
9326 prt("(4) ´ûÃΤΥâ¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 9, 5);
9327 prt("(5) Åݤ·¤¿Å¨¤Î¿ô ¤Î°ìÍ÷", 10, 5);
9328 prt("(6) ¾Þ¶â¼ó ¤Î°ìÍ÷", 11, 5);
9329 prt("(7) ¸½ºß¤Î¥Ú¥Ã¥È ¤Î°ìÍ÷", 12, 5);
9330 prt("(8) ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 13, 5);
9331 prt("(9) *´ÕÄê*ºÑ¤ßÁõÈ÷¤ÎÂÑÀ ¤Î°ìÍ÷", 14, 5);
9332 prt("(0) ÃÏ·Á¤Îɽ¼¨Ê¸»ú/¥¿¥¤¥ë ¤Î°ìÍ÷", 15, 5);
9334 prt("(a) ¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó ¤Î°ìÍ÷", 6, 5);
9335 prt("(b) ÆÍÁ³ÊÑ°Û ¤Î°ìÍ÷", 7, 5);
9336 prt("(c) Éð´ï¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 8, 5);
9337 prt("(d) ËâË¡¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 9, 5);
9338 prt("(e) µ»Ç½¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 10, 5);
9339 prt("(f) ¥×¥ì¥¤¥ä¡¼¤ÎÆÁ ¤Î°ìÍ÷", 11, 5);
9340 prt("(g) Æþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó ¤Î°ìÍ÷", 12, 5);
9341 prt("(h) ¼Â¹ÔÃæ¤Î¥¯¥¨¥¹¥È ¤Î°ìÍ÷", 13, 5);
9342 prt("(i) ¸½ºß¤Î¼«Æ°½¦¤¤/Ç˲õÀßÄê ¤Î°ìÍ÷", 14, 5);
9346 prt("(1) Display known artifacts", 6, 5);
9347 prt("(2) Display known objects", 7, 5);
9348 prt("(3) Display remaining uniques", 8, 5);
9349 prt("(4) Display known monster", 9, 5);
9350 prt("(5) Display kill count", 10, 5);
9351 prt("(6) Display wanted monsters", 11, 5);
9352 prt("(7) Display current pets", 12, 5);
9353 prt("(8) Display home inventory", 13, 5);
9354 prt("(9) Display *identified* equip.", 14, 5);
9355 prt("(0) Display terrain symbols.", 15, 5);
9357 prt("(a) Display about yourself", 6, 5);
9358 prt("(b) Display mutations", 7, 5);
9359 prt("(c) Display weapon proficiency", 8, 5);
9360 prt("(d) Display spell proficiency", 9, 5);
9361 prt("(e) Display misc. proficiency", 10, 5);
9362 prt("(f) Display virtues", 11, 5);
9363 prt("(g) Display dungeons", 12, 5);
9364 prt("(h) Display current quests", 13, 5);
9365 prt("(i) Display auto pick/destroy", 14, 5);
9370 prt("-³¤¯-", 17, 8);
9371 prt("ESC) È´¤±¤ë", 21, 1);
9372 prt("SPACE) ¼¡¥Ú¡¼¥¸", 21, 30);
9373 /*prt("-) Á°¥Ú¡¼¥¸", 21, 60);*/
9374 prt("¥³¥Þ¥ó¥É:", 20, 0);
9376 prt("-more-", 17, 8);
9377 prt("ESC) Exit menu", 21, 1);
9378 prt("SPACE) Next page", 21, 30);
9379 /*prt("-) Previous page", 21, 60);*/
9380 prt("Command: ", 20, 0);
9386 if (i == ESCAPE) break;
9389 case ' ': /* Page change */
9393 case '1': /* Artifacts */
9394 do_cmd_knowledge_artifacts();
9396 case '2': /* Objects */
9397 do_cmd_knowledge_objects();
9399 case '3': /* Uniques */
9400 do_cmd_knowledge_uniques();
9402 case '4': /* Monsters */
9403 do_cmd_knowledge_monsters();
9405 case '5': /* Kill count */
9406 do_cmd_knowledge_kill_count();
9408 case '6': /* wanted */
9409 do_cmd_knowledge_kubi();
9411 case '7': /* Pets */
9412 do_cmd_knowledge_pets();
9414 case '8': /* Home */
9415 do_cmd_knowledge_home();
9417 case '9': /* Resist list */
9418 do_cmd_knowledge_inven();
9420 case '0': /* Feature list */
9421 do_cmd_knowledge_features();
9424 case 'a': /* Max stat */
9425 do_cmd_knowledge_stat();
9427 case 'b': /* Mutations */
9428 do_cmd_knowledge_mutations();
9430 case 'c': /* weapon-exp */
9431 do_cmd_knowledge_weapon_exp();
9433 case 'd': /* spell-exp */
9434 do_cmd_knowledge_spell_exp();
9436 case 'e': /* skill-exp */
9437 do_cmd_knowledge_skill_exp();
9439 case 'f': /* Virtues */
9440 do_cmd_knowledge_virtues();
9442 case 'g': /* Dungeon */
9443 do_cmd_knowledge_dungeon();
9445 case 'h': /* Quests */
9446 do_cmd_knowledge_quests();
9448 case 'i': /* Autopick */
9449 do_cmd_knowledge_autopick();
9451 default: /* Unknown option */
9454 /* Flush messages */
9457 /* Restore the screen */
9463 * Check on the status of an active quest
9465 void do_cmd_checkquest(void)
9467 /* File type is "TEXT" */
9468 FILE_TYPE(FILE_TYPE_TEXT);
9470 /* Save the screen */
9474 do_cmd_knowledge_quests();
9476 /* Restore the screen */
9482 * Display the time and date
9484 void do_cmd_time(void)
9486 int day, hour, min, full, start, end, num;
9494 extract_day_hour_min(&day, &hour, &min);
9496 full = hour * 100 + min;
9504 strcpy(desc, "ÊѤʻþ¹ï¤À¡£");
9506 strcpy(desc, "It is a strange time.");
9510 if (day < MAX_DAYS) sprintf(day_buf, "%d", day);
9511 else strcpy(day_buf, "*****");
9515 msg_format("%sÆüÌÜ, »þ¹ï¤Ï%d:%02d %s¤Ç¤¹¡£",
9516 day_buf, (hour % 12 == 0) ? 12 : (hour % 12),
9517 min, (hour < 12) ? "AM" : "PM");
9519 msg_format("This is day %s. The time is %d:%02d %s.",
9520 day_buf, (hour % 12 == 0) ? 12 : (hour % 12),
9521 min, (hour < 12) ? "AM" : "PM");
9526 if (!randint0(10) || p_ptr->image)
9529 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timefun_j.txt");
9531 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timefun.txt");
9538 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timenorm_j.txt");
9540 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timenorm.txt");
9545 /* Open this file */
9546 fff = my_fopen(buf, "rt");
9551 /* Find this time */
9552 while (!my_fgets(fff, buf, sizeof(buf)))
9554 /* Ignore comments */
9555 if (!buf[0] || (buf[0] == '#')) continue;
9557 /* Ignore invalid lines */
9558 if (buf[1] != ':') continue;
9560 /* Process 'Start' */
9563 /* Extract the starting time */
9564 start = atoi(buf + 2);
9566 /* Assume valid for an hour */
9576 /* Extract the ending time */
9577 end = atoi(buf + 2);
9583 /* Ignore incorrect range */
9584 if ((start > full) || (full > end)) continue;
9586 /* Process 'Description' */
9591 /* Apply the randomizer */
9592 if (!randint0(num)) strcpy(desc, buf + 2);
9602 /* Close the file */