3 * @brief ¥×¥ì¥¤¥ä¡¼¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ë´Ø¤¹¤ë¥³¥Þ¥ó¥É¤Î¼ÂÁõ / Interface commands
7 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research,
9 * and not for profit purposes provided that this copyright and statement
10 * are included in all such copies. Other copyrights may also apply.
14 * A set of functions to maintain automatic dumps of various kinds.
16 * remove_auto_dump(orig_file, mark)
17 * Remove the old automatic dump of type "mark".
18 * auto_dump_printf(fmt, ...)
19 * Dump a formatted string using fprintf().
20 * open_auto_dump(buf, mark)
21 * Open a file, remove old dump, and add new header.
22 * close_auto_dump(void)
23 * Add a footer, and close the file.
24 * The dump commands of original Angband simply add new lines to
25 * existing files; these files will become bigger and bigger unless
26 * an user deletes some or all of these files by hand at some
28 * These three functions automatically delete old dumped lines
29 * before adding new ones. Since there are various kinds of automatic
30 * dumps in a single file, we add a header and a footer with a type
31 * name for every automatic dump, and kill old lines only when the
32 * lines have the correct type of header and footer.
33 * We need to be quite paranoid about correctness; the user might
34 * (mistakenly) edit the file by hand, and see all their work come
35 * to nothing on the next auto dump otherwise. The current code only
36 * detects changes by noting inconsistencies between the actual number
37 * of lines and the number written in the footer. Note that this will
38 * 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;
64 * @brief prf½ÐÎÏÆâÍƤò¾Ãµî¤¹¤ë /
65 * Remove old lines automatically generated before.
66 * @param orig_file ¾Ãµî¤ò¹Ô¤¦¥Õ¥¡¥¤¥ë̾
68 static void remove_auto_dump(cptr orig_file)
70 FILE *tmp_fff, *orig_fff;
74 bool between_mark = FALSE;
77 long header_location = 0;
78 char header_mark_str[80];
79 char footer_mark_str[80];
82 /* Prepare a header/footer mark string */
83 sprintf(header_mark_str, auto_dump_header, auto_dump_mark);
84 sprintf(footer_mark_str, auto_dump_footer, auto_dump_mark);
86 mark_len = strlen(footer_mark_str);
88 /* Open an old dump file in read-only mode */
89 orig_fff = my_fopen(orig_file, "r");
91 /* If original file does not exist, nothing to do */
92 if (!orig_fff) return;
94 /* Open a new (temporary) file */
95 tmp_fff = my_fopen_temp(tmp_file, 1024);
100 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", tmp_file);
102 msg_format("Failed to create temporary file %s.", tmp_file);
108 /* Loop for every line */
112 if (my_fgets(orig_fff, buf, sizeof(buf)))
114 /* Read error: Assume End of File */
117 * Was looking for the footer, but not found.
119 * Since automatic dump might be edited by hand,
120 * it's dangerous to kill these lines.
121 * Seek back to the next line of the (pseudo) header,
126 fseek(orig_fff, header_location, SEEK_SET);
127 between_mark = FALSE;
131 /* Success -- End the loop */
138 /* We are looking for the header mark of automatic dump */
141 /* Is this line a header? */
142 if (!strcmp(buf, header_mark_str))
144 /* Memorise seek point of this line */
145 header_location = ftell(orig_fff);
147 /* Initialize counter for number of lines */
150 /* Look for the footer from now */
153 /* There are some changes */
160 /* Copy orginally lines */
161 fprintf(tmp_fff, "%s\n", buf);
165 /* We are looking for the footer mark of automatic dump */
168 /* Is this line a footer? */
169 if (!strncmp(buf, footer_mark_str, mark_len))
174 * Compare the number of lines
176 * If there is an inconsistency between
177 * actual number of lines and the
178 * number here, the automatic dump
179 * might be edited by hand. So it's
180 * dangerous to kill these lines.
181 * Seek back to the next line of the
182 * (pseudo) header, and read again.
184 if (!sscanf(buf + mark_len, " (%d)", &tmp)
187 fseek(orig_fff, header_location, SEEK_SET);
190 /* Look for another header */
191 between_mark = FALSE;
197 /* Ignore old line, and count number of lines */
207 /* If there are some changes, overwrite the original file with new one */
210 /* Copy contents of temporary file */
212 tmp_fff = my_fopen(tmp_file, "r");
213 orig_fff = my_fopen(orig_file, "w");
215 while (!my_fgets(tmp_fff, buf, sizeof(buf)))
216 fprintf(orig_fff, "%s\n", buf);
222 /* Kill the temporary file */
230 * @brief prf¥Õ¥¡¥¤¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë½¾¤Ã¤¿ÆâÍƤò½ÐÎϤ¹¤ë /
231 * Dump a formatted line, using "vstrnfmt()".
232 * @param fmt ½ÐÎÏÆâÍÆ
234 static void auto_dump_printf(cptr fmt, ...)
241 /* Begin the Varargs Stuff */
244 /* Format the args, save the length */
245 (void)vstrnfmt(buf, sizeof(buf), fmt, vp);
247 /* End the Varargs Stuff */
250 /* Count number of lines */
251 for (p = buf; *p; p++)
253 if (*p == '\n') auto_dump_line_num++;
257 fprintf(auto_dump_stream, "%s", buf);
262 * @brief prf¥Õ¥¡¥¤¥ë¤ò¥Õ¥¡¥¤¥ë¥ª¡¼¥×¥ó¤¹¤ë /
263 * Open file to append auto dump.
264 * @param buf ¥Õ¥¡¥¤¥ë̾
265 * @param mark ½ÐÎϤ¹¤ë¥Ø¥Ã¥À¥Þ¡¼¥¯
266 * @return ¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¤ò¼èÆÀ¤Ç¤¤¿¤éTRUE¤òÊÖ¤¹
268 static bool open_auto_dump(cptr buf, cptr mark)
271 char header_mark_str[80];
273 /* Save the mark string */
274 auto_dump_mark = mark;
276 /* Prepare a header mark string */
277 sprintf(header_mark_str, auto_dump_header, auto_dump_mark);
279 /* Remove old macro dumps */
280 remove_auto_dump(buf);
282 /* Append to the file */
283 auto_dump_stream = my_fopen(buf, "a");
286 if (!auto_dump_stream) {
288 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
290 msg_format("Failed to open %s.", buf);
299 fprintf(auto_dump_stream, "%s\n", header_mark_str);
301 /* Initialize counter */
302 auto_dump_line_num = 0;
305 auto_dump_printf("# *·Ù¹ð!!* °Ê¹ß¤Î¹Ô¤Ï¼«Æ°À¸À®¤µ¤ì¤¿¤â¤Î¤Ç¤¹¡£\n");
306 auto_dump_printf("# *·Ù¹ð!!* ¸å¤Ç¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¤Î¤ÇÊÔ½¸¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£\n");
308 auto_dump_printf("# *Warning!* The lines below are an automatic dump.\n");
309 auto_dump_printf("# Don't edit them; changes will be deleted and replaced automatically.\n");
317 * @brief prf¥Õ¥¡¥¤¥ë¤ò¥Õ¥¡¥¤¥ë¥¯¥í¡¼¥º¤¹¤ë /
318 * Append foot part and close auto dump.
321 static void close_auto_dump(void)
323 char footer_mark_str[80];
325 /* Prepare a footer mark string */
326 sprintf(footer_mark_str, auto_dump_footer, auto_dump_mark);
329 auto_dump_printf("# *·Ù¹ð!!* °Ê¾å¤Î¹Ô¤Ï¼«Æ°À¸À®¤µ¤ì¤¿¤â¤Î¤Ç¤¹¡£\n");
330 auto_dump_printf("# *·Ù¹ð!!* ¸å¤Ç¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¤Î¤ÇÊÔ½¸¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£\n");
332 auto_dump_printf("# *Warning!* The lines above are an automatic dump.\n");
333 auto_dump_printf("# Don't edit them; changes will be deleted and replaced automatically.\n");
337 fprintf(auto_dump_stream, "%s (%d)\n", footer_mark_str, auto_dump_line_num);
340 my_fclose(auto_dump_stream);
349 * @brief Return suffix of ordinal number
351 * @return pointer of suffix string.
353 cptr get_ordinal_number_suffix(int num)
355 num = ABS(num) % 100;
359 return (num == 11) ? "th" : "st";
361 return (num == 12) ? "th" : "nd";
363 return (num == 13) ? "th" : "rd";
372 * @brief Æüµ¤Ë¥á¥Ã¥»¡¼¥¸¤òÄɲ乤ë /
373 * Take note to the diary.
374 * @param type ÆüµÆâÍƤÎID
375 * @param num ÆüµÆâÍƤÎID¤Ë±þ¤¸¤¿¿ôÃÍ
376 * @param note ÆüµÆâÍƤÎID¤Ë±þ¤¸¤¿Ê¸»úÎ󻲾ȥݥ¤¥ó¥¿
379 errr do_cmd_write_nikki(int type, int num, cptr note)
385 cptr note_level = "";
386 bool do_level = TRUE;
387 char note_level_buf[40];
390 static bool disable_nikki = FALSE;
392 extract_day_hour_min(&day, &hour, &min);
394 if (disable_nikki) return(-1);
396 if (type == NIKKI_FIX_QUEST_C ||
397 type == NIKKI_FIX_QUEST_F ||
398 type == NIKKI_RAND_QUEST_C ||
399 type == NIKKI_RAND_QUEST_F ||
400 type == NIKKI_TO_QUEST)
404 old_quest = p_ptr->inside_quest;
405 p_ptr->inside_quest = (quest[num].type == QUEST_TYPE_RANDOM) ? 0 : num;
407 /* Get the quest text */
408 init_flags = INIT_NAME_ONLY;
410 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
412 /* Reset the old quest number */
413 p_ptr->inside_quest = old_quest;
417 sprintf(file_name,"playrecord-%s.txt",savefile_base);
419 /* different filne name to avoid mixing */
420 sprintf(file_name,"playrec-%s.txt",savefile_base);
423 /* Build the filename */
424 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
426 /* File type is "TEXT" */
427 FILE_TYPE(FILE_TYPE_TEXT);
429 fff = my_fopen(buf, "a");
435 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£¥×¥ì¥¤µÏ¿¤ò°ì»þÄä»ß¤·¤Þ¤¹¡£", buf);
437 msg_format("Failed to open %s. Play-Record is disabled temporally.", buf);
444 q_idx = quest_number(dun_level);
448 if (p_ptr->inside_arena)
450 note_level = "¥¢¥ê¡¼¥Ê:";
452 note_level = "Arane:";
456 note_level = "ÃϾå:";
458 note_level = "Surface:";
460 else if (q_idx && (is_fixed_quest_idx(q_idx)
461 && !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
463 note_level = "¥¯¥¨¥¹¥È:";
465 note_level = "Quest:";
470 sprintf(note_level_buf, "%d³¬(%s):", dun_level, d_name+d_info[dungeon_type].name);
472 sprintf(note_level_buf, "%s L%d:", d_name+d_info[dungeon_type].name, dun_level);
474 note_level = note_level_buf;
483 if (day < MAX_DAYS) fprintf(fff, "%dÆüÌÜ\n", day);
484 else fputs("*****ÆüÌÜ\n", fff);
486 if (day < MAX_DAYS) fprintf(fff, "Day %d\n", day);
487 else fputs("Day *****\n", fff);
496 fprintf(fff, "%s\n",note);
500 fprintf(fff, " %2d:%02d %20s %s\n",hour, min, note_level, note);
506 fprintf(fff, " %2d:%02d %20s %s¤òȯ¸«¤·¤¿¡£\n", hour, min, note_level, note);
508 fprintf(fff, " %2d:%02d %20s discovered %s.\n", hour, min, note_level, note);
515 fprintf(fff, " %2d:%02d %20s %s¤òÅݤ·¤¿¡£\n", hour, min, note_level, note);
517 fprintf(fff, " %2d:%02d %20s defeated %s.\n", hour, min, note_level, note);
521 case NIKKI_FIX_QUEST_C:
523 if (quest[num].flags & QUEST_FLAG_SILENT) break;
525 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤òãÀ®¤·¤¿¡£\n", hour, min, note_level, quest[num].name);
527 fprintf(fff, " %2d:%02d %20s completed quest '%s'.\n", hour, min, note_level, quest[num].name);
531 case NIKKI_FIX_QUEST_F:
533 if (quest[num].flags & QUEST_FLAG_SILENT) break;
535 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤«¤éÌ¿¤«¤é¤¬¤éƨ¤²µ¢¤Ã¤¿¡£\n", hour, min, note_level, quest[num].name);
537 fprintf(fff, " %2d:%02d %20s run away from quest '%s'.\n", hour, min, note_level, quest[num].name);
541 case NIKKI_RAND_QUEST_C:
544 strcpy(name, r_name+r_info[quest[num].r_idx].name);
546 fprintf(fff, " %2d:%02d %20s ¥é¥ó¥À¥à¥¯¥¨¥¹¥È(%s)¤òãÀ®¤·¤¿¡£\n", hour, min, note_level, name);
548 fprintf(fff, " %2d:%02d %20s completed random quest '%s'\n", hour, min, note_level, name);
552 case NIKKI_RAND_QUEST_F:
555 strcpy(name, r_name+r_info[quest[num].r_idx].name);
557 fprintf(fff, " %2d:%02d %20s ¥é¥ó¥À¥à¥¯¥¨¥¹¥È(%s)¤«¤éƨ¤²½Ð¤·¤¿¡£\n", hour, min, note_level, name);
559 fprintf(fff, " %2d:%02d %20s ran away from quest '%s'.\n", hour, min, note_level, name);
563 case NIKKI_MAXDEAPTH:
566 fprintf(fff, " %2d:%02d %20s %s¤ÎºÇ¿¼³¬%d³¬¤ËÅþ㤷¤¿¡£\n", hour, min, note_level, d_name+d_info[dungeon_type].name, num);
568 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);
575 fprintf(fff, " %2d:%02d %20s %s%s¤ÎºÇ¿¼³¬¤ò%d³¬¤Ë¥»¥Ã¥È¤·¤¿¡£\n", hour, min, note_level, note, d_name + d_info[num].name, max_dlv[num]);
577 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);
584 if (q_idx && (is_fixed_quest_idx(q_idx)
585 && !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
596 if (!(dun_level+num)) to = "ÃϾå";
597 else to = format("%d³¬", dun_level+num);
599 if (!(dun_level+num)) to = "the surface";
600 else to = format("level %d", dun_level+num);
605 fprintf(fff, " %2d:%02d %20s %s¤Ø%s¡£\n", hour, min, note_level, to, note);
607 fprintf(fff, " %2d:%02d %20s %s %s.\n", hour, min, note_level, note, to);
615 fprintf(fff, " %2d:%02d %20s µ¢´Ô¤ò»È¤Ã¤Æ%s¤Î%d³¬¤Ø²¼¤ê¤¿¡£\n", hour, min, note_level, d_name+d_info[dungeon_type].name, max_dlv[dungeon_type]);
617 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);
621 fprintf(fff, " %2d:%02d %20s µ¢´Ô¤ò»È¤Ã¤ÆÃϾå¤Ø¤ÈÌá¤Ã¤¿¡£\n", hour, min, note_level);
623 fprintf(fff, " %2d:%02d %20s recalled from dungeon to surface.\n", hour, min, note_level);
629 if (quest[num].flags & QUEST_FLAG_SILENT) break;
631 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤Ø¤ÈÆÍÆþ¤·¤¿¡£\n", hour, min, note_level, quest[num].name);
633 fprintf(fff, " %2d:%02d %20s entered the quest '%s'.\n", hour, min, note_level, quest[num].name);
640 fprintf(fff, " %2d:%02d %20s ¥ì¥Ù¥ë¡¦¥Æ¥ì¥Ý¡¼¥È¤Çæ½Ð¤·¤¿¡£\n", hour, min, note_level);
642 fprintf(fff, " %2d:%02d %20s Got out using teleport level.\n", hour, min, note_level);
649 fprintf(fff, " %2d:%02d %20s %s¤ò¹ØÆþ¤·¤¿¡£\n", hour, min, note_level, note);
651 fprintf(fff, " %2d:%02d %20s bought %s.\n", hour, min, note_level, note);
658 fprintf(fff, " %2d:%02d %20s %s¤òÇäµÑ¤·¤¿¡£\n", hour, min, note_level, note);
660 fprintf(fff, " %2d:%02d %20s sold %s.\n", hour, min, note_level, note);
669 fprintf(fff, " %2d:%02d %20s Æ®µ»¾ì¤Î%d²óÀï¤Ç¡¢%s¤ÎÁ°¤ËÇÔ¤ìµî¤Ã¤¿¡£\n", hour, min, note_level, -num, note);
672 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));
677 fprintf(fff, " %2d:%02d %20s Æ®µ»¾ì¤Î%d²óÀï(%s)¤Ë¾¡Íø¤·¤¿¡£\n", hour, min, note_level, num, note);
679 fprintf(fff, " %2d:%02d %20s won the %d%s fight (%s).\n", hour, min, note_level, num, get_ordinal_number_suffix(num), note);
681 if (num == MAX_ARENA_MONS)
684 fprintf(fff, " Æ®µ»¾ì¤Î¤¹¤Ù¤Æ¤ÎŨ¤Ë¾¡Íø¤·¡¢¥Á¥ã¥ó¥Ô¥ª¥ó¤È¤Ê¤Ã¤¿¡£\n");
686 fprintf(fff, " won all fight to become a Chanpion.\n");
695 fprintf(fff, " %2d:%02d %20s %s¤ò¼±Ê̤·¤¿¡£\n", hour, min, note_level, note);
697 fprintf(fff, " %2d:%02d %20s identified %s.\n", hour, min, note_level, note);
712 to = format("%d³¬(%s)", dun_level, d_name+d_info[dungeon_type].name);
714 to = format("level %d of %s", dun_level, d_name+d_info[dungeon_type].name);
718 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥¦¥£¥¶¡¼¥É¡¦¥Æ¥ì¥Ý¡¼¥È¤Ç°ÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
720 fprintf(fff, " %2d:%02d %20s wizard-teleport to %s.\n", hour, min, note_level, to);
735 to = format("%d³¬(%s)", dun_level, d_name+d_info[dungeon_type].name);
737 to = format("level %d of %s", dun_level, d_name+d_info[dungeon_type].name);
741 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥Ñ¥¿¡¼¥ó¤ÎÎϤǰÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
743 fprintf(fff, " %2d:%02d %20s used Pattern to teleport to %s.\n", hour, min, note_level, to);
750 fprintf(fff, " %2d:%02d %20s ¥ì¥Ù¥ë¤¬%d¤Ë¾å¤¬¤Ã¤¿¡£\n", hour, min, note_level, num);
752 fprintf(fff, " %2d:%02d %20s reached player level %d.\n", hour, min, note_level, num);
756 case NIKKI_GAMESTART:
758 time_t ct = time((time_t*)0);
762 fprintf(fff, "%s %s",note, ctime(&ct));
765 fprintf(fff, " %2d:%02d %20s %s %s",hour, min, note_level, note, ctime(&ct));
768 case NIKKI_NAMED_PET:
770 fprintf(fff, " %2d:%02d %20s ", hour, min, note_level);
773 case RECORD_NAMED_PET_NAME:
775 fprintf(fff, "%s¤òι¤Îͧ¤Ë¤¹¤ë¤³¤È¤Ë·è¤á¤¿¡£\n", note);
777 fprintf(fff, "decided to travel together with %s.\n", note);
780 case RECORD_NAMED_PET_UNNAME:
782 fprintf(fff, "%s¤Î̾Á°¤ò¾Ã¤·¤¿¡£\n", note);
784 fprintf(fff, "unnamed %s.\n", note);
787 case RECORD_NAMED_PET_DISMISS:
789 fprintf(fff, "%s¤ò²òÊü¤·¤¿¡£\n", note);
791 fprintf(fff, "dismissed %s.\n", note);
794 case RECORD_NAMED_PET_DEATH:
796 fprintf(fff, "%s¤¬»à¤ó¤Ç¤·¤Þ¤Ã¤¿¡£\n", note);
798 fprintf(fff, "%s died.\n", note);
801 case RECORD_NAMED_PET_MOVED:
803 fprintf(fff, "%s¤ò¤ª¤¤¤ÆÊ̤ΥޥåפذÜÆ°¤·¤¿¡£\n", note);
805 fprintf(fff, "moved to another map leaving %s behind.\n", note);
808 case RECORD_NAMED_PET_LOST_SIGHT:
810 fprintf(fff, "%s¤È¤Ï¤°¤ì¤Æ¤·¤Þ¤Ã¤¿¡£\n", note);
812 fprintf(fff, "lost sight of %s.\n", note);
815 case RECORD_NAMED_PET_DESTROY:
817 fprintf(fff, "%s¤¬*Ç˲õ*¤Ë¤è¤Ã¤Æ¾Ã¤¨µî¤Ã¤¿¡£\n", note);
819 fprintf(fff, "%s was made disappeared by *destruction*.\n", note);
822 case RECORD_NAMED_PET_EARTHQUAKE:
824 fprintf(fff, "%s¤¬´äÀФ˲¡¤·ÄÙ¤µ¤ì¤¿¡£\n", note);
826 fprintf(fff, "%s was crushed by falling rocks.\n", note);
829 case RECORD_NAMED_PET_GENOCIDE:
831 fprintf(fff, "%s¤¬Ëõ»¦¤Ë¤è¤Ã¤Æ¾Ã¤¨µî¤Ã¤¿¡£\n", note);
833 fprintf(fff, "%s was made disappeared by genocide.\n", note);
836 case RECORD_NAMED_PET_WIZ_ZAP:
838 fprintf(fff, "%s¤¬¥Ç¥Ð¥Ã¥°¥³¥Þ¥ó¥É¤Ë¤è¤Ã¤Æ¾Ã¤¨µî¤Ã¤¿¡£\n", note);
840 fprintf(fff, "%s was removed by debug command.\n", note);
843 case RECORD_NAMED_PET_TELE_LEVEL:
845 fprintf(fff, "%s¤¬¥Æ¥ì¥Ý¡¼¥È¡¦¥ì¥Ù¥ë¤Ë¤è¤Ã¤Æ¾Ã¤¨µî¤Ã¤¿¡£\n", note);
847 fprintf(fff, "%s was made disappeared by teleport level.\n", note);
850 case RECORD_NAMED_PET_BLAST:
852 fprintf(fff, "%s¤òÇúÇˤ·¤¿¡£\n", note);
854 fprintf(fff, "blasted %s.\n", note);
857 case RECORD_NAMED_PET_HEAL_LEPER:
859 fprintf(fff, "%s¤Îɵ¤¤¬¼£¤ê餫¤é³°¤ì¤¿¡£\n", note);
861 fprintf(fff, "%s was healed and left.\n", note);
864 case RECORD_NAMED_PET_COMPACT:
866 fprintf(fff, "%s¤¬¥â¥ó¥¹¥¿¡¼¾ðÊ󰵽̤ˤè¤Ã¤Æ¾Ã¤¨µî¤Ã¤¿¡£\n", note);
868 fprintf(fff, "%s was made disappeared by compacting monsters.\n", note);
871 case RECORD_NAMED_PET_LOSE_PARENT:
873 fprintf(fff, "%s¤Î¾¤´¼Ô¤¬´û¤Ë¤¤¤Ê¤¤¤¿¤á¾Ã¤¨µî¤Ã¤¿¡£\n", note);
875 fprintf(fff, "%s disappeared because there does not exist summoner.\n", note);
890 if (do_level) write_level = FALSE;
896 #define MAX_SUBTITLE (sizeof(subtitle)/sizeof(subtitle[0]))
899 * @brief Æüµ¤Î¥¿¥¤¥È¥ëɽµ¤ÈÆâÍƽÐÎÏ /
902 static void do_cmd_disp_nikki(void)
904 char nikki_title[256];
909 static const char subtitle[][30] = {"ºÇ¶¯¤ÎÆùÂΤòµá¤á¤Æ",
910 "¿ÍÀ¸¤½¤ì¤Ï¤Ï¤«¤Ê¤¤",
921 "Åݤ¹¤Ù¤Å¨¤Ï¥²¡û¥Ä",
922 "¤ó¡Á¡©Ê¹¤³¤¨¤ó¤Ê¤¡",
923 "¥ª¥ì¤Î̾¤ò¸À¤Ã¤Æ¤ß¤í",
924 "Ƭ¤¬ÊѤˤʤäÁ¤ã¤Ã¤¿",
929 "¤³¤ó¤Ê¤â¤ó¤¸¤ã¤Ê¤¤",
938 "ºÇ¹â¤ÎƬǾ¤òµá¤á¤Æ"};
940 static const char subtitle[][51] ={"Quest of The World's Toughest Body",
941 "Attack is the best form of defence.",
943 "An unexpected windfall",
944 "A drowning man will catch at a straw",
945 "Don't count your chickens before they are hatched.",
946 "It is no use crying over spilt milk.",
947 "Seeing is believing.",
948 "Strike the iron while it is hot.",
949 "I don't care what follows.",
950 "To dig a well to put out a house on fire.",
951 "Tomorrow is another day.",
952 "Easy come, easy go.",
953 "The more haste, the less speed.",
954 "Where there is life, there is hope.",
955 "There is no royal road to *WINNER*.",
956 "Danger past, God forgotten.",
957 "The best thing to do now is to run away.",
958 "Life is but an empty dream.",
959 "Dead men tell no tales.",
960 "A book that remains shut is but a block.",
961 "Misfortunes never come singly.",
962 "A little knowledge is a dangerous thing.",
963 "History repeats itself.",
964 "*WINNER* was not built in a day.",
965 "Ignorance is bliss.",
966 "To lose is to win?",
967 "No medicine can cure folly.",
968 "All good things come to an end.",
969 "M$ Empire strikes back.",
970 "To see is to believe",
972 "Quest of The World's Greatest Brain"};
975 sprintf(file_name,"playrecord-%s.txt",savefile_base);
977 sprintf(file_name,"playrec-%s.txt",savefile_base);
980 /* Build the filename */
981 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
983 if (p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_MONK || p_ptr->pclass == CLASS_SAMURAI || p_ptr->pclass == CLASS_BERSERKER)
984 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)]);
985 else if (p_ptr->pclass == CLASS_MAGE || p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER)
986 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)+1]);
987 else strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-2)+1]);
990 sprintf(nikki_title, "¡Ö%s%s%s¤ÎÅÁÀâ -%s-¡×",
991 ap_ptr->title, ap_ptr->no ? "¤Î" : "", player_name, tmp);
993 sprintf(nikki_title, "Legend of %s %s '%s'",
994 ap_ptr->title, player_name, tmp);
997 /* Display the file contents */
998 show_file(FALSE, buf, nikki_title, -1, 0);
1002 * @brief Æüµ¤ËǤ°Õ¤ÎÆâÍƤòɽµ¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó /
1005 static void do_cmd_bunshou(void)
1007 char tmp[80] = "\0";
1008 char bunshou[80] = "\0";
1011 if (get_string("ÆâÍÆ: ", tmp, 79))
1013 if (get_string("diary note: ", tmp, 79))
1016 strcpy(bunshou, tmp);
1018 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, bunshou);
1023 * @brief ºÇ¸å¤Ë¼èÆÀ¤·¤¿¥¢¥¤¥Æ¥à¤Î¾ðÊó¤òÆüµ¤ËÄɲ乤ë¥á¥¤¥ó¥ë¡¼¥Á¥ó /
1026 static void do_cmd_last_get(void)
1031 if (record_o_name[0] == '\0') return;
1034 sprintf(buf,"%s¤ÎÆþ¼ê¤òµÏ¿¤·¤Þ¤¹¡£",record_o_name);
1036 sprintf(buf,"Do you really want to record getting %s? ",record_o_name);
1038 if (!get_check(buf)) return;
1043 sprintf(buf,"%s¤ò¼ê¤ËÆþ¤ì¤¿¡£", record_o_name);
1045 sprintf(buf,"descover %s.", record_o_name);
1047 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, buf);
1051 static void do_cmd_erase_nikki(void)
1058 if (!get_check("ËÜÅö¤ËµÏ¿¤ò¾Ãµî¤·¤Þ¤¹¤«¡©")) return;
1060 if (!get_check("Do you really want to delete all your record? ")) return;
1064 sprintf(file_name,"playrecord-%s.txt",savefile_base);
1066 sprintf(file_name,"playrec-%s.txt",savefile_base);
1069 /* Build the filename */
1070 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
1072 /* Remove the file */
1075 fff = my_fopen(buf, "w");
1079 msg_format("µÏ¿¤ò¾Ãµî¤·¤Þ¤·¤¿¡£");
1081 msg_format("deleted record.");
1085 msg_format("%s ¤Î¾Ãµî¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£", buf);
1087 msg_format("failed to delete %s.", buf);
1094 * @brief Æüµ¥³¥Þ¥ó¥É
1097 void do_cmd_nikki(void)
1101 /* File type is "TEXT" */
1102 FILE_TYPE(FILE_TYPE_TEXT);
1104 /* Save the screen */
1107 /* Interact until done */
1113 /* Ask for a choice */
1115 prt("[ µÏ¿¤ÎÀßÄê ]", 2, 0);
1117 prt("[ Play Record ]", 2, 0);
1121 /* Give some choices */
1123 prt("(1) µÏ¿¤ò¸«¤ë", 4, 5);
1124 prt("(2) ʸ¾Ï¤òµÏ¿¤¹¤ë", 5, 5);
1125 prt("(3) ľÁ°¤ËÆþ¼êËô¤Ï´ÕÄꤷ¤¿¤â¤Î¤òµÏ¿¤¹¤ë", 6, 5);
1126 prt("(4) µÏ¿¤ò¾Ãµî¤¹¤ë", 7, 5);
1128 prt("(R) ¥×¥ì¥¤Æ°²è¤òµÏ¿¤¹¤ë/Ãæ»ß¤¹¤ë", 9, 5);
1130 prt("(1) Display your record", 4, 5);
1131 prt("(2) Add record", 5, 5);
1132 prt("(3) Record item you last get/identify", 6, 5);
1133 prt("(4) Delete your record", 7, 5);
1135 prt("(R) Record playing movie / or stop it", 9, 5);
1141 prt("¥³¥Þ¥ó¥É:", 18, 0);
1143 prt("Command: ", 18, 0);
1151 if (i == ESCAPE) break;
1156 do_cmd_disp_nikki();
1165 do_cmd_erase_nikki();
1169 prepare_movie_hooks();
1171 default: /* Unknown option */
1175 /* Flush messages */
1179 /* Restore the screen */
1184 * @brief ²èÌ̤òºÆÉÁ²è¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó
1185 * Hack -- redraw the screen
1189 * This command performs various low level updates, clears all the "extra"
1190 * windows, does a total redraw of the main window, and requests all of the
1191 * interesting updates and redraws that I can think of.
1193 * This command is also used to "instantiate" the results of the user
1194 * selecting various things, such as graphics mode, so it must call
1195 * the "TERM_XTRA_REACT" hook before redrawing the windows.
1198 void do_cmd_redraw(void)
1205 /* Hack -- react to changes */
1206 Term_xtra(TERM_XTRA_REACT, 0);
1209 /* Combine and Reorder the pack (later) */
1210 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1214 p_ptr->update |= (PU_TORCH);
1217 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
1219 /* Forget lite/view */
1220 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
1222 /* Update lite/view */
1223 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
1225 /* Update monsters */
1226 p_ptr->update |= (PU_MONSTERS);
1228 /* Redraw everything */
1229 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1232 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
1235 p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
1239 /* Hack -- update */
1242 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
1245 /* Redraw every window */
1246 for (j = 0; j < 8; j++)
1249 if (!angband_term[j]) continue;
1252 Term_activate(angband_term[j]);
1267 * @brief ̾Á°¤òÊѹ¹¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó
1268 * Hack -- change name
1271 void do_cmd_change_name(void)
1280 /* Save the screen */
1288 /* Display the player */
1289 display_player(mode);
1294 display_player(mode);
1299 Term_putstr(2, 23, -1, TERM_WHITE,
1300 "['c'¤Ç̾Á°Êѹ¹, 'f'¤Ç¥Õ¥¡¥¤¥ë¤Ø½ñ½Ð, 'h'¤Ç¥â¡¼¥ÉÊѹ¹, ESC¤Ç½ªÎ»]");
1302 Term_putstr(2, 23, -1, TERM_WHITE,
1303 "['c' to change name, 'f' to file, 'h' to change mode, or ESC]");
1311 if (c == ESCAPE) break;
1318 /* Process the player name */
1319 process_player_name(FALSE);
1325 sprintf(tmp, "%s.txt", player_base);
1327 if (get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
1329 if (get_string("File name: ", tmp, 80))
1333 if (tmp[0] && (tmp[0] != ' '))
1335 file_character(tmp);
1352 /* Flush messages */
1356 /* Restore the screen */
1359 /* Redraw everything */
1360 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1367 * @brief ºÇ¶áɽ¼¨¤µ¤ì¤¿¥á¥Ã¥»¡¼¥¸¤òºÆɽ¼¨¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó
1368 * Recall the most recent message
1371 void do_cmd_message_one(void)
1373 /* Recall one message XXX XXX XXX */
1374 prt(format("> %s", message_str(0)), 0, 0);
1379 * @brief ¥á¥Ã¥»¡¼¥¸¤Î¥í¥°¤òɽ¼¨¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó
1380 * Recall the most recent message
1384 * Show previous messages to the user -BEN-
1386 * The screen format uses line 0 and 23 for headers and prompts,
1387 * skips line 1 and 22, and uses line 2 thru 21 for old messages.
1389 * This command shows you which commands you are viewing, and allows
1390 * you to "search" for strings in the recall.
1392 * Note that messages may be longer than 80 characters, but they are
1393 * displayed using "infinite" length, with a special sub-command to
1394 * "slide" the virtual display to the left or right.
1396 * Attempt to only hilite the matching portions of the string.
1399 void do_cmd_messages(int num_now)
1403 char shower_str[81];
1404 char finder_str[81];
1411 Term_get_size(&wid, &hgt);
1413 /* Number of message lines in a screen */
1414 num_lines = hgt - 4;
1417 strcpy(finder_str, "");
1420 strcpy(shower_str, "");
1422 /* Total messages */
1425 /* Start on first message */
1428 /* Save the screen */
1434 /* Process requests until done */
1440 /* Dump up to 20 lines of messages */
1441 for (j = 0; (j < num_lines) && (i + j < n); j++)
1443 cptr msg = message_str(i+j);
1445 /* Dump the messages, bottom to top */
1446 c_prt((i + j < num_now ? TERM_WHITE : TERM_SLATE), msg, num_lines + 1 - j, 0);
1448 /* Hilite "shower" */
1449 if (shower && shower[0])
1453 /* Display matches */
1454 while ((str = my_strstr(str, shower)) != NULL)
1456 int len = strlen(shower);
1458 /* Display the match */
1459 Term_putstr(str-msg, num_lines + 1 - j, len, TERM_YELLOW, shower);
1467 /* Erase remaining lines */
1468 for (; j < num_lines; j++)
1470 Term_erase(0, num_lines + 1 - j, 255);
1473 /* Display header XXX XXX XXX */
1476 prt(format("°ÊÁ°¤Î¥á¥Ã¥»¡¼¥¸ %d-%d Á´Éô¤Ç(%d)",
1477 i, i + j - 1, n), 0, 0);
1479 prt(format("Message Recall (%d-%d of %d)",
1480 i, i + j - 1, n), 0, 0);
1483 /* Display prompt (not very informative) */
1485 prt("[ 'p' ¤Ç¹¹¤Ë¸Å¤¤¤â¤Î, 'n' ¤Ç¹¹¤Ë¿·¤·¤¤¤â¤Î, '/' ¤Ç¸¡º÷, ESC ¤ÇÃæÃÇ ]", hgt - 1, 0);
1487 prt("[Press 'p' for older, 'n' for newer, ..., or ESCAPE]", hgt - 1, 0);
1491 skey = inkey_special(TRUE);
1493 /* Exit on Escape */
1494 if (skey == ESCAPE) break;
1496 /* Hack -- Save the old index */
1501 /* Hack -- handle show */
1505 prt("¶¯Ä´: ", hgt - 1, 0);
1507 prt("Show: ", hgt - 1, 0);
1510 /* Get a "shower" string, or continue */
1511 strcpy(back_str, shower_str);
1512 if (askfor(shower_str, 80))
1515 shower = shower_str[0] ? shower_str : NULL;
1517 else strcpy(shower_str, back_str);
1522 /* Hack -- handle find */
1530 prt("¸¡º÷: ", hgt - 1, 0);
1532 prt("Find: ", hgt - 1, 0);
1535 /* Get a "finder" string, or continue */
1536 strcpy(back_str, finder_str);
1537 if (!askfor(finder_str, 80))
1539 strcpy(finder_str, back_str);
1542 else if (!finder_str[0])
1544 shower = NULL; /* Stop showing */
1549 shower = finder_str;
1552 for (z = i + 1; z < n; z++)
1554 cptr msg = message_str(z);
1557 if (my_strstr(msg, finder_str))
1569 /* Recall 1 older message */
1571 /* Go to the oldest line */
1575 /* Recall 1 newer message */
1577 /* Go to the newest line */
1581 /* Recall 1 older message */
1586 /* Go older if legal */
1587 i = MIN(i + 1, n - num_lines);
1590 /* Recall 10 older messages */
1592 /* Go older if legal */
1593 i = MIN(i + 10, n - num_lines);
1596 /* Recall 20 older messages */
1601 /* Go older if legal */
1602 i = MIN(i + num_lines, n - num_lines);
1605 /* Recall 20 newer messages */
1609 /* Go newer (if able) */
1610 i = MAX(0, i - num_lines);
1613 /* Recall 10 newer messages */
1615 /* Go newer (if able) */
1619 /* Recall 1 newer messages */
1622 /* Go newer (if able) */
1627 /* Hack -- Error of some kind */
1631 /* Restore the screen */
1638 * ¥Á¡¼¥È¥ª¥×¥·¥ç¥ó¤ÎºÇÂç¿ô / Number of cheating options
1643 * ¥Á¡¼¤È¥ª¥×¥·¥ç¥ó¤ÎÄêµÁ¥Æ¡¼¥Ö¥ë / Cheating options
1645 static option_type cheat_info[CHEAT_MAX] =
1647 { &cheat_peek, FALSE, 255, 0x01, 0x00,
1649 "cheat_peek", "¥¢¥¤¥Æ¥à¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë"
1651 "cheat_peek", "Peek into object creation"
1655 { &cheat_hear, FALSE, 255, 0x02, 0x00,
1657 "cheat_hear", "¥â¥ó¥¹¥¿¡¼¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë"
1659 "cheat_hear", "Peek into monster creation"
1663 { &cheat_room, FALSE, 255, 0x04, 0x00,
1665 "cheat_room", "¥À¥ó¥¸¥ç¥ó¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë"
1667 "cheat_room", "Peek into dungeon creation"
1671 { &cheat_xtra, FALSE, 255, 0x08, 0x00,
1673 "cheat_xtra", "¤½¤Î¾¤Î»ö¤ò¤Î¤¾¤¸«¤ë"
1675 "cheat_xtra", "Peek into something else"
1679 { &cheat_know, FALSE, 255, 0x10, 0x00,
1681 "cheat_know", "´°Á´¤Ê¥â¥ó¥¹¥¿¡¼¤Î»×¤¤½Ð¤òÃΤë"
1683 "cheat_know", "Know complete monster info"
1687 { &cheat_live, FALSE, 255, 0x20, 0x00,
1689 "cheat_live", "»à¤ò²óÈò¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë"
1691 "cheat_live", "Allow player to avoid death"
1695 { &cheat_save, FALSE, 255, 0x40, 0x00,
1697 "cheat_save", "»à¤ó¤À»þ¥»¡¼¥Ö¤¹¤ë¤«³Îǧ¤¹¤ë"
1699 "cheat_save", "Ask for saving death"
1705 * @brief ¥Á¡¼¥È¥ª¥×¥·¥ç¥ó¤òÊѹ¹¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó
1706 * Interact with some options for cheating
1707 * @param info ɽ¼¨¥á¥Ã¥»¡¼¥¸
1710 static void do_cmd_options_cheat(cptr info)
1714 int i, k = 0, n = CHEAT_MAX;
1722 /* Interact with the player */
1727 /* Prompt XXX XXX XXX */
1729 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê )", info);
1731 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1737 /* º¾µ½¥ª¥×¥·¥ç¥ó¤ò¤¦¤Ã¤«¤ê¤¤¤¸¤Ã¤Æ¤·¤Þ¤¦¿Í¤¬¤¤¤ë¤è¤¦¤Ê¤Î¤ÇÃí°Õ */
1738 prt(" << Ãí°Õ >>", 11, 0);
1739 prt(" º¾µ½¥ª¥×¥·¥ç¥ó¤ò°ìÅ٤ǤâÀßÄꤹ¤ë¤È¡¢¥¹¥³¥¢µÏ¿¤¬»Ä¤é¤Ê¤¯¤Ê¤ê¤Þ¤¹¡ª", 12, 0);
1740 prt(" ¸å¤Ë²ò½ü¤·¤Æ¤â¥À¥á¤Ç¤¹¤Î¤Ç¡¢¾¡Íø¼Ô¤òÌܻؤ¹Êý¤Ï¤³¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤¤", 13, 0);
1741 prt(" ¤¸¤é¤Ê¤¤¤è¤¦¤Ë¤·¤Æ²¼¤µ¤¤¡£", 14, 0);
1743 /* Display the options */
1744 for (i = 0; i < n; i++)
1746 byte a = TERM_WHITE;
1748 /* Color current option */
1749 if (i == k) a = TERM_L_BLUE;
1751 /* Display the option text */
1752 sprintf(buf, "%-48s: %s (%s)",
1753 cheat_info[i].o_desc,
1755 (*cheat_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1757 (*cheat_info[i].o_var ? "yes" : "no "),
1760 cheat_info[i].o_text);
1761 c_prt(a, buf, i + 2, 0);
1764 /* Hilite current option */
1765 move_cursor(k + 2, 50);
1771 * HACK - Try to translate the key into a direction
1772 * to allow using the roguelike keys for navigation.
1774 dir = get_keymap_dir(ch);
1775 if ((dir == 2) || (dir == 4) || (dir == 6) || (dir == 8))
1789 k = (n + k - 1) % n;
1808 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "º¾µ½¥ª¥×¥·¥ç¥ó¤òON¤Ë¤·¤Æ¡¢¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
1810 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use cheating options.");
1812 p_ptr->noscore |= (cheat_info[k].o_set * 256 + cheat_info[k].o_bit);
1813 (*cheat_info[k].o_var) = TRUE;
1822 (*cheat_info[k].o_var) = FALSE;
1830 strnfmt(buf, sizeof(buf), "joption.txt#%s", cheat_info[k].o_text);
1832 strnfmt(buf, sizeof(buf), "option.txt#%s", cheat_info[k].o_text);
1834 /* Peruse the help file */
1835 (void)show_file(TRUE, buf, NULL, 0, 0);
1852 * ¼«Æ°¥»¡¼¥Ö¥ª¥×¥·¥ç¥ó¥Æ¡¼¥Ö¥ë
1854 static option_type autosave_info[2] =
1856 { &autosave_l, FALSE, 255, 0x01, 0x00,
1858 "autosave_l", "¿·¤·¤¤³¬¤ËÆþ¤ëÅ٤˼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1860 "autosave_l", "Autosave when entering new levels" },
1864 { &autosave_t, FALSE, 255, 0x02, 0x00,
1866 "autosave_t", "°ìÄ꥿¡¼¥óËè¤Ë¼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1868 "autosave_t", "Timed autosave" },
1874 * @brief ¥»¡¼¥ÖÉÑÅÙ¥¿¡¼¥ó¤Î¼¡¤ÎÃͤòÊÖ¤¹
1875 * @param current ¸½ºß¤Î¥»¡¼¥ÖÉÑÅÙ¥¿¡¼¥óÃÍ
1876 * @return ¼¡¤Î¥»¡¼¥ÖÉÑÅÙ¥¿¡¼¥óÃÍ
1878 static s16b toggle_frequency(s16b current)
1883 case 50: return 100;
1884 case 100: return 250;
1885 case 250: return 500;
1886 case 500: return 1000;
1887 case 1000: return 2500;
1888 case 2500: return 5000;
1889 case 5000: return 10000;
1890 case 10000: return 25000;
1897 * @brief ¼«Æ°¥»¡¼¥Ö¥ª¥×¥·¥ç¥ó¤òÊѹ¹¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó
1898 * @param info ɽ¼¨¥á¥Ã¥»¡¼¥¸
1901 static void do_cmd_options_autosave(cptr info)
1905 int i, k = 0, n = 2;
1913 /* Interact with the player */
1916 /* Prompt XXX XXX XXX */
1918 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, F ¤ÇÉÑÅÙ¤òÆþÎÏ, ESC ¤Ç·èÄê ) ", info);
1920 sprintf(buf, "%s (RET to advance, y/n to set, 'F' for frequency, ESC to accept) ", info);
1925 /* Display the options */
1926 for (i = 0; i < n; i++)
1928 byte a = TERM_WHITE;
1930 /* Color current option */
1931 if (i == k) a = TERM_L_BLUE;
1933 /* Display the option text */
1934 sprintf(buf, "%-48s: %s (%s)",
1935 autosave_info[i].o_desc,
1937 (*autosave_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1939 (*autosave_info[i].o_var ? "yes" : "no "),
1942 autosave_info[i].o_text);
1943 c_prt(a, buf, i + 2, 0);
1947 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè", autosave_freq), 5, 0);
1949 prt(format("Timed autosave frequency: every %d turns", autosave_freq), 5, 0);
1954 /* Hilite current option */
1955 move_cursor(k + 2, 50);
1971 k = (n + k - 1) % n;
1989 (*autosave_info[k].o_var) = TRUE;
1998 (*autosave_info[k].o_var) = FALSE;
2006 autosave_freq = toggle_frequency(autosave_freq);
2008 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè",
2009 autosave_freq), 5, 0);
2011 prt(format("Timed autosave frequency: every %d turns",
2012 autosave_freq), 5, 0);
2020 (void)show_file(TRUE, "joption.txt#Autosave", NULL, 0, 0);
2022 (void)show_file(TRUE, "option.txt#Autosave", NULL, 0, 0);
2041 * @brief ɸ½à¥ª¥×¥·¥ç¥ó¤òÊѹ¹¤¹¤ë¥³¥Þ¥ó¥É¤Î¥µ¥Ö¥ë¡¼¥Á¥ó /
2042 * Interact with some options
2043 * @param page ¥ª¥×¥·¥ç¥ó¥Ú¡¼¥¸ÈÖ¹æ
2044 * @param info ɽ¼¨¥á¥Ã¥»¡¼¥¸
2047 void do_cmd_options_aux(int page, cptr info)
2050 int i, k = 0, n = 0, l;
2053 bool browse_only = (page == OPT_PAGE_BIRTH) && character_generated &&
2054 (!p_ptr->wizard || !allow_debug_opts);
2057 /* Lookup the options */
2058 for (i = 0; i < 24; i++) opt[i] = 0;
2060 /* Scan the options */
2061 for (i = 0; option_info[i].o_desc; i++)
2063 /* Notice options on this "page" */
2064 if (option_info[i].o_page == page) opt[n++] = i;
2071 /* Interact with the player */
2076 /* Prompt XXX XXX XXX */
2078 sprintf(buf, "%s (¥ê¥¿¡¼¥ó:¼¡, %sESC:½ªÎ», ?:¥Ø¥ë¥×) ", info, browse_only ? "" : "y/n:Êѹ¹, ");
2080 sprintf(buf, "%s (RET:next, %s, ?:help) ", info, browse_only ? "ESC:exit" : "y/n:change, ESC:accept");
2086 /* HACK -- description for easy-auto-destroy options */
2088 if (page == OPT_PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢´Ê°×¼«Æ°Ç˲õ¤ò»ÈÍѤ¹¤ë¤È¤¤Î¤ß͸ú", 6, 6);
2090 if (page == OPT_PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "Following options will protect items from easy auto-destroyer.", 6, 3);
2093 /* Display the options */
2094 for (i = 0; i < n; i++)
2096 byte a = TERM_WHITE;
2098 /* Color current option */
2099 if (i == k) a = TERM_L_BLUE;
2101 /* Display the option text */
2102 sprintf(buf, "%-48s: %s (%.19s)",
2103 option_info[opt[i]].o_desc,
2105 (*option_info[opt[i]].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
2107 (*option_info[opt[i]].o_var ? "yes" : "no "),
2110 option_info[opt[i]].o_text);
2111 if ((page == OPT_PAGE_AUTODESTROY) && i > 2) c_prt(a, buf, i + 5, 0);
2112 else c_prt(a, buf, i + 2, 0);
2115 if ((page == OPT_PAGE_AUTODESTROY) && (k > 2)) l = 3;
2118 /* Hilite current option */
2119 move_cursor(k + 2 + l, 50);
2125 * HACK - Try to translate the key into a direction
2126 * to allow using the roguelike keys for navigation.
2128 dir = get_keymap_dir(ch);
2129 if ((dir == 2) || (dir == 4) || (dir == 6) || (dir == 8))
2143 k = (n + k - 1) % n;
2160 if (browse_only) break;
2161 (*option_info[opt[k]].o_var) = TRUE;
2170 if (browse_only) break;
2171 (*option_info[opt[k]].o_var) = FALSE;
2179 if (!browse_only) (*option_info[opt[k]].o_var) = !(*option_info[opt[k]].o_var);
2186 strnfmt(buf, sizeof(buf), "joption.txt#%s", option_info[opt[k]].o_text);
2188 strnfmt(buf, sizeof(buf), "option.txt#%s", option_info[opt[k]].o_text);
2190 /* Peruse the help file */
2191 (void)show_file(TRUE, buf, NULL, 0, 0);
2208 * @brief ¥¦¥£¥ó¥É¥¦¥ª¥×¥·¥ç¥ó¤òÊѹ¹¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó /
2209 * Modify the "window" options
2212 static void do_cmd_options_win(void)
2226 /* Memorize old flags */
2227 for (j = 0; j < 8; j++)
2229 /* Acquire current flags */
2230 old_flag[j] = window_flag[j];
2240 /* Prompt XXX XXX XXX */
2242 prt("¥¦¥£¥ó¥É¥¦¡¦¥Õ¥é¥° (<Êý¸þ>¤Ç°ÜÆ°, t¤Ç¥Á¥§¥ó¥¸, y/n ¤Ç¥»¥Ã¥È, ESC)", 0, 0);
2244 prt("Window Flags (<dir>, t, y, n, ESC) ", 0, 0);
2248 /* Display the windows */
2249 for (j = 0; j < 8; j++)
2251 byte a = TERM_WHITE;
2253 cptr s = angband_term_name[j];
2256 if (j == x) a = TERM_L_BLUE;
2258 /* Window name, staggered, centered */
2259 Term_putstr(35 + j * 5 - strlen(s) / 2, 2 + j % 2, -1, a, s);
2262 /* Display the options */
2263 for (i = 0; i < 16; i++)
2265 byte a = TERM_WHITE;
2267 cptr str = window_flag_desc[i];
2270 if (i == y) a = TERM_L_BLUE;
2274 if (!str) str = "(̤»ÈÍÑ)";
2276 if (!str) str = "(Unused option)";
2281 Term_putstr(0, i + 5, -1, a, str);
2283 /* Display the windows */
2284 for (j = 0; j < 8; j++)
2286 byte a = TERM_WHITE;
2291 if ((i == y) && (j == x)) a = TERM_L_BLUE;
2294 if (window_flag[j] & (1L << i)) c = 'X';
2297 Term_putch(35 + j * 5, i + 5, a, c);
2302 Term_gotoxy(35 + x * 5, y + 5);
2320 for (j = 0; j < 8; j++)
2322 window_flag[j] &= ~(1L << y);
2326 for (i = 0; i < 16; i++)
2328 window_flag[x] &= ~(1L << i);
2341 window_flag[x] |= (1L << y);
2349 window_flag[x] &= ~(1L << y);
2356 (void)show_file(TRUE, "joption.txt#Window", NULL, 0, 0);
2358 (void)show_file(TRUE, "option.txt#Window", NULL, 0, 0);
2368 d = get_keymap_dir(ch);
2370 x = (x + ddx[d] + 8) % 8;
2371 y = (y + ddy[d] + 16) % 16;
2378 /* Notice changes */
2379 for (j = 0; j < 8; j++)
2384 if (!angband_term[j]) continue;
2386 /* Ignore non-changes */
2387 if (window_flag[j] == old_flag[j]) continue;
2390 Term_activate(angband_term[j]);
2413 option_fields[OPT_NUM] =
2416 { '1', " ¥¡¼ÆþÎÏ ¥ª¥×¥·¥ç¥ó", 3 },
2417 { '2', " ¥Þ¥Ã¥×²èÌÌ ¥ª¥×¥·¥ç¥ó", 4 },
2418 { '3', " ¥Æ¥¥¹¥Èɽ¼¨ ¥ª¥×¥·¥ç¥ó", 5 },
2419 { '4', " ¥²¡¼¥à¥×¥ì¥¤ ¥ª¥×¥·¥ç¥ó", 6 },
2420 { '5', " ¹ÔÆ°Ãæ»ß´Ø·¸ ¥ª¥×¥·¥ç¥ó", 7 },
2421 { '6', " ´Ê°×¼«Æ°Ç˲õ ¥ª¥×¥·¥ç¥ó", 8 },
2422 { 'r', " ¥×¥ì¥¤µÏ¿ ¥ª¥×¥·¥ç¥ó", 9 },
2424 { 'p', "¼«Æ°½¦¤¤¥¨¥Ç¥£¥¿", 11 },
2425 { 'd', " ´ðËÜ¥¦¥§¥¤¥ÈÎÌ ", 12 },
2426 { 'h', "Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È", 13 },
2427 { 'm', " ÄãËâÎÏ¿§ïçÃÍ ", 14 },
2428 { 'a', " ¼«Æ°¥»¡¼¥Ö ¥ª¥×¥·¥ç¥ó", 15 },
2429 { 'w', "¥¦¥¤¥ó¥É¥¦¥Õ¥é¥°", 16 },
2431 { 'b', " ½é´ü ¥ª¥×¥·¥ç¥ó (»²¾È¤Î¤ß)", 18 },
2432 { 'c', " º¾µ½ ¥ª¥×¥·¥ç¥ó", 19 },
2434 { '1', "Input Options", 3 },
2435 { '2', "Map Screen Options", 4 },
2436 { '3', "Text Display Options", 5 },
2437 { '4', "Game-Play Options", 6 },
2438 { '5', "Disturbance Options", 7 },
2439 { '6', "Easy Auto-Destroyer Options", 8 },
2440 { 'r', "Play record Options", 9 },
2442 { 'p', "Auto-picker/destroyer editor", 11 },
2443 { 'd', "Base Delay Factor", 12 },
2444 { 'h', "Hitpoint Warning", 13 },
2445 { 'm', "Mana Color Threshold", 14 },
2446 { 'a', "Autosave Options", 15 },
2447 { 'w', "Window Flags", 16 },
2449 { 'b', "Birth Options (Browse Only)", 18 },
2450 { 'c', "Cheat Options", 19 },
2456 * @brief ɸ½à¥ª¥×¥·¥ç¥ó¤òÊѹ¹¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó /
2457 * Set or unset various options.
2461 * The user must use the "Ctrl-R" command to "adapt" to changes
2462 * in any options which control "visual" aspects of the game.
2465 void do_cmd_options(void)
2471 /* Save the screen */
2479 /* Does not list cheat option when cheat option is off */
2480 if (!p_ptr->noscore && !allow_debug_opts) n--;
2485 /* Why are we here */
2487 prt("[ ¥ª¥×¥·¥ç¥ó¤ÎÀßÄê ]", 1, 0);
2489 prt("TinyAngband options", 1, 0);
2494 /* Give some choices */
2495 for (i = 0; i < n; i++)
2497 byte a = TERM_WHITE;
2498 if (i == y) a = TERM_L_BLUE;
2499 Term_putstr(5, option_fields[i].row, -1, a,
2500 format("(%c) %s", toupper(option_fields[i].key), option_fields[i].name));
2504 prt("<Êý¸þ>¤Ç°ÜÆ°, Enter¤Ç·èÄê, ESC¤Ç¥¥ã¥ó¥»¥ë, ?¤Ç¥Ø¥ë¥×: ", 21, 0);
2506 prt("Move to <dir>, Select to Enter, Cancel to ESC, ? to help: ", 21, 0);
2510 skey = inkey_special(TRUE);
2511 if (!(skey & SKEY_MASK)) k = (char)skey;
2515 if (k == ESCAPE) break;
2517 if (my_strchr("\n\r ", k))
2519 k = option_fields[y].key;
2523 for (i = 0; i < n; i++)
2525 if (tolower(k) == option_fields[i].key) break;
2528 /* Command is found */
2531 /* Hack -- browse help */
2532 if (k == '?') break;
2536 if (skey == SKEY_UP) d = 8;
2537 if (skey == SKEY_DOWN) d = 2;
2538 y = (y + ddy[d] + n) % n;
2543 if (k == ESCAPE) break;
2550 /* Process the general options */
2552 do_cmd_options_aux(OPT_PAGE_INPUT, "¥¡¼ÆþÎÏ¥ª¥×¥·¥ç¥ó");
2554 do_cmd_options_aux(OPT_PAGE_INPUT, "Input Options");
2561 /* Process the general options */
2563 do_cmd_options_aux(OPT_PAGE_MAPSCREEN, "¥Þ¥Ã¥×²èÌÌ¥ª¥×¥·¥ç¥ó");
2565 do_cmd_options_aux(OPT_PAGE_MAPSCREEN, "Map Screen Options");
2574 do_cmd_options_aux(OPT_PAGE_TEXT, "¥Æ¥¥¹¥Èɽ¼¨¥ª¥×¥·¥ç¥ó");
2576 do_cmd_options_aux(OPT_PAGE_TEXT, "Text Display Options");
2585 do_cmd_options_aux(OPT_PAGE_GAMEPLAY, "¥²¡¼¥à¥×¥ì¥¤¡¦¥ª¥×¥·¥ç¥ó");
2587 do_cmd_options_aux(OPT_PAGE_GAMEPLAY, "Game-Play Options");
2596 do_cmd_options_aux(OPT_PAGE_DISTURBANCE, "¹ÔÆ°Ãæ»ß´Ø·¸¤Î¥ª¥×¥·¥ç¥ó");
2598 do_cmd_options_aux(OPT_PAGE_DISTURBANCE, "Disturbance Options");
2607 do_cmd_options_aux(OPT_PAGE_AUTODESTROY, "´Ê°×¼«Æ°Ç˲õ¥ª¥×¥·¥ç¥ó");
2609 do_cmd_options_aux(OPT_PAGE_AUTODESTROY, "Easy Auto-Destroyer Options");
2614 /* Play-record Options */
2620 do_cmd_options_aux(OPT_PAGE_PLAYRECORD, "¥×¥ì¥¤µÏ¿¥ª¥×¥·¥ç¥ó");
2622 do_cmd_options_aux(OPT_PAGE_PLAYRECORD, "Play-record Options");
2633 do_cmd_options_aux(OPT_PAGE_BIRTH, (!p_ptr->wizard || !allow_debug_opts) ? "½é´ü¥ª¥×¥·¥ç¥ó(»²¾È¤Î¤ß)" : "½é´ü¥ª¥×¥·¥ç¥ó((*)¤Ï¥¹¥³¥¢¤Ë±Æ¶Á)");
2635 do_cmd_options_aux(OPT_PAGE_BIRTH, (!p_ptr->wizard || !allow_debug_opts) ? "Birth Options(browse only)" : "Birth Options((*)s effect score)");
2640 /* Cheating Options */
2643 if (!p_ptr->noscore && !allow_debug_opts)
2645 /* Cheat options are not permitted */
2652 do_cmd_options_cheat("º¾µ½»Õ¤Ï·è¤·¤Æ¾¡Íø¤Ç¤¤Ê¤¤¡ª");
2654 do_cmd_options_cheat("Cheaters never win");
2663 do_cmd_options_autosave("¼«Æ°¥»¡¼¥Ö");
2665 do_cmd_options_autosave("Autosave");
2675 do_cmd_options_win();
2676 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL |
2677 PW_PLAYER | PW_MESSAGE | PW_OVERHEAD |
2678 PW_MONSTER | PW_OBJECT | PW_SNAPSHOT |
2679 PW_BORG_1 | PW_BORG_2 | PW_DUNGEON |
2684 /* Auto-picker/destroyer editor */
2688 do_cmd_edit_autopick();
2692 /* Hack -- Delay Speed */
2699 prt("¥³¥Þ¥ó¥É: ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 19, 0);
2701 prt("Command: Base Delay Factor", 19, 0);
2704 /* Get a new value */
2707 int msec = delay_factor * delay_factor * delay_factor;
2709 prt(format("¸½ºß¤Î¥¦¥§¥¤¥È: %d (%d¥ß¥êÉÃ)",
2710 delay_factor, msec), 22, 0);
2712 prt(format("Current base delay factor: %d (%d msec)",
2713 delay_factor, msec), 22, 0);
2717 prt("¥¦¥§¥¤¥È (0-9) ESC¤Ç·èÄê: ", 20, 0);
2719 prt("Delay Factor (0-9 or ESC to accept): ", 20, 0);
2723 if (k == ESCAPE) break;
2727 (void)show_file(TRUE, "joption.txt#BaseDelay", NULL, 0, 0);
2729 (void)show_file(TRUE, "option.txt#BaseDelay", NULL, 0, 0);
2733 else if (isdigit(k)) delay_factor = D2I(k);
2740 /* Hack -- hitpoint warning factor */
2747 prt("¥³¥Þ¥ó¥É: Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 19, 0);
2749 prt("Command: Hitpoint Warning", 19, 0);
2752 /* Get a new value */
2756 prt(format("¸½ºß¤ÎÄã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð: %d0%%",
2757 hitpoint_warn), 22, 0);
2759 prt(format("Current hitpoint warning: %d0%%",
2760 hitpoint_warn), 22, 0);
2764 prt("Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð (0-9) ESC¤Ç·èÄê: ", 20, 0);
2766 prt("Hitpoint Warning (0-9 or ESC to accept): ", 20, 0);
2770 if (k == ESCAPE) break;
2774 (void)show_file(TRUE, "joption.txt#Hitpoint", NULL, 0, 0);
2776 (void)show_file(TRUE, "option.txt#Hitpoint", NULL, 0, 0);
2780 else if (isdigit(k)) hitpoint_warn = D2I(k);
2787 /* Hack -- mana color factor */
2794 prt("¥³¥Þ¥ó¥É: ÄãËâÎÏ¿§ïçÃÍ", 19, 0);
2796 prt("Command: Mana Color Threshold", 19, 0);
2799 /* Get a new value */
2803 prt(format("¸½ºß¤ÎÄãËâÎÏ¿§ïçÃÍ: %d0%%",
2806 prt(format("Current mana color threshold: %d0%%",
2811 prt("ÄãËâÎÏïçÃÍ (0-9) ESC¤Ç·èÄê: ", 20, 0);
2813 prt("Mana color Threshold (0-9 or ESC to accept): ", 20, 0);
2817 if (k == ESCAPE) break;
2821 (void)show_file(TRUE, "joption.txt#Manapoint", NULL, 0, 0);
2823 (void)show_file(TRUE, "option.txt#Manapoint", NULL, 0, 0);
2827 else if (isdigit(k)) mana_warn = D2I(k);
2836 (void)show_file(TRUE, "joption.txt", NULL, 0, 0);
2838 (void)show_file(TRUE, "option.txt", NULL, 0, 0);
2843 /* Unknown option */
2852 /* Flush messages */
2857 /* Restore the screen */
2860 /* Hack - Redraw equippy chars */
2861 p_ptr->redraw |= (PR_EQUIPPY);
2867 * @brief pref¥Õ¥¡¥¤¥ë¤òÁªÂò¤·¤Æ½èÍý¤¹¤ë /
2868 * Ask for a "user pref line" and process it
2871 * XXX XXX XXX Allow absolute file names?
2873 void do_cmd_pref(void)
2880 /* Ask for a "user pref command" */
2882 if (!get_string("ÀßÄêÊѹ¹¥³¥Þ¥ó¥É: ", buf, 80)) return;
2884 if (!get_string("Pref: ", buf, 80)) return;
2888 /* Process that pref command */
2889 (void)process_pref_file_command(buf);
2893 * @brief ¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó /
2896 void do_cmd_reload_autopick(void)
2899 if (!get_check("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹¤«? ")) return;
2901 if (!get_check("Reload auto-pick preference file? ")) return;
2904 /* Load the file with messages */
2905 autopick_load_pref(TRUE);
2911 * @brief ¥Þ¥¯¥í¾ðÊó¤òpref¥Õ¥¡¥¤¥ë¤ËÊݸ¤¹¤ë /
2912 * @param fname ¥Õ¥¡¥¤¥ë̾
2915 static errr macro_dump(cptr fname)
2917 static cptr mark = "Macro Dump";
2923 /* Build the filename */
2924 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
2926 /* File type is "TEXT" */
2927 FILE_TYPE(FILE_TYPE_TEXT);
2929 /* Append to the file */
2930 if (!open_auto_dump(buf, mark)) return (-1);
2934 auto_dump_printf("\n# ¼«Æ°¥Þ¥¯¥í¥»¡¼¥Ö\n\n");
2936 auto_dump_printf("\n# Automatic macro dump\n\n");
2940 for (i = 0; i < macro__num; i++)
2942 /* Extract the action */
2943 ascii_to_text(buf, macro__act[i]);
2945 /* Dump the macro */
2946 auto_dump_printf("A:%s\n", buf);
2948 /* Extract the action */
2949 ascii_to_text(buf, macro__pat[i]);
2951 /* Dump normal macros */
2952 auto_dump_printf("P:%s\n", buf);
2955 auto_dump_printf("\n");
2967 * @brief ¥Þ¥¯¥í¤Î¥È¥ê¥¬¡¼¥¡¼¤ò¼èÆÀ¤¹¤ë /
2968 * Hack -- ask for a "trigger" (see below)
2969 * @param buf ¥¡¼É½µ¤òÊݴɤ¹¤ë¥Ð¥Ã¥Õ¥¡
2973 * Note the complex use of the "inkey()" function from "util.c".
2975 * Note that both "flush()" calls are extremely important.
2978 static void do_cmd_macro_aux(char *buf)
2988 /* Do not process macros */
2994 /* Read the pattern */
3000 /* Do not process macros */
3003 /* Do not wait for keys */
3006 /* Attempt to read a key */
3017 /* Convert the trigger */
3018 ascii_to_text(tmp, buf);
3020 /* Hack -- display the trigger */
3021 Term_addstr(-1, TERM_WHITE, tmp);
3027 * @brief ¥Þ¥¯¥í¤Î¥¡¼É½µ¤«¤é¥¢¥¹¥¡¼¥³¡¼¥É¤òÆÀ¤Æ¥¿¡¼¥ß¥Ê¥ë¤Ëɽ¼¨¤¹¤ë /
3028 * Hack -- ask for a keymap "trigger" (see below)
3029 * @param buf ¥¡¼É½µ¤ò¼èÆÀ¤¹¤ë¥Ð¥Ã¥Õ¥¡
3033 * Note that both "flush()" calls are extremely important. This may
3034 * no longer be true, since "util.c" is much simpler now. XXX XXX XXX
3037 static void do_cmd_macro_aux_keymap(char *buf)
3051 /* Convert to ascii */
3052 ascii_to_text(tmp, buf);
3054 /* Hack -- display the trigger */
3055 Term_addstr(-1, TERM_WHITE, tmp);
3064 * @brief ¥¡¼¥Þ¥Ã¥×¤òpref¥Õ¥¡¥¤¥ë¤Ë¥À¥ó¥×¤¹¤ë /
3065 * Hack -- append all keymaps to the given file
3066 * @param fname ¥Õ¥¡¥¤¥ë¥Í¡¼¥à
3067 * @return ¥¨¥é¡¼¥³¡¼¥É
3070 static errr keymap_dump(cptr fname)
3072 static cptr mark = "Keymap Dump";
3081 if (rogue_like_commands)
3083 mode = KEYMAP_MODE_ROGUE;
3089 mode = KEYMAP_MODE_ORIG;
3093 /* Build the filename */
3094 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
3096 /* File type is "TEXT" */
3097 FILE_TYPE(FILE_TYPE_TEXT);
3099 /* Append to the file */
3100 if (!open_auto_dump(buf, mark)) return -1;
3104 auto_dump_printf("\n# ¼«Æ°¥¡¼ÇÛÃÖ¥»¡¼¥Ö\n\n");
3106 auto_dump_printf("\n# Automatic keymap dump\n\n");
3110 for (i = 0; i < 256; i++)
3114 /* Loop up the keymap */
3115 act = keymap_act[mode][i];
3117 /* Skip empty keymaps */
3120 /* Encode the key */
3123 ascii_to_text(key, buf);
3125 /* Encode the action */
3126 ascii_to_text(buf, act);
3128 /* Dump the macro */
3129 auto_dump_printf("A:%s\n", buf);
3130 auto_dump_printf("C:%d:%s\n", mode, key);
3142 * @brief ¥Þ¥¯¥í¤òÀßÄꤹ¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó /
3143 * Interact with "macros"
3147 * Note that the macro "action" must be defined before the trigger.
3149 * Could use some helpful instructions on this page. XXX XXX XXX
3152 void do_cmd_macros(void)
3164 if (rogue_like_commands)
3166 mode = KEYMAP_MODE_ROGUE;
3172 mode = KEYMAP_MODE_ORIG;
3175 /* File type is "TEXT" */
3176 FILE_TYPE(FILE_TYPE_TEXT);
3183 /* Process requests until done */
3191 prt("[ ¥Þ¥¯¥í¤ÎÀßÄê ]", 2, 0);
3193 prt("Interact with Macros", 2, 0);
3198 /* Describe that action */
3200 prt("¥Þ¥¯¥í¹ÔÆ°¤¬(¤â¤·¤¢¤ì¤Ð)²¼¤Ëɽ¼¨¤µ¤ì¤Þ¤¹:", 20, 0);
3202 prt("Current action (if any) shown below:", 20, 0);
3206 /* Analyze the current action */
3207 ascii_to_text(buf, macro__buf);
3209 /* Display the current action */
3215 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
3217 prt("(1) Load a user pref file", 4, 5);
3222 prt("(2) ¥Õ¥¡¥¤¥ë¤Ë¥Þ¥¯¥í¤òÄɲÃ", 5, 5);
3223 prt("(3) ¥Þ¥¯¥í¤Î³Îǧ", 6, 5);
3224 prt("(4) ¥Þ¥¯¥í¤ÎºîÀ®", 7, 5);
3225 prt("(5) ¥Þ¥¯¥í¤Îºï½ü", 8, 5);
3226 prt("(6) ¥Õ¥¡¥¤¥ë¤Ë¥¡¼ÇÛÃÖ¤òÄɲÃ", 9, 5);
3227 prt("(7) ¥¡¼ÇÛÃ֤γÎǧ", 10, 5);
3228 prt("(8) ¥¡¼ÇÛÃ֤κîÀ®", 11, 5);
3229 prt("(9) ¥¡¼ÇÛÃ֤κï½ü", 12, 5);
3230 prt("(0) ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 13, 5);
3232 prt("(2) Append macros to a file", 5, 5);
3233 prt("(3) Query a macro", 6, 5);
3234 prt("(4) Create a macro", 7, 5);
3235 prt("(5) Remove a macro", 8, 5);
3236 prt("(6) Append keymaps to a file", 9, 5);
3237 prt("(7) Query a keymap", 10, 5);
3238 prt("(8) Create a keymap", 11, 5);
3239 prt("(9) Remove a keymap", 12, 5);
3240 prt("(0) Enter a new action", 13, 5);
3243 #endif /* ALLOW_MACROS */
3247 prt("¥³¥Þ¥ó¥É: ", 16, 0);
3249 prt("Command: ", 16, 0);
3257 if (i == ESCAPE) break;
3259 /* Load a 'macro' file */
3266 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 16, 0);
3268 prt("Command: Load a user pref file", 16, 0);
3274 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3276 prt("File: ", 18, 0);
3280 /* Default filename */
3281 sprintf(tmp, "%s.prf", player_base);
3283 /* Ask for a file */
3284 if (!askfor(tmp, 80)) continue;
3286 /* Process the given filename */
3287 err = process_pref_file(tmp);
3291 msg_format("ɸ½à¤ÎÀßÄê¥Õ¥¡¥¤¥ë'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
3293 msg_format("Loaded default '%s'.", tmp);
3300 msg_format("'%s'¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡ª", tmp);
3302 msg_format("Failed to load '%s'!");
3308 msg_format("'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
3310 msg_format("Loaded '%s'.", tmp);
3322 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
3324 prt("Command: Append macros to a file", 16, 0);
3330 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3332 prt("File: ", 18, 0);
3336 /* Default filename */
3337 sprintf(tmp, "%s.prf", player_base);
3339 /* Ask for a file */
3340 if (!askfor(tmp, 80)) continue;
3342 /* Dump the macros */
3343 (void)macro_dump(tmp);
3347 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
3349 msg_print("Appended macros.");
3361 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Î³Îǧ", 16, 0);
3363 prt("Command: Query a macro", 16, 0);
3369 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3371 prt("Trigger: ", 18, 0);
3375 /* Get a macro trigger */
3376 do_cmd_macro_aux(buf);
3378 /* Acquire action */
3379 k = macro_find_exact(buf);
3386 msg_print("¤½¤Î¥¡¼¤Ë¤Ï¥Þ¥¯¥í¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
3388 msg_print("Found no macro.");
3396 /* Obtain the action */
3397 strcpy(macro__buf, macro__act[k]);
3399 /* Analyze the current action */
3400 ascii_to_text(buf, macro__buf);
3402 /* Display the current action */
3407 msg_print("¥Þ¥¯¥í¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
3409 msg_print("Found a macro.");
3415 /* Create a macro */
3420 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ÎºîÀ®", 16, 0);
3422 prt("Command: Create a macro", 16, 0);
3428 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3430 prt("Trigger: ", 18, 0);
3434 /* Get a macro trigger */
3435 do_cmd_macro_aux(buf);
3442 c_prt(TERM_L_RED, "¥«¡¼¥½¥ë¥¡¼¤Îº¸±¦¤Ç¥«¡¼¥½¥ë°ÌÃÖ¤ò°ÜÆ°¡£Backspace¤«Delete¤Ç°ìʸ»úºï½ü¡£", 22, 0);
3444 c_prt(TERM_L_RED, "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char.", 22, 0);
3449 prt("¥Þ¥¯¥í¹ÔÆ°: ", 20, 0);
3451 prt("Action: ", 20, 0);
3455 /* Convert to text */
3456 ascii_to_text(tmp, macro__buf);
3458 /* Get an encoded action */
3459 if (askfor(tmp, 80))
3461 /* Convert to ascii */
3462 text_to_ascii(macro__buf, tmp);
3464 /* Link the macro */
3465 macro_add(buf, macro__buf);
3469 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
3471 msg_print("Added a macro.");
3477 /* Remove a macro */
3482 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Îºï½ü", 16, 0);
3484 prt("Command: Remove a macro", 16, 0);
3490 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3492 prt("Trigger: ", 18, 0);
3496 /* Get a macro trigger */
3497 do_cmd_macro_aux(buf);
3499 /* Link the macro */
3500 macro_add(buf, buf);
3504 msg_print("¥Þ¥¯¥í¤òºï½ü¤·¤Þ¤·¤¿¡£");
3506 msg_print("Removed a macro.");
3516 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃÖ¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
3518 prt("Command: Append keymaps to a file", 16, 0);
3524 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3526 prt("File: ", 18, 0);
3530 /* Default filename */
3531 sprintf(tmp, "%s.prf", player_base);
3533 /* Ask for a file */
3534 if (!askfor(tmp, 80)) continue;
3536 /* Dump the macros */
3537 (void)keymap_dump(tmp);
3541 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3543 msg_print("Appended keymaps.");
3548 /* Query a keymap */
3555 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤γÎǧ", 16, 0);
3557 prt("Command: Query a keymap", 16, 0);
3563 prt("²¡¤¹¥¡¼: ", 18, 0);
3565 prt("Keypress: ", 18, 0);
3569 /* Get a keymap trigger */
3570 do_cmd_macro_aux_keymap(buf);
3572 /* Look up the keymap */
3573 act = keymap_act[mode][(byte)(buf[0])];
3580 msg_print("¥¡¼ÇÛÃÖ¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
3582 msg_print("Found no keymap.");
3590 /* Obtain the action */
3591 strcpy(macro__buf, act);
3593 /* Analyze the current action */
3594 ascii_to_text(buf, macro__buf);
3596 /* Display the current action */
3601 msg_print("¥¡¼ÇÛÃÖ¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
3603 msg_print("Found a keymap.");
3609 /* Create a keymap */
3614 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κîÀ®", 16, 0);
3616 prt("Command: Create a keymap", 16, 0);
3622 prt("²¡¤¹¥¡¼: ", 18, 0);
3624 prt("Keypress: ", 18, 0);
3628 /* Get a keymap trigger */
3629 do_cmd_macro_aux_keymap(buf);
3636 c_prt(TERM_L_RED, "¥«¡¼¥½¥ë¥¡¼¤Îº¸±¦¤Ç¥«¡¼¥½¥ë°ÌÃÖ¤ò°ÜÆ°¡£Backspace¤«Delete¤Ç°ìʸ»úºï½ü¡£", 22, 0);
3638 c_prt(TERM_L_RED, "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char.", 22, 0);
3643 prt("¹ÔÆ°: ", 20, 0);
3645 prt("Action: ", 20, 0);
3649 /* Convert to text */
3650 ascii_to_text(tmp, macro__buf);
3652 /* Get an encoded action */
3653 if (askfor(tmp, 80))
3655 /* Convert to ascii */
3656 text_to_ascii(macro__buf, tmp);
3658 /* Free old keymap */
3659 string_free(keymap_act[mode][(byte)(buf[0])]);
3661 /* Make new keymap */
3662 keymap_act[mode][(byte)(buf[0])] = string_make(macro__buf);
3666 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3668 msg_print("Added a keymap.");
3674 /* Remove a keymap */
3679 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κï½ü", 16, 0);
3681 prt("Command: Remove a keymap", 16, 0);
3687 prt("²¡¤¹¥¡¼: ", 18, 0);
3689 prt("Keypress: ", 18, 0);
3693 /* Get a keymap trigger */
3694 do_cmd_macro_aux_keymap(buf);
3696 /* Free old keymap */
3697 string_free(keymap_act[mode][(byte)(buf[0])]);
3699 /* Make new keymap */
3700 keymap_act[mode][(byte)(buf[0])] = NULL;
3704 msg_print("¥¡¼ÇÛÃÖ¤òºï½ü¤·¤Þ¤·¤¿¡£");
3706 msg_print("Removed a keymap.");
3711 /* Enter a new action */
3716 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 16, 0);
3718 prt("Command: Enter a new action", 16, 0);
3726 c_prt(TERM_L_RED, "¥«¡¼¥½¥ë¥¡¼¤Îº¸±¦¤Ç¥«¡¼¥½¥ë°ÌÃÖ¤ò°ÜÆ°¡£Backspace¤«Delete¤Ç°ìʸ»úºï½ü¡£", 22, 0);
3728 c_prt(TERM_L_RED, "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char.", 22, 0);
3733 prt("¥Þ¥¯¥í¹ÔÆ°: ", 20, 0);
3735 prt("Action: ", 20, 0);
3738 /* Hack -- limit the value */
3741 /* Get an encoded action */
3742 if (!askfor(buf, 80)) continue;
3744 /* Extract an action */
3745 text_to_ascii(macro__buf, buf);
3748 #endif /* ALLOW_MACROS */
3757 /* Flush messages */
3766 static cptr lighting_level_str[F_LIT_MAX] =
3780 static bool cmd_visuals_aux(int i, int *num, int max)
3787 sprintf(str, "%d", *num);
3789 if (!get_string(format("Input new number(0-%d): ", max-1), str, 4))
3792 tmp = strtol(str, NULL, 0);
3793 if (tmp >= 0 && tmp < max)
3796 else if (isupper(i))
3797 *num = (*num + max - 1) % max;
3799 *num = (*num + 1) % max;
3804 static void print_visuals_menu(cptr choice_msg)
3807 prt("[ ²èÌÌɽ¼¨¤ÎÀßÄê ]", 1, 0);
3809 prt("Interact with Visuals", 1, 0);
3812 /* Give some choices */
3814 prt("(0) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 3, 5);
3816 prt("(0) Load a user pref file", 3, 5);
3819 #ifdef ALLOW_VISUALS
3821 prt("(1) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 4, 5);
3822 prt("(2) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
3823 prt("(3) ÃÏ·Á¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 6, 5);
3824 prt("(4) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë (¿ôÃÍÁàºî)", 7, 5);
3825 prt("(5) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë (¿ôÃÍÁàºî)", 8, 5);
3826 prt("(6) ÃÏ·Á¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë (¿ôÃÍÁàºî)", 9, 5);
3827 prt("(7) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë (¥·¥ó¥Ü¥ë¥¨¥Ç¥£¥¿)", 10, 5);
3828 prt("(8) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë (¥·¥ó¥Ü¥ë¥¨¥Ç¥£¥¿)", 11, 5);
3829 prt("(9) ÃÏ·Á¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë (¥·¥ó¥Ü¥ë¥¨¥Ç¥£¥¿)", 12, 5);
3831 prt("(1) Dump monster attr/chars", 4, 5);
3832 prt("(2) Dump object attr/chars", 5, 5);
3833 prt("(3) Dump feature attr/chars", 6, 5);
3834 prt("(4) Change monster attr/chars (numeric operation)", 7, 5);
3835 prt("(5) Change object attr/chars (numeric operation)", 8, 5);
3836 prt("(6) Change feature attr/chars (numeric operation)", 9, 5);
3837 prt("(7) Change monster attr/chars (visual mode)", 10, 5);
3838 prt("(8) Change object attr/chars (visual mode)", 11, 5);
3839 prt("(9) Change feature attr/chars (visual mode)", 12, 5);
3842 #endif /* ALLOW_VISUALS */
3845 prt("(R) ²èÌÌɽ¼¨ÊýË¡¤Î½é´ü²½", 13, 5);
3847 prt("(R) Reset visuals", 13, 5);
3852 prt(format("¥³¥Þ¥ó¥É: %s", choice_msg ? choice_msg : ""), 15, 0);
3854 prt(format("Command: %s", choice_msg ? choice_msg : ""), 15, 0);
3858 static void do_cmd_knowledge_monsters(bool *need_redraw, bool visual_only, int direct_r_idx);
3859 static void do_cmd_knowledge_objects(bool *need_redraw, bool visual_only, int direct_k_idx);
3860 static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, int direct_f_idx, int *lighting_level);
3863 * Interact with "visuals"
3865 void do_cmd_visuals(void)
3870 bool need_redraw = FALSE;
3871 const char *empty_symbol = "<< ? >>";
3873 if (use_bigtile) empty_symbol = "<< ?? >>";
3875 /* File type is "TEXT" */
3876 FILE_TYPE(FILE_TYPE_TEXT);
3878 /* Save the screen */
3881 /* Interact until done */
3887 /* Ask for a choice */
3888 print_visuals_menu(NULL);
3894 if (i == ESCAPE) break;
3898 /* Load a 'pref' file */
3902 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 15, 0);
3904 prt("Command: Load a user pref file", 15, 0);
3909 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3911 prt("File: ", 17, 0);
3914 /* Default filename */
3915 sprintf(tmp, "%s.prf", player_base);
3918 if (!askfor(tmp, 70)) continue;
3920 /* Process the given filename */
3921 (void)process_pref_file(tmp);
3926 #ifdef ALLOW_VISUALS
3928 /* Dump monster attr/chars */
3931 static cptr mark = "Monster attr/chars";
3935 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3937 prt("Command: Dump monster attr/chars", 15, 0);
3942 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3944 prt("File: ", 17, 0);
3947 /* Default filename */
3948 sprintf(tmp, "%s.prf", player_base);
3950 /* Get a filename */
3951 if (!askfor(tmp, 70)) continue;
3953 /* Build the filename */
3954 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3956 /* Append to the file */
3957 if (!open_auto_dump(buf, mark)) continue;
3961 auto_dump_printf("\n# ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3963 auto_dump_printf("\n# Monster attr/char definitions\n\n");
3967 for (i = 0; i < max_r_idx; i++)
3969 monster_race *r_ptr = &r_info[i];
3971 /* Skip non-entries */
3972 if (!r_ptr->name) continue;
3974 /* Dump a comment */
3975 auto_dump_printf("# %s\n", (r_name + r_ptr->name));
3977 /* Dump the monster attr/char info */
3978 auto_dump_printf("R:%d:0x%02X/0x%02X\n\n", i,
3979 (byte)(r_ptr->x_attr), (byte)(r_ptr->x_char));
3987 msg_print("¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3989 msg_print("Dumped monster attr/chars.");
3995 /* Dump object attr/chars */
3998 static cptr mark = "Object attr/chars";
4002 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
4004 prt("Command: Dump object attr/chars", 15, 0);
4009 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
4011 prt("File: ", 17, 0);
4014 /* Default filename */
4015 sprintf(tmp, "%s.prf", player_base);
4017 /* Get a filename */
4018 if (!askfor(tmp, 70)) continue;
4020 /* Build the filename */
4021 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
4023 /* Append to the file */
4024 if (!open_auto_dump(buf, mark)) continue;
4028 auto_dump_printf("\n# ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
4030 auto_dump_printf("\n# Object attr/char definitions\n\n");
4034 for (i = 0; i < max_k_idx; i++)
4037 object_kind *k_ptr = &k_info[i];
4039 /* Skip non-entries */
4040 if (!k_ptr->name) continue;
4045 strip_name(o_name, i);
4051 /* Prepare dummy object */
4052 object_prep(&forge, i);
4054 /* Get un-shuffled flavor name */
4055 object_desc(o_name, &forge, OD_FORCE_FLAVOR);
4058 /* Dump a comment */
4059 auto_dump_printf("# %s\n", o_name);
4061 /* Dump the object attr/char info */
4062 auto_dump_printf("K:%d:0x%02X/0x%02X\n\n", i,
4063 (byte)(k_ptr->x_attr), (byte)(k_ptr->x_char));
4071 msg_print("¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
4073 msg_print("Dumped object attr/chars.");
4079 /* Dump feature attr/chars */
4082 static cptr mark = "Feature attr/chars";
4086 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
4088 prt("Command: Dump feature attr/chars", 15, 0);
4093 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
4095 prt("File: ", 17, 0);
4098 /* Default filename */
4099 sprintf(tmp, "%s.prf", player_base);
4101 /* Get a filename */
4102 if (!askfor(tmp, 70)) continue;
4104 /* Build the filename */
4105 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
4107 /* Append to the file */
4108 if (!open_auto_dump(buf, mark)) continue;
4112 auto_dump_printf("\n# ÃÏ·Á¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
4114 auto_dump_printf("\n# Feature attr/char definitions\n\n");
4118 for (i = 0; i < max_f_idx; i++)
4120 feature_type *f_ptr = &f_info[i];
4122 /* Skip non-entries */
4123 if (!f_ptr->name) continue;
4125 /* Skip mimiccing features */
4126 if (f_ptr->mimic != i) continue;
4128 /* Dump a comment */
4129 auto_dump_printf("# %s\n", (f_name + f_ptr->name));
4131 /* Dump the feature attr/char info */
4132 auto_dump_printf("F:%d:0x%02X/0x%02X:0x%02X/0x%02X:0x%02X/0x%02X\n\n", i,
4133 (byte)(f_ptr->x_attr[F_LIT_STANDARD]), (byte)(f_ptr->x_char[F_LIT_STANDARD]),
4134 (byte)(f_ptr->x_attr[F_LIT_LITE]), (byte)(f_ptr->x_char[F_LIT_LITE]),
4135 (byte)(f_ptr->x_attr[F_LIT_DARK]), (byte)(f_ptr->x_char[F_LIT_DARK]));
4143 msg_print("ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
4145 msg_print("Dumped feature attr/chars.");
4151 /* Modify monster attr/chars (numeric operation) */
4155 static cptr choice_msg = "¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹";
4157 static cptr choice_msg = "Change monster attr/chars";
4162 prt(format("¥³¥Þ¥ó¥É: %s", choice_msg), 15, 0);
4164 prt(format("Command: %s", choice_msg), 15, 0);
4167 /* Hack -- query until done */
4170 monster_race *r_ptr = &r_info[r];
4174 byte da = r_ptr->d_attr;
4175 byte dc = r_ptr->d_char;
4176 byte ca = r_ptr->x_attr;
4177 byte cc = r_ptr->x_char;
4179 /* Label the object */
4181 Term_putstr(5, 17, -1, TERM_WHITE,
4182 format("¥â¥ó¥¹¥¿¡¼ = %d, ̾Á° = %-40.40s",
4183 r, (r_name + r_ptr->name)));
4185 Term_putstr(5, 17, -1, TERM_WHITE,
4186 format("Monster = %d, Name = %-40.40s",
4187 r, (r_name + r_ptr->name)));
4190 /* Label the Default values */
4192 Term_putstr(10, 19, -1, TERM_WHITE,
4193 format("½é´üÃÍ ¿§ / ʸ»ú = %3u / %3u", da, dc));
4195 Term_putstr(10, 19, -1, TERM_WHITE,
4196 format("Default attr/char = %3u / %3u", da, dc));
4199 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
4200 Term_queue_bigchar(43, 19, da, dc, 0, 0);
4202 /* Label the Current values */
4204 Term_putstr(10, 20, -1, TERM_WHITE,
4205 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3u / %3u", ca, cc));
4207 Term_putstr(10, 20, -1, TERM_WHITE,
4208 format("Current attr/char = %3u / %3u", ca, cc));
4211 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
4212 Term_queue_bigchar(43, 20, ca, cc, 0, 0);
4216 Term_putstr(0, 22, -1, TERM_WHITE,
4217 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C/v/V/^V): ");
4219 Term_putstr(0, 22, -1, TERM_WHITE,
4220 "Command (n/N/^N/a/A/^A/c/C/^C/v/V/^V): ");
4227 if (i == ESCAPE) break;
4229 if (iscntrl(i)) c = 'a' + i - KTRL('A');
4230 else if (isupper(i)) c = 'a' + i - 'A';
4240 if (!cmd_visuals_aux(i, &r, max_r_idx))
4246 while (!r_info[r].name);
4250 t = (int)r_ptr->x_attr;
4251 (void)cmd_visuals_aux(i, &t, 256);
4252 r_ptr->x_attr = (byte)t;
4256 t = (int)r_ptr->x_char;
4257 (void)cmd_visuals_aux(i, &t, 256);
4258 r_ptr->x_char = (byte)t;
4262 do_cmd_knowledge_monsters(&need_redraw, TRUE, r);
4266 print_visuals_menu(choice_msg);
4274 /* Modify object attr/chars (numeric operation) */
4278 static cptr choice_msg = "¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹";
4280 static cptr choice_msg = "Change object attr/chars";
4285 prt(format("¥³¥Þ¥ó¥É: %s", choice_msg), 15, 0);
4287 prt(format("Command: %s", choice_msg), 15, 0);
4290 /* Hack -- query until done */
4293 object_kind *k_ptr = &k_info[k];
4297 byte da = k_ptr->d_attr;
4298 byte dc = k_ptr->d_char;
4299 byte ca = k_ptr->x_attr;
4300 byte cc = k_ptr->x_char;
4302 /* Label the object */
4304 Term_putstr(5, 17, -1, TERM_WHITE,
4305 format("¥¢¥¤¥Æ¥à = %d, ̾Á° = %-40.40s",
4306 k, k_name + (!k_ptr->flavor ? k_ptr->name : k_ptr->flavor_name)));
4308 Term_putstr(5, 17, -1, TERM_WHITE,
4309 format("Object = %d, Name = %-40.40s",
4310 k, k_name + (!k_ptr->flavor ? k_ptr->name : k_ptr->flavor_name)));
4313 /* Label the Default values */
4315 Term_putstr(10, 19, -1, TERM_WHITE,
4316 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
4318 Term_putstr(10, 19, -1, TERM_WHITE,
4319 format("Default attr/char = %3d / %3d", da, dc));
4322 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
4323 Term_queue_bigchar(43, 19, da, dc, 0, 0);
4325 /* Label the Current values */
4327 Term_putstr(10, 20, -1, TERM_WHITE,
4328 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
4330 Term_putstr(10, 20, -1, TERM_WHITE,
4331 format("Current attr/char = %3d / %3d", ca, cc));
4334 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
4335 Term_queue_bigchar(43, 20, ca, cc, 0, 0);
4339 Term_putstr(0, 22, -1, TERM_WHITE,
4340 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C/v/V/^V): ");
4342 Term_putstr(0, 22, -1, TERM_WHITE,
4343 "Command (n/N/^N/a/A/^A/c/C/^C/v/V/^V): ");
4350 if (i == ESCAPE) break;
4352 if (iscntrl(i)) c = 'a' + i - KTRL('A');
4353 else if (isupper(i)) c = 'a' + i - 'A';
4363 if (!cmd_visuals_aux(i, &k, max_k_idx))
4369 while (!k_info[k].name);
4373 t = (int)k_ptr->x_attr;
4374 (void)cmd_visuals_aux(i, &t, 256);
4375 k_ptr->x_attr = (byte)t;
4379 t = (int)k_ptr->x_char;
4380 (void)cmd_visuals_aux(i, &t, 256);
4381 k_ptr->x_char = (byte)t;
4385 do_cmd_knowledge_objects(&need_redraw, TRUE, k);
4389 print_visuals_menu(choice_msg);
4397 /* Modify feature attr/chars (numeric operation) */
4401 static cptr choice_msg = "ÃÏ·Á¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹";
4403 static cptr choice_msg = "Change feature attr/chars";
4406 static int lighting_level = F_LIT_STANDARD;
4409 prt(format("¥³¥Þ¥ó¥É: %s", choice_msg), 15, 0);
4411 prt(format("Command: %s", choice_msg), 15, 0);
4414 /* Hack -- query until done */
4417 feature_type *f_ptr = &f_info[f];
4421 byte da = f_ptr->d_attr[lighting_level];
4422 byte dc = f_ptr->d_char[lighting_level];
4423 byte ca = f_ptr->x_attr[lighting_level];
4424 byte cc = f_ptr->x_char[lighting_level];
4426 /* Label the object */
4429 Term_putstr(5, 17, -1, TERM_WHITE,
4430 format("ÃÏ·Á = %d, ̾Á° = %s, ÌÀÅÙ = %s",
4431 f, (f_name + f_ptr->name), lighting_level_str[lighting_level]));
4433 Term_putstr(5, 17, -1, TERM_WHITE,
4434 format("Terrain = %d, Name = %s, Lighting = %s",
4435 f, (f_name + f_ptr->name), lighting_level_str[lighting_level]));
4438 /* Label the Default values */
4440 Term_putstr(10, 19, -1, TERM_WHITE,
4441 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
4443 Term_putstr(10, 19, -1, TERM_WHITE,
4444 format("Default attr/char = %3d / %3d", da, dc));
4447 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
4449 Term_queue_bigchar(43, 19, da, dc, 0, 0);
4451 /* Label the Current values */
4453 Term_putstr(10, 20, -1, TERM_WHITE,
4454 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
4456 Term_putstr(10, 20, -1, TERM_WHITE,
4457 format("Current attr/char = %3d / %3d", ca, cc));
4460 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
4461 Term_queue_bigchar(43, 20, ca, cc, 0, 0);
4465 Term_putstr(0, 22, -1, TERM_WHITE,
4466 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C/l/L/^L/d/D/^D/v/V/^V): ");
4468 Term_putstr(0, 22, -1, TERM_WHITE,
4469 "Command (n/N/^N/a/A/^A/c/C/^C/l/L/^L/d/D/^D/v/V/^V): ");
4476 if (i == ESCAPE) break;
4478 if (iscntrl(i)) c = 'a' + i - KTRL('A');
4479 else if (isupper(i)) c = 'a' + i - 'A';
4489 if (!cmd_visuals_aux(i, &f, max_f_idx))
4495 while (!f_info[f].name || (f_info[f].mimic != f));
4499 t = (int)f_ptr->x_attr[lighting_level];
4500 (void)cmd_visuals_aux(i, &t, 256);
4501 f_ptr->x_attr[lighting_level] = (byte)t;
4505 t = (int)f_ptr->x_char[lighting_level];
4506 (void)cmd_visuals_aux(i, &t, 256);
4507 f_ptr->x_char[lighting_level] = (byte)t;
4511 (void)cmd_visuals_aux(i, &lighting_level, F_LIT_MAX);
4514 apply_default_feat_lighting(f_ptr->x_attr, f_ptr->x_char);
4518 do_cmd_knowledge_features(&need_redraw, TRUE, f, &lighting_level);
4522 print_visuals_menu(choice_msg);
4530 /* Modify monster attr/chars (visual mode) */
4532 do_cmd_knowledge_monsters(&need_redraw, TRUE, -1);
4535 /* Modify object attr/chars (visual mode) */
4537 do_cmd_knowledge_objects(&need_redraw, TRUE, -1);
4540 /* Modify feature attr/chars (visual mode) */
4543 int lighting_level = F_LIT_STANDARD;
4544 do_cmd_knowledge_features(&need_redraw, TRUE, -1, &lighting_level);
4548 #endif /* ALLOW_VISUALS */
4558 msg_print("²èÌ̾å¤Î[¿§/ʸ»ú]¤ò½é´üÃͤ˥ꥻ¥Ã¥È¤·¤Þ¤·¤¿¡£");
4560 msg_print("Visual attr/char tables reset.");
4566 /* Unknown option */
4572 /* Flush messages */
4576 /* Restore the screen */
4579 if (need_redraw) do_cmd_redraw();
4584 * Interact with "colors"
4586 void do_cmd_colors(void)
4595 /* File type is "TEXT" */
4596 FILE_TYPE(FILE_TYPE_TEXT);
4599 /* Save the screen */
4603 /* Interact until done */
4609 /* Ask for a choice */
4611 prt("[ ¥«¥é¡¼¤ÎÀßÄê ]", 2, 0);
4613 prt("Interact with Colors", 2, 0);
4617 /* Give some choices */
4619 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
4621 prt("(1) Load a user pref file", 4, 5);
4626 prt("(2) ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
4627 prt("(3) ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤¹¤ë", 6, 5);
4629 prt("(2) Dump colors", 5, 5);
4630 prt("(3) Modify colors", 6, 5);
4637 prt("¥³¥Þ¥ó¥É: ", 8, 0);
4639 prt("Command: ", 8, 0);
4647 if (i == ESCAPE) break;
4649 /* Load a 'pref' file */
4654 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹", 8, 0);
4656 prt("Command: Load a user pref file", 8, 0);
4662 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4664 prt("File: ", 10, 0);
4669 sprintf(tmp, "%s.prf", player_base);
4672 if (!askfor(tmp, 70)) continue;
4674 /* Process the given filename */
4675 (void)process_pref_file(tmp);
4677 /* Mega-Hack -- react to changes */
4678 Term_xtra(TERM_XTRA_REACT, 0);
4680 /* Mega-Hack -- redraw */
4689 static cptr mark = "Colors";
4693 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 8, 0);
4695 prt("Command: Dump colors", 8, 0);
4701 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4703 prt("File: ", 10, 0);
4707 /* Default filename */
4708 sprintf(tmp, "%s.prf", player_base);
4710 /* Get a filename */
4711 if (!askfor(tmp, 70)) continue;
4713 /* Build the filename */
4714 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
4716 /* Append to the file */
4717 if (!open_auto_dump(buf, mark)) continue;
4721 auto_dump_printf("\n# ¥«¥é¡¼¤ÎÀßÄê\n\n");
4723 auto_dump_printf("\n# Color redefinitions\n\n");
4727 for (i = 0; i < 256; i++)
4729 int kv = angband_color_table[i][0];
4730 int rv = angband_color_table[i][1];
4731 int gv = angband_color_table[i][2];
4732 int bv = angband_color_table[i][3];
4737 cptr name = "unknown";
4741 /* Skip non-entries */
4742 if (!kv && !rv && !gv && !bv) continue;
4744 /* Extract the color name */
4745 if (i < 16) name = color_names[i];
4747 /* Dump a comment */
4749 auto_dump_printf("# ¥«¥é¡¼ '%s'\n", name);
4751 auto_dump_printf("# Color '%s'\n", name);
4754 /* Dump the monster attr/char info */
4755 auto_dump_printf("V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n",
4764 msg_print("¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
4766 msg_print("Dumped color redefinitions.");
4778 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤·¤Þ¤¹", 8, 0);
4780 prt("Command: Modify colors", 8, 0);
4784 /* Hack -- query until done */
4793 /* Exhibit the normal colors */
4794 for (j = 0; j < 16; j++)
4796 /* Exhibit this color */
4797 Term_putstr(j*4, 20, -1, a, "###");
4799 /* Exhibit all colors */
4800 Term_putstr(j*4, 22, -1, j, format("%3d", j));
4803 /* Describe the color */
4805 name = ((a < 16) ? color_names[a] : "̤ÄêµÁ");
4807 name = ((a < 16) ? color_names[a] : "undefined");
4811 /* Describe the color */
4813 Term_putstr(5, 10, -1, TERM_WHITE,
4814 format("¥«¥é¡¼ = %d, ̾Á° = %s", a, name));
4816 Term_putstr(5, 10, -1, TERM_WHITE,
4817 format("Color = %d, Name = %s", a, name));
4821 /* Label the Current values */
4822 Term_putstr(5, 12, -1, TERM_WHITE,
4823 format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x",
4824 angband_color_table[a][0],
4825 angband_color_table[a][1],
4826 angband_color_table[a][2],
4827 angband_color_table[a][3]));
4831 Term_putstr(0, 14, -1, TERM_WHITE,
4832 "¥³¥Þ¥ó¥É (n/N/k/K/r/R/g/G/b/B): ");
4834 Term_putstr(0, 14, -1, TERM_WHITE,
4835 "Command (n/N/k/K/r/R/g/G/b/B): ");
4843 if (i == ESCAPE) break;
4846 if (i == 'n') a = (byte)(a + 1);
4847 if (i == 'N') a = (byte)(a - 1);
4848 if (i == 'k') angband_color_table[a][0] = (byte)(angband_color_table[a][0] + 1);
4849 if (i == 'K') angband_color_table[a][0] = (byte)(angband_color_table[a][0] - 1);
4850 if (i == 'r') angband_color_table[a][1] = (byte)(angband_color_table[a][1] + 1);
4851 if (i == 'R') angband_color_table[a][1] = (byte)(angband_color_table[a][1] - 1);
4852 if (i == 'g') angband_color_table[a][2] = (byte)(angband_color_table[a][2] + 1);
4853 if (i == 'G') angband_color_table[a][2] = (byte)(angband_color_table[a][2] - 1);
4854 if (i == 'b') angband_color_table[a][3] = (byte)(angband_color_table[a][3] + 1);
4855 if (i == 'B') angband_color_table[a][3] = (byte)(angband_color_table[a][3] - 1);
4857 /* Hack -- react to changes */
4858 Term_xtra(TERM_XTRA_REACT, 0);
4860 /* Hack -- redraw */
4867 /* Unknown option */
4873 /* Flush messages */
4878 /* Restore the screen */
4884 * Note something in the message recall
4886 void do_cmd_note(void)
4895 if (!get_string("¥á¥â: ", buf, 60)) return;
4897 if (!get_string("Note: ", buf, 60)) return;
4901 /* Ignore empty notes */
4902 if (!buf[0] || (buf[0] == ' ')) return;
4904 /* Add the note to the message recall */
4906 msg_format("¥á¥â: %s", buf);
4908 msg_format("Note: %s", buf);
4915 * Mention the current version
4917 void do_cmd_version(void)
4922 msg_format("ÊѶòÈÚÅÜ(Hengband) %d.%d.%d",
4923 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4925 msg_format("You are playing Hengband %d.%d.%d.",
4926 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4933 * Array of feeling strings
4935 static cptr do_cmd_feeling_text[11] =
4938 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4940 "Looks like any other level.",
4944 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4946 "You feel there is something special about this level.",
4950 "¶²¤í¤·¤¤»à¤Î¸¸¤¬ÌܤËÉ⤫¤Ó¡¢µ¤À䤷¤½¤¦¤Ë¤Ê¤Ã¤¿¡ª",
4952 "You nearly faint as horrible visions of death fill your mind!",
4956 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4958 "This level looks very dangerous.",
4962 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4964 "You have a very bad feeling...",
4968 "°¤¤Í½´¶¤¬¤¹¤ë...",
4970 "You have a bad feeling...",
4976 "You feel nervous.",
4980 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4982 "You feel your luck is turning...",
4986 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4988 "You don't like the look of this place.",
4992 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4994 "This level looks reasonably safe.",
4998 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
5000 "What a boring place..."
5005 static cptr do_cmd_feeling_text_combat[11] =
5008 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
5010 "Looks like any other level.",
5014 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
5016 "You feel there is something special about this level.",
5020 "º£Ìë¤â¤Þ¤¿¡¢Ã¯¤«¤¬Ì¿¤òÍî¤È¤¹...",
5022 "You nearly faint as horrible visions of death fill your mind!",
5026 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
5028 "This level looks very dangerous.",
5032 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
5034 "You have a very bad feeling...",
5038 "°¤¤Í½´¶¤¬¤¹¤ë...",
5040 "You have a bad feeling...",
5046 "You feel nervous.",
5050 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
5052 "You feel your luck is turning...",
5056 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
5058 "You don't like the look of this place.",
5062 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
5064 "This level looks reasonably safe.",
5068 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
5070 "What a boring place..."
5075 static cptr do_cmd_feeling_text_lucky[11] =
5078 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
5079 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
5080 "¤³¤Î³¬¤Ï¤³¤Î¾å¤Ê¤¯ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë¡£",
5081 "ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë...",
5082 "¤È¤Æ¤âÎɤ¤´¶¤¸¤¬¤¹¤ë...",
5083 "Îɤ¤´¶¤¸¤¬¤¹¤ë...",
5084 "¤Á¤ç¤Ã¤È¹¬±¿¤Ê´¶¤¸¤¬¤¹¤ë...",
5085 "¿¾¯¤Ï±¿¤¬¸þ¤¤¤Æ¤¤¿¤«...",
5086 "¸«¤¿´¶¤¸°¤¯¤Ï¤Ê¤¤...",
5087 "Á´Á³ÂÌÌܤȤ¤¤¦¤³¤È¤Ï¤Ê¤¤¤¬...",
5088 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
5090 "Looks like any other level.",
5091 "You feel there is something special about this level.",
5092 "You have a superb feeling about this level.",
5093 "You have an excellent feeling...",
5094 "You have a very good feeling...",
5095 "You have a good feeling...",
5096 "You feel strangely lucky...",
5097 "You feel your luck is turning...",
5098 "You like the look of this place...",
5099 "This level can't be all bad...",
5100 "What a boring place..."
5106 * Note that "feeling" is set to zero unless some time has passed.
5107 * Note that this is done when the level is GENERATED, not entered.
5109 void do_cmd_feeling(void)
5111 /* No useful feeling in quests */
5112 if (p_ptr->inside_quest && !random_quest_number(dun_level))
5115 msg_print("ŵ·¿Åª¤Ê¥¯¥¨¥¹¥È¤Î¥À¥ó¥¸¥ç¥ó¤Î¤è¤¦¤À¡£");
5117 msg_print("Looks like a typical quest level.");
5123 /* No useful feeling in town */
5124 else if (p_ptr->town_num && !dun_level)
5127 if (!strcmp(town[p_ptr->town_num].name, "¹ÓÌî"))
5129 if (!strcmp(town[p_ptr->town_num].name, "wilderness"))
5133 msg_print("²¿¤«¤¢¤ê¤½¤¦¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
5135 msg_print("Looks like a strange wilderness.");
5143 msg_print("ŵ·¿Åª¤ÊÄ®¤Î¤è¤¦¤À¡£");
5145 msg_print("Looks like a typical town.");
5152 /* No useful feeling in the wilderness */
5153 else if (!dun_level)
5156 msg_print("ŵ·¿Åª¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
5158 msg_print("Looks like a typical wilderness.");
5164 /* Display the feeling */
5165 if (p_ptr->muta3 & MUT3_GOOD_LUCK)
5166 msg_print(do_cmd_feeling_text_lucky[p_ptr->feeling]);
5167 else if (p_ptr->pseikaku == SEIKAKU_COMBAT ||
5168 inventory[INVEN_BOW].name1 == ART_CRIMSON)
5169 msg_print(do_cmd_feeling_text_combat[p_ptr->feeling]);
5171 msg_print(do_cmd_feeling_text[p_ptr->feeling]);
5177 * Description of each monster group.
5179 static cptr monster_group_text[] =
5182 "¥æ¥Ë¡¼¥¯", /* "Uniques" */
5183 "¾èÇϲÄǽ¤Ê¥â¥ó¥¹¥¿¡¼", /* "Riding" */
5184 "¾Þ¶â¼ó", /* "Wanted */
5185 "¥¢¥ó¥Ð¡¼¤Î²¦Â²", /* "Ambertite" */
5214 /* "¸ÅÂå¥É¥é¥´¥ó/¥ï¥¤¥¢¡¼¥à", */
5231 /* "¾åµé¥Ç¡¼¥â¥ó", */
5275 /* "Ancient Dragon/Wyrm", */
5284 "Multi-Headed Reptile",
5289 "Reptile/Amphibian",
5290 "Spider/Scorpion/Tick",
5292 /* "Major Demon", */
5309 * Symbols of monsters in each group. Note the "Uniques" group
5310 * is handled differently.
5312 static cptr monster_group_char[] =
5369 "!$&()+./=>?[\\]`{|~",
5379 * hook function to sort monsters by level
5381 static bool ang_sort_comp_monster_level(vptr u, vptr v, int a, int b)
5383 u16b *who = (u16b*)(u);
5388 monster_race *r_ptr1 = &r_info[w1];
5389 monster_race *r_ptr2 = &r_info[w2];
5394 if (r_ptr2->level > r_ptr1->level) return TRUE;
5395 if (r_ptr1->level > r_ptr2->level) return FALSE;
5397 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return TRUE;
5398 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return FALSE;
5403 * Build a list of monster indexes in the given group. Return the number
5404 * of monsters in the group.
5406 * mode & 0x01 : check for non-empty group
5407 * mode & 0x02 : visual operation only
5409 static int collect_monsters(int grp_cur, s16b mon_idx[], byte mode)
5414 /* Get a list of x_char in this group */
5415 cptr group_char = monster_group_char[grp_cur];
5417 /* XXX Hack -- Check if this is the "Uniques" group */
5418 bool grp_unique = (monster_group_char[grp_cur] == (char *) -1L);
5420 /* XXX Hack -- Check if this is the "Riding" group */
5421 bool grp_riding = (monster_group_char[grp_cur] == (char *) -2L);
5423 /* XXX Hack -- Check if this is the "Wanted" group */
5424 bool grp_wanted = (monster_group_char[grp_cur] == (char *) -3L);
5426 /* XXX Hack -- Check if this is the "Amberite" group */
5427 bool grp_amberite = (monster_group_char[grp_cur] == (char *) -4L);
5430 /* Check every race */
5431 for (i = 0; i < max_r_idx; i++)
5433 /* Access the race */
5434 monster_race *r_ptr = &r_info[i];
5436 /* Skip empty race */
5437 if (!r_ptr->name) continue ;
5439 /* Require known monsters */
5440 if (!(mode & 0x02) && !cheat_know && !r_ptr->r_sights) continue;
5444 if (!(r_ptr->flags1 & RF1_UNIQUE)) continue;
5447 else if (grp_riding)
5449 if (!(r_ptr->flags7 & RF7_RIDING)) continue;
5452 else if (grp_wanted)
5454 bool wanted = FALSE;
5456 for (j = 0; j < MAX_KUBI; j++)
5458 if (kubi_r_idx[j] == i || kubi_r_idx[j] - 10000 == i ||
5459 (p_ptr->today_mon && p_ptr->today_mon == i))
5465 if (!wanted) continue;
5468 else if (grp_amberite)
5470 if (!(r_ptr->flags3 & RF3_AMBERITE)) continue;
5475 /* Check for race in the group */
5476 if (!my_strchr(group_char, r_ptr->d_char)) continue;
5480 mon_idx[mon_cnt++] = i;
5482 /* XXX Hack -- Just checking for non-empty group */
5483 if (mode & 0x01) break;
5486 /* Terminate the list */
5487 mon_idx[mon_cnt] = -1;
5489 /* Select the sort method */
5490 ang_sort_comp = ang_sort_comp_monster_level;
5491 ang_sort_swap = ang_sort_swap_hook;
5493 /* Sort by monster level */
5494 ang_sort(mon_idx, &dummy_why, mon_cnt);
5496 /* Return the number of races */
5502 * Description of each monster group.
5504 static cptr object_group_text[] =
5507 "¥¥Î¥³", /* "Mushrooms" */
5508 "Ìô", /* "Potions" */
5509 "Ìý¤Ä¤Ü", /* "Flasks" */
5510 "´¬Êª", /* "Scrolls" */
5511 "»ØÎØ", /* "Rings" */
5512 "¥¢¥ß¥å¥ì¥Ã¥È", /* "Amulets" */
5513 "ū", /* "Whistle" */
5514 "¸÷¸»", /* "Lanterns" */
5515 "ËâË¡ËÀ", /* "Wands" */
5516 "¾ó", /* "Staffs" */
5517 "¥í¥Ã¥É", /* "Rods" */
5518 "¥«¡¼¥É", /* "Cards" */
5519 "¥¥ã¥×¥Á¥ã¡¼¡¦¥Ü¡¼¥ë",
5529 "Åá·õÎà", /* "Swords" */
5530 "Æß´ï", /* "Blunt Weapons" */
5531 "ĹÊÁÉð´ï", /* "Polearms" */
5532 "ºÎ·¡Æ»¶ñ", /* "Diggers" */
5533 "Èô¤ÓÆ»¶ñ", /* "Bows" */
5537 "·ÚÁõ³»", /* "Soft Armor" */
5538 "½ÅÁõ³»", /* "Hard Armor" */
5539 "¥É¥é¥´¥ó³»", /* "Dragon Armor" */
5540 "½â", /* "Shields" */
5541 "¥¯¥í¡¼¥¯", /* "Cloaks" */
5542 "äƼê", /* "Gloves" */
5543 "¥Ø¥ë¥á¥Ã¥È", /* "Helms" */
5544 "´§", /* "Crowns" */
5545 "¥Ö¡¼¥Ä", /* "Boots" */
5598 * TVALs of items in each group
5600 static byte object_group_tval[] =
5641 TV_LIFE_BOOK, /* Hack -- all spellbooks */
5649 * Build a list of object indexes in the given group. Return the number
5650 * of objects in the group.
5652 * mode & 0x01 : check for non-empty group
5653 * mode & 0x02 : visual operation only
5655 static int collect_objects(int grp_cur, int object_idx[], byte mode)
5657 int i, j, k, object_cnt = 0;
5659 /* Get a list of x_char in this group */
5660 byte group_tval = object_group_tval[grp_cur];
5662 /* Check every object */
5663 for (i = 0; i < max_k_idx; i++)
5665 /* Access the object */
5666 object_kind *k_ptr = &k_info[i];
5668 /* Skip empty objects */
5669 if (!k_ptr->name) continue;
5673 /* Any objects will be displayed */
5679 /* Skip non-flavoured objects */
5680 if (!k_ptr->flavor) continue;
5682 /* Require objects ever seen */
5683 if (!k_ptr->aware) continue;
5686 /* Skip items with no distribution (special artifacts) */
5687 for (j = 0, k = 0; j < 4; j++) k += k_ptr->chance[j];
5691 /* Check for objects in the group */
5692 if (TV_LIFE_BOOK == group_tval)
5694 /* Hack -- All spell books */
5695 if (TV_LIFE_BOOK <= k_ptr->tval && k_ptr->tval <= TV_HEX_BOOK)
5697 /* Add the object */
5698 object_idx[object_cnt++] = i;
5702 else if (k_ptr->tval == group_tval)
5704 /* Add the object */
5705 object_idx[object_cnt++] = i;
5709 /* XXX Hack -- Just checking for non-empty group */
5710 if (mode & 0x01) break;
5713 /* Terminate the list */
5714 object_idx[object_cnt] = -1;
5716 /* Return the number of objects */
5722 * Description of each feature group.
5724 static cptr feature_group_text[] =
5732 * Build a list of feature indexes in the given group. Return the number
5733 * of features in the group.
5735 * mode & 0x01 : check for non-empty group
5737 static int collect_features(int grp_cur, int *feat_idx, byte mode)
5739 int i, feat_cnt = 0;
5741 /* Unused; There is a single group. */
5744 /* Check every feature */
5745 for (i = 0; i < max_f_idx; i++)
5747 /* Access the index */
5748 feature_type *f_ptr = &f_info[i];
5750 /* Skip empty index */
5751 if (!f_ptr->name) continue;
5753 /* Skip mimiccing features */
5754 if (f_ptr->mimic != i) continue;
5757 feat_idx[feat_cnt++] = i;
5759 /* XXX Hack -- Just checking for non-empty group */
5760 if (mode & 0x01) break;
5763 /* Terminate the list */
5764 feat_idx[feat_cnt] = -1;
5766 /* Return the number of races */
5773 * Build a list of monster indexes in the given group. Return the number
5774 * of monsters in the group.
5776 static int collect_artifacts(int grp_cur, int object_idx[])
5778 int i, object_cnt = 0;
5780 /* Get a list of x_char in this group */
5781 byte group_tval = object_group_tval[grp_cur];
5783 /* Check every object */
5784 for (i = 0; i < max_a_idx; i++)
5786 /* Access the artifact */
5787 artifact_type *a_ptr = &a_info[i];
5789 /* Skip empty artifacts */
5790 if (!a_ptr->name) continue;
5792 /* Skip "uncreated" artifacts */
5793 if (!a_ptr->cur_num) continue;
5795 /* Check for race in the group */
5796 if (a_ptr->tval == group_tval)
5799 object_idx[object_cnt++] = i;
5803 /* Terminate the list */
5804 object_idx[object_cnt] = 0;
5806 /* Return the number of races */
5813 * Encode the screen colors
5815 static char hack[17] = "dwsorgbuDWvyRGBU";
5819 * Hack -- load a screen dump from a file
5821 void do_cmd_load_screen(void)
5836 Term_get_size(&wid, &hgt);
5838 /* Build the filename */
5839 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
5841 /* Append to the file */
5842 fff = my_fopen(buf, "r");
5847 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
5849 msg_format("Failed to open %s.", buf);
5856 /* Save the screen */
5859 /* Clear the screen */
5863 /* Load the screen */
5864 for (y = 0; okay; y++)
5866 /* Get a line of data including control code */
5867 if (!fgets(buf, 1024, fff)) okay = FALSE;
5869 /* Get the blank line */
5870 if (buf[0] == '\n' || buf[0] == '\0') break;
5872 /* Ignore too large screen image */
5873 if (y >= hgt) continue;
5876 for (x = 0; x < wid - 1; x++)
5879 if (buf[x] == '\n' || buf[x] == '\0') break;
5881 /* Put the attr/char */
5882 Term_draw(x, y, TERM_WHITE, buf[x]);
5886 /* Dump the screen */
5887 for (y = 0; okay; y++)
5889 /* Get a line of data including control code */
5890 if (!fgets(buf, 1024, fff)) okay = FALSE;
5892 /* Get the blank line */
5893 if (buf[0] == '\n' || buf[0] == '\0') break;
5895 /* Ignore too large screen image */
5896 if (y >= hgt) continue;
5899 for (x = 0; x < wid - 1; x++)
5902 if (buf[x] == '\n' || buf[x] == '\0') break;
5904 /* Get the attr/char */
5905 (void)(Term_what(x, y, &a, &c));
5907 /* Look up the attr */
5908 for (i = 0; i < 16; i++)
5910 /* Use attr matches */
5911 if (hack[i] == buf[x]) a = i;
5914 /* Put the attr/char */
5915 Term_draw(x, y, a, c);
5926 prt("¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤µ¤ì¤¿²èÌÌ(µÇ°»£±Æ)¤ò¥í¡¼¥É¤·¤Þ¤·¤¿¡£", 0, 0);
5928 msg_print("Screen dump loaded.");
5935 /* Restore the screen */
5942 cptr inven_res_label =
5944 " »ÀÅŲÐÎäÆǸ÷°ÇÇ˹ì¹ö°øÆÙÎô ÌÕÉÝÍðáãÆ©Ì¿´¶¾ÃÉüÉâ";
5946 " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv";
5951 #define IM_FLAG_STR "¡ö"
5952 #define HAS_FLAG_STR "¡Ü"
5953 #define NO_FLAG_STR "¡¦"
5955 #define IM_FLAG_STR "* "
5956 #define HAS_FLAG_STR "+ "
5957 #define NO_FLAG_STR ". "
5960 #define print_im_or_res_flag(IM, RES) \
5962 fputs(have_flag(flgs, (IM)) ? IM_FLAG_STR : \
5963 (have_flag(flgs, (RES)) ? HAS_FLAG_STR : NO_FLAG_STR), fff); \
5966 #define print_flag(TR) \
5968 fputs(have_flag(flgs, (TR)) ? HAS_FLAG_STR : NO_FLAG_STR, fff); \
5972 /* XTRA HACK RESLIST */
5973 static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr, int *j, byte tval, char *where)
5975 char o_name[MAX_NLEN];
5976 u32b flgs[TR_FLAG_SIZE];
5978 if (!o_ptr->k_idx) return;
5979 if (o_ptr->tval != tval) return;
5981 /* Identified items only */
5982 if (!object_is_known(o_ptr)) return;
5985 * HACK:Ring of Lordly protection and Dragon equipment
5986 * have random resistances.
5988 if ((object_is_wearable(o_ptr) && object_is_ego(o_ptr))
5989 || ((tval == TV_AMULET) && (o_ptr->sval == SV_AMULET_RESISTANCE))
5990 || ((tval == TV_RING) && (o_ptr->sval == SV_RING_LORDLY))
5991 || ((tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD))
5992 || ((tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM))
5993 || ((tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES))
5994 || ((tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE))
5995 || object_is_artifact(o_ptr))
5998 object_desc(o_name, o_ptr, OD_NAME_ONLY);
6000 while (o_name[i] && (i < 26))
6003 if (iskanji(o_name[i])) i++;
6012 o_name[i] = ' '; i++;
6017 fprintf(fff, "%s %s", where, o_name);
6019 if (!(o_ptr->ident & (IDENT_MENTAL)))
6022 fputs("-------ÉÔÌÀ--------------- -------ÉÔÌÀ---------\n", fff);
6024 fputs("-------unknown------------ -------unknown------\n", fff);
6029 object_flags_known(o_ptr, flgs);
6031 print_im_or_res_flag(TR_IM_ACID, TR_RES_ACID);
6032 print_im_or_res_flag(TR_IM_ELEC, TR_RES_ELEC);
6033 print_im_or_res_flag(TR_IM_FIRE, TR_RES_FIRE);
6034 print_im_or_res_flag(TR_IM_COLD, TR_RES_COLD);
6035 print_flag(TR_RES_POIS);
6036 print_flag(TR_RES_LITE);
6037 print_flag(TR_RES_DARK);
6038 print_flag(TR_RES_SHARDS);
6039 print_flag(TR_RES_SOUND);
6040 print_flag(TR_RES_NETHER);
6041 print_flag(TR_RES_NEXUS);
6042 print_flag(TR_RES_CHAOS);
6043 print_flag(TR_RES_DISEN);
6047 print_flag(TR_RES_BLIND);
6048 print_flag(TR_RES_FEAR);
6049 print_flag(TR_RES_CONF);
6050 print_flag(TR_FREE_ACT);
6051 print_flag(TR_SEE_INVIS);
6052 print_flag(TR_HOLD_EXP);
6053 print_flag(TR_TELEPATHY);
6054 print_flag(TR_SLOW_DIGEST);
6055 print_flag(TR_REGEN);
6056 print_flag(TR_LEVITATION);
6064 fprintf(fff, "%s\n", inven_res_label);
6070 * Display *ID* ed weapons/armors's resistances
6072 static void do_cmd_knowledge_inven(void)
6076 char file_name[1024];
6086 /* Open a new file */
6087 fff = my_fopen_temp(file_name, 1024);
6091 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6093 msg_format("Failed to create temporary file %s.", file_name);
6098 fprintf(fff, "%s\n", inven_res_label);
6100 for (tval = TV_WEARABLE_BEGIN; tval <= TV_WEARABLE_END; tval++)
6104 for (; j < 9; j++) fputc('\n', fff);
6106 fprintf(fff, "%s\n", inven_res_label);
6110 strcpy(where, "Áõ");
6112 strcpy(where, "E ");
6114 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
6116 do_cmd_knowledge_inven_aux(fff, &inventory[i], &j, tval, where);
6120 strcpy(where, "»ý");
6122 strcpy(where, "I ");
6124 for (i = 0; i < INVEN_PACK; i++)
6126 do_cmd_knowledge_inven_aux(fff, &inventory[i], &j, tval, where);
6129 st_ptr = &town[1].store[STORE_HOME];
6131 strcpy(where, "²È");
6133 strcpy(where, "H ");
6136 for (i = 0; i < st_ptr->stock_num; i++)
6138 do_cmd_knowledge_inven_aux(fff, &st_ptr->stock[i], &j, tval, where);
6142 /* Close the file */
6145 /* Display the file contents */
6147 show_file(TRUE, file_name, "*´ÕÄê*ºÑ¤ßÉð´ï/Ëɶñ¤ÎÂÑÀ¥ê¥¹¥È", 0, 0);
6149 show_file(TRUE, file_name, "Resistances of *identified* equipment", 0, 0);
6152 /* Remove the file */
6157 void do_cmd_save_screen_html_aux(char *filename, int message)
6161 byte a = 0, old_a = 0;
6175 cptr html_head[] = {
6176 "<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
6180 cptr html_foot[] = {
6182 "</body>\n</html>\n",
6188 Term_get_size(&wid, &hgt);
6190 /* File type is "TEXT" */
6191 FILE_TYPE(FILE_TYPE_TEXT);
6193 /* Append to the file */
6194 fff = my_fopen(filename, "w");
6200 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", filename);
6202 msg_format("Failed to open file %s.", filename);
6210 /* Save the screen */
6214 /* Build the filename */
6215 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "htmldump.prf");
6216 tmpfff = my_fopen(buf, "r");
6218 for (i = 0; html_head[i]; i++)
6219 fputs(html_head[i], fff);
6223 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
6225 if (strncmp(buf, tags[0], strlen(tags[0])) == 0)
6229 if (strncmp(buf, tags[1], strlen(tags[1])) == 0)
6231 fprintf(fff, "%s\n", buf);
6236 /* Dump the screen */
6237 for (y = 0; y < hgt; y++)
6244 for (x = 0; x < wid - 1; x++)
6248 /* Get the attr/char */
6249 (void)(Term_what(x, y, &a, &c));
6253 case '&': cc = "&"; break;
6254 case '<': cc = "<"; break;
6255 case '>': cc = ">"; break;
6257 case 0x1f: c = '.'; break;
6258 case 0x7f: c = (a == 0x09) ? '%' : '#'; break;
6263 if ((y == 0 && x == 0) || a != old_a) {
6264 rv = angband_color_table[a][1];
6265 gv = angband_color_table[a][2];
6266 bv = angband_color_table[a][3];
6267 fprintf(fff, "%s<font color=\"#%02x%02x%02x\">",
6268 ((y == 0 && x == 0) ? "" : "</font>"), rv, gv, bv);
6272 fprintf(fff, "%s", cc);
6274 fprintf(fff, "%c", c);
6277 fprintf(fff, "</font>");
6280 for (i = 0; html_foot[i]; i++)
6281 fputs(html_foot[i], fff);
6286 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
6288 if (strncmp(buf, tags[2], strlen(tags[2])) == 0)
6292 if (strncmp(buf, tags[3], strlen(tags[3])) == 0)
6294 fprintf(fff, "%s\n", buf);
6309 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
6311 msg_print("Screen dump saved.");
6316 /* Restore the screen */
6322 * Hack -- save a screen dump to a file
6324 static void do_cmd_save_screen_html(void)
6326 char buf[1024], tmp[256] = "screen.html";
6329 if (!get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
6331 if (!get_string("File name: ", tmp, 80))
6335 /* Build the filename */
6336 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
6340 do_cmd_save_screen_html_aux(buf, 1);
6345 * Redefinable "save_screen" action
6347 void (*screendump_aux)(void) = NULL;
6351 * Hack -- save a screen dump to a file
6353 void do_cmd_save_screen(void)
6355 bool old_use_graphics = use_graphics;
6356 bool html_dump = FALSE;
6361 prt("µÇ°»£±Æ¤·¤Þ¤¹¤«¡© [(y)es/(h)tml/(n)o] ", 0, 0);
6363 prt("Save screen dump? [(y)es/(h)tml/(n)o] ", 0, 0);
6368 if (c == 'Y' || c == 'y')
6370 else if (c == 'H' || c == 'h')
6382 Term_get_size(&wid, &hgt);
6384 if (old_use_graphics)
6386 use_graphics = FALSE;
6389 /* Redraw everything */
6390 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
6392 /* Hack -- update */
6398 do_cmd_save_screen_html();
6402 /* Do we use a special screendump function ? */
6403 else if (screendump_aux)
6405 /* Dump the screen to a graphics file */
6406 (*screendump_aux)();
6408 else /* Dump the screen as text */
6419 /* Build the filename */
6420 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
6422 /* File type is "TEXT" */
6423 FILE_TYPE(FILE_TYPE_TEXT);
6425 /* Append to the file */
6426 fff = my_fopen(buf, "w");
6432 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
6434 msg_format("Failed to open file %s.", buf);
6441 /* Save the screen */
6445 /* Dump the screen */
6446 for (y = 0; y < hgt; y++)
6449 for (x = 0; x < wid - 1; x++)
6451 /* Get the attr/char */
6452 (void)(Term_what(x, y, &a, &c));
6462 fprintf(fff, "%s\n", buf);
6469 /* Dump the screen */
6470 for (y = 0; y < hgt; y++)
6473 for (x = 0; x < wid - 1; x++)
6475 /* Get the attr/char */
6476 (void)(Term_what(x, y, &a, &c));
6479 buf[x] = hack[a&0x0F];
6486 fprintf(fff, "%s\n", buf);
6498 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
6500 msg_print("Screen dump saved.");
6506 /* Restore the screen */
6510 if (old_use_graphics)
6512 use_graphics = TRUE;
6515 /* Redraw everything */
6516 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
6518 /* Hack -- update */
6525 * Sorting hook -- Comp function -- see below
6527 * We use "u" to point to array of monster indexes,
6528 * and "v" to select the type of sorting to perform on "u".
6530 static bool ang_sort_art_comp(vptr u, vptr v, int a, int b)
6532 u16b *who = (u16b*)(u);
6534 u16b *why = (u16b*)(v);
6541 /* Sort by total kills */
6544 /* Extract total kills */
6545 z1 = a_info[w1].tval;
6546 z2 = a_info[w2].tval;
6548 /* Compare total kills */
6549 if (z1 < z2) return (TRUE);
6550 if (z1 > z2) return (FALSE);
6554 /* Sort by monster level */
6557 /* Extract levels */
6558 z1 = a_info[w1].sval;
6559 z2 = a_info[w2].sval;
6561 /* Compare levels */
6562 if (z1 < z2) return (TRUE);
6563 if (z1 > z2) return (FALSE);
6567 /* Sort by monster experience */
6570 /* Extract experience */
6571 z1 = a_info[w1].level;
6572 z2 = a_info[w2].level;
6574 /* Compare experience */
6575 if (z1 < z2) return (TRUE);
6576 if (z1 > z2) return (FALSE);
6580 /* Compare indexes */
6586 * Sorting hook -- Swap function -- see below
6588 * We use "u" to point to array of monster indexes,
6589 * and "v" to select the type of sorting to perform.
6591 static void ang_sort_art_swap(vptr u, vptr v, int a, int b)
6593 u16b *who = (u16b*)(u);
6608 * Check the status of "artifacts"
6610 static void do_cmd_knowledge_artifacts(void)
6612 int i, k, z, x, y, n = 0;
6618 char file_name[1024];
6620 char base_name[MAX_NLEN];
6624 /* Open a new file */
6625 fff = my_fopen_temp(file_name, 1024);
6629 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6631 msg_format("Failed to create temporary file %s.", file_name);
6637 /* Allocate the "who" array */
6638 C_MAKE(who, max_a_idx, s16b);
6640 /* Allocate the "okay" array */
6641 C_MAKE(okay, max_a_idx, bool);
6643 /* Scan the artifacts */
6644 for (k = 0; k < max_a_idx; k++)
6646 artifact_type *a_ptr = &a_info[k];
6651 /* Skip "empty" artifacts */
6652 if (!a_ptr->name) continue;
6654 /* Skip "uncreated" artifacts */
6655 if (!a_ptr->cur_num) continue;
6661 /* Check the dungeon */
6662 for (y = 0; y < cur_hgt; y++)
6664 for (x = 0; x < cur_wid; x++)
6666 cave_type *c_ptr = &cave[y][x];
6668 s16b this_o_idx, next_o_idx = 0;
6670 /* Scan all objects in the grid */
6671 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
6675 /* Acquire object */
6676 o_ptr = &o_list[this_o_idx];
6678 /* Acquire next object */
6679 next_o_idx = o_ptr->next_o_idx;
6681 /* Ignore non-artifacts */
6682 if (!object_is_fixed_artifact(o_ptr)) continue;
6684 /* Ignore known items */
6685 if (object_is_known(o_ptr)) continue;
6687 /* Note the artifact */
6688 okay[o_ptr->name1] = FALSE;
6693 /* Check the inventory and equipment */
6694 for (i = 0; i < INVEN_TOTAL; i++)
6696 object_type *o_ptr = &inventory[i];
6698 /* Ignore non-objects */
6699 if (!o_ptr->k_idx) continue;
6701 /* Ignore non-artifacts */
6702 if (!object_is_fixed_artifact(o_ptr)) continue;
6704 /* Ignore known items */
6705 if (object_is_known(o_ptr)) continue;
6707 /* Note the artifact */
6708 okay[o_ptr->name1] = FALSE;
6711 for (k = 0; k < max_a_idx; k++)
6713 if (okay[k]) who[n++] = k;
6716 /* Select the sort method */
6717 ang_sort_comp = ang_sort_art_comp;
6718 ang_sort_swap = ang_sort_art_swap;
6720 /* Sort the array by dungeon depth of monsters */
6721 ang_sort(who, &why, n);
6723 /* Scan the artifacts */
6724 for (k = 0; k < n; k++)
6726 artifact_type *a_ptr = &a_info[who[k]];
6730 strcpy(base_name, "̤ÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à");
6732 strcpy(base_name, "Unknown Artifact");
6736 /* Obtain the base object type */
6737 z = lookup_kind(a_ptr->tval, a_ptr->sval);
6745 /* Get local object */
6748 /* Create fake object */
6749 object_prep(q_ptr, z);
6751 /* Make it an artifact */
6752 q_ptr->name1 = (byte)who[k];
6754 /* Display as if known */
6755 q_ptr->ident |= IDENT_STORE;
6757 /* Describe the artifact */
6758 object_desc(base_name, q_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
6761 /* Hack -- Build the artifact name */
6763 fprintf(fff, " %s\n", base_name);
6765 fprintf(fff, " The %s\n", base_name);
6770 /* Free the "who" array */
6771 C_KILL(who, max_a_idx, s16b);
6773 /* Free the "okay" array */
6774 C_KILL(okay, max_a_idx, bool);
6776 /* Close the file */
6779 /* Display the file contents */
6781 show_file(TRUE, file_name, "´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à", 0, 0);
6783 show_file(TRUE, file_name, "Artifacts Seen", 0, 0);
6787 /* Remove the file */
6793 * Display known uniques
6794 * With "XTRA HACK UNIQHIST" (Originally from XAngband)
6796 static void do_cmd_knowledge_uniques(void)
6804 char file_name[1024];
6807 int n_alive_surface = 0;
6808 int n_alive_over100 = 0;
6809 int n_alive_total = 0;
6812 for (i = 0; i < 10; i++) n_alive[i] = 0;
6814 /* Open a new file */
6815 fff = my_fopen_temp(file_name, 1024);
6820 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6822 msg_format("Failed to create temporary file %s.", file_name);
6828 /* Allocate the "who" array */
6829 C_MAKE(who, max_r_idx, s16b);
6831 /* Scan the monsters */
6832 for (i = 1; i < max_r_idx; i++)
6834 monster_race *r_ptr = &r_info[i];
6837 if (!r_ptr->name) continue;
6839 /* Require unique monsters */
6840 if (!(r_ptr->flags1 & RF1_UNIQUE)) continue;
6842 /* Only display "known" uniques */
6843 if (!cheat_know && !r_ptr->r_sights) continue;
6845 /* Only print rarity <= 100 uniques */
6846 if (!r_ptr->rarity || ((r_ptr->rarity > 100) && !(r_ptr->flags1 & RF1_QUESTOR))) continue;
6848 /* Only "alive" uniques */
6849 if (r_ptr->max_num == 0) continue;
6853 lev = (r_ptr->level - 1) / 10;
6857 if (max_lev < lev) max_lev = lev;
6859 else n_alive_over100++;
6861 else n_alive_surface++;
6863 /* Collect "appropriate" monsters */
6867 /* Select the sort method */
6868 ang_sort_comp = ang_sort_comp_hook;
6869 ang_sort_swap = ang_sort_swap_hook;
6871 /* Sort the array by dungeon depth of monsters */
6872 ang_sort(who, &why, n);
6874 if (n_alive_surface)
6877 fprintf(fff, " ÃϾå À¸Â¸: %3dÂÎ\n", n_alive_surface);
6879 fprintf(fff, " Surface alive: %3d\n", n_alive_surface);
6881 n_alive_total += n_alive_surface;
6883 for (i = 0; i <= max_lev; i++)
6886 fprintf(fff, "%3d-%3d³¬ À¸Â¸: %3dÂÎ\n", 1 + i * 10, 10 + i * 10, n_alive[i]);
6888 fprintf(fff, "Level %3d-%3d alive: %3d\n", 1 + i * 10, 10 + i * 10, n_alive[i]);
6890 n_alive_total += n_alive[i];
6892 if (n_alive_over100)
6895 fprintf(fff, "101- ³¬ À¸Â¸: %3dÂÎ\n", n_alive_over100);
6897 fprintf(fff, "Level 101- alive: %3d\n", n_alive_over100);
6899 n_alive_total += n_alive_over100;
6905 fputs("--------- -----------\n", fff);
6906 fprintf(fff, " ¹ç·× À¸Â¸: %3dÂÎ\n\n", n_alive_total);
6908 fputs("------------- ----------\n", fff);
6909 fprintf(fff, " Total alive: %3d\n\n", n_alive_total);
6915 fputs("¸½ºß¤Ï´ûÃΤÎÀ¸Â¸¥æ¥Ë¡¼¥¯¤Ï¤¤¤Þ¤»¤ó¡£\n", fff);
6917 fputs("No known uniques alive.\n", fff);
6921 /* Scan the monster races */
6922 for (k = 0; k < n; k++)
6924 monster_race *r_ptr = &r_info[who[k]];
6926 /* Print a message */
6928 fprintf(fff, " %s (¥ì¥Ù¥ë%d)\n", r_name + r_ptr->name, r_ptr->level);
6930 fprintf(fff, " %s (level %d)\n", r_name + r_ptr->name, r_ptr->level);
6934 /* Free the "who" array */
6935 C_KILL(who, max_r_idx, s16b);
6937 /* Close the file */
6940 /* Display the file contents */
6942 show_file(TRUE, file_name, "¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
6944 show_file(TRUE, file_name, "Alive Uniques", 0, 0);
6948 /* Remove the file */
6954 * Display weapon-exp
6956 static void do_cmd_knowledge_weapon_exp(void)
6958 int i, j, num, weapon_exp;
6962 char file_name[1024];
6965 /* Open a new file */
6966 fff = my_fopen_temp(file_name, 1024);
6969 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6971 msg_format("Failed to create temporary file %s.", file_name);
6977 for (i = 0; i < 5; i++)
6979 for (num = 0; num < 64; num++)
6981 for (j = 0; j < max_k_idx; j++)
6983 object_kind *k_ptr = &k_info[j];
6985 if ((k_ptr->tval == TV_SWORD - i) && (k_ptr->sval == num))
6987 if ((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON)) continue;
6989 weapon_exp = p_ptr->weapon_exp[4 - i][num];
6991 fprintf(fff, "%-25s ", tmp);
6992 if (weapon_exp >= s_info[p_ptr->pclass].w_max[4 - i][num]) fprintf(fff, "!");
6993 else fprintf(fff, " ");
6994 fprintf(fff, "%s", exp_level_str[weapon_exp_level(weapon_exp)]);
6995 if (cheat_xtra) fprintf(fff, " %d", weapon_exp);
7003 /* Close the file */
7006 /* Display the file contents */
7008 show_file(TRUE, file_name, "Éð´ï¤Î·Ð¸³ÃÍ", 0, 0);
7010 show_file(TRUE, file_name, "Weapon Proficiency", 0, 0);
7014 /* Remove the file */
7020 * @brief ËâË¡¤Î·Ð¸³Ãͤòɽ¼¨¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó
7024 static void do_cmd_knowledge_spell_exp(void)
7026 int i = 0, spell_exp, exp_level;
7029 const magic_type *s_ptr;
7031 char file_name[1024];
7033 /* Open a new file */
7034 fff = my_fopen_temp(file_name, 1024);
7037 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7039 msg_format("Failed to create temporary file %s.", file_name);
7045 if (p_ptr->realm1 != REALM_NONE)
7048 fprintf(fff, "%s¤ÎËâË¡½ñ\n", realm_names[p_ptr->realm1]);
7050 fprintf(fff, "%s Spellbook\n", realm_names[p_ptr->realm1]);
7052 for (i = 0; i < 32; i++)
7054 if (!is_magic(p_ptr->realm1))
7056 s_ptr = &technic_info[p_ptr->realm1 - MIN_TECHNIC][i];
7060 s_ptr = &mp_ptr->info[p_ptr->realm1 - 1][i];
7062 if (s_ptr->slevel >= 99) continue;
7063 spell_exp = p_ptr->spell_exp[i];
7064 exp_level = spell_exp_level(spell_exp);
7065 fprintf(fff, "%-25s ", do_spell(p_ptr->realm1, i, SPELL_NAME));
7066 if (p_ptr->realm1 == REALM_HISSATSU)
7067 fprintf(fff, "[--]");
7070 if (exp_level >= EXP_LEVEL_MASTER) fprintf(fff, "!");
7071 else fprintf(fff, " ");
7072 fprintf(fff, "%s", exp_level_str[exp_level]);
7074 if (cheat_xtra) fprintf(fff, " %d", spell_exp);
7079 if (p_ptr->realm2 != REALM_NONE)
7082 fprintf(fff, "%s¤ÎËâË¡½ñ\n", realm_names[p_ptr->realm2]);
7084 fprintf(fff, "\n%s Spellbook\n", realm_names[p_ptr->realm2]);
7086 for (i = 0; i < 32; i++)
7088 if (!is_magic(p_ptr->realm1))
7090 s_ptr = &technic_info[p_ptr->realm2 - MIN_TECHNIC][i];
7094 s_ptr = &mp_ptr->info[p_ptr->realm2 - 1][i];
7096 if (s_ptr->slevel >= 99) continue;
7098 spell_exp = p_ptr->spell_exp[i + 32];
7099 exp_level = spell_exp_level(spell_exp);
7100 fprintf(fff, "%-25s ", do_spell(p_ptr->realm2, i, SPELL_NAME));
7101 if (exp_level >= EXP_LEVEL_EXPERT) fprintf(fff, "!");
7102 else fprintf(fff, " ");
7103 fprintf(fff, "%s", exp_level_str[exp_level]);
7104 if (cheat_xtra) fprintf(fff, " %d", spell_exp);
7109 /* Close the file */
7112 /* Display the file contents */
7114 show_file(TRUE, file_name, "ËâË¡¤Î·Ð¸³ÃÍ", 0, 0);
7116 show_file(TRUE, file_name, "Spell Proficiency", 0, 0);
7120 /* Remove the file */
7126 * @brief ¥¹¥¥ë¾ðÊó¤òɽ¼¨¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó /
7130 static void do_cmd_knowledge_skill_exp(void)
7132 int i = 0, skill_exp;
7136 char file_name[1024];
7138 char skill_name[3][17]={"¥Þ¡¼¥·¥ã¥ë¥¢¡¼¥Ä", "ÆóÅáή ", "¾èÇÏ "};
7140 char skill_name[3][20]={"Martial Arts ", "Dual Wielding ", "Riding "};
7143 /* Open a new file */
7144 fff = my_fopen_temp(file_name, 1024);
7147 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7149 msg_format("Failed to create temporary file %s.", file_name);
7155 for (i = 0; i < 3; i++)
7157 skill_exp = p_ptr->skill_exp[i];
7158 fprintf(fff, "%-20s ", skill_name[i]);
7159 if (skill_exp >= s_info[p_ptr->pclass].s_max[i]) fprintf(fff, "!");
7160 else fprintf(fff, " ");
7161 fprintf(fff, "%s", exp_level_str[(i == GINOU_RIDING) ? riding_exp_level(skill_exp) : weapon_exp_level(skill_exp)]);
7162 if (cheat_xtra) fprintf(fff, " %d", skill_exp);
7166 /* Close the file */
7169 /* Display the file contents */
7171 show_file(TRUE, file_name, "µ»Ç½¤Î·Ð¸³ÃÍ", 0, 0);
7173 show_file(TRUE, file_name, "Miscellaneous Proficiency", 0, 0);
7177 /* Remove the file */
7183 * @brief ±Ññ¸ì¡¢¶ç¡¢Àâ¤òÊ£¿ô·Á¤òÊÑ´¹¤¹¤ë / Pluralize a monster name
7184 * @param Name ÊÑ´¹¤·¤¿¤¤Ê¸»úÎó¤Î»²¾È¥Ý¥¤¥ó¥¿
7187 void plural_aux(char *Name)
7189 int NameLen = strlen(Name);
7191 if (my_strstr(Name, "Disembodied hand"))
7193 strcpy(Name, "Disembodied hands that strangled people");
7195 else if (my_strstr(Name, "Colour out of space"))
7197 strcpy(Name, "Colours out of space");
7199 else if (my_strstr(Name, "stairway to hell"))
7201 strcpy(Name, "stairways to hell");
7203 else if (my_strstr(Name, "Dweller on the threshold"))
7205 strcpy(Name, "Dwellers on the threshold");
7207 else if (my_strstr(Name, " of "))
7209 cptr aider = my_strstr(Name, " of ");
7220 if (dummy[i-1] == 's')
7222 strcpy(&(dummy[i]), "es");
7227 strcpy(&(dummy[i]), "s");
7230 strcpy(&(dummy[i+1]), aider);
7231 strcpy(Name, dummy);
7233 else if (my_strstr(Name, "coins"))
7236 strcpy(dummy, "piles of ");
7237 strcat(dummy, Name);
7238 strcpy(Name, dummy);
7241 else if (my_strstr(Name, "Manes"))
7245 else if (streq(&(Name[NameLen - 2]), "ey"))
7247 strcpy(&(Name[NameLen - 2]), "eys");
7249 else if (Name[NameLen - 1] == 'y')
7251 strcpy(&(Name[NameLen - 1]), "ies");
7253 else if (streq(&(Name[NameLen - 4]), "ouse"))
7255 strcpy(&(Name[NameLen - 4]), "ice");
7257 else if (streq(&(Name[NameLen - 2]), "us"))
7259 strcpy(&(Name[NameLen - 2]), "i");
7261 else if (streq(&(Name[NameLen - 6]), "kelman"))
7263 strcpy(&(Name[NameLen - 6]), "kelmen");
7265 else if (streq(&(Name[NameLen - 8]), "wordsman"))
7267 strcpy(&(Name[NameLen - 8]), "wordsmen");
7269 else if (streq(&(Name[NameLen - 7]), "oodsman"))
7271 strcpy(&(Name[NameLen - 7]), "oodsmen");
7273 else if (streq(&(Name[NameLen - 7]), "eastman"))
7275 strcpy(&(Name[NameLen - 7]), "eastmen");
7277 else if (streq(&(Name[NameLen - 8]), "izardman"))
7279 strcpy(&(Name[NameLen - 8]), "izardmen");
7281 else if (streq(&(Name[NameLen - 5]), "geist"))
7283 strcpy(&(Name[NameLen - 5]), "geister");
7285 else if (streq(&(Name[NameLen - 2]), "ex"))
7287 strcpy(&(Name[NameLen - 2]), "ices");
7289 else if (streq(&(Name[NameLen - 2]), "lf"))
7291 strcpy(&(Name[NameLen - 2]), "lves");
7293 else if (suffix(Name, "ch") ||
7294 suffix(Name, "sh") ||
7295 suffix(Name, "nx") ||
7296 suffix(Name, "s") ||
7299 strcpy(&(Name[NameLen]), "es");
7303 strcpy(&(Name[NameLen]), "s");
7308 * @brief ¸½ºß¤Î¥Ú¥Ã¥È¤òɽ¼¨¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó /
7309 * Display current pets
7312 static void do_cmd_knowledge_pets(void)
7316 monster_type *m_ptr;
7319 int show_upkeep = 0;
7320 char file_name[1024];
7323 /* Open a new file */
7324 fff = my_fopen_temp(file_name, 1024);
7327 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7329 msg_format("Failed to create temporary file %s.", file_name);
7335 /* Process the monsters (backwards) */
7336 for (i = m_max - 1; i >= 1; i--)
7338 /* Access the monster */
7341 /* Ignore "dead" monsters */
7342 if (!m_ptr->r_idx) continue;
7344 /* Calculate "upkeep" for pets */
7348 monster_desc(pet_name, m_ptr, MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
7349 fprintf(fff, "%s (%s)\n", pet_name, look_mon_desc(m_ptr, 0x00));
7353 show_upkeep = calculate_upkeep();
7355 fprintf(fff, "----------------------------------------------\n");
7357 fprintf(fff, " ¹ç·×: %d ÂΤΥڥåÈ\n", t_friends);
7358 fprintf(fff, " °Ý»ý¥³¥¹¥È: %d%% MP\n", show_upkeep);
7360 fprintf(fff, " Total: %d pet%s.\n",
7361 t_friends, (t_friends == 1 ? "" : "s"));
7362 fprintf(fff, " Upkeep: %d%% mana.\n", show_upkeep);
7367 /* Close the file */
7370 /* Display the file contents */
7372 show_file(TRUE, file_name, "¸½ºß¤Î¥Ú¥Ã¥È", 0, 0);
7374 show_file(TRUE, file_name, "Current Pets", 0, 0);
7378 /* Remove the file */
7384 * @brief ¸½ºß¤Î¥Ú¥Ã¥È¤òɽ¼¨¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó /
7387 * @note the player ghosts are ignored. XXX XXX XXX
7389 static void do_cmd_knowledge_kill_count(void)
7397 char file_name[1024];
7402 /* Open a new file */
7403 fff = my_fopen_temp(file_name, 1024);
7407 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7409 msg_format("Failed to create temporary file %s.", file_name);
7415 /* Allocate the "who" array */
7416 C_MAKE(who, max_r_idx, s16b);
7419 /* Monsters slain */
7422 for (kk = 1; kk < max_r_idx; kk++)
7424 monster_race *r_ptr = &r_info[kk];
7426 if (r_ptr->flags1 & (RF1_UNIQUE))
7428 bool dead = (r_ptr->max_num == 0);
7437 s16b This = r_ptr->r_pkills;
7448 fprintf(fff,"¤¢¤Ê¤¿¤Ï¤Þ¤ÀŨ¤òÅݤ·¤Æ¤¤¤Ê¤¤¡£\n\n");
7450 fprintf(fff,"You have defeated no enemies yet.\n\n");
7454 fprintf(fff,"¤¢¤Ê¤¿¤Ï%ldÂΤÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n", (long int)Total);
7456 fprintf(fff,"You have defeated %ld %s.\n\n", (long int)Total, (Total == 1) ? "enemy" : "enemies");
7462 /* Scan the monsters */
7463 for (i = 1; i < max_r_idx; i++)
7465 monster_race *r_ptr = &r_info[i];
7467 /* Use that monster */
7468 if (r_ptr->name) who[n++] = i;
7471 /* Select the sort method */
7472 ang_sort_comp = ang_sort_comp_hook;
7473 ang_sort_swap = ang_sort_swap_hook;
7475 /* Sort the array by dungeon depth of monsters */
7476 ang_sort(who, &why, n);
7478 /* Scan the monster races */
7479 for (k = 0; k < n; k++)
7481 monster_race *r_ptr = &r_info[who[k]];
7483 if (r_ptr->flags1 & (RF1_UNIQUE))
7485 bool dead = (r_ptr->max_num == 0);
7489 /* Print a message */
7490 fprintf(fff, " %s\n",
7491 (r_name + r_ptr->name));
7497 s16b This = r_ptr->r_pkills;
7502 /* p,t¤Ï¿Í¤È¿ô¤¨¤ë by ita */
7503 if (my_strchr("pt", r_ptr->d_char))
7504 fprintf(fff, " %3d ¿Í¤Î %s\n", This, r_name + r_ptr->name);
7506 fprintf(fff, " %3d ÂΤΠ%s\n", This, r_name + r_ptr->name);
7510 if (my_strstr(r_name + r_ptr->name, "coins"))
7512 fprintf(fff, " 1 pile of %s\n", (r_name + r_ptr->name));
7516 fprintf(fff, " 1 %s\n", (r_name + r_ptr->name));
7522 strcpy(ToPlural, (r_name + r_ptr->name));
7523 plural_aux(ToPlural);
7524 fprintf(fff, " %d %s\n", This, ToPlural);
7534 fprintf(fff,"----------------------------------------------\n");
7536 fprintf(fff," ¹ç·×: %lu ÂΤòÅݤ·¤¿¡£\n", (unsigned long int)Total);
7538 fprintf(fff," Total: %lu creature%s killed.\n",
7539 (unsigned long int)Total, (Total == 1 ? "" : "s"));
7543 /* Free the "who" array */
7544 C_KILL(who, max_r_idx, s16b);
7546 /* Close the file */
7549 /* Display the file contents */
7551 show_file(TRUE, file_name, "Åݤ·¤¿Å¨¤Î¿ô", 0, 0);
7553 show_file(TRUE, file_name, "Kill Count", 0, 0);
7557 /* Remove the file */
7563 * @brief ¥â¥ó¥¹¥¿¡¼¾ðÊó¥ê¥¹¥ÈÃæ¤Î¥°¥ë¡¼¥×¤òɽ¼¨¤¹¤ë /
7564 * Display the object groups.
7567 * @param wid ɽ¼¨Ê¸»ú¿ôÉý
7568 * @param per_page ¥ê¥¹¥È¤Îɽ¼¨¹Ô
7569 * @param grp_idx ¥°¥ë¡¼¥×¤ÎIDÇÛÎó
7570 * @param group_text ¥°¥ë¡¼¥×̾¤Îʸ»úÎóÇÛÎó
7571 * @param grp_cur ¸½ºß¤ÎÁªÂòID
7572 * @param grp_top ¸½ºß¤ÎÁªÂò¥ê¥¹¥ÈºÇ¾åÉôID
7575 static void display_group_list(int col, int row, int wid, int per_page,
7576 int grp_idx[], cptr group_text[], int grp_cur, int grp_top)
7580 /* Display lines until done */
7581 for (i = 0; i < per_page && (grp_idx[i] >= 0); i++)
7583 /* Get the group index */
7584 int grp = grp_idx[grp_top + i];
7586 /* Choose a color */
7587 byte attr = (grp_top + i == grp_cur) ? TERM_L_BLUE : TERM_WHITE;
7589 /* Erase the entire line */
7590 Term_erase(col, row + i, wid);
7592 /* Display the group label */
7593 c_put_str(attr, group_text[grp], row + i, col);
7599 * Move the cursor in a browser window
7601 static void browser_cursor(char ch, int *column, int *grp_cur, int grp_cnt,
7602 int *list_cur, int list_cnt)
7607 int list = *list_cur;
7609 /* Extract direction */
7612 /* Hack -- scroll up full screen */
7617 /* Hack -- scroll down full screen */
7622 d = get_keymap_dir(ch);
7627 /* Diagonals - hack */
7628 if ((ddx[d] > 0) && ddy[d])
7634 Term_get_size(&wid, &hgt);
7636 browser_rows = hgt - 8;
7638 /* Browse group list */
7643 /* Move up or down */
7644 grp += ddy[d] * (browser_rows - 1);
7647 if (grp >= grp_cnt) grp = grp_cnt - 1;
7648 if (grp < 0) grp = 0;
7649 if (grp != old_grp) list = 0;
7652 /* Browse sub-list list */
7655 /* Move up or down */
7656 list += ddy[d] * browser_rows;
7659 if (list >= list_cnt) list = list_cnt - 1;
7660 if (list < 0) list = 0;
7672 if (col < 0) col = 0;
7673 if (col > 1) col = 1;
7680 /* Browse group list */
7685 /* Move up or down */
7689 if (grp >= grp_cnt) grp = grp_cnt - 1;
7690 if (grp < 0) grp = 0;
7691 if (grp != old_grp) list = 0;
7694 /* Browse sub-list list */
7697 /* Move up or down */
7701 if (list >= list_cnt) list = list_cnt - 1;
7702 if (list < 0) list = 0;
7713 static void display_visual_list(int col, int row, int height, int width, byte attr_top, byte char_left)
7717 /* Clear the display lines */
7718 for (i = 0; i < height; i++)
7720 Term_erase(col, row + i, width);
7723 /* Bigtile mode uses double width */
7724 if (use_bigtile) width /= 2;
7726 /* Display lines until done */
7727 for (i = 0; i < height; i++)
7729 /* Display columns until done */
7730 for (j = 0; j < width; j++)
7738 /* Bigtile mode uses double width */
7739 if (use_bigtile) x += j;
7744 /* Ignore illegal characters */
7745 if (ia > 0x7f || ic > 0xff || ic < ' ' ||
7746 (!use_graphics && ic > 0x7f))
7752 /* Force correct code for both ASCII character and tile */
7753 if (c & 0x80) a |= 0x80;
7755 /* Display symbol */
7756 Term_queue_bigchar(x, y, a, c, 0, 0);
7763 * Place the cursor at the collect position for visual mode
7765 static void place_visual_list_cursor(int col, int row, byte a, byte c, byte attr_top, byte char_left)
7767 int i = (a & 0x7f) - attr_top;
7768 int j = c - char_left;
7773 /* Bigtile mode uses double width */
7774 if (use_bigtile) x += j;
7776 /* Place the cursor */
7782 * Clipboard variables for copy&paste in visual mode
7784 static byte attr_idx = 0;
7785 static byte char_idx = 0;
7787 /* Hack -- for feature lighting */
7788 static byte attr_idx_feat[F_LIT_MAX];
7789 static byte char_idx_feat[F_LIT_MAX];
7792 * Do visual mode command -- Change symbols
7794 static bool visual_mode_command(char ch, bool *visual_list_ptr,
7795 int height, int width,
7796 byte *attr_top_ptr, byte *char_left_ptr,
7797 byte *cur_attr_ptr, byte *cur_char_ptr, bool *need_redraw)
7799 static byte attr_old = 0, char_old = 0;
7804 if (*visual_list_ptr)
7807 *cur_attr_ptr = attr_old;
7808 *cur_char_ptr = char_old;
7809 *visual_list_ptr = FALSE;
7817 if (*visual_list_ptr)
7820 *visual_list_ptr = FALSE;
7821 *need_redraw = TRUE;
7829 if (!*visual_list_ptr)
7831 *visual_list_ptr = TRUE;
7833 *attr_top_ptr = MAX(0, (*cur_attr_ptr & 0x7f) - 5);
7834 *char_left_ptr = MAX(0, *cur_char_ptr - 10);
7836 attr_old = *cur_attr_ptr;
7837 char_old = *cur_char_ptr;
7848 /* Set the visual */
7849 attr_idx = *cur_attr_ptr;
7850 char_idx = *cur_char_ptr;
7852 /* Hack -- for feature lighting */
7853 for (i = 0; i < F_LIT_MAX; i++)
7855 attr_idx_feat[i] = 0;
7856 char_idx_feat[i] = 0;
7863 if (attr_idx || (!(char_idx & 0x80) && char_idx)) /* Allow TERM_DARK text */
7866 *cur_attr_ptr = attr_idx;
7867 *attr_top_ptr = MAX(0, (*cur_attr_ptr & 0x7f) - 5);
7868 if (!*visual_list_ptr) *need_redraw = TRUE;
7874 *cur_char_ptr = char_idx;
7875 *char_left_ptr = MAX(0, *cur_char_ptr - 10);
7876 if (!*visual_list_ptr) *need_redraw = TRUE;
7882 if (*visual_list_ptr)
7885 int d = get_keymap_dir(ch);
7886 byte a = (*cur_attr_ptr & 0x7f);
7887 byte c = *cur_char_ptr;
7889 if (use_bigtile) eff_width = width / 2;
7890 else eff_width = width;
7892 /* Restrict direction */
7893 if ((a == 0) && (ddy[d] < 0)) d = 0;
7894 if ((c == 0) && (ddx[d] < 0)) d = 0;
7895 if ((a == 0x7f) && (ddy[d] > 0)) d = 0;
7896 if ((c == 0xff) && (ddx[d] > 0)) d = 0;
7901 /* Force correct code for both ASCII character and tile */
7902 if (c & 0x80) a |= 0x80;
7904 /* Set the visual */
7909 /* Move the frame */
7910 if ((ddx[d] < 0) && *char_left_ptr > MAX(0, (int)c - 10)) (*char_left_ptr)--;
7911 if ((ddx[d] > 0) && *char_left_ptr + eff_width < MIN(0xff, (int)c + 10)) (*char_left_ptr)++;
7912 if ((ddy[d] < 0) && *attr_top_ptr > MAX(0, (int)(a & 0x7f) - 4)) (*attr_top_ptr)--;
7913 if ((ddy[d] > 0) && *attr_top_ptr + height < MIN(0x7f, (a & 0x7f) + 4)) (*attr_top_ptr)++;
7919 /* Visual mode command is not used */
7925 * Display the monsters in a group.
7927 static void display_monster_list(int col, int row, int per_page, s16b mon_idx[],
7928 int mon_cur, int mon_top, bool visual_only)
7932 /* Display lines until done */
7933 for (i = 0; i < per_page && (mon_idx[mon_top + i] >= 0); i++)
7937 /* Get the race index */
7938 int r_idx = mon_idx[mon_top + i] ;
7940 /* Access the race */
7941 monster_race *r_ptr = &r_info[r_idx];
7943 /* Choose a color */
7944 attr = ((i + mon_top == mon_cur) ? TERM_L_BLUE : TERM_WHITE);
7946 /* Display the name */
7947 c_prt(attr, (r_name + r_ptr->name), row + i, col);
7949 /* Hack -- visual_list mode */
7952 c_prt(attr, format("%02x/%02x", r_ptr->x_attr, r_ptr->x_char), row + i, (p_ptr->wizard || visual_only) ? 56 : 61);
7954 if (p_ptr->wizard || visual_only)
7956 c_prt(attr, format("%d", r_idx), row + i, 62);
7959 /* Erase chars before overwritten by the race letter */
7960 Term_erase(69, row + i, 255);
7962 /* Display symbol */
7963 Term_queue_bigchar(use_bigtile ? 69 : 70, row + i, r_ptr->x_attr, r_ptr->x_char, 0, 0);
7968 if (!(r_ptr->flags1 & RF1_UNIQUE)) put_str(format("%5d", r_ptr->r_pkills), row + i, 73);
7970 else c_put_str((r_ptr->max_num == 0 ? TERM_L_DARK : TERM_WHITE), (r_ptr->max_num == 0 ? "»àË´" : "À¸Â¸"), row + i, 74);
7972 else c_put_str((r_ptr->max_num == 0 ? TERM_L_DARK : TERM_WHITE), (r_ptr->max_num == 0 ? " dead" : "alive"), row + i, 73);
7977 /* Clear remaining lines */
7978 for (; i < per_page; i++)
7980 Term_erase(col, row + i, 255);
7986 * Display known monsters.
7988 static void do_cmd_knowledge_monsters(bool *need_redraw, bool visual_only, int direct_r_idx)
7991 int grp_cur, grp_top, old_grp_cur;
7992 int mon_cur, mon_top;
7993 int grp_cnt, grp_idx[100];
8001 bool visual_list = FALSE;
8002 byte attr_top = 0, char_left = 0;
8010 Term_get_size(&wid, &hgt);
8012 browser_rows = hgt - 8;
8014 /* Allocate the "mon_idx" array */
8015 C_MAKE(mon_idx, max_r_idx, s16b);
8020 if (direct_r_idx < 0)
8022 mode = visual_only ? 0x03 : 0x01;
8024 /* Check every group */
8025 for (i = 0; monster_group_text[i] != NULL; i++)
8027 /* Measure the label */
8028 len = strlen(monster_group_text[i]);
8030 /* Save the maximum length */
8031 if (len > max) max = len;
8033 /* See if any monsters are known */
8034 if ((monster_group_char[i] == ((char *) -1L)) || collect_monsters(i, mon_idx, mode))
8036 /* Build a list of groups with known monsters */
8037 grp_idx[grp_cnt++] = i;
8045 mon_idx[0] = direct_r_idx;
8048 /* Terminate the list */
8051 (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
8052 &attr_top, &char_left, &r_info[direct_r_idx].x_attr, &r_info[direct_r_idx].x_char, need_redraw);
8055 /* Terminate the list */
8056 grp_idx[grp_cnt] = -1;
8059 grp_cur = grp_top = 0;
8060 mon_cur = mon_top = 0;
8065 mode = visual_only ? 0x02 : 0x00;
8070 monster_race *r_ptr;
8077 prt(format("%s - ¥â¥ó¥¹¥¿¡¼", !visual_only ? "Ãμ±" : "ɽ¼¨"), 2, 0);
8078 if (direct_r_idx < 0) prt("¥°¥ë¡¼¥×", 4, 0);
8079 prt("̾Á°", 4, max + 3);
8080 if (p_ptr->wizard || visual_only) prt("Idx", 4, 62);
8082 if (!visual_only) prt("»¦³²¿ô", 4, 72);
8084 prt(format("%s - monsters", !visual_only ? "Knowledge" : "Visuals"), 2, 0);
8085 if (direct_r_idx < 0) prt("Group", 4, 0);
8086 prt("Name", 4, max + 3);
8087 if (p_ptr->wizard || visual_only) prt("Idx", 4, 62);
8089 if (!visual_only) prt("Kills", 4, 73);
8092 for (i = 0; i < 78; i++)
8094 Term_putch(i, 5, TERM_WHITE, '=');
8097 if (direct_r_idx < 0)
8099 for (i = 0; i < browser_rows; i++)
8101 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
8108 if (direct_r_idx < 0)
8110 /* Scroll group list */
8111 if (grp_cur < grp_top) grp_top = grp_cur;
8112 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
8114 /* Display a list of monster groups */
8115 display_group_list(0, 6, max, browser_rows, grp_idx, monster_group_text, grp_cur, grp_top);
8117 if (old_grp_cur != grp_cur)
8119 old_grp_cur = grp_cur;
8121 /* Get a list of monsters in the current group */
8122 mon_cnt = collect_monsters(grp_idx[grp_cur], mon_idx, mode);
8125 /* Scroll monster list */
8126 while (mon_cur < mon_top)
8127 mon_top = MAX(0, mon_top - browser_rows/2);
8128 while (mon_cur >= mon_top + browser_rows)
8129 mon_top = MIN(mon_cnt - browser_rows, mon_top + browser_rows/2);
8134 /* Display a list of monsters in the current group */
8135 display_monster_list(max + 3, 6, browser_rows, mon_idx, mon_cur, mon_top, visual_only);
8141 /* Display a monster name */
8142 display_monster_list(max + 3, 6, 1, mon_idx, mon_cur, mon_top, visual_only);
8144 /* Display visual list below first monster */
8145 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
8150 prt(format("<Êý¸þ>%s%s%s, ESC",
8151 (!visual_list && !visual_only) ? ", 'r'¤Ç»×¤¤½Ð¤ò¸«¤ë" : "",
8152 visual_list ? ", ENTER¤Ç·èÄê" : ", 'v'¤Ç¥·¥ó¥Ü¥ëÊѹ¹",
8153 (attr_idx || char_idx) ? ", 'c', 'p'¤Ç¥Ú¡¼¥¹¥È" : ", 'c'¤Ç¥³¥Ô¡¼"),
8156 prt(format("<dir>%s%s%s, ESC",
8157 (!visual_list && !visual_only) ? ", 'r' to recall" : "",
8158 visual_list ? ", ENTER to accept" : ", 'v' for visuals",
8159 (attr_idx || char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"),
8163 /* Get the current monster */
8164 r_ptr = &r_info[mon_idx[mon_cur]];
8168 /* Mega Hack -- track this monster race */
8169 if (mon_cnt) monster_race_track(mon_idx[mon_cur]);
8171 /* Hack -- handle stuff */
8177 place_visual_list_cursor(max + 3, 7, r_ptr->x_attr, r_ptr->x_char, attr_top, char_left);
8181 Term_gotoxy(0, 6 + (grp_cur - grp_top));
8185 Term_gotoxy(max + 3, 6 + (mon_cur - mon_top));
8190 /* Do visual mode command if needed */
8191 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, need_redraw))
8193 if (direct_r_idx >= 0)
8218 /* Recall on screen */
8219 if (!visual_list && !visual_only && (mon_idx[mon_cur] > 0))
8221 screen_roff(mon_idx[mon_cur], 0);
8232 /* Move the cursor */
8233 browser_cursor(ch, &column, &grp_cur, grp_cnt, &mon_cur, mon_cnt);
8240 /* Free the "mon_idx" array */
8241 C_KILL(mon_idx, max_r_idx, s16b);
8246 * Display the objects in a group.
8248 static void display_object_list(int col, int row, int per_page, int object_idx[],
8249 int object_cur, int object_top, bool visual_only)
8253 /* Display lines until done */
8254 for (i = 0; i < per_page && (object_idx[object_top + i] >= 0); i++)
8258 object_kind *flavor_k_ptr;
8260 /* Get the object index */
8261 int k_idx = object_idx[object_top + i];
8263 /* Access the object */
8264 object_kind *k_ptr = &k_info[k_idx];
8266 /* Choose a color */
8267 byte attr = ((k_ptr->aware || visual_only) ? TERM_WHITE : TERM_SLATE);
8268 byte cursor = ((k_ptr->aware || visual_only) ? TERM_L_BLUE : TERM_BLUE);
8271 if (!visual_only && k_ptr->flavor)
8273 /* Appearance of this object is shuffled */
8274 flavor_k_ptr = &k_info[k_ptr->flavor];
8278 /* Appearance of this object is very normal */
8279 flavor_k_ptr = k_ptr;
8284 attr = ((i + object_top == object_cur) ? cursor : attr);
8286 if (!k_ptr->flavor || (!visual_only && k_ptr->aware))
8289 strip_name(o_name, k_idx);
8294 strcpy(o_name, k_name + flavor_k_ptr->flavor_name);
8297 /* Display the name */
8298 c_prt(attr, o_name, row + i, col);
8300 /* Hack -- visual_list mode */
8303 c_prt(attr, format("%02x/%02x", flavor_k_ptr->x_attr, flavor_k_ptr->x_char), row + i, (p_ptr->wizard || visual_only) ? 64 : 68);
8305 if (p_ptr->wizard || visual_only)
8307 c_prt(attr, format("%d", k_idx), row + i, 70);
8310 a = flavor_k_ptr->x_attr;
8311 c = flavor_k_ptr->x_char;
8313 /* Display symbol */
8314 Term_queue_bigchar(use_bigtile ? 76 : 77, row + i, a, c, 0, 0);
8317 /* Clear remaining lines */
8318 for (; i < per_page; i++)
8320 Term_erase(col, row + i, 255);
8325 * Describe fake object
8327 static void desc_obj_fake(int k_idx)
8330 object_type object_type_body;
8332 /* Get local object */
8333 o_ptr = &object_type_body;
8335 /* Wipe the object */
8338 /* Create the artifact */
8339 object_prep(o_ptr, k_idx);
8341 /* It's fully know */
8342 o_ptr->ident |= IDENT_KNOWN;
8344 /* Track the object */
8345 /* object_actual_track(o_ptr); */
8347 /* Hack - mark as fake */
8348 /* term_obj_real = FALSE; */
8350 /* Hack -- Handle stuff */
8353 if (!screen_object(o_ptr, SCROBJ_FAKE_OBJECT | SCROBJ_FORCE_DETAIL))
8356 msg_print("ÆäËÊѤï¤Ã¤¿¤È¤³¤í¤Ï¤Ê¤¤¤è¤¦¤À¡£");
8358 msg_print("You see nothing special.");
8367 * Display known objects
8369 static void do_cmd_knowledge_objects(bool *need_redraw, bool visual_only, int direct_k_idx)
8372 int grp_cur, grp_top, old_grp_cur;
8373 int object_old, object_cur, object_top;
8374 int grp_cnt, grp_idx[100];
8382 bool visual_list = FALSE;
8383 byte attr_top = 0, char_left = 0;
8391 Term_get_size(&wid, &hgt);
8393 browser_rows = hgt - 8;
8395 /* Allocate the "object_idx" array */
8396 C_MAKE(object_idx, max_k_idx, int);
8401 if (direct_k_idx < 0)
8403 mode = visual_only ? 0x03 : 0x01;
8405 /* Check every group */
8406 for (i = 0; object_group_text[i] != NULL; i++)
8408 /* Measure the label */
8409 len = strlen(object_group_text[i]);
8411 /* Save the maximum length */
8412 if (len > max) max = len;
8414 /* See if any monsters are known */
8415 if (collect_objects(i, object_idx, mode))
8417 /* Build a list of groups with known monsters */
8418 grp_idx[grp_cnt++] = i;
8427 object_kind *k_ptr = &k_info[direct_k_idx];
8428 object_kind *flavor_k_ptr;
8430 if (!visual_only && k_ptr->flavor)
8432 /* Appearance of this object is shuffled */
8433 flavor_k_ptr = &k_info[k_ptr->flavor];
8437 /* Appearance of this object is very normal */
8438 flavor_k_ptr = k_ptr;
8441 object_idx[0] = direct_k_idx;
8442 object_old = direct_k_idx;
8445 /* Terminate the list */
8448 (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
8449 &attr_top, &char_left, &flavor_k_ptr->x_attr, &flavor_k_ptr->x_char, need_redraw);
8452 /* Terminate the list */
8453 grp_idx[grp_cnt] = -1;
8456 grp_cur = grp_top = 0;
8457 object_cur = object_top = 0;
8462 mode = visual_only ? 0x02 : 0x00;
8467 object_kind *k_ptr, *flavor_k_ptr;
8474 prt(format("%s - ¥¢¥¤¥Æ¥à", !visual_only ? "Ãμ±" : "ɽ¼¨"), 2, 0);
8475 if (direct_k_idx < 0) prt("¥°¥ë¡¼¥×", 4, 0);
8476 prt("̾Á°", 4, max + 3);
8477 if (p_ptr->wizard || visual_only) prt("Idx", 4, 70);
8480 prt(format("%s - objects", !visual_only ? "Knowledge" : "Visuals"), 2, 0);
8481 if (direct_k_idx < 0) prt("Group", 4, 0);
8482 prt("Name", 4, max + 3);
8483 if (p_ptr->wizard || visual_only) prt("Idx", 4, 70);
8487 for (i = 0; i < 78; i++)
8489 Term_putch(i, 5, TERM_WHITE, '=');
8492 if (direct_k_idx < 0)
8494 for (i = 0; i < browser_rows; i++)
8496 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
8503 if (direct_k_idx < 0)
8505 /* Scroll group list */
8506 if (grp_cur < grp_top) grp_top = grp_cur;
8507 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
8509 /* Display a list of object groups */
8510 display_group_list(0, 6, max, browser_rows, grp_idx, object_group_text, grp_cur, grp_top);
8512 if (old_grp_cur != grp_cur)
8514 old_grp_cur = grp_cur;
8516 /* Get a list of objects in the current group */
8517 object_cnt = collect_objects(grp_idx[grp_cur], object_idx, mode);
8520 /* Scroll object list */
8521 while (object_cur < object_top)
8522 object_top = MAX(0, object_top - browser_rows/2);
8523 while (object_cur >= object_top + browser_rows)
8524 object_top = MIN(object_cnt - browser_rows, object_top + browser_rows/2);
8529 /* Display a list of objects in the current group */
8530 display_object_list(max + 3, 6, browser_rows, object_idx, object_cur, object_top, visual_only);
8534 object_top = object_cur;
8536 /* Display a list of objects in the current group */
8537 display_object_list(max + 3, 6, 1, object_idx, object_cur, object_top, visual_only);
8539 /* Display visual list below first object */
8540 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
8543 /* Get the current object */
8544 k_ptr = &k_info[object_idx[object_cur]];
8546 if (!visual_only && k_ptr->flavor)
8548 /* Appearance of this object is shuffled */
8549 flavor_k_ptr = &k_info[k_ptr->flavor];
8553 /* Appearance of this object is very normal */
8554 flavor_k_ptr = k_ptr;
8559 prt(format("<Êý¸þ>%s%s%s, ESC",
8560 (!visual_list && !visual_only) ? ", 'r'¤Ç¾ÜºÙ¤ò¸«¤ë" : "",
8561 visual_list ? ", ENTER¤Ç·èÄê" : ", 'v'¤Ç¥·¥ó¥Ü¥ëÊѹ¹",
8562 (attr_idx || char_idx) ? ", 'c', 'p'¤Ç¥Ú¡¼¥¹¥È" : ", 'c'¤Ç¥³¥Ô¡¼"),
8565 prt(format("<dir>%s%s%s, ESC",
8566 (!visual_list && !visual_only) ? ", 'r' to recall" : "",
8567 visual_list ? ", ENTER to accept" : ", 'v' for visuals",
8568 (attr_idx || char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"),
8574 /* Mega Hack -- track this object */
8575 if (object_cnt) object_kind_track(object_idx[object_cur]);
8577 /* The "current" object changed */
8578 if (object_old != object_idx[object_cur])
8580 /* Hack -- handle stuff */
8583 /* Remember the "current" object */
8584 object_old = object_idx[object_cur];
8590 place_visual_list_cursor(max + 3, 7, flavor_k_ptr->x_attr, flavor_k_ptr->x_char, attr_top, char_left);
8594 Term_gotoxy(0, 6 + (grp_cur - grp_top));
8598 Term_gotoxy(max + 3, 6 + (object_cur - object_top));
8603 /* Do visual mode command if needed */
8604 if (visual_mode_command(ch, &visual_list, browser_rows-1, wid - (max + 3), &attr_top, &char_left, &flavor_k_ptr->x_attr, &flavor_k_ptr->x_char, need_redraw))
8606 if (direct_k_idx >= 0)
8631 /* Recall on screen */
8632 if (!visual_list && !visual_only && (grp_cnt > 0))
8634 desc_obj_fake(object_idx[object_cur]);
8642 /* Move the cursor */
8643 browser_cursor(ch, &column, &grp_cur, grp_cnt, &object_cur, object_cnt);
8649 /* Free the "object_idx" array */
8650 C_KILL(object_idx, max_k_idx, int);
8655 * Display the features in a group.
8657 static void display_feature_list(int col, int row, int per_page, int *feat_idx,
8658 int feat_cur, int feat_top, bool visual_only, int lighting_level)
8660 int lit_col[F_LIT_MAX], i, j;
8661 int f_idx_col = use_bigtile ? 62 : 64;
8663 /* Correct columns 1 and 4 */
8664 lit_col[F_LIT_STANDARD] = use_bigtile ? (71 - F_LIT_MAX) : 71;
8665 for (i = F_LIT_NS_BEGIN; i < F_LIT_MAX; i++)
8666 lit_col[i] = lit_col[F_LIT_STANDARD] + 2 + (i - F_LIT_NS_BEGIN) * 2 + (use_bigtile ? i : 0);
8668 /* Display lines until done */
8669 for (i = 0; i < per_page && (feat_idx[feat_top + i] >= 0); i++)
8674 int f_idx = feat_idx[feat_top + i];
8676 /* Access the index */
8677 feature_type *f_ptr = &f_info[f_idx];
8679 int row_i = row + i;
8681 /* Choose a color */
8682 attr = ((i + feat_top == feat_cur) ? TERM_L_BLUE : TERM_WHITE);
8684 /* Display the name */
8685 c_prt(attr, f_name + f_ptr->name, row_i, col);
8687 /* Hack -- visual_list mode */
8690 /* Display lighting level */
8691 c_prt(attr, format("(%s)", lighting_level_str[lighting_level]), row_i, col + 1 + strlen(f_name + f_ptr->name));
8693 c_prt(attr, format("%02x/%02x", f_ptr->x_attr[lighting_level], f_ptr->x_char[lighting_level]), row_i, f_idx_col - ((p_ptr->wizard || visual_only) ? 6 : 2));
8695 if (p_ptr->wizard || visual_only)
8697 c_prt(attr, format("%d", f_idx), row_i, f_idx_col);
8700 /* Display symbol */
8701 Term_queue_bigchar(lit_col[F_LIT_STANDARD], row_i, f_ptr->x_attr[F_LIT_STANDARD], f_ptr->x_char[F_LIT_STANDARD], 0, 0);
8703 Term_putch(lit_col[F_LIT_NS_BEGIN], row_i, TERM_SLATE, '(');
8704 for (j = F_LIT_NS_BEGIN + 1; j < F_LIT_MAX; j++)
8706 Term_putch(lit_col[j], row_i, TERM_SLATE, '/');
8708 Term_putch(lit_col[F_LIT_MAX - 1] + (use_bigtile ? 3 : 2), row_i, TERM_SLATE, ')');
8710 /* Mega-hack -- Use non-standard colour */
8711 for (j = F_LIT_NS_BEGIN; j < F_LIT_MAX; j++)
8713 Term_queue_bigchar(lit_col[j] + 1, row_i, f_ptr->x_attr[j], f_ptr->x_char[j], 0, 0);
8717 /* Clear remaining lines */
8718 for (; i < per_page; i++)
8720 Term_erase(col, row + i, 255);
8726 * Interact with feature visuals.
8728 static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, int direct_f_idx, int *lighting_level)
8731 int grp_cur, grp_top, old_grp_cur;
8732 int feat_cur, feat_top;
8733 int grp_cnt, grp_idx[100];
8741 bool visual_list = FALSE;
8742 byte attr_top = 0, char_left = 0;
8747 byte attr_old[F_LIT_MAX];
8748 byte char_old[F_LIT_MAX];
8749 byte *cur_attr_ptr, *cur_char_ptr;
8751 (void)C_WIPE(attr_old, F_LIT_MAX, byte);
8752 (void)C_WIPE(char_old, F_LIT_MAX, byte);
8755 Term_get_size(&wid, &hgt);
8757 browser_rows = hgt - 8;
8759 /* Allocate the "feat_idx" array */
8760 C_MAKE(feat_idx, max_f_idx, int);
8765 if (direct_f_idx < 0)
8767 /* Check every group */
8768 for (i = 0; feature_group_text[i] != NULL; i++)
8770 /* Measure the label */
8771 len = strlen(feature_group_text[i]);
8773 /* Save the maximum length */
8774 if (len > max) max = len;
8776 /* See if any features are known */
8777 if (collect_features(i, feat_idx, 0x01))
8779 /* Build a list of groups with known features */
8780 grp_idx[grp_cnt++] = i;
8788 feature_type *f_ptr = &f_info[direct_f_idx];
8790 feat_idx[0] = direct_f_idx;
8793 /* Terminate the list */
8796 (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
8797 &attr_top, &char_left, &f_ptr->x_attr[*lighting_level], &f_ptr->x_char[*lighting_level], need_redraw);
8799 for (i = 0; i < F_LIT_MAX; i++)
8801 attr_old[i] = f_ptr->x_attr[i];
8802 char_old[i] = f_ptr->x_char[i];
8806 /* Terminate the list */
8807 grp_idx[grp_cnt] = -1;
8810 grp_cur = grp_top = 0;
8811 feat_cur = feat_top = 0;
8819 feature_type *f_ptr;
8826 prt("ɽ¼¨ - ÃÏ·Á", 2, 0);
8827 if (direct_f_idx < 0) prt("¥°¥ë¡¼¥×", 4, 0);
8828 prt("̾Á°", 4, max + 3);
8831 if (p_ptr->wizard || visual_only) prt("Idx", 4, 62);
8832 prt("ʸ»ú ( l/ d)", 4, 66);
8836 if (p_ptr->wizard || visual_only) prt("Idx", 4, 64);
8837 prt("ʸ»ú (l/d)", 4, 68);
8840 prt("Visuals - features", 2, 0);
8841 if (direct_f_idx < 0) prt("Group", 4, 0);
8842 prt("Name", 4, max + 3);
8845 if (p_ptr->wizard || visual_only) prt("Idx", 4, 62);
8846 prt("Sym ( l/ d)", 4, 67);
8850 if (p_ptr->wizard || visual_only) prt("Idx", 4, 64);
8851 prt("Sym (l/d)", 4, 69);
8855 for (i = 0; i < 78; i++)
8857 Term_putch(i, 5, TERM_WHITE, '=');
8860 if (direct_f_idx < 0)
8862 for (i = 0; i < browser_rows; i++)
8864 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
8871 if (direct_f_idx < 0)
8873 /* Scroll group list */
8874 if (grp_cur < grp_top) grp_top = grp_cur;
8875 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
8877 /* Display a list of feature groups */
8878 display_group_list(0, 6, max, browser_rows, grp_idx, feature_group_text, grp_cur, grp_top);
8880 if (old_grp_cur != grp_cur)
8882 old_grp_cur = grp_cur;
8884 /* Get a list of features in the current group */
8885 feat_cnt = collect_features(grp_idx[grp_cur], feat_idx, 0x00);
8888 /* Scroll feature list */
8889 while (feat_cur < feat_top)
8890 feat_top = MAX(0, feat_top - browser_rows/2);
8891 while (feat_cur >= feat_top + browser_rows)
8892 feat_top = MIN(feat_cnt - browser_rows, feat_top + browser_rows/2);
8897 /* Display a list of features in the current group */
8898 display_feature_list(max + 3, 6, browser_rows, feat_idx, feat_cur, feat_top, visual_only, F_LIT_STANDARD);
8902 feat_top = feat_cur;
8904 /* Display a list of features in the current group */
8905 display_feature_list(max + 3, 6, 1, feat_idx, feat_cur, feat_top, visual_only, *lighting_level);
8907 /* Display visual list below first object */
8908 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
8913 prt(format("<Êý¸þ>%s, 'd'¤Çɸ½à¸÷¸»¸ú²Ì%s, ESC",
8914 visual_list ? ", ENTER¤Ç·èÄê, 'a'¤ÇÂоÝÌÀÅÙÊѹ¹" : ", 'v'¤Ç¥·¥ó¥Ü¥ëÊѹ¹",
8915 (attr_idx || char_idx) ? ", 'c', 'p'¤Ç¥Ú¡¼¥¹¥È" : ", 'c'¤Ç¥³¥Ô¡¼"),
8918 prt(format("<dir>%s, 'd' for default lighting%s, ESC",
8919 visual_list ? ", ENTER to accept, 'a' for lighting level" : ", 'v' for visuals",
8920 (attr_idx || char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"),
8924 /* Get the current feature */
8925 f_ptr = &f_info[feat_idx[feat_cur]];
8926 cur_attr_ptr = &f_ptr->x_attr[*lighting_level];
8927 cur_char_ptr = &f_ptr->x_char[*lighting_level];
8931 place_visual_list_cursor(max + 3, 7, *cur_attr_ptr, *cur_char_ptr, attr_top, char_left);
8935 Term_gotoxy(0, 6 + (grp_cur - grp_top));
8939 Term_gotoxy(max + 3, 6 + (feat_cur - feat_top));
8944 if (visual_list && ((ch == 'A') || (ch == 'a')))
8946 int prev_lighting_level = *lighting_level;
8950 if (*lighting_level <= 0) *lighting_level = F_LIT_MAX - 1;
8951 else (*lighting_level)--;
8955 if (*lighting_level >= F_LIT_MAX - 1) *lighting_level = 0;
8956 else (*lighting_level)++;
8959 if (f_ptr->x_attr[prev_lighting_level] != f_ptr->x_attr[*lighting_level])
8960 attr_top = MAX(0, (f_ptr->x_attr[*lighting_level] & 0x7f) - 5);
8962 if (f_ptr->x_char[prev_lighting_level] != f_ptr->x_char[*lighting_level])
8963 char_left = MAX(0, f_ptr->x_char[*lighting_level] - 10);
8968 else if ((ch == 'D') || (ch == 'd'))
8970 byte prev_x_attr = f_ptr->x_attr[*lighting_level];
8971 byte prev_x_char = f_ptr->x_char[*lighting_level];
8973 apply_default_feat_lighting(f_ptr->x_attr, f_ptr->x_char);
8977 if (prev_x_attr != f_ptr->x_attr[*lighting_level])
8978 attr_top = MAX(0, (f_ptr->x_attr[*lighting_level] & 0x7f) - 5);
8980 if (prev_x_char != f_ptr->x_char[*lighting_level])
8981 char_left = MAX(0, f_ptr->x_char[*lighting_level] - 10);
8983 else *need_redraw = TRUE;
8988 /* Do visual mode command if needed */
8989 else if (visual_mode_command(ch, &visual_list, browser_rows-1, wid - (max + 3), &attr_top, &char_left, cur_attr_ptr, cur_char_ptr, need_redraw))
8993 /* Restore previous visual settings */
8995 for (i = 0; i < F_LIT_MAX; i++)
8997 f_ptr->x_attr[i] = attr_old[i];
8998 f_ptr->x_char[i] = char_old[i];
9005 if (direct_f_idx >= 0) flag = TRUE;
9006 else *lighting_level = F_LIT_STANDARD;
9009 /* Preserve current visual settings */
9012 for (i = 0; i < F_LIT_MAX; i++)
9014 attr_old[i] = f_ptr->x_attr[i];
9015 char_old[i] = f_ptr->x_char[i];
9017 *lighting_level = F_LIT_STANDARD;
9024 for (i = 0; i < F_LIT_MAX; i++)
9026 attr_idx_feat[i] = f_ptr->x_attr[i];
9027 char_idx_feat[i] = f_ptr->x_char[i];
9036 /* Allow TERM_DARK text */
9037 for (i = F_LIT_NS_BEGIN; i < F_LIT_MAX; i++)
9039 if (attr_idx_feat[i] || (!(char_idx_feat[i] & 0x80) && char_idx_feat[i])) f_ptr->x_attr[i] = attr_idx_feat[i];
9040 if (char_idx_feat[i]) f_ptr->x_char[i] = char_idx_feat[i];
9058 /* Move the cursor */
9059 browser_cursor(ch, &column, &grp_cur, grp_cnt, &feat_cur, feat_cnt);
9065 /* Free the "feat_idx" array */
9066 C_KILL(feat_idx, max_f_idx, int);
9071 * List wanted monsters
9073 static void do_cmd_knowledge_kubi(void)
9078 char file_name[1024];
9081 /* Open a new file */
9082 fff = my_fopen_temp(file_name, 1024);
9085 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
9087 msg_format("Failed to create temporary file %s.", file_name);
9095 bool listed = FALSE;
9098 fprintf(fff, "º£Æü¤Î¥¿¡¼¥²¥Ã¥È : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "ÉÔÌÀ"));
9100 fprintf(fff, "¾Þ¶â¼ó¥ê¥¹¥È\n");
9102 fprintf(fff, "Today target : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "unknown"));
9104 fprintf(fff, "List of wanted monsters\n");
9106 fprintf(fff, "----------------------------------------------\n");
9108 for (i = 0; i < MAX_KUBI; i++)
9110 if (kubi_r_idx[i] <= 10000)
9112 fprintf(fff,"%s\n", r_name + r_info[kubi_r_idx[i]].name);
9121 fprintf(fff,"\n%s\n", "¾Þ¶â¼ó¤Ï¤â¤¦»Ä¤Ã¤Æ¤¤¤Þ¤»¤ó¡£");
9123 fprintf(fff,"\n%s\n", "There is no more wanted monster.");
9128 /* Close the file */
9131 /* Display the file contents */
9133 show_file(TRUE, file_name, "¾Þ¶â¼ó¤Î°ìÍ÷", 0, 0);
9135 show_file(TRUE, file_name, "Wanted monsters", 0, 0);
9139 /* Remove the file */
9144 * List virtues & status
9146 static void do_cmd_knowledge_virtues(void)
9150 char file_name[1024];
9153 /* Open a new file */
9154 fff = my_fopen_temp(file_name, 1024);
9157 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
9159 msg_format("Failed to create temporary file %s.", file_name);
9168 fprintf(fff, "¸½ºß¤Î°À : %s\n\n", your_alignment());
9170 fprintf(fff, "Your alighnment : %s\n\n", your_alignment());
9175 /* Close the file */
9178 /* Display the file contents */
9180 show_file(TRUE, file_name, "Ȭ¤Ä¤ÎÆÁ", 0, 0);
9182 show_file(TRUE, file_name, "Virtues", 0, 0);
9186 /* Remove the file */
9194 static void do_cmd_knowledge_dungeon(void)
9198 char file_name[1024];
9202 /* Open a new file */
9203 fff = my_fopen_temp(file_name, 1024);
9206 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
9208 msg_format("Failed to create temporary file %s.", file_name);
9216 for (i = 1; i < max_d_idx; i++)
9220 if (!d_info[i].maxdepth) continue;
9221 if (!max_dlv[i]) continue;
9222 if (d_info[i].final_guardian)
9224 if (!r_info[d_info[i].final_guardian].max_num) seiha = TRUE;
9226 else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
9228 fprintf(fff,"%c%-12s : %3d ³¬\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
9230 fprintf(fff,"%c%-16s : level %3d\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
9235 /* Close the file */
9238 /* Display the file contents */
9240 show_file(TRUE, file_name, "º£¤Þ¤Ç¤ËÆþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó", 0, 0);
9242 show_file(TRUE, file_name, "Dungeon", 0, 0);
9246 /* Remove the file */
9251 * List virtues & status
9254 static void do_cmd_knowledge_stat(void)
9258 char file_name[1024];
9261 /* Open a new file */
9262 fff = my_fopen_temp(file_name, 1024);
9265 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
9267 msg_format("Failed to create temporary file %s.", file_name);
9275 percent = (int)(((long)p_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
9276 (2 * p_ptr->hitdie +
9277 ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
9280 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : %d/100\n\n", percent);
9281 else fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : ???\n\n");
9282 fprintf(fff, "ǽÎϤκÇÂçÃÍ\n\n");
9284 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "Your current Life Rating is %d/100.\n\n", percent);
9285 else fprintf(fff, "Your current Life Rating is ???.\n\n");
9286 fprintf(fff, "Limits of maximum stats\n\n");
9288 for (v_nr = 0; v_nr < 6; v_nr++)
9290 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);
9291 else fprintf(fff, "%s ???\n", stat_names[v_nr]);
9297 /* Close the file */
9300 /* Display the file contents */
9302 show_file(TRUE, file_name, "¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó", 0, 0);
9304 show_file(TRUE, file_name, "HP-rate & Max stat", 0, 0);
9308 /* Remove the file */
9314 * Print all active quests
9316 static void do_cmd_knowledge_quests_current(FILE *fff)
9319 char rand_tmp_str[120] = "\0";
9321 monster_race *r_ptr;
9323 int rand_level = 100;
9327 fprintf(fff, "¡Ô¿ë¹ÔÃæ¤Î¥¯¥¨¥¹¥È¡Õ\n");
9329 fprintf(fff, "< Current Quest >\n");
9332 for (i = 1; i < max_quests; i++)
9334 if ((quest[i].status == QUEST_STATUS_TAKEN) ||
9335 ((quest[i].status == QUEST_STATUS_STAGE_COMPLETED) && (quest[i].type == QUEST_TYPE_TOWER)) ||
9336 (quest[i].status == QUEST_STATUS_COMPLETED))
9338 /* Set the quest number temporary */
9339 int old_quest = p_ptr->inside_quest;
9342 /* Clear the text */
9343 for (j = 0; j < 10; j++) quest_text[j][0] = '\0';
9344 quest_text_line = 0;
9346 p_ptr->inside_quest = i;
9348 /* Get the quest text */
9349 init_flags = INIT_SHOW_TEXT;
9351 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
9353 /* Reset the old quest number */
9354 p_ptr->inside_quest = old_quest;
9356 /* No info from "silent" quests */
9357 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
9361 if (quest[i].type != QUEST_TYPE_RANDOM)
9363 char note[80] = "\0";
9365 if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_STAGE_COMPLETED)
9367 switch (quest[i].type)
9369 case QUEST_TYPE_KILL_LEVEL:
9370 case QUEST_TYPE_KILL_ANY_LEVEL:
9371 r_ptr = &r_info[quest[i].r_idx];
9372 strcpy(name, r_name + r_ptr->name);
9373 if (quest[i].max_num > 1)
9376 sprintf(note," - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",
9377 quest[i].max_num, name, quest[i].max_num - quest[i].cur_num);
9380 sprintf(note," - kill %d %s, have killed %d.",
9381 quest[i].max_num, name, quest[i].cur_num);
9386 sprintf(note," - %s¤òÅݤ¹¡£",name);
9388 sprintf(note," - kill %s.",name);
9392 case QUEST_TYPE_FIND_ARTIFACT:
9395 artifact_type *a_ptr = &a_info[quest[i].k_idx];
9397 object_type *q_ptr = &forge;
9398 int k_idx = lookup_kind(a_ptr->tval, a_ptr->sval);
9399 object_prep(q_ptr, k_idx);
9400 q_ptr->name1 = quest[i].k_idx;
9401 q_ptr->ident = IDENT_STORE;
9402 object_desc(name, q_ptr, OD_NAME_ONLY);
9405 sprintf(note,"\n - %s¤ò¸«¤Ä¤±½Ð¤¹¡£", name);
9407 sprintf(note,"\n - Find out %s.", name);
9410 case QUEST_TYPE_FIND_EXIT:
9412 sprintf(note," - ½Ð¸ý¤ËÅþ㤹¤ë¡£");
9414 sprintf(note," - Reach to Exit.");
9418 case QUEST_TYPE_KILL_NUMBER:
9420 sprintf(note," - %d ÂΤΥâ¥ó¥¹¥¿¡¼¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",
9421 quest[i].max_num, quest[i].max_num - quest[i].cur_num);
9423 sprintf(note," - Kill %d monsters, have killed %d.",
9424 quest[i].max_num, quest[i].cur_num);
9428 case QUEST_TYPE_KILL_ALL:
9429 case QUEST_TYPE_TOWER:
9431 sprintf(note," - Á´¤Æ¤Î¥â¥ó¥¹¥¿¡¼¤òÅݤ¹¡£");
9433 sprintf(note," - Kill all monsters.");
9439 /* Print the quest info */
9441 sprintf(tmp_str, " %s (´í¸±ÅÙ:%d³¬ÁêÅö)%s\n",
9442 quest[i].name, quest[i].level, note);
9444 sprintf(tmp_str, " %s (Danger level: %d)%s\n",
9445 quest[i].name, quest[i].level, note);
9448 fputs(tmp_str, fff);
9450 if (quest[i].status == QUEST_STATUS_COMPLETED)
9453 sprintf(tmp_str, " ¥¯¥¨¥¹¥ÈãÀ® - ¤Þ¤ÀÊó½·¤ò¼õ¤±¤È¤Ã¤Æ¤Ê¤¤¡£\n");
9455 sprintf(tmp_str, " Quest Completed - Unrewarded\n");
9457 fputs(tmp_str, fff);
9463 while (quest_text[j][0] && j < 10)
9465 fprintf(fff, " %s\n", quest_text[j]);
9470 else if (quest[i].level < rand_level) /* QUEST_TYPE_RANDOM */
9473 rand_level = quest[i].level;
9475 if (max_dlv[DUNGEON_ANGBAND] >= rand_level)
9477 /* Print the quest info */
9478 r_ptr = &r_info[quest[i].r_idx];
9479 strcpy(name, r_name + r_ptr->name);
9481 if (quest[i].max_num > 1)
9484 sprintf(rand_tmp_str," %s (%d ³¬) - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)\n",
9485 quest[i].name, quest[i].level,
9486 quest[i].max_num, name, quest[i].max_num - quest[i].cur_num);
9490 sprintf(rand_tmp_str," %s (Dungeon level: %d)\n Kill %d %s, have killed %d.\n",
9491 quest[i].name, quest[i].level,
9492 quest[i].max_num, name, quest[i].cur_num);
9498 sprintf(rand_tmp_str," %s (%d ³¬) - %s¤òÅݤ¹¡£\n",
9499 quest[i].name, quest[i].level, name);
9501 sprintf(rand_tmp_str," %s (Dungeon level: %d)\n Kill %s.\n",
9502 quest[i].name, quest[i].level, name);
9510 /* Print the current random quest */
9511 if (rand_tmp_str[0]) fputs(rand_tmp_str, fff);
9514 if (!total) fprintf(fff, " ¤Ê¤·\n");
9516 if (!total) fprintf(fff, " Nothing.\n");
9521 static bool do_cmd_knowledge_quests_aux(FILE *fff, int q_idx)
9524 char playtime_str[16];
9525 quest_type* const q_ptr = &quest[q_idx];
9527 if (is_fixed_quest_idx(q_idx))
9529 /* Set the quest number temporary */
9530 int old_quest = p_ptr->inside_quest;
9532 p_ptr->inside_quest = q_idx;
9535 init_flags = INIT_NAME_ONLY;
9537 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
9539 /* Reset the old quest number */
9540 p_ptr->inside_quest = old_quest;
9542 /* No info from "silent" quests */
9543 if (q_ptr->flags & QUEST_FLAG_SILENT) return FALSE;
9546 strnfmt(playtime_str, sizeof(playtime_str), "%02d:%02d:%02d",
9547 q_ptr->comptime/(60*60), (q_ptr->comptime/60)%60, q_ptr->comptime%60);
9549 if (!is_fixed_quest_idx(q_idx) && q_ptr->r_idx)
9551 /* Print the quest info */
9552 if (q_ptr->complev == 0)
9555 _(" %-35s (%3d³¬) - ÉÔÀᄀ - %s\n",
9556 " %-35s (Dungeon level: %3d) - Unearned - %s\n") ,
9557 r_name+r_info[q_ptr->r_idx].name,
9558 q_ptr->level, playtime_str);
9563 _(" %-35s (%3d³¬) - ¥ì¥Ù¥ë%2d - %s\n",
9564 " %-35s (Dungeon level: %3d) - level %2d - %s\n") ,
9565 r_name+r_info[q_ptr->r_idx].name,
9573 /* Print the quest info */
9575 _(" %-35s (´í¸±ÅÙ:%3d³¬ÁêÅö) - ¥ì¥Ù¥ë%2d - %s\n",
9576 " %-35s (Danger level: %3d) - level %2d - %s\n") ,
9577 q_ptr->name, q_ptr->level, q_ptr->complev, playtime_str);
9580 fputs(tmp_str, fff);
9586 * Print all finished quests
9588 void do_cmd_knowledge_quests_completed(FILE *fff, int quest_num[])
9594 fprintf(fff, "¡ÔãÀ®¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
9596 fprintf(fff, "< Completed Quest >\n");
9598 for (i = 1; i < max_quests; i++)
9600 int q_idx = quest_num[i];
9601 quest_type* const q_ptr = &quest[q_idx];
9603 if (q_ptr->status == QUEST_STATUS_FINISHED &&
9604 do_cmd_knowledge_quests_aux(fff, q_idx))
9610 if (!total) fprintf(fff, " ¤Ê¤·\n");
9612 if (!total) fprintf(fff, " Nothing.\n");
9618 * Print all failed quests
9620 void do_cmd_knowledge_quests_failed(FILE *fff, int quest_num[])
9626 fprintf(fff, "¡Ô¼ºÇÔ¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
9628 fprintf(fff, "< Failed Quest >\n");
9630 for (i = 1; i < max_quests; i++)
9632 int q_idx = quest_num[i];
9633 quest_type* const q_ptr = &quest[q_idx];
9635 if (((q_ptr->status == QUEST_STATUS_FAILED_DONE) || (q_ptr->status == QUEST_STATUS_FAILED)) &&
9636 do_cmd_knowledge_quests_aux(fff, q_idx))
9642 if (!total) fprintf(fff, " ¤Ê¤·\n");
9644 if (!total) fprintf(fff, " Nothing.\n");
9650 * Print all random quests
9652 static void do_cmd_knowledge_quests_wiz_random(FILE *fff)
9659 fprintf(fff, "¡Ô»Ä¤ê¤Î¥é¥ó¥À¥à¥¯¥¨¥¹¥È¡Õ\n");
9661 fprintf(fff, "< Remaining Random Quest >\n");
9663 for (i = 1; i < max_quests; i++)
9665 /* No info from "silent" quests */
9666 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
9668 if ((quest[i].type == QUEST_TYPE_RANDOM) && (quest[i].status == QUEST_STATUS_TAKEN))
9672 /* Print the quest info */
9674 sprintf(tmp_str, " %s (%d³¬, %s)\n",
9675 quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
9677 sprintf(tmp_str, " %s (%d, %s)\n",
9678 quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
9680 fputs(tmp_str, fff);
9684 if (!total) fprintf(fff, " ¤Ê¤·\n");
9686 if (!total) fprintf(fff, " Nothing.\n");
9691 bool ang_sort_comp_quest_num(vptr u, vptr v, int a, int b)
9693 int *q_num = (int *)u;
9694 quest_type *qa = &quest[q_num[a]];
9695 quest_type *qb = &quest[q_num[b]];
9700 return (qa->comptime <= qb->comptime);
9703 void ang_sort_swap_quest_num(vptr u, vptr v, int a, int b)
9705 int *q_num = (int *)u;
9712 q_num[a] = q_num[b];
9718 * Print quest status of all active quests
9720 static void do_cmd_knowledge_quests(void)
9723 char file_name[1024];
9724 int *quest_num, dummy, i;
9726 /* Open a new file */
9727 fff = my_fopen_temp(file_name, 1024);
9731 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
9733 msg_format("Failed to create temporary file %s.", file_name);
9739 /* Allocate Memory */
9740 C_MAKE(quest_num, max_quests, int);
9742 /* Sort by compete level */
9743 for (i = 1; i < max_quests; i++) quest_num[i] = i;
9744 ang_sort_comp = ang_sort_comp_quest_num;
9745 ang_sort_swap = ang_sort_swap_quest_num;
9746 ang_sort(quest_num, &dummy, max_quests);
9748 /* Dump Quest Information */
9749 do_cmd_knowledge_quests_current(fff);
9751 do_cmd_knowledge_quests_completed(fff, quest_num);
9753 do_cmd_knowledge_quests_failed(fff, quest_num);
9757 do_cmd_knowledge_quests_wiz_random(fff);
9760 /* Close the file */
9763 /* Display the file contents */
9765 show_file(TRUE, file_name, "¥¯¥¨¥¹¥ÈãÀ®¾õ¶·", 0, 0);
9767 show_file(TRUE, file_name, "Quest status", 0, 0);
9770 /* Remove the file */
9774 C_KILL(quest_num, max_quests, int);
9781 static void do_cmd_knowledge_home(void)
9786 char file_name[1024];
9788 char o_name[MAX_NLEN];
9791 process_dungeon_file("w_info.txt", 0, 0, max_wild_y, max_wild_x);
9793 /* Open a new file */
9794 fff = my_fopen_temp(file_name, 1024);
9797 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
9799 msg_format("Failed to create temporary file %s.", file_name);
9807 /* Print all homes in the different towns */
9808 st_ptr = &town[1].store[STORE_HOME];
9810 /* Home -- if anything there */
9811 if (st_ptr->stock_num)
9816 /* Header with name of the town */
9818 fprintf(fff, " [ ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ]\n");
9820 fprintf(fff, " [Home Inventory]\n");
9823 /* Dump all available items */
9824 for (i = 0; i < st_ptr->stock_num; i++)
9827 if ((i % 12) == 0) fprintf(fff, "\n ( %d ¥Ú¡¼¥¸ )\n", x++);
9828 object_desc(o_name, &st_ptr->stock[i], 0);
9829 if (strlen(o_name) <= 80-3)
9831 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
9837 for (n = 0, t = o_name; n < 80-3; n++, t++)
9838 if(iskanji(*t)) {t++; n++;}
9839 if (n == 81-3) n = 79-3; /* ºÇ¸å¤¬´Á»úȾʬ */
9841 fprintf(fff, "%c%s %.*s\n", I2A(i%12), paren, n, o_name);
9842 fprintf(fff, " %.77s\n", o_name+n);
9845 object_desc(o_name, &st_ptr->stock[i], 0);
9846 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
9851 /* Add an empty line */
9852 fprintf(fff, "\n\n");
9856 /* Close the file */
9859 /* Display the file contents */
9861 show_file(TRUE, file_name, "²æ¤¬²È¤Î¥¢¥¤¥Æ¥à", 0, 0);
9863 show_file(TRUE, file_name, "Home Inventory", 0, 0);
9867 /* Remove the file */
9873 * Check the status of "autopick"
9875 static void do_cmd_knowledge_autopick(void)
9879 char file_name[1024];
9881 /* Open a new file */
9882 fff = my_fopen_temp(file_name, 1024);
9887 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
9889 msg_format("Failed to create temporary file %s.", file_name);
9898 fprintf(fff, "¼«Æ°Ç˲õ/½¦¤¤¤Ë¤Ï²¿¤âÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
9900 fprintf(fff, "No preference for auto picker/destroyer.");
9906 fprintf(fff, " ¼«Æ°½¦¤¤/Ç˲õ¤Ë¤Ï¸½ºß %d¹ÔÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£\n\n", max_autopick);
9908 fprintf(fff, " There are %d registered lines for auto picker/destroyer.\n\n", max_autopick);
9912 for (k = 0; k < max_autopick; k++)
9915 byte act = autopick_list[k].action;
9916 if (act & DONT_AUTOPICK)
9924 else if (act & DO_AUTODESTROY)
9932 else if (act & DO_AUTOPICK)
9940 else /* if (act & DO_QUERY_AUTOPICK) */ /* Obvious */
9949 if (act & DO_DISPLAY)
9950 fprintf(fff, "%11s", format("[%s]", tmp));
9952 fprintf(fff, "%11s", format("(%s)", tmp));
9954 tmp = autopick_line_from_entry(&autopick_list[k]);
9955 fprintf(fff, " %s", tmp);
9959 /* Close the file */
9961 /* Display the file contents */
9963 show_file(TRUE, file_name, "¼«Æ°½¦¤¤/Ç˲õ ÀßÄê¥ê¥¹¥È", 0, 0);
9965 show_file(TRUE, file_name, "Auto-picker/Destroyer", 0, 0);
9968 /* Remove the file */
9974 * Interact with "knowledge"
9976 void do_cmd_knowledge(void)
9979 bool need_redraw = FALSE;
9981 /* File type is "TEXT" */
9982 FILE_TYPE(FILE_TYPE_TEXT);
9984 /* Save the screen */
9987 /* Interact until done */
9993 /* Ask for a choice */
9995 prt(format("%d/2 ¥Ú¡¼¥¸", (p+1)), 2, 65);
9996 prt("¸½ºß¤ÎÃ챤ò³Îǧ¤¹¤ë", 3, 0);
9998 prt(format("page %d/2", (p+1)), 2, 65);
9999 prt("Display current knowledge", 3, 0);
10002 /* Give some choices */
10006 prt("(1) ´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 6, 5);
10007 prt("(2) ´ûÃΤΥ¢¥¤¥Æ¥à ¤Î°ìÍ÷", 7, 5);
10008 prt("(3) ´ûÃΤÎÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 8, 5);
10009 prt("(4) ´ûÃΤΥâ¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 9, 5);
10010 prt("(5) Åݤ·¤¿Å¨¤Î¿ô ¤Î°ìÍ÷", 10, 5);
10011 if (!vanilla_town) prt("(6) ¾Þ¶â¼ó ¤Î°ìÍ÷", 11, 5);
10012 prt("(7) ¸½ºß¤Î¥Ú¥Ã¥È ¤Î°ìÍ÷", 12, 5);
10013 prt("(8) ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 13, 5);
10014 prt("(9) *´ÕÄê*ºÑ¤ßÁõÈ÷¤ÎÂÑÀ ¤Î°ìÍ÷", 14, 5);
10015 prt("(0) ÃÏ·Á¤Îɽ¼¨Ê¸»ú/¥¿¥¤¥ë ¤Î°ìÍ÷", 15, 5);
10019 prt("(a) ¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó ¤Î°ìÍ÷", 6, 5);
10020 prt("(b) ÆÍÁ³ÊÑ°Û ¤Î°ìÍ÷", 7, 5);
10021 prt("(c) Éð´ï¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 8, 5);
10022 prt("(d) ËâË¡¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 9, 5);
10023 prt("(e) µ»Ç½¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 10, 5);
10024 prt("(f) ¥×¥ì¥¤¥ä¡¼¤ÎÆÁ ¤Î°ìÍ÷", 11, 5);
10025 prt("(g) Æþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó ¤Î°ìÍ÷", 12, 5);
10026 prt("(h) ¼Â¹ÔÃæ¤Î¥¯¥¨¥¹¥È ¤Î°ìÍ÷", 13, 5);
10027 prt("(i) ¸½ºß¤Î¼«Æ°½¦¤¤/Ç˲õÀßÄê ¤Î°ìÍ÷", 14, 5);
10032 prt("(1) Display known artifacts", 6, 5);
10033 prt("(2) Display known objects", 7, 5);
10034 prt("(3) Display remaining uniques", 8, 5);
10035 prt("(4) Display known monster", 9, 5);
10036 prt("(5) Display kill count", 10, 5);
10037 if (!vanilla_town) prt("(6) Display wanted monsters", 11, 5);
10038 prt("(7) Display current pets", 12, 5);
10039 prt("(8) Display home inventory", 13, 5);
10040 prt("(9) Display *identified* equip.", 14, 5);
10041 prt("(0) Display terrain symbols.", 15, 5);
10045 prt("(a) Display about yourself", 6, 5);
10046 prt("(b) Display mutations", 7, 5);
10047 prt("(c) Display weapon proficiency", 8, 5);
10048 prt("(d) Display spell proficiency", 9, 5);
10049 prt("(e) Display misc. proficiency", 10, 5);
10050 prt("(f) Display virtues", 11, 5);
10051 prt("(g) Display dungeons", 12, 5);
10052 prt("(h) Display current quests", 13, 5);
10053 prt("(i) Display auto pick/destroy", 14, 5);
10058 prt("-³¤¯-", 17, 8);
10059 prt("ESC) È´¤±¤ë", 21, 1);
10060 prt("SPACE) ¼¡¥Ú¡¼¥¸", 21, 30);
10061 /*prt("-) Á°¥Ú¡¼¥¸", 21, 60);*/
10062 prt("¥³¥Þ¥ó¥É:", 20, 0);
10064 prt("-more-", 17, 8);
10065 prt("ESC) Exit menu", 21, 1);
10066 prt("SPACE) Next page", 21, 30);
10067 /*prt("-) Previous page", 21, 60);*/
10068 prt("Command: ", 20, 0);
10075 if (i == ESCAPE) break;
10078 case ' ': /* Page change */
10082 case '1': /* Artifacts */
10083 do_cmd_knowledge_artifacts();
10085 case '2': /* Objects */
10086 do_cmd_knowledge_objects(&need_redraw, FALSE, -1);
10088 case '3': /* Uniques */
10089 do_cmd_knowledge_uniques();
10091 case '4': /* Monsters */
10092 do_cmd_knowledge_monsters(&need_redraw, FALSE, -1);
10094 case '5': /* Kill count */
10095 do_cmd_knowledge_kill_count();
10097 case '6': /* wanted */
10098 if (!vanilla_town) do_cmd_knowledge_kubi();
10100 case '7': /* Pets */
10101 do_cmd_knowledge_pets();
10103 case '8': /* Home */
10104 do_cmd_knowledge_home();
10106 case '9': /* Resist list */
10107 do_cmd_knowledge_inven();
10109 case '0': /* Feature list */
10111 int lighting_level = F_LIT_STANDARD;
10112 do_cmd_knowledge_features(&need_redraw, FALSE, -1, &lighting_level);
10116 case 'a': /* Max stat */
10117 do_cmd_knowledge_stat();
10119 case 'b': /* Mutations */
10120 do_cmd_knowledge_mutations();
10122 case 'c': /* weapon-exp */
10123 do_cmd_knowledge_weapon_exp();
10125 case 'd': /* spell-exp */
10126 do_cmd_knowledge_spell_exp();
10128 case 'e': /* skill-exp */
10129 do_cmd_knowledge_skill_exp();
10131 case 'f': /* Virtues */
10132 do_cmd_knowledge_virtues();
10134 case 'g': /* Dungeon */
10135 do_cmd_knowledge_dungeon();
10137 case 'h': /* Quests */
10138 do_cmd_knowledge_quests();
10140 case 'i': /* Autopick */
10141 do_cmd_knowledge_autopick();
10143 default: /* Unknown option */
10147 /* Flush messages */
10151 /* Restore the screen */
10154 if (need_redraw) do_cmd_redraw();
10159 * Check on the status of an active quest
10161 void do_cmd_checkquest(void)
10163 /* File type is "TEXT" */
10164 FILE_TYPE(FILE_TYPE_TEXT);
10166 /* Save the screen */
10170 do_cmd_knowledge_quests();
10172 /* Restore the screen */
10178 * Display the time and date
10180 void do_cmd_time(void)
10182 int day, hour, min, full, start, end, num;
10190 extract_day_hour_min(&day, &hour, &min);
10192 full = hour * 100 + min;
10200 strcpy(desc, "ÊѤʻþ¹ï¤À¡£");
10202 strcpy(desc, "It is a strange time.");
10206 if (day < MAX_DAYS) sprintf(day_buf, "%d", day);
10207 else strcpy(day_buf, "*****");
10211 msg_format("%sÆüÌÜ, »þ¹ï¤Ï%d:%02d %s¤Ç¤¹¡£",
10212 day_buf, (hour % 12 == 0) ? 12 : (hour % 12),
10213 min, (hour < 12) ? "AM" : "PM");
10215 msg_format("This is day %s. The time is %d:%02d %s.",
10216 day_buf, (hour % 12 == 0) ? 12 : (hour % 12),
10217 min, (hour < 12) ? "AM" : "PM");
10221 /* Find the path */
10222 if (!randint0(10) || p_ptr->image)
10225 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timefun_j.txt");
10227 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timefun.txt");
10234 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timenorm_j.txt");
10236 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timenorm.txt");
10241 /* Open this file */
10242 fff = my_fopen(buf, "rt");
10247 /* Find this time */
10248 while (!my_fgets(fff, buf, sizeof(buf)))
10250 /* Ignore comments */
10251 if (!buf[0] || (buf[0] == '#')) continue;
10253 /* Ignore invalid lines */
10254 if (buf[1] != ':') continue;
10256 /* Process 'Start' */
10259 /* Extract the starting time */
10260 start = atoi(buf + 2);
10262 /* Assume valid for an hour */
10269 /* Process 'End' */
10272 /* Extract the ending time */
10273 end = atoi(buf + 2);
10279 /* Ignore incorrect range */
10280 if ((start > full) || (full > end)) continue;
10282 /* Process 'Description' */
10287 /* Apply the randomizer */
10288 if (!randint0(num)) strcpy(desc, buf + 2);
10298 /* Close the file */