3 * @brief ¥×¥ì¥¤¥ä¡¼¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ë´Ø¤¹¤ë¥³¥Þ¥ó¥É¤Î¼ÂÁõ / Interface commands
7 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
9 * This software may be copied and distributed for educational, research,
10 * and not for profit purposes provided that this copyright and statement
11 * are included in all such copies. Other copyrights may also apply.
20 * A set of functions to maintain automatic dumps of various kinds.
23 * remove_auto_dump(orig_file, mark)
24 * Remove the old automatic dump of type "mark".
25 * auto_dump_printf(fmt, ...)
26 * Dump a formatted string using fprintf().
27 * open_auto_dump(buf, mark)
28 * Open a file, remove old dump, and add new header.
29 * close_auto_dump(void)
30 * Add a footer, and close the file.
32 * The dump commands of original Angband simply add new lines to
33 * existing files; these files will become bigger and bigger unless
34 * an user deletes some or all of these files by hand at some
37 * These three functions automatically delete old dumped lines
38 * before adding new ones. Since there are various kinds of automatic
39 * dumps in a single file, we add a header and a footer with a type
40 * name for every automatic dump, and kill old lines only when the
41 * lines have the correct type of header and footer.
43 * We need to be quite paranoid about correctness; the user might
44 * (mistakenly) edit the file by hand, and see all their work come
45 * to nothing on the next auto dump otherwise. The current code only
46 * detects changes by noting inconsistencies between the actual number
47 * of lines and the number written in the footer. Note that this will
48 * not catch single-line edits.
52 * Mark strings for auto dump
54 static char auto_dump_header[] = "# vvvvvvv== %s ==vvvvvvv";
55 static char auto_dump_footer[] = "# ^^^^^^^== %s ==^^^^^^^";
58 * Variables for auto dump
60 static FILE *auto_dump_stream;
61 static cptr auto_dump_mark;
62 static int auto_dump_line_num;
66 * @brief prf½ÐÎÏÆâÍƤò¾Ãµî¤¹¤ë /
67 * Remove old lines automatically generated before.
68 * @param orig_file ¾Ãµî¤ò¹Ô¤¦¥Õ¥¡¥¤¥ë̾
70 static void remove_auto_dump(cptr orig_file)
72 FILE *tmp_fff, *orig_fff;
76 bool between_mark = FALSE;
79 long header_location = 0;
80 char header_mark_str[80];
81 char footer_mark_str[80];
84 /* Prepare a header/footer mark string */
85 sprintf(header_mark_str, auto_dump_header, auto_dump_mark);
86 sprintf(footer_mark_str, auto_dump_footer, auto_dump_mark);
88 mark_len = strlen(footer_mark_str);
90 /* Open an old dump file in read-only mode */
91 orig_fff = my_fopen(orig_file, "r");
93 /* If original file does not exist, nothing to do */
94 if (!orig_fff) return;
96 /* Open a new (temporary) file */
97 tmp_fff = my_fopen_temp(tmp_file, 1024);
102 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", tmp_file);
104 msg_format("Failed to create temporary file %s.", tmp_file);
110 /* Loop for every line */
114 if (my_fgets(orig_fff, buf, sizeof(buf)))
116 /* Read error: Assume End of File */
119 * Was looking for the footer, but not found.
121 * Since automatic dump might be edited by hand,
122 * it's dangerous to kill these lines.
123 * Seek back to the next line of the (pseudo) header,
128 fseek(orig_fff, header_location, SEEK_SET);
129 between_mark = FALSE;
133 /* Success -- End the loop */
140 /* We are looking for the header mark of automatic dump */
143 /* Is this line a header? */
144 if (!strcmp(buf, header_mark_str))
146 /* Memorise seek point of this line */
147 header_location = ftell(orig_fff);
149 /* Initialize counter for number of lines */
152 /* Look for the footer from now */
155 /* There are some changes */
162 /* Copy orginally lines */
163 fprintf(tmp_fff, "%s\n", buf);
167 /* We are looking for the footer mark of automatic dump */
170 /* Is this line a footer? */
171 if (!strncmp(buf, footer_mark_str, mark_len))
176 * Compare the number of lines
178 * If there is an inconsistency between
179 * actual number of lines and the
180 * number here, the automatic dump
181 * might be edited by hand. So it's
182 * dangerous to kill these lines.
183 * Seek back to the next line of the
184 * (pseudo) header, and read again.
186 if (!sscanf(buf + mark_len, " (%d)", &tmp)
189 fseek(orig_fff, header_location, SEEK_SET);
192 /* Look for another header */
193 between_mark = FALSE;
199 /* Ignore old line, and count number of lines */
209 /* If there are some changes, overwrite the original file with new one */
212 /* Copy contents of temporary file */
214 tmp_fff = my_fopen(tmp_file, "r");
215 orig_fff = my_fopen(orig_file, "w");
217 while (!my_fgets(tmp_fff, buf, sizeof(buf)))
218 fprintf(orig_fff, "%s\n", buf);
224 /* Kill the temporary file */
232 * @brief prf¥Õ¥¡¥¤¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë½¾¤Ã¤¿ÆâÍƤò½ÐÎϤ¹¤ë /
233 * Dump a formatted line, using "vstrnfmt()".
234 * @param fmt ½ÐÎÏÆâÍÆ
236 static void auto_dump_printf(cptr fmt, ...)
243 /* Begin the Varargs Stuff */
246 /* Format the args, save the length */
247 (void)vstrnfmt(buf, sizeof(buf), fmt, vp);
249 /* End the Varargs Stuff */
252 /* Count number of lines */
253 for (p = buf; *p; p++)
255 if (*p == '\n') auto_dump_line_num++;
259 fprintf(auto_dump_stream, "%s", buf);
264 * @brief prf¥Õ¥¡¥¤¥ë¤ò¥Õ¥¡¥¤¥ë¥ª¡¼¥×¥ó¤¹¤ë /
265 * Open file to append auto dump.
266 * @param buf ¥Õ¥¡¥¤¥ë̾
267 * @param mark ½ÐÎϤ¹¤ë¥Ø¥Ã¥À¥Þ¡¼¥¯
268 * @return ¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¤ò¼èÆÀ¤Ç¤¤¿¤éTRUE¤òÊÖ¤¹
270 static bool open_auto_dump(cptr buf, cptr mark)
273 char header_mark_str[80];
275 /* Save the mark string */
276 auto_dump_mark = mark;
278 /* Prepare a header mark string */
279 sprintf(header_mark_str, auto_dump_header, auto_dump_mark);
281 /* Remove old macro dumps */
282 remove_auto_dump(buf);
284 /* Append to the file */
285 auto_dump_stream = my_fopen(buf, "a");
288 if (!auto_dump_stream) {
290 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
292 msg_format("Failed to open %s.", buf);
301 fprintf(auto_dump_stream, "%s\n", header_mark_str);
303 /* Initialize counter */
304 auto_dump_line_num = 0;
307 auto_dump_printf("# *·Ù¹ð!!* °Ê¹ß¤Î¹Ô¤Ï¼«Æ°À¸À®¤µ¤ì¤¿¤â¤Î¤Ç¤¹¡£\n");
308 auto_dump_printf("# *·Ù¹ð!!* ¸å¤Ç¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¤Î¤ÇÊÔ½¸¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£\n");
310 auto_dump_printf("# *Warning!* The lines below are an automatic dump.\n");
311 auto_dump_printf("# Don't edit them; changes will be deleted and replaced automatically.\n");
319 * 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);
348 * Return suffix of ordinal number
350 cptr get_ordinal_number_suffix(int num)
352 num = ABS(num) % 100;
356 return (num == 11) ? "th" : "st";
358 return (num == 12) ? "th" : "nd";
360 return (num == 13) ? "th" : "rd";
369 * Take note to the diary.
371 errr do_cmd_write_nikki(int type, int num, cptr note)
377 cptr note_level = "";
378 bool do_level = TRUE;
379 char note_level_buf[40];
382 static bool disable_nikki = FALSE;
384 extract_day_hour_min(&day, &hour, &min);
386 if (disable_nikki) return(-1);
388 if (type == NIKKI_FIX_QUEST_C ||
389 type == NIKKI_FIX_QUEST_F ||
390 type == NIKKI_RAND_QUEST_C ||
391 type == NIKKI_RAND_QUEST_F ||
392 type == NIKKI_TO_QUEST)
396 old_quest = p_ptr->inside_quest;
397 p_ptr->inside_quest = (quest[num].type == QUEST_TYPE_RANDOM) ? 0 : num;
399 /* Get the quest text */
400 init_flags = INIT_NAME_ONLY;
402 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
404 /* Reset the old quest number */
405 p_ptr->inside_quest = old_quest;
409 sprintf(file_name,"playrecord-%s.txt",savefile_base);
411 /* different filne name to avoid mixing */
412 sprintf(file_name,"playrec-%s.txt",savefile_base);
415 /* Build the filename */
416 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
418 /* File type is "TEXT" */
419 FILE_TYPE(FILE_TYPE_TEXT);
421 fff = my_fopen(buf, "a");
427 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£¥×¥ì¥¤µÏ¿¤ò°ì»þÄä»ß¤·¤Þ¤¹¡£", buf);
429 msg_format("Failed to open %s. Play-Record is disabled temporally.", buf);
436 q_idx = quest_number(dun_level);
440 if (p_ptr->inside_arena)
442 note_level = "¥¢¥ê¡¼¥Ê:";
444 note_level = "Arane:";
448 note_level = "ÃϾå:";
450 note_level = "Surface:";
452 else if (q_idx && (is_fixed_quest_idx(q_idx)
453 && !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
455 note_level = "¥¯¥¨¥¹¥È:";
457 note_level = "Quest:";
462 sprintf(note_level_buf, "%d³¬(%s):", dun_level, d_name+d_info[dungeon_type].name);
464 sprintf(note_level_buf, "%s L%d:", d_name+d_info[dungeon_type].name, dun_level);
466 note_level = note_level_buf;
475 if (day < MAX_DAYS) fprintf(fff, "%dÆüÌÜ\n", day);
476 else fputs("*****ÆüÌÜ\n", fff);
478 if (day < MAX_DAYS) fprintf(fff, "Day %d\n", day);
479 else fputs("Day *****\n", fff);
488 fprintf(fff, "%s\n",note);
492 fprintf(fff, " %2d:%02d %20s %s\n",hour, min, note_level, note);
498 fprintf(fff, " %2d:%02d %20s %s¤òȯ¸«¤·¤¿¡£\n", hour, min, note_level, note);
500 fprintf(fff, " %2d:%02d %20s discovered %s.\n", hour, min, note_level, note);
507 fprintf(fff, " %2d:%02d %20s %s¤òÅݤ·¤¿¡£\n", hour, min, note_level, note);
509 fprintf(fff, " %2d:%02d %20s defeated %s.\n", hour, min, note_level, note);
513 case NIKKI_FIX_QUEST_C:
515 if (quest[num].flags & QUEST_FLAG_SILENT) break;
517 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤òãÀ®¤·¤¿¡£\n", hour, min, note_level, quest[num].name);
519 fprintf(fff, " %2d:%02d %20s completed quest '%s'.\n", hour, min, note_level, quest[num].name);
523 case NIKKI_FIX_QUEST_F:
525 if (quest[num].flags & QUEST_FLAG_SILENT) break;
527 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤«¤éÌ¿¤«¤é¤¬¤éƨ¤²µ¢¤Ã¤¿¡£\n", hour, min, note_level, quest[num].name);
529 fprintf(fff, " %2d:%02d %20s run away from quest '%s'.\n", hour, min, note_level, quest[num].name);
533 case NIKKI_RAND_QUEST_C:
536 strcpy(name, r_name+r_info[quest[num].r_idx].name);
538 fprintf(fff, " %2d:%02d %20s ¥é¥ó¥À¥à¥¯¥¨¥¹¥È(%s)¤òãÀ®¤·¤¿¡£\n", hour, min, note_level, name);
540 fprintf(fff, " %2d:%02d %20s completed random quest '%s'\n", hour, min, note_level, name);
544 case NIKKI_RAND_QUEST_F:
547 strcpy(name, r_name+r_info[quest[num].r_idx].name);
549 fprintf(fff, " %2d:%02d %20s ¥é¥ó¥À¥à¥¯¥¨¥¹¥È(%s)¤«¤éƨ¤²½Ð¤·¤¿¡£\n", hour, min, note_level, name);
551 fprintf(fff, " %2d:%02d %20s ran away from quest '%s'.\n", hour, min, note_level, name);
555 case NIKKI_MAXDEAPTH:
558 fprintf(fff, " %2d:%02d %20s %s¤ÎºÇ¿¼³¬%d³¬¤ËÅþ㤷¤¿¡£\n", hour, min, note_level, d_name+d_info[dungeon_type].name, num);
560 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);
567 fprintf(fff, " %2d:%02d %20s %s%s¤ÎºÇ¿¼³¬¤ò%d³¬¤Ë¥»¥Ã¥È¤·¤¿¡£\n", hour, min, note_level, note, d_name + d_info[num].name, max_dlv[num]);
569 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);
576 if (q_idx && (is_fixed_quest_idx(q_idx)
577 && !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
588 if (!(dun_level+num)) to = "ÃϾå";
589 else to = format("%d³¬", dun_level+num);
591 if (!(dun_level+num)) to = "the surface";
592 else to = format("level %d", dun_level+num);
597 fprintf(fff, " %2d:%02d %20s %s¤Ø%s¡£\n", hour, min, note_level, to, note);
599 fprintf(fff, " %2d:%02d %20s %s %s.\n", hour, min, note_level, note, to);
607 fprintf(fff, " %2d:%02d %20s µ¢´Ô¤ò»È¤Ã¤Æ%s¤Î%d³¬¤Ø²¼¤ê¤¿¡£\n", hour, min, note_level, d_name+d_info[dungeon_type].name, max_dlv[dungeon_type]);
609 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);
613 fprintf(fff, " %2d:%02d %20s µ¢´Ô¤ò»È¤Ã¤ÆÃϾå¤Ø¤ÈÌá¤Ã¤¿¡£\n", hour, min, note_level);
615 fprintf(fff, " %2d:%02d %20s recalled from dungeon to surface.\n", hour, min, note_level);
621 if (quest[num].flags & QUEST_FLAG_SILENT) break;
623 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤Ø¤ÈÆÍÆþ¤·¤¿¡£\n", hour, min, note_level, quest[num].name);
625 fprintf(fff, " %2d:%02d %20s entered the quest '%s'.\n", hour, min, note_level, quest[num].name);
632 fprintf(fff, " %2d:%02d %20s ¥ì¥Ù¥ë¡¦¥Æ¥ì¥Ý¡¼¥È¤Çæ½Ð¤·¤¿¡£\n", hour, min, note_level);
634 fprintf(fff, " %2d:%02d %20s Got out using teleport level.\n", hour, min, note_level);
641 fprintf(fff, " %2d:%02d %20s %s¤ò¹ØÆþ¤·¤¿¡£\n", hour, min, note_level, note);
643 fprintf(fff, " %2d:%02d %20s bought %s.\n", hour, min, note_level, note);
650 fprintf(fff, " %2d:%02d %20s %s¤òÇäµÑ¤·¤¿¡£\n", hour, min, note_level, note);
652 fprintf(fff, " %2d:%02d %20s sold %s.\n", hour, min, note_level, note);
661 fprintf(fff, " %2d:%02d %20s Æ®µ»¾ì¤Î%d²óÀï¤Ç¡¢%s¤ÎÁ°¤ËÇÔ¤ìµî¤Ã¤¿¡£\n", hour, min, note_level, -num, note);
664 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));
669 fprintf(fff, " %2d:%02d %20s Æ®µ»¾ì¤Î%d²óÀï(%s)¤Ë¾¡Íø¤·¤¿¡£\n", hour, min, note_level, num, note);
671 fprintf(fff, " %2d:%02d %20s won the %d%s fight (%s).\n", hour, min, note_level, num, get_ordinal_number_suffix(num), note);
673 if (num == MAX_ARENA_MONS)
676 fprintf(fff, " Æ®µ»¾ì¤Î¤¹¤Ù¤Æ¤ÎŨ¤Ë¾¡Íø¤·¡¢¥Á¥ã¥ó¥Ô¥ª¥ó¤È¤Ê¤Ã¤¿¡£\n");
678 fprintf(fff, " won all fight to become a Chanpion.\n");
687 fprintf(fff, " %2d:%02d %20s %s¤ò¼±Ê̤·¤¿¡£\n", hour, min, note_level, note);
689 fprintf(fff, " %2d:%02d %20s identified %s.\n", hour, min, note_level, note);
704 to = format("%d³¬(%s)", dun_level, d_name+d_info[dungeon_type].name);
706 to = format("level %d of %s", dun_level, d_name+d_info[dungeon_type].name);
710 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥¦¥£¥¶¡¼¥É¡¦¥Æ¥ì¥Ý¡¼¥È¤Ç°ÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
712 fprintf(fff, " %2d:%02d %20s wizard-teleport to %s.\n", hour, min, note_level, to);
727 to = format("%d³¬(%s)", dun_level, d_name+d_info[dungeon_type].name);
729 to = format("level %d of %s", dun_level, d_name+d_info[dungeon_type].name);
733 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥Ñ¥¿¡¼¥ó¤ÎÎϤǰÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
735 fprintf(fff, " %2d:%02d %20s used Pattern to teleport to %s.\n", hour, min, note_level, to);
742 fprintf(fff, " %2d:%02d %20s ¥ì¥Ù¥ë¤¬%d¤Ë¾å¤¬¤Ã¤¿¡£\n", hour, min, note_level, num);
744 fprintf(fff, " %2d:%02d %20s reached player level %d.\n", hour, min, note_level, num);
748 case NIKKI_GAMESTART:
750 time_t ct = time((time_t*)0);
754 fprintf(fff, "%s %s",note, ctime(&ct));
757 fprintf(fff, " %2d:%02d %20s %s %s",hour, min, note_level, note, ctime(&ct));
760 case NIKKI_NAMED_PET:
762 fprintf(fff, " %2d:%02d %20s ", hour, min, note_level);
765 case RECORD_NAMED_PET_NAME:
767 fprintf(fff, "%s¤òι¤Îͧ¤Ë¤¹¤ë¤³¤È¤Ë·è¤á¤¿¡£\n", note);
769 fprintf(fff, "decided to travel together with %s.\n", note);
772 case RECORD_NAMED_PET_UNNAME:
774 fprintf(fff, "%s¤Î̾Á°¤ò¾Ã¤·¤¿¡£\n", note);
776 fprintf(fff, "unnamed %s.\n", note);
779 case RECORD_NAMED_PET_DISMISS:
781 fprintf(fff, "%s¤ò²òÊü¤·¤¿¡£\n", note);
783 fprintf(fff, "dismissed %s.\n", note);
786 case RECORD_NAMED_PET_DEATH:
788 fprintf(fff, "%s¤¬»à¤ó¤Ç¤·¤Þ¤Ã¤¿¡£\n", note);
790 fprintf(fff, "%s died.\n", note);
793 case RECORD_NAMED_PET_MOVED:
795 fprintf(fff, "%s¤ò¤ª¤¤¤ÆÊ̤ΥޥåפذÜÆ°¤·¤¿¡£\n", note);
797 fprintf(fff, "moved to another map leaving %s behind.\n", note);
800 case RECORD_NAMED_PET_LOST_SIGHT:
802 fprintf(fff, "%s¤È¤Ï¤°¤ì¤Æ¤·¤Þ¤Ã¤¿¡£\n", note);
804 fprintf(fff, "lost sight of %s.\n", note);
807 case RECORD_NAMED_PET_DESTROY:
809 fprintf(fff, "%s¤¬*Ç˲õ*¤Ë¤è¤Ã¤Æ¾Ã¤¨µî¤Ã¤¿¡£\n", note);
811 fprintf(fff, "%s was made disappeared by *destruction*.\n", note);
814 case RECORD_NAMED_PET_EARTHQUAKE:
816 fprintf(fff, "%s¤¬´äÀФ˲¡¤·ÄÙ¤µ¤ì¤¿¡£\n", note);
818 fprintf(fff, "%s was crushed by falling rocks.\n", note);
821 case RECORD_NAMED_PET_GENOCIDE:
823 fprintf(fff, "%s¤¬Ëõ»¦¤Ë¤è¤Ã¤Æ¾Ã¤¨µî¤Ã¤¿¡£\n", note);
825 fprintf(fff, "%s was made disappeared by genocide.\n", note);
828 case RECORD_NAMED_PET_WIZ_ZAP:
830 fprintf(fff, "%s¤¬¥Ç¥Ð¥Ã¥°¥³¥Þ¥ó¥É¤Ë¤è¤Ã¤Æ¾Ã¤¨µî¤Ã¤¿¡£\n", note);
832 fprintf(fff, "%s was removed by debug command.\n", note);
835 case RECORD_NAMED_PET_TELE_LEVEL:
837 fprintf(fff, "%s¤¬¥Æ¥ì¥Ý¡¼¥È¡¦¥ì¥Ù¥ë¤Ë¤è¤Ã¤Æ¾Ã¤¨µî¤Ã¤¿¡£\n", note);
839 fprintf(fff, "%s was made disappeared by teleport level.\n", note);
842 case RECORD_NAMED_PET_BLAST:
844 fprintf(fff, "%s¤òÇúÇˤ·¤¿¡£\n", note);
846 fprintf(fff, "blasted %s.\n", note);
849 case RECORD_NAMED_PET_HEAL_LEPER:
851 fprintf(fff, "%s¤Îɵ¤¤¬¼£¤ê餫¤é³°¤ì¤¿¡£\n", note);
853 fprintf(fff, "%s was healed and left.\n", note);
856 case RECORD_NAMED_PET_COMPACT:
858 fprintf(fff, "%s¤¬¥â¥ó¥¹¥¿¡¼¾ðÊ󰵽̤ˤè¤Ã¤Æ¾Ã¤¨µî¤Ã¤¿¡£\n", note);
860 fprintf(fff, "%s was made disappeared by compacting monsters.\n", note);
863 case RECORD_NAMED_PET_LOSE_PARENT:
865 fprintf(fff, "%s¤Î¾¤´¼Ô¤¬´û¤Ë¤¤¤Ê¤¤¤¿¤á¾Ã¤¨µî¤Ã¤¿¡£\n", note);
867 fprintf(fff, "%s disappeared because there does not exist summoner.\n", note);
882 if (do_level) write_level = FALSE;
888 #define MAX_SUBTITLE (sizeof(subtitle)/sizeof(subtitle[0]))
890 static void do_cmd_disp_nikki(void)
892 char nikki_title[256];
897 static const char subtitle[][30] = {"ºÇ¶¯¤ÎÆùÂΤòµá¤á¤Æ",
898 "¿ÍÀ¸¤½¤ì¤Ï¤Ï¤«¤Ê¤¤",
909 "Åݤ¹¤Ù¤Å¨¤Ï¥²¡û¥Ä",
910 "¤ó¡Á¡©Ê¹¤³¤¨¤ó¤Ê¤¡",
911 "¥ª¥ì¤Î̾¤ò¸À¤Ã¤Æ¤ß¤í",
912 "Ƭ¤¬ÊѤˤʤäÁ¤ã¤Ã¤¿",
917 "¤³¤ó¤Ê¤â¤ó¤¸¤ã¤Ê¤¤",
926 "ºÇ¹â¤ÎƬǾ¤òµá¤á¤Æ"};
928 static const char subtitle[][51] ={"Quest of The World's Toughest Body",
929 "Attack is the best form of defence.",
931 "An unexpected windfall",
932 "A drowning man will catch at a straw",
933 "Don't count your chickens before they are hatched.",
934 "It is no use crying over spilt milk.",
935 "Seeing is believing.",
936 "Strike the iron while it is hot.",
937 "I don't care what follows.",
938 "To dig a well to put out a house on fire.",
939 "Tomorrow is another day.",
940 "Easy come, easy go.",
941 "The more haste, the less speed.",
942 "Where there is life, there is hope.",
943 "There is no royal road to *WINNER*.",
944 "Danger past, God forgotten.",
945 "The best thing to do now is to run away.",
946 "Life is but an empty dream.",
947 "Dead men tell no tales.",
948 "A book that remains shut is but a block.",
949 "Misfortunes never come singly.",
950 "A little knowledge is a dangerous thing.",
951 "History repeats itself.",
952 "*WINNER* was not built in a day.",
953 "Ignorance is bliss.",
954 "To lose is to win?",
955 "No medicine can cure folly.",
956 "All good things come to an end.",
957 "M$ Empire strikes back.",
958 "To see is to believe",
960 "Quest of The World's Greatest Brain"};
963 sprintf(file_name,"playrecord-%s.txt",savefile_base);
965 sprintf(file_name,"playrec-%s.txt",savefile_base);
968 /* Build the filename */
969 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
971 if (p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_MONK || p_ptr->pclass == CLASS_SAMURAI || p_ptr->pclass == CLASS_BERSERKER)
972 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)]);
973 else if (p_ptr->pclass == CLASS_MAGE || p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER)
974 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)+1]);
975 else strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-2)+1]);
978 sprintf(nikki_title, "¡Ö%s%s%s¤ÎÅÁÀâ -%s-¡×",
979 ap_ptr->title, ap_ptr->no ? "¤Î" : "", player_name, tmp);
981 sprintf(nikki_title, "Legend of %s %s '%s'",
982 ap_ptr->title, player_name, tmp);
985 /* Display the file contents */
986 show_file(FALSE, buf, nikki_title, -1, 0);
989 static void do_cmd_bunshou(void)
992 char bunshou[80] = "\0";
995 if (get_string("ÆâÍÆ: ", tmp, 79))
997 if (get_string("diary note: ", tmp, 79))
1000 strcpy(bunshou, tmp);
1002 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, bunshou);
1006 static void do_cmd_last_get(void)
1011 if (record_o_name[0] == '\0') return;
1014 sprintf(buf,"%s¤ÎÆþ¼ê¤òµÏ¿¤·¤Þ¤¹¡£",record_o_name);
1016 sprintf(buf,"Do you really want to record getting %s? ",record_o_name);
1018 if (!get_check(buf)) return;
1023 sprintf(buf,"%s¤ò¼ê¤ËÆþ¤ì¤¿¡£", record_o_name);
1025 sprintf(buf,"descover %s.", record_o_name);
1027 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, buf);
1031 static void do_cmd_erase_nikki(void)
1038 if (!get_check("ËÜÅö¤ËµÏ¿¤ò¾Ãµî¤·¤Þ¤¹¤«¡©")) return;
1040 if (!get_check("Do you really want to delete all your record? ")) return;
1044 sprintf(file_name,"playrecord-%s.txt",savefile_base);
1046 sprintf(file_name,"playrec-%s.txt",savefile_base);
1049 /* Build the filename */
1050 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
1052 /* Remove the file */
1055 fff = my_fopen(buf, "w");
1059 msg_format("µÏ¿¤ò¾Ãµî¤·¤Þ¤·¤¿¡£");
1061 msg_format("deleted record.");
1065 msg_format("%s ¤Î¾Ãµî¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£", buf);
1067 msg_format("failed to delete %s.", buf);
1074 void do_cmd_nikki(void)
1078 /* File type is "TEXT" */
1079 FILE_TYPE(FILE_TYPE_TEXT);
1081 /* Save the screen */
1084 /* Interact until done */
1090 /* Ask for a choice */
1092 prt("[ µÏ¿¤ÎÀßÄê ]", 2, 0);
1094 prt("[ Play Record ]", 2, 0);
1098 /* Give some choices */
1100 prt("(1) µÏ¿¤ò¸«¤ë", 4, 5);
1101 prt("(2) ʸ¾Ï¤òµÏ¿¤¹¤ë", 5, 5);
1102 prt("(3) ľÁ°¤ËÆþ¼êËô¤Ï´ÕÄꤷ¤¿¤â¤Î¤òµÏ¿¤¹¤ë", 6, 5);
1103 prt("(4) µÏ¿¤ò¾Ãµî¤¹¤ë", 7, 5);
1105 prt("(R) ¥×¥ì¥¤Æ°²è¤òµÏ¿¤¹¤ë/Ãæ»ß¤¹¤ë", 9, 5);
1107 prt("(1) Display your record", 4, 5);
1108 prt("(2) Add record", 5, 5);
1109 prt("(3) Record item you last get/identify", 6, 5);
1110 prt("(4) Delete your record", 7, 5);
1112 prt("(R) Record playing movie / or stop it", 9, 5);
1118 prt("¥³¥Þ¥ó¥É:", 18, 0);
1120 prt("Command: ", 18, 0);
1128 if (i == ESCAPE) break;
1133 do_cmd_disp_nikki();
1142 do_cmd_erase_nikki();
1146 prepare_movie_hooks();
1148 default: /* Unknown option */
1152 /* Flush messages */
1156 /* Restore the screen */
1161 * Hack -- redraw the screen
1163 * This command performs various low level updates, clears all the "extra"
1164 * windows, does a total redraw of the main window, and requests all of the
1165 * interesting updates and redraws that I can think of.
1167 * This command is also used to "instantiate" the results of the user
1168 * selecting various things, such as graphics mode, so it must call
1169 * the "TERM_XTRA_REACT" hook before redrawing the windows.
1171 void do_cmd_redraw(void)
1178 /* Hack -- react to changes */
1179 Term_xtra(TERM_XTRA_REACT, 0);
1182 /* Combine and Reorder the pack (later) */
1183 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1187 p_ptr->update |= (PU_TORCH);
1190 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
1192 /* Forget lite/view */
1193 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
1195 /* Update lite/view */
1196 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
1198 /* Update monsters */
1199 p_ptr->update |= (PU_MONSTERS);
1201 /* Redraw everything */
1202 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1205 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
1208 p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
1212 /* Hack -- update */
1215 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
1218 /* Redraw every window */
1219 for (j = 0; j < 8; j++)
1222 if (!angband_term[j]) continue;
1225 Term_activate(angband_term[j]);
1240 * Hack -- change name
1242 void do_cmd_change_name(void)
1251 /* Save the screen */
1259 /* Display the player */
1260 display_player(mode);
1265 display_player(mode);
1270 Term_putstr(2, 23, -1, TERM_WHITE,
1271 "['c'¤Ç̾Á°Êѹ¹, 'f'¤Ç¥Õ¥¡¥¤¥ë¤Ø½ñ½Ð, 'h'¤Ç¥â¡¼¥ÉÊѹ¹, ESC¤Ç½ªÎ»]");
1273 Term_putstr(2, 23, -1, TERM_WHITE,
1274 "['c' to change name, 'f' to file, 'h' to change mode, or ESC]");
1282 if (c == ESCAPE) break;
1289 /* Process the player name */
1290 process_player_name(FALSE);
1296 sprintf(tmp, "%s.txt", player_base);
1298 if (get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
1300 if (get_string("File name: ", tmp, 80))
1304 if (tmp[0] && (tmp[0] != ' '))
1306 file_character(tmp);
1323 /* Flush messages */
1327 /* Restore the screen */
1330 /* Redraw everything */
1331 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1338 * Recall the most recent message
1340 void do_cmd_message_one(void)
1342 /* Recall one message XXX XXX XXX */
1343 prt(format("> %s", message_str(0)), 0, 0);
1348 * Show previous messages to the user -BEN-
1350 * The screen format uses line 0 and 23 for headers and prompts,
1351 * skips line 1 and 22, and uses line 2 thru 21 for old messages.
1353 * This command shows you which commands you are viewing, and allows
1354 * you to "search" for strings in the recall.
1356 * Note that messages may be longer than 80 characters, but they are
1357 * displayed using "infinite" length, with a special sub-command to
1358 * "slide" the virtual display to the left or right.
1360 * Attempt to only hilite the matching portions of the string.
1362 void do_cmd_messages(int num_now)
1366 char shower_str[81];
1367 char finder_str[81];
1374 Term_get_size(&wid, &hgt);
1376 /* Number of message lines in a screen */
1377 num_lines = hgt - 4;
1380 strcpy(finder_str, "");
1383 strcpy(shower_str, "");
1385 /* Total messages */
1388 /* Start on first message */
1391 /* Save the screen */
1397 /* Process requests until done */
1403 /* Dump up to 20 lines of messages */
1404 for (j = 0; (j < num_lines) && (i + j < n); j++)
1406 cptr msg = message_str(i+j);
1408 /* Dump the messages, bottom to top */
1409 c_prt((i + j < num_now ? TERM_WHITE : TERM_SLATE), msg, num_lines + 1 - j, 0);
1411 /* Hilite "shower" */
1412 if (shower && shower[0])
1416 /* Display matches */
1417 while ((str = my_strstr(str, shower)) != NULL)
1419 int len = strlen(shower);
1421 /* Display the match */
1422 Term_putstr(str-msg, num_lines + 1 - j, len, TERM_YELLOW, shower);
1430 /* Erase remaining lines */
1431 for (; j < num_lines; j++)
1433 Term_erase(0, num_lines + 1 - j, 255);
1436 /* Display header XXX XXX XXX */
1439 prt(format("°ÊÁ°¤Î¥á¥Ã¥»¡¼¥¸ %d-%d Á´Éô¤Ç(%d)",
1440 i, i + j - 1, n), 0, 0);
1442 prt(format("Message Recall (%d-%d of %d)",
1443 i, i + j - 1, n), 0, 0);
1446 /* Display prompt (not very informative) */
1448 prt("[ 'p' ¤Ç¹¹¤Ë¸Å¤¤¤â¤Î, 'n' ¤Ç¹¹¤Ë¿·¤·¤¤¤â¤Î, '/' ¤Ç¸¡º÷, ESC ¤ÇÃæÃÇ ]", hgt - 1, 0);
1450 prt("[Press 'p' for older, 'n' for newer, ..., or ESCAPE]", hgt - 1, 0);
1454 skey = inkey_special(TRUE);
1456 /* Exit on Escape */
1457 if (skey == ESCAPE) break;
1459 /* Hack -- Save the old index */
1464 /* Hack -- handle show */
1468 prt("¶¯Ä´: ", hgt - 1, 0);
1470 prt("Show: ", hgt - 1, 0);
1473 /* Get a "shower" string, or continue */
1474 strcpy(back_str, shower_str);
1475 if (askfor(shower_str, 80))
1478 shower = shower_str[0] ? shower_str : NULL;
1480 else strcpy(shower_str, back_str);
1485 /* Hack -- handle find */
1493 prt("¸¡º÷: ", hgt - 1, 0);
1495 prt("Find: ", hgt - 1, 0);
1498 /* Get a "finder" string, or continue */
1499 strcpy(back_str, finder_str);
1500 if (!askfor(finder_str, 80))
1502 strcpy(finder_str, back_str);
1505 else if (!finder_str[0])
1507 shower = NULL; /* Stop showing */
1512 shower = finder_str;
1515 for (z = i + 1; z < n; z++)
1517 cptr msg = message_str(z);
1520 if (my_strstr(msg, finder_str))
1532 /* Recall 1 older message */
1534 /* Go to the oldest line */
1538 /* Recall 1 newer message */
1540 /* Go to the newest line */
1544 /* Recall 1 older message */
1549 /* Go older if legal */
1550 i = MIN(i + 1, n - num_lines);
1553 /* Recall 10 older messages */
1555 /* Go older if legal */
1556 i = MIN(i + 10, n - num_lines);
1559 /* Recall 20 older messages */
1564 /* Go older if legal */
1565 i = MIN(i + num_lines, n - num_lines);
1568 /* Recall 20 newer messages */
1572 /* Go newer (if able) */
1573 i = MAX(0, i - num_lines);
1576 /* Recall 10 newer messages */
1578 /* Go newer (if able) */
1582 /* Recall 1 newer messages */
1585 /* Go newer (if able) */
1590 /* Hack -- Error of some kind */
1594 /* Restore the screen */
1601 * Number of cheating options
1608 static option_type cheat_info[CHEAT_MAX] =
1610 { &cheat_peek, FALSE, 255, 0x01, 0x00,
1612 "cheat_peek", "¥¢¥¤¥Æ¥à¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë"
1614 "cheat_peek", "Peek into object creation"
1618 { &cheat_hear, FALSE, 255, 0x02, 0x00,
1620 "cheat_hear", "¥â¥ó¥¹¥¿¡¼¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë"
1622 "cheat_hear", "Peek into monster creation"
1626 { &cheat_room, FALSE, 255, 0x04, 0x00,
1628 "cheat_room", "¥À¥ó¥¸¥ç¥ó¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë"
1630 "cheat_room", "Peek into dungeon creation"
1634 { &cheat_xtra, FALSE, 255, 0x08, 0x00,
1636 "cheat_xtra", "¤½¤Î¾¤Î»ö¤ò¤Î¤¾¤¸«¤ë"
1638 "cheat_xtra", "Peek into something else"
1642 { &cheat_know, FALSE, 255, 0x10, 0x00,
1644 "cheat_know", "´°Á´¤Ê¥â¥ó¥¹¥¿¡¼¤Î»×¤¤½Ð¤òÃΤë"
1646 "cheat_know", "Know complete monster info"
1650 { &cheat_live, FALSE, 255, 0x20, 0x00,
1652 "cheat_live", "»à¤ò²óÈò¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë"
1654 "cheat_live", "Allow player to avoid death"
1658 { &cheat_save, FALSE, 255, 0x40, 0x00,
1660 "cheat_save", "»à¤ó¤À»þ¥»¡¼¥Ö¤¹¤ë¤«³Îǧ¤¹¤ë"
1662 "cheat_save", "Ask for saving death"
1668 * Interact with some options for cheating
1670 static void do_cmd_options_cheat(cptr info)
1674 int i, k = 0, n = CHEAT_MAX;
1682 /* Interact with the player */
1687 /* Prompt XXX XXX XXX */
1689 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê )", info);
1691 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1697 /* º¾µ½¥ª¥×¥·¥ç¥ó¤ò¤¦¤Ã¤«¤ê¤¤¤¸¤Ã¤Æ¤·¤Þ¤¦¿Í¤¬¤¤¤ë¤è¤¦¤Ê¤Î¤ÇÃí°Õ */
1698 prt(" << Ãí°Õ >>", 11, 0);
1699 prt(" º¾µ½¥ª¥×¥·¥ç¥ó¤ò°ìÅ٤ǤâÀßÄꤹ¤ë¤È¡¢¥¹¥³¥¢µÏ¿¤¬»Ä¤é¤Ê¤¯¤Ê¤ê¤Þ¤¹¡ª", 12, 0);
1700 prt(" ¸å¤Ë²ò½ü¤·¤Æ¤â¥À¥á¤Ç¤¹¤Î¤Ç¡¢¾¡Íø¼Ô¤òÌܻؤ¹Êý¤Ï¤³¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤¤", 13, 0);
1701 prt(" ¤¸¤é¤Ê¤¤¤è¤¦¤Ë¤·¤Æ²¼¤µ¤¤¡£", 14, 0);
1703 /* Display the options */
1704 for (i = 0; i < n; i++)
1706 byte a = TERM_WHITE;
1708 /* Color current option */
1709 if (i == k) a = TERM_L_BLUE;
1711 /* Display the option text */
1712 sprintf(buf, "%-48s: %s (%s)",
1713 cheat_info[i].o_desc,
1715 (*cheat_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1717 (*cheat_info[i].o_var ? "yes" : "no "),
1720 cheat_info[i].o_text);
1721 c_prt(a, buf, i + 2, 0);
1724 /* Hilite current option */
1725 move_cursor(k + 2, 50);
1731 * HACK - Try to translate the key into a direction
1732 * to allow using the roguelike keys for navigation.
1734 dir = get_keymap_dir(ch);
1735 if ((dir == 2) || (dir == 4) || (dir == 6) || (dir == 8))
1749 k = (n + k - 1) % n;
1768 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "º¾µ½¥ª¥×¥·¥ç¥ó¤òON¤Ë¤·¤Æ¡¢¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
1770 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use cheating options.");
1772 p_ptr->noscore |= (cheat_info[k].o_set * 256 + cheat_info[k].o_bit);
1773 (*cheat_info[k].o_var) = TRUE;
1782 (*cheat_info[k].o_var) = FALSE;
1790 strnfmt(buf, sizeof(buf), "joption.txt#%s", cheat_info[k].o_text);
1792 strnfmt(buf, sizeof(buf), "option.txt#%s", cheat_info[k].o_text);
1794 /* Peruse the help file */
1795 (void)show_file(TRUE, buf, NULL, 0, 0);
1811 static option_type autosave_info[2] =
1813 { &autosave_l, FALSE, 255, 0x01, 0x00,
1815 "autosave_l", "¿·¤·¤¤³¬¤ËÆþ¤ëÅ٤˼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1817 "autosave_l", "Autosave when entering new levels" },
1821 { &autosave_t, FALSE, 255, 0x02, 0x00,
1823 "autosave_t", "°ìÄ꥿¡¼¥óËè¤Ë¼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1825 "autosave_t", "Timed autosave" },
1831 static s16b toggle_frequency(s16b current)
1836 case 50: return 100;
1837 case 100: return 250;
1838 case 250: return 500;
1839 case 500: return 1000;
1840 case 1000: return 2500;
1841 case 2500: return 5000;
1842 case 5000: return 10000;
1843 case 10000: return 25000;
1850 * Interact with some options for cheating
1852 static void do_cmd_options_autosave(cptr info)
1856 int i, k = 0, n = 2;
1864 /* Interact with the player */
1867 /* Prompt XXX XXX XXX */
1869 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, F ¤ÇÉÑÅÙ¤òÆþÎÏ, ESC ¤Ç·èÄê ) ", info);
1871 sprintf(buf, "%s (RET to advance, y/n to set, 'F' for frequency, ESC to accept) ", info);
1876 /* Display the options */
1877 for (i = 0; i < n; i++)
1879 byte a = TERM_WHITE;
1881 /* Color current option */
1882 if (i == k) a = TERM_L_BLUE;
1884 /* Display the option text */
1885 sprintf(buf, "%-48s: %s (%s)",
1886 autosave_info[i].o_desc,
1888 (*autosave_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1890 (*autosave_info[i].o_var ? "yes" : "no "),
1893 autosave_info[i].o_text);
1894 c_prt(a, buf, i + 2, 0);
1898 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè", autosave_freq), 5, 0);
1900 prt(format("Timed autosave frequency: every %d turns", autosave_freq), 5, 0);
1905 /* Hilite current option */
1906 move_cursor(k + 2, 50);
1922 k = (n + k - 1) % n;
1940 (*autosave_info[k].o_var) = TRUE;
1949 (*autosave_info[k].o_var) = FALSE;
1957 autosave_freq = toggle_frequency(autosave_freq);
1959 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè",
1960 autosave_freq), 5, 0);
1962 prt(format("Timed autosave frequency: every %d turns",
1963 autosave_freq), 5, 0);
1971 (void)show_file(TRUE, "joption.txt#Autosave", NULL, 0, 0);
1973 (void)show_file(TRUE, "option.txt#Autosave", NULL, 0, 0);
1992 * Interact with some options
1994 void do_cmd_options_aux(int page, cptr info)
1997 int i, k = 0, n = 0, l;
2000 bool browse_only = (page == OPT_PAGE_BIRTH) && character_generated &&
2001 (!p_ptr->wizard || !allow_debug_opts);
2004 /* Lookup the options */
2005 for (i = 0; i < 24; i++) opt[i] = 0;
2007 /* Scan the options */
2008 for (i = 0; option_info[i].o_desc; i++)
2010 /* Notice options on this "page" */
2011 if (option_info[i].o_page == page) opt[n++] = i;
2018 /* Interact with the player */
2023 /* Prompt XXX XXX XXX */
2025 sprintf(buf, "%s (¥ê¥¿¡¼¥ó:¼¡, %sESC:½ªÎ», ?:¥Ø¥ë¥×) ", info, browse_only ? "" : "y/n:Êѹ¹, ");
2027 sprintf(buf, "%s (RET:next, %s, ?:help) ", info, browse_only ? "ESC:exit" : "y/n:change, ESC:accept");
2033 /* HACK -- description for easy-auto-destroy options */
2035 if (page == OPT_PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢´Ê°×¼«Æ°Ç˲õ¤ò»ÈÍѤ¹¤ë¤È¤¤Î¤ß͸ú", 6, 6);
2037 if (page == OPT_PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "Following options will protect items from easy auto-destroyer.", 6, 3);
2040 /* Display the options */
2041 for (i = 0; i < n; i++)
2043 byte a = TERM_WHITE;
2045 /* Color current option */
2046 if (i == k) a = TERM_L_BLUE;
2048 /* Display the option text */
2049 sprintf(buf, "%-48s: %s (%.19s)",
2050 option_info[opt[i]].o_desc,
2052 (*option_info[opt[i]].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
2054 (*option_info[opt[i]].o_var ? "yes" : "no "),
2057 option_info[opt[i]].o_text);
2058 if ((page == OPT_PAGE_AUTODESTROY) && i > 2) c_prt(a, buf, i + 5, 0);
2059 else c_prt(a, buf, i + 2, 0);
2062 if ((page == OPT_PAGE_AUTODESTROY) && (k > 2)) l = 3;
2065 /* Hilite current option */
2066 move_cursor(k + 2 + l, 50);
2072 * HACK - Try to translate the key into a direction
2073 * to allow using the roguelike keys for navigation.
2075 dir = get_keymap_dir(ch);
2076 if ((dir == 2) || (dir == 4) || (dir == 6) || (dir == 8))
2090 k = (n + k - 1) % n;
2107 if (browse_only) break;
2108 (*option_info[opt[k]].o_var) = TRUE;
2117 if (browse_only) break;
2118 (*option_info[opt[k]].o_var) = FALSE;
2126 if (!browse_only) (*option_info[opt[k]].o_var) = !(*option_info[opt[k]].o_var);
2133 strnfmt(buf, sizeof(buf), "joption.txt#%s", option_info[opt[k]].o_text);
2135 strnfmt(buf, sizeof(buf), "option.txt#%s", option_info[opt[k]].o_text);
2137 /* Peruse the help file */
2138 (void)show_file(TRUE, buf, NULL, 0, 0);
2155 * Modify the "window" options
2157 static void do_cmd_options_win(void)
2171 /* Memorize old flags */
2172 for (j = 0; j < 8; j++)
2174 /* Acquire current flags */
2175 old_flag[j] = window_flag[j];
2185 /* Prompt XXX XXX XXX */
2187 prt("¥¦¥£¥ó¥É¥¦¡¦¥Õ¥é¥° (<Êý¸þ>¤Ç°ÜÆ°, t¤Ç¥Á¥§¥ó¥¸, y/n ¤Ç¥»¥Ã¥È, ESC)", 0, 0);
2189 prt("Window Flags (<dir>, t, y, n, ESC) ", 0, 0);
2193 /* Display the windows */
2194 for (j = 0; j < 8; j++)
2196 byte a = TERM_WHITE;
2198 cptr s = angband_term_name[j];
2201 if (j == x) a = TERM_L_BLUE;
2203 /* Window name, staggered, centered */
2204 Term_putstr(35 + j * 5 - strlen(s) / 2, 2 + j % 2, -1, a, s);
2207 /* Display the options */
2208 for (i = 0; i < 16; i++)
2210 byte a = TERM_WHITE;
2212 cptr str = window_flag_desc[i];
2215 if (i == y) a = TERM_L_BLUE;
2219 if (!str) str = "(̤»ÈÍÑ)";
2221 if (!str) str = "(Unused option)";
2226 Term_putstr(0, i + 5, -1, a, str);
2228 /* Display the windows */
2229 for (j = 0; j < 8; j++)
2231 byte a = TERM_WHITE;
2236 if ((i == y) && (j == x)) a = TERM_L_BLUE;
2239 if (window_flag[j] & (1L << i)) c = 'X';
2242 Term_putch(35 + j * 5, i + 5, a, c);
2247 Term_gotoxy(35 + x * 5, y + 5);
2265 for (j = 0; j < 8; j++)
2267 window_flag[j] &= ~(1L << y);
2271 for (i = 0; i < 16; i++)
2273 window_flag[x] &= ~(1L << i);
2286 window_flag[x] |= (1L << y);
2294 window_flag[x] &= ~(1L << y);
2301 (void)show_file(TRUE, "joption.txt#Window", NULL, 0, 0);
2303 (void)show_file(TRUE, "option.txt#Window", NULL, 0, 0);
2313 d = get_keymap_dir(ch);
2315 x = (x + ddx[d] + 8) % 8;
2316 y = (y + ddy[d] + 16) % 16;
2323 /* Notice changes */
2324 for (j = 0; j < 8; j++)
2329 if (!angband_term[j]) continue;
2331 /* Ignore non-changes */
2332 if (window_flag[j] == old_flag[j]) continue;
2335 Term_activate(angband_term[j]);
2358 option_fields[OPT_NUM] =
2361 { '1', " ¥¡¼ÆþÎÏ ¥ª¥×¥·¥ç¥ó", 3 },
2362 { '2', " ¥Þ¥Ã¥×²èÌÌ ¥ª¥×¥·¥ç¥ó", 4 },
2363 { '3', " ¥Æ¥¥¹¥Èɽ¼¨ ¥ª¥×¥·¥ç¥ó", 5 },
2364 { '4', " ¥²¡¼¥à¥×¥ì¥¤ ¥ª¥×¥·¥ç¥ó", 6 },
2365 { '5', " ¹ÔÆ°Ãæ»ß´Ø·¸ ¥ª¥×¥·¥ç¥ó", 7 },
2366 { '6', " ´Ê°×¼«Æ°Ç˲õ ¥ª¥×¥·¥ç¥ó", 8 },
2367 { 'r', " ¥×¥ì¥¤µÏ¿ ¥ª¥×¥·¥ç¥ó", 9 },
2369 { 'p', "¼«Æ°½¦¤¤¥¨¥Ç¥£¥¿", 11 },
2370 { 'd', " ´ðËÜ¥¦¥§¥¤¥ÈÎÌ ", 12 },
2371 { 'h', "Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È", 13 },
2372 { 'm', " ÄãËâÎÏ¿§ïçÃÍ ", 14 },
2373 { 'a', " ¼«Æ°¥»¡¼¥Ö ¥ª¥×¥·¥ç¥ó", 15 },
2374 { 'w', "¥¦¥¤¥ó¥É¥¦¥Õ¥é¥°", 16 },
2376 { 'b', " ½é´ü ¥ª¥×¥·¥ç¥ó (»²¾È¤Î¤ß)", 18 },
2377 { 'c', " º¾µ½ ¥ª¥×¥·¥ç¥ó", 19 },
2379 { '1', "Input Options", 3 },
2380 { '2', "Map Screen Options", 4 },
2381 { '3', "Text Display Options", 5 },
2382 { '4', "Game-Play Options", 6 },
2383 { '5', "Disturbance Options", 7 },
2384 { '6', "Easy Auto-Destroyer Options", 8 },
2385 { 'r', "Play record Options", 9 },
2387 { 'p', "Auto-picker/destroyer editor", 11 },
2388 { 'd', "Base Delay Factor", 12 },
2389 { 'h', "Hitpoint Warning", 13 },
2390 { 'm', "Mana Color Threshold", 14 },
2391 { 'a', "Autosave Options", 15 },
2392 { 'w', "Window Flags", 16 },
2394 { 'b', "Birth Options (Browse Only)", 18 },
2395 { 'c', "Cheat Options", 19 },
2401 * Set or unset various options.
2403 * The user must use the "Ctrl-R" command to "adapt" to changes
2404 * in any options which control "visual" aspects of the game.
2406 void do_cmd_options(void)
2412 /* Save the screen */
2420 /* Does not list cheat option when cheat option is off */
2421 if (!p_ptr->noscore && !allow_debug_opts) n--;
2426 /* Why are we here */
2428 prt("[ ¥ª¥×¥·¥ç¥ó¤ÎÀßÄê ]", 1, 0);
2430 prt("TinyAngband options", 1, 0);
2435 /* Give some choices */
2436 for (i = 0; i < n; i++)
2438 byte a = TERM_WHITE;
2439 if (i == y) a = TERM_L_BLUE;
2440 Term_putstr(5, option_fields[i].row, -1, a,
2441 format("(%c) %s", toupper(option_fields[i].key), option_fields[i].name));
2445 prt("<Êý¸þ>¤Ç°ÜÆ°, Enter¤Ç·èÄê, ESC¤Ç¥¥ã¥ó¥»¥ë, ?¤Ç¥Ø¥ë¥×: ", 21, 0);
2447 prt("Move to <dir>, Select to Enter, Cancel to ESC, ? to help: ", 21, 0);
2451 skey = inkey_special(TRUE);
2452 if (!(skey & SKEY_MASK)) k = (char)skey;
2456 if (k == ESCAPE) break;
2458 if (my_strchr("\n\r ", k))
2460 k = option_fields[y].key;
2464 for (i = 0; i < n; i++)
2466 if (tolower(k) == option_fields[i].key) break;
2469 /* Command is found */
2472 /* Hack -- browse help */
2473 if (k == '?') break;
2477 if (skey == SKEY_UP) d = 8;
2478 if (skey == SKEY_DOWN) d = 2;
2479 y = (y + ddy[d] + n) % n;
2484 if (k == ESCAPE) break;
2491 /* Process the general options */
2493 do_cmd_options_aux(OPT_PAGE_INPUT, "¥¡¼ÆþÎÏ¥ª¥×¥·¥ç¥ó");
2495 do_cmd_options_aux(OPT_PAGE_INPUT, "Input Options");
2502 /* Process the general options */
2504 do_cmd_options_aux(OPT_PAGE_MAPSCREEN, "¥Þ¥Ã¥×²èÌÌ¥ª¥×¥·¥ç¥ó");
2506 do_cmd_options_aux(OPT_PAGE_MAPSCREEN, "Map Screen Options");
2515 do_cmd_options_aux(OPT_PAGE_TEXT, "¥Æ¥¥¹¥Èɽ¼¨¥ª¥×¥·¥ç¥ó");
2517 do_cmd_options_aux(OPT_PAGE_TEXT, "Text Display Options");
2526 do_cmd_options_aux(OPT_PAGE_GAMEPLAY, "¥²¡¼¥à¥×¥ì¥¤¡¦¥ª¥×¥·¥ç¥ó");
2528 do_cmd_options_aux(OPT_PAGE_GAMEPLAY, "Game-Play Options");
2537 do_cmd_options_aux(OPT_PAGE_DISTURBANCE, "¹ÔÆ°Ãæ»ß´Ø·¸¤Î¥ª¥×¥·¥ç¥ó");
2539 do_cmd_options_aux(OPT_PAGE_DISTURBANCE, "Disturbance Options");
2548 do_cmd_options_aux(OPT_PAGE_AUTODESTROY, "´Ê°×¼«Æ°Ç˲õ¥ª¥×¥·¥ç¥ó");
2550 do_cmd_options_aux(OPT_PAGE_AUTODESTROY, "Easy Auto-Destroyer Options");
2555 /* Play-record Options */
2561 do_cmd_options_aux(OPT_PAGE_PLAYRECORD, "¥×¥ì¥¤µÏ¿¥ª¥×¥·¥ç¥ó");
2563 do_cmd_options_aux(OPT_PAGE_PLAYRECORD, "Play-record Options");
2574 do_cmd_options_aux(OPT_PAGE_BIRTH, (!p_ptr->wizard || !allow_debug_opts) ? "½é´ü¥ª¥×¥·¥ç¥ó(»²¾È¤Î¤ß)" : "½é´ü¥ª¥×¥·¥ç¥ó((*)¤Ï¥¹¥³¥¢¤Ë±Æ¶Á)");
2576 do_cmd_options_aux(OPT_PAGE_BIRTH, (!p_ptr->wizard || !allow_debug_opts) ? "Birth Options(browse only)" : "Birth Options((*)s effect score)");
2581 /* Cheating Options */
2584 if (!p_ptr->noscore && !allow_debug_opts)
2586 /* Cheat options are not permitted */
2593 do_cmd_options_cheat("º¾µ½»Õ¤Ï·è¤·¤Æ¾¡Íø¤Ç¤¤Ê¤¤¡ª");
2595 do_cmd_options_cheat("Cheaters never win");
2604 do_cmd_options_autosave("¼«Æ°¥»¡¼¥Ö");
2606 do_cmd_options_autosave("Autosave");
2616 do_cmd_options_win();
2617 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL |
2618 PW_PLAYER | PW_MESSAGE | PW_OVERHEAD |
2619 PW_MONSTER | PW_OBJECT | PW_SNAPSHOT |
2620 PW_BORG_1 | PW_BORG_2 | PW_DUNGEON |
2625 /* Auto-picker/destroyer editor */
2629 do_cmd_edit_autopick();
2633 /* Hack -- Delay Speed */
2640 prt("¥³¥Þ¥ó¥É: ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 19, 0);
2642 prt("Command: Base Delay Factor", 19, 0);
2645 /* Get a new value */
2648 int msec = delay_factor * delay_factor * delay_factor;
2650 prt(format("¸½ºß¤Î¥¦¥§¥¤¥È: %d (%d¥ß¥êÉÃ)",
2651 delay_factor, msec), 22, 0);
2653 prt(format("Current base delay factor: %d (%d msec)",
2654 delay_factor, msec), 22, 0);
2658 prt("¥¦¥§¥¤¥È (0-9) ESC¤Ç·èÄê: ", 20, 0);
2660 prt("Delay Factor (0-9 or ESC to accept): ", 20, 0);
2664 if (k == ESCAPE) break;
2668 (void)show_file(TRUE, "joption.txt#BaseDelay", NULL, 0, 0);
2670 (void)show_file(TRUE, "option.txt#BaseDelay", NULL, 0, 0);
2674 else if (isdigit(k)) delay_factor = D2I(k);
2681 /* Hack -- hitpoint warning factor */
2688 prt("¥³¥Þ¥ó¥É: Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 19, 0);
2690 prt("Command: Hitpoint Warning", 19, 0);
2693 /* Get a new value */
2697 prt(format("¸½ºß¤ÎÄã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð: %d0%%",
2698 hitpoint_warn), 22, 0);
2700 prt(format("Current hitpoint warning: %d0%%",
2701 hitpoint_warn), 22, 0);
2705 prt("Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð (0-9) ESC¤Ç·èÄê: ", 20, 0);
2707 prt("Hitpoint Warning (0-9 or ESC to accept): ", 20, 0);
2711 if (k == ESCAPE) break;
2715 (void)show_file(TRUE, "joption.txt#Hitpoint", NULL, 0, 0);
2717 (void)show_file(TRUE, "option.txt#Hitpoint", NULL, 0, 0);
2721 else if (isdigit(k)) hitpoint_warn = D2I(k);
2728 /* Hack -- mana color factor */
2735 prt("¥³¥Þ¥ó¥É: ÄãËâÎÏ¿§ïçÃÍ", 19, 0);
2737 prt("Command: Mana Color Threshold", 19, 0);
2740 /* Get a new value */
2744 prt(format("¸½ºß¤ÎÄãËâÎÏ¿§ïçÃÍ: %d0%%",
2747 prt(format("Current mana color threshold: %d0%%",
2752 prt("ÄãËâÎÏïçÃÍ (0-9) ESC¤Ç·èÄê: ", 20, 0);
2754 prt("Mana color Threshold (0-9 or ESC to accept): ", 20, 0);
2758 if (k == ESCAPE) break;
2762 (void)show_file(TRUE, "joption.txt#Manapoint", NULL, 0, 0);
2764 (void)show_file(TRUE, "option.txt#Manapoint", NULL, 0, 0);
2768 else if (isdigit(k)) mana_warn = D2I(k);
2777 (void)show_file(TRUE, "joption.txt", NULL, 0, 0);
2779 (void)show_file(TRUE, "option.txt", NULL, 0, 0);
2784 /* Unknown option */
2793 /* Flush messages */
2798 /* Restore the screen */
2801 /* Hack - Redraw equippy chars */
2802 p_ptr->redraw |= (PR_EQUIPPY);
2808 * Ask for a "user pref line" and process it
2810 * XXX XXX XXX Allow absolute file names?
2812 void do_cmd_pref(void)
2819 /* Ask for a "user pref command" */
2821 if (!get_string("ÀßÄêÊѹ¹¥³¥Þ¥ó¥É: ", buf, 80)) return;
2823 if (!get_string("Pref: ", buf, 80)) return;
2827 /* Process that pref command */
2828 (void)process_pref_file_command(buf);
2831 void do_cmd_reload_autopick(void)
2834 if (!get_check("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹¤«? ")) return;
2836 if (!get_check("Reload auto-pick preference file? ")) return;
2839 /* Load the file with messages */
2840 autopick_load_pref(TRUE);
2846 * Hack -- append all current macros to the given file
2848 static errr macro_dump(cptr fname)
2850 static cptr mark = "Macro Dump";
2856 /* Build the filename */
2857 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
2859 /* File type is "TEXT" */
2860 FILE_TYPE(FILE_TYPE_TEXT);
2862 /* Append to the file */
2863 if (!open_auto_dump(buf, mark)) return (-1);
2867 auto_dump_printf("\n# ¼«Æ°¥Þ¥¯¥í¥»¡¼¥Ö\n\n");
2869 auto_dump_printf("\n# Automatic macro dump\n\n");
2873 for (i = 0; i < macro__num; i++)
2875 /* Extract the action */
2876 ascii_to_text(buf, macro__act[i]);
2878 /* Dump the macro */
2879 auto_dump_printf("A:%s\n", buf);
2881 /* Extract the action */
2882 ascii_to_text(buf, macro__pat[i]);
2884 /* Dump normal macros */
2885 auto_dump_printf("P:%s\n", buf);
2888 auto_dump_printf("\n");
2900 * Hack -- ask for a "trigger" (see below)
2902 * Note the complex use of the "inkey()" function from "util.c".
2904 * Note that both "flush()" calls are extremely important.
2906 static void do_cmd_macro_aux(char *buf)
2916 /* Do not process macros */
2922 /* Read the pattern */
2928 /* Do not process macros */
2931 /* Do not wait for keys */
2934 /* Attempt to read a key */
2945 /* Convert the trigger */
2946 ascii_to_text(tmp, buf);
2948 /* Hack -- display the trigger */
2949 Term_addstr(-1, TERM_WHITE, tmp);
2956 * Hack -- ask for a keymap "trigger" (see below)
2958 * Note that both "flush()" calls are extremely important. This may
2959 * no longer be true, since "util.c" is much simpler now. XXX XXX XXX
2961 static void do_cmd_macro_aux_keymap(char *buf)
2975 /* Convert to ascii */
2976 ascii_to_text(tmp, buf);
2978 /* Hack -- display the trigger */
2979 Term_addstr(-1, TERM_WHITE, tmp);
2988 * Hack -- append all keymaps to the given file
2990 static errr keymap_dump(cptr fname)
2992 static cptr mark = "Keymap Dump";
3001 if (rogue_like_commands)
3003 mode = KEYMAP_MODE_ROGUE;
3009 mode = KEYMAP_MODE_ORIG;
3013 /* Build the filename */
3014 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
3016 /* File type is "TEXT" */
3017 FILE_TYPE(FILE_TYPE_TEXT);
3019 /* Append to the file */
3020 if (!open_auto_dump(buf, mark)) return -1;
3024 auto_dump_printf("\n# ¼«Æ°¥¡¼ÇÛÃÖ¥»¡¼¥Ö\n\n");
3026 auto_dump_printf("\n# Automatic keymap dump\n\n");
3030 for (i = 0; i < 256; i++)
3034 /* Loop up the keymap */
3035 act = keymap_act[mode][i];
3037 /* Skip empty keymaps */
3040 /* Encode the key */
3043 ascii_to_text(key, buf);
3045 /* Encode the action */
3046 ascii_to_text(buf, act);
3048 /* Dump the macro */
3049 auto_dump_printf("A:%s\n", buf);
3050 auto_dump_printf("C:%d:%s\n", mode, key);
3063 * Interact with "macros"
3065 * Note that the macro "action" must be defined before the trigger.
3067 * Could use some helpful instructions on this page. XXX XXX XXX
3069 void do_cmd_macros(void)
3081 if (rogue_like_commands)
3083 mode = KEYMAP_MODE_ROGUE;
3089 mode = KEYMAP_MODE_ORIG;
3092 /* File type is "TEXT" */
3093 FILE_TYPE(FILE_TYPE_TEXT);
3100 /* Process requests until done */
3108 prt("[ ¥Þ¥¯¥í¤ÎÀßÄê ]", 2, 0);
3110 prt("Interact with Macros", 2, 0);
3115 /* Describe that action */
3117 prt("¥Þ¥¯¥í¹ÔÆ°¤¬(¤â¤·¤¢¤ì¤Ð)²¼¤Ëɽ¼¨¤µ¤ì¤Þ¤¹:", 20, 0);
3119 prt("Current action (if any) shown below:", 20, 0);
3123 /* Analyze the current action */
3124 ascii_to_text(buf, macro__buf);
3126 /* Display the current action */
3132 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
3134 prt("(1) Load a user pref file", 4, 5);
3139 prt("(2) ¥Õ¥¡¥¤¥ë¤Ë¥Þ¥¯¥í¤òÄɲÃ", 5, 5);
3140 prt("(3) ¥Þ¥¯¥í¤Î³Îǧ", 6, 5);
3141 prt("(4) ¥Þ¥¯¥í¤ÎºîÀ®", 7, 5);
3142 prt("(5) ¥Þ¥¯¥í¤Îºï½ü", 8, 5);
3143 prt("(6) ¥Õ¥¡¥¤¥ë¤Ë¥¡¼ÇÛÃÖ¤òÄɲÃ", 9, 5);
3144 prt("(7) ¥¡¼ÇÛÃ֤γÎǧ", 10, 5);
3145 prt("(8) ¥¡¼ÇÛÃ֤κîÀ®", 11, 5);
3146 prt("(9) ¥¡¼ÇÛÃ֤κï½ü", 12, 5);
3147 prt("(0) ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 13, 5);
3149 prt("(2) Append macros to a file", 5, 5);
3150 prt("(3) Query a macro", 6, 5);
3151 prt("(4) Create a macro", 7, 5);
3152 prt("(5) Remove a macro", 8, 5);
3153 prt("(6) Append keymaps to a file", 9, 5);
3154 prt("(7) Query a keymap", 10, 5);
3155 prt("(8) Create a keymap", 11, 5);
3156 prt("(9) Remove a keymap", 12, 5);
3157 prt("(0) Enter a new action", 13, 5);
3160 #endif /* ALLOW_MACROS */
3164 prt("¥³¥Þ¥ó¥É: ", 16, 0);
3166 prt("Command: ", 16, 0);
3174 if (i == ESCAPE) break;
3176 /* Load a 'macro' file */
3183 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 16, 0);
3185 prt("Command: Load a user pref file", 16, 0);
3191 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3193 prt("File: ", 18, 0);
3197 /* Default filename */
3198 sprintf(tmp, "%s.prf", player_base);
3200 /* Ask for a file */
3201 if (!askfor(tmp, 80)) continue;
3203 /* Process the given filename */
3204 err = process_pref_file(tmp);
3208 msg_format("ɸ½à¤ÎÀßÄê¥Õ¥¡¥¤¥ë'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
3210 msg_format("Loaded default '%s'.", tmp);
3217 msg_format("'%s'¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡ª", tmp);
3219 msg_format("Failed to load '%s'!");
3225 msg_format("'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
3227 msg_format("Loaded '%s'.", tmp);
3239 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
3241 prt("Command: Append macros to a file", 16, 0);
3247 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3249 prt("File: ", 18, 0);
3253 /* Default filename */
3254 sprintf(tmp, "%s.prf", player_base);
3256 /* Ask for a file */
3257 if (!askfor(tmp, 80)) continue;
3259 /* Dump the macros */
3260 (void)macro_dump(tmp);
3264 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
3266 msg_print("Appended macros.");
3278 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Î³Îǧ", 16, 0);
3280 prt("Command: Query a macro", 16, 0);
3286 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3288 prt("Trigger: ", 18, 0);
3292 /* Get a macro trigger */
3293 do_cmd_macro_aux(buf);
3295 /* Acquire action */
3296 k = macro_find_exact(buf);
3303 msg_print("¤½¤Î¥¡¼¤Ë¤Ï¥Þ¥¯¥í¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
3305 msg_print("Found no macro.");
3313 /* Obtain the action */
3314 strcpy(macro__buf, macro__act[k]);
3316 /* Analyze the current action */
3317 ascii_to_text(buf, macro__buf);
3319 /* Display the current action */
3324 msg_print("¥Þ¥¯¥í¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
3326 msg_print("Found a macro.");
3332 /* Create a macro */
3337 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ÎºîÀ®", 16, 0);
3339 prt("Command: Create a macro", 16, 0);
3345 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3347 prt("Trigger: ", 18, 0);
3351 /* Get a macro trigger */
3352 do_cmd_macro_aux(buf);
3359 c_prt(TERM_L_RED, "¥«¡¼¥½¥ë¥¡¼¤Îº¸±¦¤Ç¥«¡¼¥½¥ë°ÌÃÖ¤ò°ÜÆ°¡£Backspace¤«Delete¤Ç°ìʸ»úºï½ü¡£", 22, 0);
3361 c_prt(TERM_L_RED, "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char.", 22, 0);
3366 prt("¥Þ¥¯¥í¹ÔÆ°: ", 20, 0);
3368 prt("Action: ", 20, 0);
3372 /* Convert to text */
3373 ascii_to_text(tmp, macro__buf);
3375 /* Get an encoded action */
3376 if (askfor(tmp, 80))
3378 /* Convert to ascii */
3379 text_to_ascii(macro__buf, tmp);
3381 /* Link the macro */
3382 macro_add(buf, macro__buf);
3386 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
3388 msg_print("Added a macro.");
3394 /* Remove a macro */
3399 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Îºï½ü", 16, 0);
3401 prt("Command: Remove a macro", 16, 0);
3407 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3409 prt("Trigger: ", 18, 0);
3413 /* Get a macro trigger */
3414 do_cmd_macro_aux(buf);
3416 /* Link the macro */
3417 macro_add(buf, buf);
3421 msg_print("¥Þ¥¯¥í¤òºï½ü¤·¤Þ¤·¤¿¡£");
3423 msg_print("Removed a macro.");
3433 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃÖ¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
3435 prt("Command: Append keymaps to a file", 16, 0);
3441 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3443 prt("File: ", 18, 0);
3447 /* Default filename */
3448 sprintf(tmp, "%s.prf", player_base);
3450 /* Ask for a file */
3451 if (!askfor(tmp, 80)) continue;
3453 /* Dump the macros */
3454 (void)keymap_dump(tmp);
3458 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3460 msg_print("Appended keymaps.");
3465 /* Query a keymap */
3472 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤γÎǧ", 16, 0);
3474 prt("Command: Query a keymap", 16, 0);
3480 prt("²¡¤¹¥¡¼: ", 18, 0);
3482 prt("Keypress: ", 18, 0);
3486 /* Get a keymap trigger */
3487 do_cmd_macro_aux_keymap(buf);
3489 /* Look up the keymap */
3490 act = keymap_act[mode][(byte)(buf[0])];
3497 msg_print("¥¡¼ÇÛÃÖ¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
3499 msg_print("Found no keymap.");
3507 /* Obtain the action */
3508 strcpy(macro__buf, act);
3510 /* Analyze the current action */
3511 ascii_to_text(buf, macro__buf);
3513 /* Display the current action */
3518 msg_print("¥¡¼ÇÛÃÖ¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
3520 msg_print("Found a keymap.");
3526 /* Create a keymap */
3531 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κîÀ®", 16, 0);
3533 prt("Command: Create a keymap", 16, 0);
3539 prt("²¡¤¹¥¡¼: ", 18, 0);
3541 prt("Keypress: ", 18, 0);
3545 /* Get a keymap trigger */
3546 do_cmd_macro_aux_keymap(buf);
3553 c_prt(TERM_L_RED, "¥«¡¼¥½¥ë¥¡¼¤Îº¸±¦¤Ç¥«¡¼¥½¥ë°ÌÃÖ¤ò°ÜÆ°¡£Backspace¤«Delete¤Ç°ìʸ»úºï½ü¡£", 22, 0);
3555 c_prt(TERM_L_RED, "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char.", 22, 0);
3560 prt("¹ÔÆ°: ", 20, 0);
3562 prt("Action: ", 20, 0);
3566 /* Convert to text */
3567 ascii_to_text(tmp, macro__buf);
3569 /* Get an encoded action */
3570 if (askfor(tmp, 80))
3572 /* Convert to ascii */
3573 text_to_ascii(macro__buf, tmp);
3575 /* Free old keymap */
3576 string_free(keymap_act[mode][(byte)(buf[0])]);
3578 /* Make new keymap */
3579 keymap_act[mode][(byte)(buf[0])] = string_make(macro__buf);
3583 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3585 msg_print("Added a keymap.");
3591 /* Remove a keymap */
3596 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κï½ü", 16, 0);
3598 prt("Command: Remove a keymap", 16, 0);
3604 prt("²¡¤¹¥¡¼: ", 18, 0);
3606 prt("Keypress: ", 18, 0);
3610 /* Get a keymap trigger */
3611 do_cmd_macro_aux_keymap(buf);
3613 /* Free old keymap */
3614 string_free(keymap_act[mode][(byte)(buf[0])]);
3616 /* Make new keymap */
3617 keymap_act[mode][(byte)(buf[0])] = NULL;
3621 msg_print("¥¡¼ÇÛÃÖ¤òºï½ü¤·¤Þ¤·¤¿¡£");
3623 msg_print("Removed a keymap.");
3628 /* Enter a new action */
3633 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 16, 0);
3635 prt("Command: Enter a new action", 16, 0);
3643 c_prt(TERM_L_RED, "¥«¡¼¥½¥ë¥¡¼¤Îº¸±¦¤Ç¥«¡¼¥½¥ë°ÌÃÖ¤ò°ÜÆ°¡£Backspace¤«Delete¤Ç°ìʸ»úºï½ü¡£", 22, 0);
3645 c_prt(TERM_L_RED, "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char.", 22, 0);
3650 prt("¥Þ¥¯¥í¹ÔÆ°: ", 20, 0);
3652 prt("Action: ", 20, 0);
3655 /* Hack -- limit the value */
3658 /* Get an encoded action */
3659 if (!askfor(buf, 80)) continue;
3661 /* Extract an action */
3662 text_to_ascii(macro__buf, buf);
3665 #endif /* ALLOW_MACROS */
3674 /* Flush messages */
3683 static cptr lighting_level_str[F_LIT_MAX] =
3697 static bool cmd_visuals_aux(int i, int *num, int max)
3704 sprintf(str, "%d", *num);
3706 if (!get_string(format("Input new number(0-%d): ", max-1), str, 4))
3709 tmp = strtol(str, NULL, 0);
3710 if (tmp >= 0 && tmp < max)
3713 else if (isupper(i))
3714 *num = (*num + max - 1) % max;
3716 *num = (*num + 1) % max;
3721 static void print_visuals_menu(cptr choice_msg)
3724 prt("[ ²èÌÌɽ¼¨¤ÎÀßÄê ]", 1, 0);
3726 prt("Interact with Visuals", 1, 0);
3729 /* Give some choices */
3731 prt("(0) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 3, 5);
3733 prt("(0) Load a user pref file", 3, 5);
3736 #ifdef ALLOW_VISUALS
3738 prt("(1) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 4, 5);
3739 prt("(2) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
3740 prt("(3) ÃÏ·Á¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 6, 5);
3741 prt("(4) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë (¿ôÃÍÁàºî)", 7, 5);
3742 prt("(5) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë (¿ôÃÍÁàºî)", 8, 5);
3743 prt("(6) ÃÏ·Á¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë (¿ôÃÍÁàºî)", 9, 5);
3744 prt("(7) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë (¥·¥ó¥Ü¥ë¥¨¥Ç¥£¥¿)", 10, 5);
3745 prt("(8) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë (¥·¥ó¥Ü¥ë¥¨¥Ç¥£¥¿)", 11, 5);
3746 prt("(9) ÃÏ·Á¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë (¥·¥ó¥Ü¥ë¥¨¥Ç¥£¥¿)", 12, 5);
3748 prt("(1) Dump monster attr/chars", 4, 5);
3749 prt("(2) Dump object attr/chars", 5, 5);
3750 prt("(3) Dump feature attr/chars", 6, 5);
3751 prt("(4) Change monster attr/chars (numeric operation)", 7, 5);
3752 prt("(5) Change object attr/chars (numeric operation)", 8, 5);
3753 prt("(6) Change feature attr/chars (numeric operation)", 9, 5);
3754 prt("(7) Change monster attr/chars (visual mode)", 10, 5);
3755 prt("(8) Change object attr/chars (visual mode)", 11, 5);
3756 prt("(9) Change feature attr/chars (visual mode)", 12, 5);
3759 #endif /* ALLOW_VISUALS */
3762 prt("(R) ²èÌÌɽ¼¨ÊýË¡¤Î½é´ü²½", 13, 5);
3764 prt("(R) Reset visuals", 13, 5);
3769 prt(format("¥³¥Þ¥ó¥É: %s", choice_msg ? choice_msg : ""), 15, 0);
3771 prt(format("Command: %s", choice_msg ? choice_msg : ""), 15, 0);
3775 static void do_cmd_knowledge_monsters(bool *need_redraw, bool visual_only, int direct_r_idx);
3776 static void do_cmd_knowledge_objects(bool *need_redraw, bool visual_only, int direct_k_idx);
3777 static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, int direct_f_idx, int *lighting_level);
3780 * Interact with "visuals"
3782 void do_cmd_visuals(void)
3787 bool need_redraw = FALSE;
3788 const char *empty_symbol = "<< ? >>";
3790 if (use_bigtile) empty_symbol = "<< ?? >>";
3792 /* File type is "TEXT" */
3793 FILE_TYPE(FILE_TYPE_TEXT);
3795 /* Save the screen */
3798 /* Interact until done */
3804 /* Ask for a choice */
3805 print_visuals_menu(NULL);
3811 if (i == ESCAPE) break;
3815 /* Load a 'pref' file */
3819 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 15, 0);
3821 prt("Command: Load a user pref file", 15, 0);
3826 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3828 prt("File: ", 17, 0);
3831 /* Default filename */
3832 sprintf(tmp, "%s.prf", player_base);
3835 if (!askfor(tmp, 70)) continue;
3837 /* Process the given filename */
3838 (void)process_pref_file(tmp);
3843 #ifdef ALLOW_VISUALS
3845 /* Dump monster attr/chars */
3848 static cptr mark = "Monster attr/chars";
3852 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3854 prt("Command: Dump monster attr/chars", 15, 0);
3859 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3861 prt("File: ", 17, 0);
3864 /* Default filename */
3865 sprintf(tmp, "%s.prf", player_base);
3867 /* Get a filename */
3868 if (!askfor(tmp, 70)) continue;
3870 /* Build the filename */
3871 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3873 /* Append to the file */
3874 if (!open_auto_dump(buf, mark)) continue;
3878 auto_dump_printf("\n# ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3880 auto_dump_printf("\n# Monster attr/char definitions\n\n");
3884 for (i = 0; i < max_r_idx; i++)
3886 monster_race *r_ptr = &r_info[i];
3888 /* Skip non-entries */
3889 if (!r_ptr->name) continue;
3891 /* Dump a comment */
3892 auto_dump_printf("# %s\n", (r_name + r_ptr->name));
3894 /* Dump the monster attr/char info */
3895 auto_dump_printf("R:%d:0x%02X/0x%02X\n\n", i,
3896 (byte)(r_ptr->x_attr), (byte)(r_ptr->x_char));
3904 msg_print("¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3906 msg_print("Dumped monster attr/chars.");
3912 /* Dump object attr/chars */
3915 static cptr mark = "Object attr/chars";
3919 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3921 prt("Command: Dump object attr/chars", 15, 0);
3926 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3928 prt("File: ", 17, 0);
3931 /* Default filename */
3932 sprintf(tmp, "%s.prf", player_base);
3934 /* Get a filename */
3935 if (!askfor(tmp, 70)) continue;
3937 /* Build the filename */
3938 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3940 /* Append to the file */
3941 if (!open_auto_dump(buf, mark)) continue;
3945 auto_dump_printf("\n# ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3947 auto_dump_printf("\n# Object attr/char definitions\n\n");
3951 for (i = 0; i < max_k_idx; i++)
3954 object_kind *k_ptr = &k_info[i];
3956 /* Skip non-entries */
3957 if (!k_ptr->name) continue;
3962 strip_name(o_name, i);
3968 /* Prepare dummy object */
3969 object_prep(&forge, i);
3971 /* Get un-shuffled flavor name */
3972 object_desc(o_name, &forge, OD_FORCE_FLAVOR);
3975 /* Dump a comment */
3976 auto_dump_printf("# %s\n", o_name);
3978 /* Dump the object attr/char info */
3979 auto_dump_printf("K:%d:0x%02X/0x%02X\n\n", i,
3980 (byte)(k_ptr->x_attr), (byte)(k_ptr->x_char));
3988 msg_print("¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3990 msg_print("Dumped object attr/chars.");
3996 /* Dump feature attr/chars */
3999 static cptr mark = "Feature attr/chars";
4003 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
4005 prt("Command: Dump feature attr/chars", 15, 0);
4010 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
4012 prt("File: ", 17, 0);
4015 /* Default filename */
4016 sprintf(tmp, "%s.prf", player_base);
4018 /* Get a filename */
4019 if (!askfor(tmp, 70)) continue;
4021 /* Build the filename */
4022 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
4024 /* Append to the file */
4025 if (!open_auto_dump(buf, mark)) continue;
4029 auto_dump_printf("\n# ÃÏ·Á¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
4031 auto_dump_printf("\n# Feature attr/char definitions\n\n");
4035 for (i = 0; i < max_f_idx; i++)
4037 feature_type *f_ptr = &f_info[i];
4039 /* Skip non-entries */
4040 if (!f_ptr->name) continue;
4042 /* Skip mimiccing features */
4043 if (f_ptr->mimic != i) continue;
4045 /* Dump a comment */
4046 auto_dump_printf("# %s\n", (f_name + f_ptr->name));
4048 /* Dump the feature attr/char info */
4049 auto_dump_printf("F:%d:0x%02X/0x%02X:0x%02X/0x%02X:0x%02X/0x%02X\n\n", i,
4050 (byte)(f_ptr->x_attr[F_LIT_STANDARD]), (byte)(f_ptr->x_char[F_LIT_STANDARD]),
4051 (byte)(f_ptr->x_attr[F_LIT_LITE]), (byte)(f_ptr->x_char[F_LIT_LITE]),
4052 (byte)(f_ptr->x_attr[F_LIT_DARK]), (byte)(f_ptr->x_char[F_LIT_DARK]));
4060 msg_print("ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
4062 msg_print("Dumped feature attr/chars.");
4068 /* Modify monster attr/chars (numeric operation) */
4072 static cptr choice_msg = "¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹";
4074 static cptr choice_msg = "Change monster attr/chars";
4079 prt(format("¥³¥Þ¥ó¥É: %s", choice_msg), 15, 0);
4081 prt(format("Command: %s", choice_msg), 15, 0);
4084 /* Hack -- query until done */
4087 monster_race *r_ptr = &r_info[r];
4091 byte da = r_ptr->d_attr;
4092 byte dc = r_ptr->d_char;
4093 byte ca = r_ptr->x_attr;
4094 byte cc = r_ptr->x_char;
4096 /* Label the object */
4098 Term_putstr(5, 17, -1, TERM_WHITE,
4099 format("¥â¥ó¥¹¥¿¡¼ = %d, ̾Á° = %-40.40s",
4100 r, (r_name + r_ptr->name)));
4102 Term_putstr(5, 17, -1, TERM_WHITE,
4103 format("Monster = %d, Name = %-40.40s",
4104 r, (r_name + r_ptr->name)));
4107 /* Label the Default values */
4109 Term_putstr(10, 19, -1, TERM_WHITE,
4110 format("½é´üÃÍ ¿§ / ʸ»ú = %3u / %3u", da, dc));
4112 Term_putstr(10, 19, -1, TERM_WHITE,
4113 format("Default attr/char = %3u / %3u", da, dc));
4116 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
4117 Term_queue_bigchar(43, 19, da, dc, 0, 0);
4119 /* Label the Current values */
4121 Term_putstr(10, 20, -1, TERM_WHITE,
4122 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3u / %3u", ca, cc));
4124 Term_putstr(10, 20, -1, TERM_WHITE,
4125 format("Current attr/char = %3u / %3u", ca, cc));
4128 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
4129 Term_queue_bigchar(43, 20, ca, cc, 0, 0);
4133 Term_putstr(0, 22, -1, TERM_WHITE,
4134 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C/v/V/^V): ");
4136 Term_putstr(0, 22, -1, TERM_WHITE,
4137 "Command (n/N/^N/a/A/^A/c/C/^C/v/V/^V): ");
4144 if (i == ESCAPE) break;
4146 if (iscntrl(i)) c = 'a' + i - KTRL('A');
4147 else if (isupper(i)) c = 'a' + i - 'A';
4157 if (!cmd_visuals_aux(i, &r, max_r_idx))
4163 while (!r_info[r].name);
4167 t = (int)r_ptr->x_attr;
4168 (void)cmd_visuals_aux(i, &t, 256);
4169 r_ptr->x_attr = (byte)t;
4173 t = (int)r_ptr->x_char;
4174 (void)cmd_visuals_aux(i, &t, 256);
4175 r_ptr->x_char = (byte)t;
4179 do_cmd_knowledge_monsters(&need_redraw, TRUE, r);
4183 print_visuals_menu(choice_msg);
4191 /* Modify object attr/chars (numeric operation) */
4195 static cptr choice_msg = "¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹";
4197 static cptr choice_msg = "Change object attr/chars";
4202 prt(format("¥³¥Þ¥ó¥É: %s", choice_msg), 15, 0);
4204 prt(format("Command: %s", choice_msg), 15, 0);
4207 /* Hack -- query until done */
4210 object_kind *k_ptr = &k_info[k];
4214 byte da = k_ptr->d_attr;
4215 byte dc = k_ptr->d_char;
4216 byte ca = k_ptr->x_attr;
4217 byte cc = k_ptr->x_char;
4219 /* Label the object */
4221 Term_putstr(5, 17, -1, TERM_WHITE,
4222 format("¥¢¥¤¥Æ¥à = %d, ̾Á° = %-40.40s",
4223 k, k_name + (!k_ptr->flavor ? k_ptr->name : k_ptr->flavor_name)));
4225 Term_putstr(5, 17, -1, TERM_WHITE,
4226 format("Object = %d, Name = %-40.40s",
4227 k, k_name + (!k_ptr->flavor ? k_ptr->name : k_ptr->flavor_name)));
4230 /* Label the Default values */
4232 Term_putstr(10, 19, -1, TERM_WHITE,
4233 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
4235 Term_putstr(10, 19, -1, TERM_WHITE,
4236 format("Default attr/char = %3d / %3d", da, dc));
4239 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
4240 Term_queue_bigchar(43, 19, da, dc, 0, 0);
4242 /* Label the Current values */
4244 Term_putstr(10, 20, -1, TERM_WHITE,
4245 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
4247 Term_putstr(10, 20, -1, TERM_WHITE,
4248 format("Current attr/char = %3d / %3d", ca, cc));
4251 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
4252 Term_queue_bigchar(43, 20, ca, cc, 0, 0);
4256 Term_putstr(0, 22, -1, TERM_WHITE,
4257 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C/v/V/^V): ");
4259 Term_putstr(0, 22, -1, TERM_WHITE,
4260 "Command (n/N/^N/a/A/^A/c/C/^C/v/V/^V): ");
4267 if (i == ESCAPE) break;
4269 if (iscntrl(i)) c = 'a' + i - KTRL('A');
4270 else if (isupper(i)) c = 'a' + i - 'A';
4280 if (!cmd_visuals_aux(i, &k, max_k_idx))
4286 while (!k_info[k].name);
4290 t = (int)k_ptr->x_attr;
4291 (void)cmd_visuals_aux(i, &t, 256);
4292 k_ptr->x_attr = (byte)t;
4296 t = (int)k_ptr->x_char;
4297 (void)cmd_visuals_aux(i, &t, 256);
4298 k_ptr->x_char = (byte)t;
4302 do_cmd_knowledge_objects(&need_redraw, TRUE, k);
4306 print_visuals_menu(choice_msg);
4314 /* Modify feature attr/chars (numeric operation) */
4318 static cptr choice_msg = "ÃÏ·Á¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹";
4320 static cptr choice_msg = "Change feature attr/chars";
4323 static int lighting_level = F_LIT_STANDARD;
4326 prt(format("¥³¥Þ¥ó¥É: %s", choice_msg), 15, 0);
4328 prt(format("Command: %s", choice_msg), 15, 0);
4331 /* Hack -- query until done */
4334 feature_type *f_ptr = &f_info[f];
4338 byte da = f_ptr->d_attr[lighting_level];
4339 byte dc = f_ptr->d_char[lighting_level];
4340 byte ca = f_ptr->x_attr[lighting_level];
4341 byte cc = f_ptr->x_char[lighting_level];
4343 /* Label the object */
4346 Term_putstr(5, 17, -1, TERM_WHITE,
4347 format("ÃÏ·Á = %d, ̾Á° = %s, ÌÀÅÙ = %s",
4348 f, (f_name + f_ptr->name), lighting_level_str[lighting_level]));
4350 Term_putstr(5, 17, -1, TERM_WHITE,
4351 format("Terrain = %d, Name = %s, Lighting = %s",
4352 f, (f_name + f_ptr->name), lighting_level_str[lighting_level]));
4355 /* Label the Default values */
4357 Term_putstr(10, 19, -1, TERM_WHITE,
4358 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
4360 Term_putstr(10, 19, -1, TERM_WHITE,
4361 format("Default attr/char = %3d / %3d", da, dc));
4364 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
4366 Term_queue_bigchar(43, 19, da, dc, 0, 0);
4368 /* Label the Current values */
4370 Term_putstr(10, 20, -1, TERM_WHITE,
4371 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
4373 Term_putstr(10, 20, -1, TERM_WHITE,
4374 format("Current attr/char = %3d / %3d", ca, cc));
4377 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
4378 Term_queue_bigchar(43, 20, ca, cc, 0, 0);
4382 Term_putstr(0, 22, -1, TERM_WHITE,
4383 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C/l/L/^L/d/D/^D/v/V/^V): ");
4385 Term_putstr(0, 22, -1, TERM_WHITE,
4386 "Command (n/N/^N/a/A/^A/c/C/^C/l/L/^L/d/D/^D/v/V/^V): ");
4393 if (i == ESCAPE) break;
4395 if (iscntrl(i)) c = 'a' + i - KTRL('A');
4396 else if (isupper(i)) c = 'a' + i - 'A';
4406 if (!cmd_visuals_aux(i, &f, max_f_idx))
4412 while (!f_info[f].name || (f_info[f].mimic != f));
4416 t = (int)f_ptr->x_attr[lighting_level];
4417 (void)cmd_visuals_aux(i, &t, 256);
4418 f_ptr->x_attr[lighting_level] = (byte)t;
4422 t = (int)f_ptr->x_char[lighting_level];
4423 (void)cmd_visuals_aux(i, &t, 256);
4424 f_ptr->x_char[lighting_level] = (byte)t;
4428 (void)cmd_visuals_aux(i, &lighting_level, F_LIT_MAX);
4431 apply_default_feat_lighting(f_ptr->x_attr, f_ptr->x_char);
4435 do_cmd_knowledge_features(&need_redraw, TRUE, f, &lighting_level);
4439 print_visuals_menu(choice_msg);
4447 /* Modify monster attr/chars (visual mode) */
4449 do_cmd_knowledge_monsters(&need_redraw, TRUE, -1);
4452 /* Modify object attr/chars (visual mode) */
4454 do_cmd_knowledge_objects(&need_redraw, TRUE, -1);
4457 /* Modify feature attr/chars (visual mode) */
4460 int lighting_level = F_LIT_STANDARD;
4461 do_cmd_knowledge_features(&need_redraw, TRUE, -1, &lighting_level);
4465 #endif /* ALLOW_VISUALS */
4475 msg_print("²èÌ̾å¤Î[¿§/ʸ»ú]¤ò½é´üÃͤ˥ꥻ¥Ã¥È¤·¤Þ¤·¤¿¡£");
4477 msg_print("Visual attr/char tables reset.");
4483 /* Unknown option */
4489 /* Flush messages */
4493 /* Restore the screen */
4496 if (need_redraw) do_cmd_redraw();
4501 * Interact with "colors"
4503 void do_cmd_colors(void)
4512 /* File type is "TEXT" */
4513 FILE_TYPE(FILE_TYPE_TEXT);
4516 /* Save the screen */
4520 /* Interact until done */
4526 /* Ask for a choice */
4528 prt("[ ¥«¥é¡¼¤ÎÀßÄê ]", 2, 0);
4530 prt("Interact with Colors", 2, 0);
4534 /* Give some choices */
4536 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
4538 prt("(1) Load a user pref file", 4, 5);
4543 prt("(2) ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
4544 prt("(3) ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤¹¤ë", 6, 5);
4546 prt("(2) Dump colors", 5, 5);
4547 prt("(3) Modify colors", 6, 5);
4554 prt("¥³¥Þ¥ó¥É: ", 8, 0);
4556 prt("Command: ", 8, 0);
4564 if (i == ESCAPE) break;
4566 /* Load a 'pref' file */
4571 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹", 8, 0);
4573 prt("Command: Load a user pref file", 8, 0);
4579 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4581 prt("File: ", 10, 0);
4586 sprintf(tmp, "%s.prf", player_base);
4589 if (!askfor(tmp, 70)) continue;
4591 /* Process the given filename */
4592 (void)process_pref_file(tmp);
4594 /* Mega-Hack -- react to changes */
4595 Term_xtra(TERM_XTRA_REACT, 0);
4597 /* Mega-Hack -- redraw */
4606 static cptr mark = "Colors";
4610 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 8, 0);
4612 prt("Command: Dump colors", 8, 0);
4618 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4620 prt("File: ", 10, 0);
4624 /* Default filename */
4625 sprintf(tmp, "%s.prf", player_base);
4627 /* Get a filename */
4628 if (!askfor(tmp, 70)) continue;
4630 /* Build the filename */
4631 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
4633 /* Append to the file */
4634 if (!open_auto_dump(buf, mark)) continue;
4638 auto_dump_printf("\n# ¥«¥é¡¼¤ÎÀßÄê\n\n");
4640 auto_dump_printf("\n# Color redefinitions\n\n");
4644 for (i = 0; i < 256; i++)
4646 int kv = angband_color_table[i][0];
4647 int rv = angband_color_table[i][1];
4648 int gv = angband_color_table[i][2];
4649 int bv = angband_color_table[i][3];
4654 cptr name = "unknown";
4658 /* Skip non-entries */
4659 if (!kv && !rv && !gv && !bv) continue;
4661 /* Extract the color name */
4662 if (i < 16) name = color_names[i];
4664 /* Dump a comment */
4666 auto_dump_printf("# ¥«¥é¡¼ '%s'\n", name);
4668 auto_dump_printf("# Color '%s'\n", name);
4671 /* Dump the monster attr/char info */
4672 auto_dump_printf("V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n",
4681 msg_print("¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
4683 msg_print("Dumped color redefinitions.");
4695 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤·¤Þ¤¹", 8, 0);
4697 prt("Command: Modify colors", 8, 0);
4701 /* Hack -- query until done */
4710 /* Exhibit the normal colors */
4711 for (j = 0; j < 16; j++)
4713 /* Exhibit this color */
4714 Term_putstr(j*4, 20, -1, a, "###");
4716 /* Exhibit all colors */
4717 Term_putstr(j*4, 22, -1, j, format("%3d", j));
4720 /* Describe the color */
4722 name = ((a < 16) ? color_names[a] : "̤ÄêµÁ");
4724 name = ((a < 16) ? color_names[a] : "undefined");
4728 /* Describe the color */
4730 Term_putstr(5, 10, -1, TERM_WHITE,
4731 format("¥«¥é¡¼ = %d, ̾Á° = %s", a, name));
4733 Term_putstr(5, 10, -1, TERM_WHITE,
4734 format("Color = %d, Name = %s", a, name));
4738 /* Label the Current values */
4739 Term_putstr(5, 12, -1, TERM_WHITE,
4740 format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x",
4741 angband_color_table[a][0],
4742 angband_color_table[a][1],
4743 angband_color_table[a][2],
4744 angband_color_table[a][3]));
4748 Term_putstr(0, 14, -1, TERM_WHITE,
4749 "¥³¥Þ¥ó¥É (n/N/k/K/r/R/g/G/b/B): ");
4751 Term_putstr(0, 14, -1, TERM_WHITE,
4752 "Command (n/N/k/K/r/R/g/G/b/B): ");
4760 if (i == ESCAPE) break;
4763 if (i == 'n') a = (byte)(a + 1);
4764 if (i == 'N') a = (byte)(a - 1);
4765 if (i == 'k') angband_color_table[a][0] = (byte)(angband_color_table[a][0] + 1);
4766 if (i == 'K') angband_color_table[a][0] = (byte)(angband_color_table[a][0] - 1);
4767 if (i == 'r') angband_color_table[a][1] = (byte)(angband_color_table[a][1] + 1);
4768 if (i == 'R') angband_color_table[a][1] = (byte)(angband_color_table[a][1] - 1);
4769 if (i == 'g') angband_color_table[a][2] = (byte)(angband_color_table[a][2] + 1);
4770 if (i == 'G') angband_color_table[a][2] = (byte)(angband_color_table[a][2] - 1);
4771 if (i == 'b') angband_color_table[a][3] = (byte)(angband_color_table[a][3] + 1);
4772 if (i == 'B') angband_color_table[a][3] = (byte)(angband_color_table[a][3] - 1);
4774 /* Hack -- react to changes */
4775 Term_xtra(TERM_XTRA_REACT, 0);
4777 /* Hack -- redraw */
4784 /* Unknown option */
4790 /* Flush messages */
4795 /* Restore the screen */
4801 * Note something in the message recall
4803 void do_cmd_note(void)
4812 if (!get_string("¥á¥â: ", buf, 60)) return;
4814 if (!get_string("Note: ", buf, 60)) return;
4818 /* Ignore empty notes */
4819 if (!buf[0] || (buf[0] == ' ')) return;
4821 /* Add the note to the message recall */
4823 msg_format("¥á¥â: %s", buf);
4825 msg_format("Note: %s", buf);
4832 * Mention the current version
4834 void do_cmd_version(void)
4839 msg_format("ÊѶòÈÚÅÜ(Hengband) %d.%d.%d",
4840 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4842 msg_format("You are playing Hengband %d.%d.%d.",
4843 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4850 * Array of feeling strings
4852 static cptr do_cmd_feeling_text[11] =
4855 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4857 "Looks like any other level.",
4861 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4863 "You feel there is something special about this level.",
4867 "¶²¤í¤·¤¤»à¤Î¸¸¤¬ÌܤËÉ⤫¤Ó¡¢µ¤À䤷¤½¤¦¤Ë¤Ê¤Ã¤¿¡ª",
4869 "You nearly faint as horrible visions of death fill your mind!",
4873 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4875 "This level looks very dangerous.",
4879 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4881 "You have a very bad feeling...",
4885 "°¤¤Í½´¶¤¬¤¹¤ë...",
4887 "You have a bad feeling...",
4893 "You feel nervous.",
4897 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4899 "You feel your luck is turning...",
4903 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4905 "You don't like the look of this place.",
4909 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4911 "This level looks reasonably safe.",
4915 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4917 "What a boring place..."
4922 static cptr do_cmd_feeling_text_combat[11] =
4925 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4927 "Looks like any other level.",
4931 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4933 "You feel there is something special about this level.",
4937 "º£Ìë¤â¤Þ¤¿¡¢Ã¯¤«¤¬Ì¿¤òÍî¤È¤¹...",
4939 "You nearly faint as horrible visions of death fill your mind!",
4943 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4945 "This level looks very dangerous.",
4949 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4951 "You have a very bad feeling...",
4955 "°¤¤Í½´¶¤¬¤¹¤ë...",
4957 "You have a bad feeling...",
4963 "You feel nervous.",
4967 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4969 "You feel your luck is turning...",
4973 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4975 "You don't like the look of this place.",
4979 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4981 "This level looks reasonably safe.",
4985 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4987 "What a boring place..."
4992 static cptr do_cmd_feeling_text_lucky[11] =
4995 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4996 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4997 "¤³¤Î³¬¤Ï¤³¤Î¾å¤Ê¤¯ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë¡£",
4998 "ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë...",
4999 "¤È¤Æ¤âÎɤ¤´¶¤¸¤¬¤¹¤ë...",
5000 "Îɤ¤´¶¤¸¤¬¤¹¤ë...",
5001 "¤Á¤ç¤Ã¤È¹¬±¿¤Ê´¶¤¸¤¬¤¹¤ë...",
5002 "¿¾¯¤Ï±¿¤¬¸þ¤¤¤Æ¤¤¿¤«...",
5003 "¸«¤¿´¶¤¸°¤¯¤Ï¤Ê¤¤...",
5004 "Á´Á³ÂÌÌܤȤ¤¤¦¤³¤È¤Ï¤Ê¤¤¤¬...",
5005 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
5007 "Looks like any other level.",
5008 "You feel there is something special about this level.",
5009 "You have a superb feeling about this level.",
5010 "You have an excellent feeling...",
5011 "You have a very good feeling...",
5012 "You have a good feeling...",
5013 "You feel strangely lucky...",
5014 "You feel your luck is turning...",
5015 "You like the look of this place...",
5016 "This level can't be all bad...",
5017 "What a boring place..."
5023 * Note that "feeling" is set to zero unless some time has passed.
5024 * Note that this is done when the level is GENERATED, not entered.
5026 void do_cmd_feeling(void)
5028 /* No useful feeling in quests */
5029 if (p_ptr->inside_quest && !random_quest_number(dun_level))
5032 msg_print("ŵ·¿Åª¤Ê¥¯¥¨¥¹¥È¤Î¥À¥ó¥¸¥ç¥ó¤Î¤è¤¦¤À¡£");
5034 msg_print("Looks like a typical quest level.");
5040 /* No useful feeling in town */
5041 else if (p_ptr->town_num && !dun_level)
5044 if (!strcmp(town[p_ptr->town_num].name, "¹ÓÌî"))
5046 if (!strcmp(town[p_ptr->town_num].name, "wilderness"))
5050 msg_print("²¿¤«¤¢¤ê¤½¤¦¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
5052 msg_print("Looks like a strange wilderness.");
5060 msg_print("ŵ·¿Åª¤ÊÄ®¤Î¤è¤¦¤À¡£");
5062 msg_print("Looks like a typical town.");
5069 /* No useful feeling in the wilderness */
5070 else if (!dun_level)
5073 msg_print("ŵ·¿Åª¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
5075 msg_print("Looks like a typical wilderness.");
5081 /* Display the feeling */
5082 if (p_ptr->muta3 & MUT3_GOOD_LUCK)
5083 msg_print(do_cmd_feeling_text_lucky[p_ptr->feeling]);
5084 else if (p_ptr->pseikaku == SEIKAKU_COMBAT ||
5085 inventory[INVEN_BOW].name1 == ART_CRIMSON)
5086 msg_print(do_cmd_feeling_text_combat[p_ptr->feeling]);
5088 msg_print(do_cmd_feeling_text[p_ptr->feeling]);
5094 * Description of each monster group.
5096 static cptr monster_group_text[] =
5099 "¥æ¥Ë¡¼¥¯", /* "Uniques" */
5100 "¾èÇϲÄǽ¤Ê¥â¥ó¥¹¥¿¡¼", /* "Riding" */
5101 "¾Þ¶â¼ó", /* "Wanted */
5102 "¥¢¥ó¥Ð¡¼¤Î²¦Â²", /* "Ambertite" */
5131 /* "¸ÅÂå¥É¥é¥´¥ó/¥ï¥¤¥¢¡¼¥à", */
5148 /* "¾åµé¥Ç¡¼¥â¥ó", */
5192 /* "Ancient Dragon/Wyrm", */
5201 "Multi-Headed Reptile",
5206 "Reptile/Amphibian",
5207 "Spider/Scorpion/Tick",
5209 /* "Major Demon", */
5226 * Symbols of monsters in each group. Note the "Uniques" group
5227 * is handled differently.
5229 static cptr monster_group_char[] =
5286 "!$&()+./=>?[\\]`{|~",
5296 * hook function to sort monsters by level
5298 static bool ang_sort_comp_monster_level(vptr u, vptr v, int a, int b)
5300 u16b *who = (u16b*)(u);
5305 monster_race *r_ptr1 = &r_info[w1];
5306 monster_race *r_ptr2 = &r_info[w2];
5311 if (r_ptr2->level > r_ptr1->level) return TRUE;
5312 if (r_ptr1->level > r_ptr2->level) return FALSE;
5314 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return TRUE;
5315 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return FALSE;
5320 * Build a list of monster indexes in the given group. Return the number
5321 * of monsters in the group.
5323 * mode & 0x01 : check for non-empty group
5324 * mode & 0x02 : visual operation only
5326 static int collect_monsters(int grp_cur, s16b mon_idx[], byte mode)
5331 /* Get a list of x_char in this group */
5332 cptr group_char = monster_group_char[grp_cur];
5334 /* XXX Hack -- Check if this is the "Uniques" group */
5335 bool grp_unique = (monster_group_char[grp_cur] == (char *) -1L);
5337 /* XXX Hack -- Check if this is the "Riding" group */
5338 bool grp_riding = (monster_group_char[grp_cur] == (char *) -2L);
5340 /* XXX Hack -- Check if this is the "Wanted" group */
5341 bool grp_wanted = (monster_group_char[grp_cur] == (char *) -3L);
5343 /* XXX Hack -- Check if this is the "Amberite" group */
5344 bool grp_amberite = (monster_group_char[grp_cur] == (char *) -4L);
5347 /* Check every race */
5348 for (i = 0; i < max_r_idx; i++)
5350 /* Access the race */
5351 monster_race *r_ptr = &r_info[i];
5353 /* Skip empty race */
5354 if (!r_ptr->name) continue ;
5356 /* Require known monsters */
5357 if (!(mode & 0x02) && !cheat_know && !r_ptr->r_sights) continue;
5361 if (!(r_ptr->flags1 & RF1_UNIQUE)) continue;
5364 else if (grp_riding)
5366 if (!(r_ptr->flags7 & RF7_RIDING)) continue;
5369 else if (grp_wanted)
5371 bool wanted = FALSE;
5373 for (j = 0; j < MAX_KUBI; j++)
5375 if (kubi_r_idx[j] == i || kubi_r_idx[j] - 10000 == i ||
5376 (p_ptr->today_mon && p_ptr->today_mon == i))
5382 if (!wanted) continue;
5385 else if (grp_amberite)
5387 if (!(r_ptr->flags3 & RF3_AMBERITE)) continue;
5392 /* Check for race in the group */
5393 if (!my_strchr(group_char, r_ptr->d_char)) continue;
5397 mon_idx[mon_cnt++] = i;
5399 /* XXX Hack -- Just checking for non-empty group */
5400 if (mode & 0x01) break;
5403 /* Terminate the list */
5404 mon_idx[mon_cnt] = -1;
5406 /* Select the sort method */
5407 ang_sort_comp = ang_sort_comp_monster_level;
5408 ang_sort_swap = ang_sort_swap_hook;
5410 /* Sort by monster level */
5411 ang_sort(mon_idx, &dummy_why, mon_cnt);
5413 /* Return the number of races */
5419 * Description of each monster group.
5421 static cptr object_group_text[] =
5424 "¥¥Î¥³", /* "Mushrooms" */
5425 "Ìô", /* "Potions" */
5426 "Ìý¤Ä¤Ü", /* "Flasks" */
5427 "´¬Êª", /* "Scrolls" */
5428 "»ØÎØ", /* "Rings" */
5429 "¥¢¥ß¥å¥ì¥Ã¥È", /* "Amulets" */
5430 "ū", /* "Whistle" */
5431 "¸÷¸»", /* "Lanterns" */
5432 "ËâË¡ËÀ", /* "Wands" */
5433 "¾ó", /* "Staffs" */
5434 "¥í¥Ã¥É", /* "Rods" */
5435 "¥«¡¼¥É", /* "Cards" */
5436 "¥¥ã¥×¥Á¥ã¡¼¡¦¥Ü¡¼¥ë",
5446 "Åá·õÎà", /* "Swords" */
5447 "Æß´ï", /* "Blunt Weapons" */
5448 "ĹÊÁÉð´ï", /* "Polearms" */
5449 "ºÎ·¡Æ»¶ñ", /* "Diggers" */
5450 "Èô¤ÓÆ»¶ñ", /* "Bows" */
5454 "·ÚÁõ³»", /* "Soft Armor" */
5455 "½ÅÁõ³»", /* "Hard Armor" */
5456 "¥É¥é¥´¥ó³»", /* "Dragon Armor" */
5457 "½â", /* "Shields" */
5458 "¥¯¥í¡¼¥¯", /* "Cloaks" */
5459 "äƼê", /* "Gloves" */
5460 "¥Ø¥ë¥á¥Ã¥È", /* "Helms" */
5461 "´§", /* "Crowns" */
5462 "¥Ö¡¼¥Ä", /* "Boots" */
5515 * TVALs of items in each group
5517 static byte object_group_tval[] =
5558 TV_LIFE_BOOK, /* Hack -- all spellbooks */
5566 * Build a list of object indexes in the given group. Return the number
5567 * of objects in the group.
5569 * mode & 0x01 : check for non-empty group
5570 * mode & 0x02 : visual operation only
5572 static int collect_objects(int grp_cur, int object_idx[], byte mode)
5574 int i, j, k, object_cnt = 0;
5576 /* Get a list of x_char in this group */
5577 byte group_tval = object_group_tval[grp_cur];
5579 /* Check every object */
5580 for (i = 0; i < max_k_idx; i++)
5582 /* Access the object */
5583 object_kind *k_ptr = &k_info[i];
5585 /* Skip empty objects */
5586 if (!k_ptr->name) continue;
5590 /* Any objects will be displayed */
5596 /* Skip non-flavoured objects */
5597 if (!k_ptr->flavor) continue;
5599 /* Require objects ever seen */
5600 if (!k_ptr->aware) continue;
5603 /* Skip items with no distribution (special artifacts) */
5604 for (j = 0, k = 0; j < 4; j++) k += k_ptr->chance[j];
5608 /* Check for objects in the group */
5609 if (TV_LIFE_BOOK == group_tval)
5611 /* Hack -- All spell books */
5612 if (TV_LIFE_BOOK <= k_ptr->tval && k_ptr->tval <= TV_HEX_BOOK)
5614 /* Add the object */
5615 object_idx[object_cnt++] = i;
5619 else if (k_ptr->tval == group_tval)
5621 /* Add the object */
5622 object_idx[object_cnt++] = i;
5626 /* XXX Hack -- Just checking for non-empty group */
5627 if (mode & 0x01) break;
5630 /* Terminate the list */
5631 object_idx[object_cnt] = -1;
5633 /* Return the number of objects */
5639 * Description of each feature group.
5641 static cptr feature_group_text[] =
5649 * Build a list of feature indexes in the given group. Return the number
5650 * of features in the group.
5652 * mode & 0x01 : check for non-empty group
5654 static int collect_features(int grp_cur, int *feat_idx, byte mode)
5656 int i, feat_cnt = 0;
5658 /* Unused; There is a single group. */
5661 /* Check every feature */
5662 for (i = 0; i < max_f_idx; i++)
5664 /* Access the index */
5665 feature_type *f_ptr = &f_info[i];
5667 /* Skip empty index */
5668 if (!f_ptr->name) continue;
5670 /* Skip mimiccing features */
5671 if (f_ptr->mimic != i) continue;
5674 feat_idx[feat_cnt++] = i;
5676 /* XXX Hack -- Just checking for non-empty group */
5677 if (mode & 0x01) break;
5680 /* Terminate the list */
5681 feat_idx[feat_cnt] = -1;
5683 /* Return the number of races */
5690 * Build a list of monster indexes in the given group. Return the number
5691 * of monsters in the group.
5693 static int collect_artifacts(int grp_cur, int object_idx[])
5695 int i, object_cnt = 0;
5697 /* Get a list of x_char in this group */
5698 byte group_tval = object_group_tval[grp_cur];
5700 /* Check every object */
5701 for (i = 0; i < max_a_idx; i++)
5703 /* Access the artifact */
5704 artifact_type *a_ptr = &a_info[i];
5706 /* Skip empty artifacts */
5707 if (!a_ptr->name) continue;
5709 /* Skip "uncreated" artifacts */
5710 if (!a_ptr->cur_num) continue;
5712 /* Check for race in the group */
5713 if (a_ptr->tval == group_tval)
5716 object_idx[object_cnt++] = i;
5720 /* Terminate the list */
5721 object_idx[object_cnt] = 0;
5723 /* Return the number of races */
5730 * Encode the screen colors
5732 static char hack[17] = "dwsorgbuDWvyRGBU";
5736 * Hack -- load a screen dump from a file
5738 void do_cmd_load_screen(void)
5753 Term_get_size(&wid, &hgt);
5755 /* Build the filename */
5756 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
5758 /* Append to the file */
5759 fff = my_fopen(buf, "r");
5764 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
5766 msg_format("Failed to open %s.", buf);
5773 /* Save the screen */
5776 /* Clear the screen */
5780 /* Load the screen */
5781 for (y = 0; okay; y++)
5783 /* Get a line of data including control code */
5784 if (!fgets(buf, 1024, fff)) okay = FALSE;
5786 /* Get the blank line */
5787 if (buf[0] == '\n' || buf[0] == '\0') break;
5789 /* Ignore too large screen image */
5790 if (y >= hgt) continue;
5793 for (x = 0; x < wid - 1; x++)
5796 if (buf[x] == '\n' || buf[x] == '\0') break;
5798 /* Put the attr/char */
5799 Term_draw(x, y, TERM_WHITE, buf[x]);
5803 /* Dump the screen */
5804 for (y = 0; okay; y++)
5806 /* Get a line of data including control code */
5807 if (!fgets(buf, 1024, fff)) okay = FALSE;
5809 /* Get the blank line */
5810 if (buf[0] == '\n' || buf[0] == '\0') break;
5812 /* Ignore too large screen image */
5813 if (y >= hgt) continue;
5816 for (x = 0; x < wid - 1; x++)
5819 if (buf[x] == '\n' || buf[x] == '\0') break;
5821 /* Get the attr/char */
5822 (void)(Term_what(x, y, &a, &c));
5824 /* Look up the attr */
5825 for (i = 0; i < 16; i++)
5827 /* Use attr matches */
5828 if (hack[i] == buf[x]) a = i;
5831 /* Put the attr/char */
5832 Term_draw(x, y, a, c);
5843 prt("¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤µ¤ì¤¿²èÌÌ(µÇ°»£±Æ)¤ò¥í¡¼¥É¤·¤Þ¤·¤¿¡£", 0, 0);
5845 msg_print("Screen dump loaded.");
5852 /* Restore the screen */
5859 cptr inven_res_label =
5861 " »ÀÅŲÐÎäÆǸ÷°ÇÇ˹ì¹ö°øÆÙÎô ÌÕÉÝÍðáãÆ©Ì¿´¶¾ÃÉüÉâ";
5863 " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv";
5868 #define IM_FLAG_STR "¡ö"
5869 #define HAS_FLAG_STR "¡Ü"
5870 #define NO_FLAG_STR "¡¦"
5872 #define IM_FLAG_STR "* "
5873 #define HAS_FLAG_STR "+ "
5874 #define NO_FLAG_STR ". "
5877 #define print_im_or_res_flag(IM, RES) \
5879 fputs(have_flag(flgs, (IM)) ? IM_FLAG_STR : \
5880 (have_flag(flgs, (RES)) ? HAS_FLAG_STR : NO_FLAG_STR), fff); \
5883 #define print_flag(TR) \
5885 fputs(have_flag(flgs, (TR)) ? HAS_FLAG_STR : NO_FLAG_STR, fff); \
5889 /* XTRA HACK RESLIST */
5890 static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr, int *j, byte tval, char *where)
5892 char o_name[MAX_NLEN];
5893 u32b flgs[TR_FLAG_SIZE];
5895 if (!o_ptr->k_idx) return;
5896 if (o_ptr->tval != tval) return;
5898 /* Identified items only */
5899 if (!object_is_known(o_ptr)) return;
5902 * HACK:Ring of Lordly protection and Dragon equipment
5903 * have random resistances.
5905 if ((object_is_wearable(o_ptr) && object_is_ego(o_ptr))
5906 || ((tval == TV_AMULET) && (o_ptr->sval == SV_AMULET_RESISTANCE))
5907 || ((tval == TV_RING) && (o_ptr->sval == SV_RING_LORDLY))
5908 || ((tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD))
5909 || ((tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM))
5910 || ((tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES))
5911 || ((tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE))
5912 || object_is_artifact(o_ptr))
5915 object_desc(o_name, o_ptr, OD_NAME_ONLY);
5917 while (o_name[i] && (i < 26))
5920 if (iskanji(o_name[i])) i++;
5929 o_name[i] = ' '; i++;
5934 fprintf(fff, "%s %s", where, o_name);
5936 if (!(o_ptr->ident & (IDENT_MENTAL)))
5939 fputs("-------ÉÔÌÀ--------------- -------ÉÔÌÀ---------\n", fff);
5941 fputs("-------unknown------------ -------unknown------\n", fff);
5946 object_flags_known(o_ptr, flgs);
5948 print_im_or_res_flag(TR_IM_ACID, TR_RES_ACID);
5949 print_im_or_res_flag(TR_IM_ELEC, TR_RES_ELEC);
5950 print_im_or_res_flag(TR_IM_FIRE, TR_RES_FIRE);
5951 print_im_or_res_flag(TR_IM_COLD, TR_RES_COLD);
5952 print_flag(TR_RES_POIS);
5953 print_flag(TR_RES_LITE);
5954 print_flag(TR_RES_DARK);
5955 print_flag(TR_RES_SHARDS);
5956 print_flag(TR_RES_SOUND);
5957 print_flag(TR_RES_NETHER);
5958 print_flag(TR_RES_NEXUS);
5959 print_flag(TR_RES_CHAOS);
5960 print_flag(TR_RES_DISEN);
5964 print_flag(TR_RES_BLIND);
5965 print_flag(TR_RES_FEAR);
5966 print_flag(TR_RES_CONF);
5967 print_flag(TR_FREE_ACT);
5968 print_flag(TR_SEE_INVIS);
5969 print_flag(TR_HOLD_LIFE);
5970 print_flag(TR_TELEPATHY);
5971 print_flag(TR_SLOW_DIGEST);
5972 print_flag(TR_REGEN);
5973 print_flag(TR_LEVITATION);
5981 fprintf(fff, "%s\n", inven_res_label);
5987 * Display *ID* ed weapons/armors's resistances
5989 static void do_cmd_knowledge_inven(void)
5993 char file_name[1024];
6003 /* Open a new file */
6004 fff = my_fopen_temp(file_name, 1024);
6008 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6010 msg_format("Failed to create temporary file %s.", file_name);
6015 fprintf(fff, "%s\n", inven_res_label);
6017 for (tval = TV_WEARABLE_BEGIN; tval <= TV_WEARABLE_END; tval++)
6021 for (; j < 9; j++) fputc('\n', fff);
6023 fprintf(fff, "%s\n", inven_res_label);
6027 strcpy(where, "Áõ");
6029 strcpy(where, "E ");
6031 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
6033 do_cmd_knowledge_inven_aux(fff, &inventory[i], &j, tval, where);
6037 strcpy(where, "»ý");
6039 strcpy(where, "I ");
6041 for (i = 0; i < INVEN_PACK; i++)
6043 do_cmd_knowledge_inven_aux(fff, &inventory[i], &j, tval, where);
6046 st_ptr = &town[1].store[STORE_HOME];
6048 strcpy(where, "²È");
6050 strcpy(where, "H ");
6053 for (i = 0; i < st_ptr->stock_num; i++)
6055 do_cmd_knowledge_inven_aux(fff, &st_ptr->stock[i], &j, tval, where);
6059 /* Close the file */
6062 /* Display the file contents */
6064 show_file(TRUE, file_name, "*´ÕÄê*ºÑ¤ßÉð´ï/Ëɶñ¤ÎÂÑÀ¥ê¥¹¥È", 0, 0);
6066 show_file(TRUE, file_name, "Resistances of *identified* equipment", 0, 0);
6069 /* Remove the file */
6074 void do_cmd_save_screen_html_aux(char *filename, int message)
6078 byte a = 0, old_a = 0;
6092 cptr html_head[] = {
6093 "<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
6097 cptr html_foot[] = {
6099 "</body>\n</html>\n",
6105 Term_get_size(&wid, &hgt);
6107 /* File type is "TEXT" */
6108 FILE_TYPE(FILE_TYPE_TEXT);
6110 /* Append to the file */
6111 fff = my_fopen(filename, "w");
6117 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", filename);
6119 msg_format("Failed to open file %s.", filename);
6127 /* Save the screen */
6131 /* Build the filename */
6132 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "htmldump.prf");
6133 tmpfff = my_fopen(buf, "r");
6135 for (i = 0; html_head[i]; i++)
6136 fputs(html_head[i], fff);
6140 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
6142 if (strncmp(buf, tags[0], strlen(tags[0])) == 0)
6146 if (strncmp(buf, tags[1], strlen(tags[1])) == 0)
6148 fprintf(fff, "%s\n", buf);
6153 /* Dump the screen */
6154 for (y = 0; y < hgt; y++)
6161 for (x = 0; x < wid - 1; x++)
6165 /* Get the attr/char */
6166 (void)(Term_what(x, y, &a, &c));
6170 case '&': cc = "&"; break;
6171 case '<': cc = "<"; break;
6172 case '>': cc = ">"; break;
6174 case 0x1f: c = '.'; break;
6175 case 0x7f: c = (a == 0x09) ? '%' : '#'; break;
6180 if ((y == 0 && x == 0) || a != old_a) {
6181 rv = angband_color_table[a][1];
6182 gv = angband_color_table[a][2];
6183 bv = angband_color_table[a][3];
6184 fprintf(fff, "%s<font color=\"#%02x%02x%02x\">",
6185 ((y == 0 && x == 0) ? "" : "</font>"), rv, gv, bv);
6189 fprintf(fff, "%s", cc);
6191 fprintf(fff, "%c", c);
6194 fprintf(fff, "</font>");
6197 for (i = 0; html_foot[i]; i++)
6198 fputs(html_foot[i], fff);
6203 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
6205 if (strncmp(buf, tags[2], strlen(tags[2])) == 0)
6209 if (strncmp(buf, tags[3], strlen(tags[3])) == 0)
6211 fprintf(fff, "%s\n", buf);
6226 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
6228 msg_print("Screen dump saved.");
6233 /* Restore the screen */
6239 * Hack -- save a screen dump to a file
6241 static void do_cmd_save_screen_html(void)
6243 char buf[1024], tmp[256] = "screen.html";
6246 if (!get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
6248 if (!get_string("File name: ", tmp, 80))
6252 /* Build the filename */
6253 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
6257 do_cmd_save_screen_html_aux(buf, 1);
6262 * Redefinable "save_screen" action
6264 void (*screendump_aux)(void) = NULL;
6268 * Hack -- save a screen dump to a file
6270 void do_cmd_save_screen(void)
6272 bool old_use_graphics = use_graphics;
6273 bool html_dump = FALSE;
6278 prt("µÇ°»£±Æ¤·¤Þ¤¹¤«¡© [(y)es/(h)tml/(n)o] ", 0, 0);
6280 prt("Save screen dump? [(y)es/(h)tml/(n)o] ", 0, 0);
6285 if (c == 'Y' || c == 'y')
6287 else if (c == 'H' || c == 'h')
6299 Term_get_size(&wid, &hgt);
6301 if (old_use_graphics)
6303 use_graphics = FALSE;
6306 /* Redraw everything */
6307 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
6309 /* Hack -- update */
6315 do_cmd_save_screen_html();
6319 /* Do we use a special screendump function ? */
6320 else if (screendump_aux)
6322 /* Dump the screen to a graphics file */
6323 (*screendump_aux)();
6325 else /* Dump the screen as text */
6336 /* Build the filename */
6337 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
6339 /* File type is "TEXT" */
6340 FILE_TYPE(FILE_TYPE_TEXT);
6342 /* Append to the file */
6343 fff = my_fopen(buf, "w");
6349 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
6351 msg_format("Failed to open file %s.", buf);
6358 /* Save the screen */
6362 /* Dump the screen */
6363 for (y = 0; y < hgt; y++)
6366 for (x = 0; x < wid - 1; x++)
6368 /* Get the attr/char */
6369 (void)(Term_what(x, y, &a, &c));
6379 fprintf(fff, "%s\n", buf);
6386 /* Dump the screen */
6387 for (y = 0; y < hgt; y++)
6390 for (x = 0; x < wid - 1; x++)
6392 /* Get the attr/char */
6393 (void)(Term_what(x, y, &a, &c));
6396 buf[x] = hack[a&0x0F];
6403 fprintf(fff, "%s\n", buf);
6415 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
6417 msg_print("Screen dump saved.");
6423 /* Restore the screen */
6427 if (old_use_graphics)
6429 use_graphics = TRUE;
6432 /* Redraw everything */
6433 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
6435 /* Hack -- update */
6442 * Sorting hook -- Comp function -- see below
6444 * We use "u" to point to array of monster indexes,
6445 * and "v" to select the type of sorting to perform on "u".
6447 static bool ang_sort_art_comp(vptr u, vptr v, int a, int b)
6449 u16b *who = (u16b*)(u);
6451 u16b *why = (u16b*)(v);
6458 /* Sort by total kills */
6461 /* Extract total kills */
6462 z1 = a_info[w1].tval;
6463 z2 = a_info[w2].tval;
6465 /* Compare total kills */
6466 if (z1 < z2) return (TRUE);
6467 if (z1 > z2) return (FALSE);
6471 /* Sort by monster level */
6474 /* Extract levels */
6475 z1 = a_info[w1].sval;
6476 z2 = a_info[w2].sval;
6478 /* Compare levels */
6479 if (z1 < z2) return (TRUE);
6480 if (z1 > z2) return (FALSE);
6484 /* Sort by monster experience */
6487 /* Extract experience */
6488 z1 = a_info[w1].level;
6489 z2 = a_info[w2].level;
6491 /* Compare experience */
6492 if (z1 < z2) return (TRUE);
6493 if (z1 > z2) return (FALSE);
6497 /* Compare indexes */
6503 * Sorting hook -- Swap function -- see below
6505 * We use "u" to point to array of monster indexes,
6506 * and "v" to select the type of sorting to perform.
6508 static void ang_sort_art_swap(vptr u, vptr v, int a, int b)
6510 u16b *who = (u16b*)(u);
6525 * Check the status of "artifacts"
6527 static void do_cmd_knowledge_artifacts(void)
6529 int i, k, z, x, y, n = 0;
6535 char file_name[1024];
6537 char base_name[MAX_NLEN];
6541 /* Open a new file */
6542 fff = my_fopen_temp(file_name, 1024);
6546 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6548 msg_format("Failed to create temporary file %s.", file_name);
6554 /* Allocate the "who" array */
6555 C_MAKE(who, max_a_idx, s16b);
6557 /* Allocate the "okay" array */
6558 C_MAKE(okay, max_a_idx, bool);
6560 /* Scan the artifacts */
6561 for (k = 0; k < max_a_idx; k++)
6563 artifact_type *a_ptr = &a_info[k];
6568 /* Skip "empty" artifacts */
6569 if (!a_ptr->name) continue;
6571 /* Skip "uncreated" artifacts */
6572 if (!a_ptr->cur_num) continue;
6578 /* Check the dungeon */
6579 for (y = 0; y < cur_hgt; y++)
6581 for (x = 0; x < cur_wid; x++)
6583 cave_type *c_ptr = &cave[y][x];
6585 s16b this_o_idx, next_o_idx = 0;
6587 /* Scan all objects in the grid */
6588 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
6592 /* Acquire object */
6593 o_ptr = &o_list[this_o_idx];
6595 /* Acquire next object */
6596 next_o_idx = o_ptr->next_o_idx;
6598 /* Ignore non-artifacts */
6599 if (!object_is_fixed_artifact(o_ptr)) continue;
6601 /* Ignore known items */
6602 if (object_is_known(o_ptr)) continue;
6604 /* Note the artifact */
6605 okay[o_ptr->name1] = FALSE;
6610 /* Check the inventory and equipment */
6611 for (i = 0; i < INVEN_TOTAL; i++)
6613 object_type *o_ptr = &inventory[i];
6615 /* Ignore non-objects */
6616 if (!o_ptr->k_idx) continue;
6618 /* Ignore non-artifacts */
6619 if (!object_is_fixed_artifact(o_ptr)) continue;
6621 /* Ignore known items */
6622 if (object_is_known(o_ptr)) continue;
6624 /* Note the artifact */
6625 okay[o_ptr->name1] = FALSE;
6628 for (k = 0; k < max_a_idx; k++)
6630 if (okay[k]) who[n++] = k;
6633 /* Select the sort method */
6634 ang_sort_comp = ang_sort_art_comp;
6635 ang_sort_swap = ang_sort_art_swap;
6637 /* Sort the array by dungeon depth of monsters */
6638 ang_sort(who, &why, n);
6640 /* Scan the artifacts */
6641 for (k = 0; k < n; k++)
6643 artifact_type *a_ptr = &a_info[who[k]];
6647 strcpy(base_name, "̤ÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à");
6649 strcpy(base_name, "Unknown Artifact");
6653 /* Obtain the base object type */
6654 z = lookup_kind(a_ptr->tval, a_ptr->sval);
6662 /* Get local object */
6665 /* Create fake object */
6666 object_prep(q_ptr, z);
6668 /* Make it an artifact */
6669 q_ptr->name1 = (byte)who[k];
6671 /* Display as if known */
6672 q_ptr->ident |= IDENT_STORE;
6674 /* Describe the artifact */
6675 object_desc(base_name, q_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
6678 /* Hack -- Build the artifact name */
6680 fprintf(fff, " %s\n", base_name);
6682 fprintf(fff, " The %s\n", base_name);
6687 /* Free the "who" array */
6688 C_KILL(who, max_a_idx, s16b);
6690 /* Free the "okay" array */
6691 C_KILL(okay, max_a_idx, bool);
6693 /* Close the file */
6696 /* Display the file contents */
6698 show_file(TRUE, file_name, "´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à", 0, 0);
6700 show_file(TRUE, file_name, "Artifacts Seen", 0, 0);
6704 /* Remove the file */
6710 * Display known uniques
6711 * With "XTRA HACK UNIQHIST" (Originally from XAngband)
6713 static void do_cmd_knowledge_uniques(void)
6721 char file_name[1024];
6724 int n_alive_surface = 0;
6725 int n_alive_over100 = 0;
6726 int n_alive_total = 0;
6729 for (i = 0; i < 10; i++) n_alive[i] = 0;
6731 /* Open a new file */
6732 fff = my_fopen_temp(file_name, 1024);
6737 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6739 msg_format("Failed to create temporary file %s.", file_name);
6745 /* Allocate the "who" array */
6746 C_MAKE(who, max_r_idx, s16b);
6748 /* Scan the monsters */
6749 for (i = 1; i < max_r_idx; i++)
6751 monster_race *r_ptr = &r_info[i];
6754 if (!r_ptr->name) continue;
6756 /* Require unique monsters */
6757 if (!(r_ptr->flags1 & RF1_UNIQUE)) continue;
6759 /* Only display "known" uniques */
6760 if (!cheat_know && !r_ptr->r_sights) continue;
6762 /* Only print rarity <= 100 uniques */
6763 if (!r_ptr->rarity || ((r_ptr->rarity > 100) && !(r_ptr->flags1 & RF1_QUESTOR))) continue;
6765 /* Only "alive" uniques */
6766 if (r_ptr->max_num == 0) continue;
6770 lev = (r_ptr->level - 1) / 10;
6774 if (max_lev < lev) max_lev = lev;
6776 else n_alive_over100++;
6778 else n_alive_surface++;
6780 /* Collect "appropriate" monsters */
6784 /* Select the sort method */
6785 ang_sort_comp = ang_sort_comp_hook;
6786 ang_sort_swap = ang_sort_swap_hook;
6788 /* Sort the array by dungeon depth of monsters */
6789 ang_sort(who, &why, n);
6791 if (n_alive_surface)
6794 fprintf(fff, " ÃϾå À¸Â¸: %3dÂÎ\n", n_alive_surface);
6796 fprintf(fff, " Surface alive: %3d\n", n_alive_surface);
6798 n_alive_total += n_alive_surface;
6800 for (i = 0; i <= max_lev; i++)
6803 fprintf(fff, "%3d-%3d³¬ À¸Â¸: %3dÂÎ\n", 1 + i * 10, 10 + i * 10, n_alive[i]);
6805 fprintf(fff, "Level %3d-%3d alive: %3d\n", 1 + i * 10, 10 + i * 10, n_alive[i]);
6807 n_alive_total += n_alive[i];
6809 if (n_alive_over100)
6812 fprintf(fff, "101- ³¬ À¸Â¸: %3dÂÎ\n", n_alive_over100);
6814 fprintf(fff, "Level 101- alive: %3d\n", n_alive_over100);
6816 n_alive_total += n_alive_over100;
6822 fputs("--------- -----------\n", fff);
6823 fprintf(fff, " ¹ç·× À¸Â¸: %3dÂÎ\n\n", n_alive_total);
6825 fputs("------------- ----------\n", fff);
6826 fprintf(fff, " Total alive: %3d\n\n", n_alive_total);
6832 fputs("¸½ºß¤Ï´ûÃΤÎÀ¸Â¸¥æ¥Ë¡¼¥¯¤Ï¤¤¤Þ¤»¤ó¡£\n", fff);
6834 fputs("No known uniques alive.\n", fff);
6838 /* Scan the monster races */
6839 for (k = 0; k < n; k++)
6841 monster_race *r_ptr = &r_info[who[k]];
6843 /* Print a message */
6845 fprintf(fff, " %s (¥ì¥Ù¥ë%d)\n", r_name + r_ptr->name, r_ptr->level);
6847 fprintf(fff, " %s (level %d)\n", r_name + r_ptr->name, r_ptr->level);
6851 /* Free the "who" array */
6852 C_KILL(who, max_r_idx, s16b);
6854 /* Close the file */
6857 /* Display the file contents */
6859 show_file(TRUE, file_name, "¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
6861 show_file(TRUE, file_name, "Alive Uniques", 0, 0);
6865 /* Remove the file */
6871 * Display weapon-exp
6873 static void do_cmd_knowledge_weapon_exp(void)
6875 int i, j, num, weapon_exp;
6879 char file_name[1024];
6882 /* Open a new file */
6883 fff = my_fopen_temp(file_name, 1024);
6886 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6888 msg_format("Failed to create temporary file %s.", file_name);
6894 for (i = 0; i < 5; i++)
6896 for (num = 0; num < 64; num++)
6898 for (j = 0; j < max_k_idx; j++)
6900 object_kind *k_ptr = &k_info[j];
6902 if ((k_ptr->tval == TV_SWORD - i) && (k_ptr->sval == num))
6904 if ((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON)) continue;
6906 weapon_exp = p_ptr->weapon_exp[4 - i][num];
6908 fprintf(fff, "%-25s ", tmp);
6909 if (weapon_exp >= s_info[p_ptr->pclass].w_max[4 - i][num]) fprintf(fff, "!");
6910 else fprintf(fff, " ");
6911 fprintf(fff, "%s", exp_level_str[weapon_exp_level(weapon_exp)]);
6912 if (cheat_xtra) fprintf(fff, " %d", weapon_exp);
6920 /* Close the file */
6923 /* Display the file contents */
6925 show_file(TRUE, file_name, "Éð´ï¤Î·Ð¸³ÃÍ", 0, 0);
6927 show_file(TRUE, file_name, "Weapon Proficiency", 0, 0);
6931 /* Remove the file */
6937 * @brief ËâË¡¤Î·Ð¸³Ãͤòɽ¼¨¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó
6941 static void do_cmd_knowledge_spell_exp(void)
6943 int i = 0, spell_exp, exp_level;
6946 const magic_type *s_ptr;
6948 char file_name[1024];
6950 /* Open a new file */
6951 fff = my_fopen_temp(file_name, 1024);
6954 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6956 msg_format("Failed to create temporary file %s.", file_name);
6962 if (p_ptr->realm1 != REALM_NONE)
6965 fprintf(fff, "%s¤ÎËâË¡½ñ\n", realm_names[p_ptr->realm1]);
6967 fprintf(fff, "%s Spellbook\n", realm_names[p_ptr->realm1]);
6969 for (i = 0; i < 32; i++)
6971 if (!is_magic(p_ptr->realm1))
6973 s_ptr = &technic_info[p_ptr->realm1 - MIN_TECHNIC][i];
6977 s_ptr = &mp_ptr->info[p_ptr->realm1 - 1][i];
6979 if (s_ptr->slevel >= 99) continue;
6980 spell_exp = p_ptr->spell_exp[i];
6981 exp_level = spell_exp_level(spell_exp);
6982 fprintf(fff, "%-25s ", do_spell(p_ptr->realm1, i, SPELL_NAME));
6983 if (p_ptr->realm1 == REALM_HISSATSU)
6984 fprintf(fff, "[--]");
6987 if (exp_level >= EXP_LEVEL_MASTER) fprintf(fff, "!");
6988 else fprintf(fff, " ");
6989 fprintf(fff, "%s", exp_level_str[exp_level]);
6991 if (cheat_xtra) fprintf(fff, " %d", spell_exp);
6996 if (p_ptr->realm2 != REALM_NONE)
6999 fprintf(fff, "%s¤ÎËâË¡½ñ\n", realm_names[p_ptr->realm2]);
7001 fprintf(fff, "\n%s Spellbook\n", realm_names[p_ptr->realm2]);
7003 for (i = 0; i < 32; i++)
7005 if (!is_magic(p_ptr->realm1))
7007 s_ptr = &technic_info[p_ptr->realm2 - MIN_TECHNIC][i];
7011 s_ptr = &mp_ptr->info[p_ptr->realm2 - 1][i];
7013 if (s_ptr->slevel >= 99) continue;
7015 spell_exp = p_ptr->spell_exp[i + 32];
7016 exp_level = spell_exp_level(spell_exp);
7017 fprintf(fff, "%-25s ", do_spell(p_ptr->realm2, i, SPELL_NAME));
7018 if (exp_level >= EXP_LEVEL_EXPERT) fprintf(fff, "!");
7019 else fprintf(fff, " ");
7020 fprintf(fff, "%s", exp_level_str[exp_level]);
7021 if (cheat_xtra) fprintf(fff, " %d", spell_exp);
7026 /* Close the file */
7029 /* Display the file contents */
7031 show_file(TRUE, file_name, "ËâË¡¤Î·Ð¸³ÃÍ", 0, 0);
7033 show_file(TRUE, file_name, "Spell Proficiency", 0, 0);
7037 /* Remove the file */
7043 * @brief ¥¹¥¥ë¾ðÊó¤òɽ¼¨¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó /
7047 static void do_cmd_knowledge_skill_exp(void)
7049 int i = 0, skill_exp;
7053 char file_name[1024];
7055 char skill_name[3][17]={"¥Þ¡¼¥·¥ã¥ë¥¢¡¼¥Ä", "ÆóÅáή ", "¾èÇÏ "};
7057 char skill_name[3][20]={"Martial Arts ", "Dual Wielding ", "Riding "};
7060 /* Open a new file */
7061 fff = my_fopen_temp(file_name, 1024);
7064 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7066 msg_format("Failed to create temporary file %s.", file_name);
7072 for (i = 0; i < 3; i++)
7074 skill_exp = p_ptr->skill_exp[i];
7075 fprintf(fff, "%-20s ", skill_name[i]);
7076 if (skill_exp >= s_info[p_ptr->pclass].s_max[i]) fprintf(fff, "!");
7077 else fprintf(fff, " ");
7078 fprintf(fff, "%s", exp_level_str[(i == GINOU_RIDING) ? riding_exp_level(skill_exp) : weapon_exp_level(skill_exp)]);
7079 if (cheat_xtra) fprintf(fff, " %d", skill_exp);
7083 /* Close the file */
7086 /* Display the file contents */
7088 show_file(TRUE, file_name, "µ»Ç½¤Î·Ð¸³ÃÍ", 0, 0);
7090 show_file(TRUE, file_name, "Miscellaneous Proficiency", 0, 0);
7094 /* Remove the file */
7100 * @brief ±Ññ¸ì¡¢¶ç¡¢Àâ¤òÊ£¿ô·Á¤òÊÑ´¹¤¹¤ë / Pluralize a monster name
7101 * @param Name ÊÑ´¹¤·¤¿¤¤Ê¸»úÎó¤Î»²¾È¥Ý¥¤¥ó¥¿
7104 void plural_aux(char *Name)
7106 int NameLen = strlen(Name);
7108 if (my_strstr(Name, "Disembodied hand"))
7110 strcpy(Name, "Disembodied hands that strangled people");
7112 else if (my_strstr(Name, "Colour out of space"))
7114 strcpy(Name, "Colours out of space");
7116 else if (my_strstr(Name, "stairway to hell"))
7118 strcpy(Name, "stairways to hell");
7120 else if (my_strstr(Name, "Dweller on the threshold"))
7122 strcpy(Name, "Dwellers on the threshold");
7124 else if (my_strstr(Name, " of "))
7126 cptr aider = my_strstr(Name, " of ");
7137 if (dummy[i-1] == 's')
7139 strcpy(&(dummy[i]), "es");
7144 strcpy(&(dummy[i]), "s");
7147 strcpy(&(dummy[i+1]), aider);
7148 strcpy(Name, dummy);
7150 else if (my_strstr(Name, "coins"))
7153 strcpy(dummy, "piles of ");
7154 strcat(dummy, Name);
7155 strcpy(Name, dummy);
7158 else if (my_strstr(Name, "Manes"))
7162 else if (streq(&(Name[NameLen - 2]), "ey"))
7164 strcpy(&(Name[NameLen - 2]), "eys");
7166 else if (Name[NameLen - 1] == 'y')
7168 strcpy(&(Name[NameLen - 1]), "ies");
7170 else if (streq(&(Name[NameLen - 4]), "ouse"))
7172 strcpy(&(Name[NameLen - 4]), "ice");
7174 else if (streq(&(Name[NameLen - 2]), "us"))
7176 strcpy(&(Name[NameLen - 2]), "i");
7178 else if (streq(&(Name[NameLen - 6]), "kelman"))
7180 strcpy(&(Name[NameLen - 6]), "kelmen");
7182 else if (streq(&(Name[NameLen - 8]), "wordsman"))
7184 strcpy(&(Name[NameLen - 8]), "wordsmen");
7186 else if (streq(&(Name[NameLen - 7]), "oodsman"))
7188 strcpy(&(Name[NameLen - 7]), "oodsmen");
7190 else if (streq(&(Name[NameLen - 7]), "eastman"))
7192 strcpy(&(Name[NameLen - 7]), "eastmen");
7194 else if (streq(&(Name[NameLen - 8]), "izardman"))
7196 strcpy(&(Name[NameLen - 8]), "izardmen");
7198 else if (streq(&(Name[NameLen - 5]), "geist"))
7200 strcpy(&(Name[NameLen - 5]), "geister");
7202 else if (streq(&(Name[NameLen - 2]), "ex"))
7204 strcpy(&(Name[NameLen - 2]), "ices");
7206 else if (streq(&(Name[NameLen - 2]), "lf"))
7208 strcpy(&(Name[NameLen - 2]), "lves");
7210 else if (suffix(Name, "ch") ||
7211 suffix(Name, "sh") ||
7212 suffix(Name, "nx") ||
7213 suffix(Name, "s") ||
7216 strcpy(&(Name[NameLen]), "es");
7220 strcpy(&(Name[NameLen]), "s");
7225 * @brief ¸½ºß¤Î¥Ú¥Ã¥È¤òɽ¼¨¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó /
7226 * Display current pets
7229 static void do_cmd_knowledge_pets(void)
7233 monster_type *m_ptr;
7236 int show_upkeep = 0;
7237 char file_name[1024];
7240 /* Open a new file */
7241 fff = my_fopen_temp(file_name, 1024);
7244 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7246 msg_format("Failed to create temporary file %s.", file_name);
7252 /* Process the monsters (backwards) */
7253 for (i = m_max - 1; i >= 1; i--)
7255 /* Access the monster */
7258 /* Ignore "dead" monsters */
7259 if (!m_ptr->r_idx) continue;
7261 /* Calculate "upkeep" for pets */
7265 monster_desc(pet_name, m_ptr, MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
7266 fprintf(fff, "%s (%s)\n", pet_name, look_mon_desc(m_ptr, 0x00));
7270 show_upkeep = calculate_upkeep();
7272 fprintf(fff, "----------------------------------------------\n");
7274 fprintf(fff, " ¹ç·×: %d ÂΤΥڥåÈ\n", t_friends);
7275 fprintf(fff, " °Ý»ý¥³¥¹¥È: %d%% MP\n", show_upkeep);
7277 fprintf(fff, " Total: %d pet%s.\n",
7278 t_friends, (t_friends == 1 ? "" : "s"));
7279 fprintf(fff, " Upkeep: %d%% mana.\n", show_upkeep);
7284 /* Close the file */
7287 /* Display the file contents */
7289 show_file(TRUE, file_name, "¸½ºß¤Î¥Ú¥Ã¥È", 0, 0);
7291 show_file(TRUE, file_name, "Current Pets", 0, 0);
7295 /* Remove the file */
7301 * @brief ¸½ºß¤Î¥Ú¥Ã¥È¤òɽ¼¨¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó /
7304 * @note the player ghosts are ignored. XXX XXX XXX
7306 static void do_cmd_knowledge_kill_count(void)
7314 char file_name[1024];
7319 /* Open a new file */
7320 fff = my_fopen_temp(file_name, 1024);
7324 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7326 msg_format("Failed to create temporary file %s.", file_name);
7332 /* Allocate the "who" array */
7333 C_MAKE(who, max_r_idx, s16b);
7336 /* Monsters slain */
7339 for (kk = 1; kk < max_r_idx; kk++)
7341 monster_race *r_ptr = &r_info[kk];
7343 if (r_ptr->flags1 & (RF1_UNIQUE))
7345 bool dead = (r_ptr->max_num == 0);
7354 s16b This = r_ptr->r_pkills;
7365 fprintf(fff,"¤¢¤Ê¤¿¤Ï¤Þ¤ÀŨ¤òÅݤ·¤Æ¤¤¤Ê¤¤¡£\n\n");
7367 fprintf(fff,"You have defeated no enemies yet.\n\n");
7371 fprintf(fff,"¤¢¤Ê¤¿¤Ï%ldÂΤÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n", (long int)Total);
7373 fprintf(fff,"You have defeated %ld %s.\n\n", (long int)Total, (Total == 1) ? "enemy" : "enemies");
7379 /* Scan the monsters */
7380 for (i = 1; i < max_r_idx; i++)
7382 monster_race *r_ptr = &r_info[i];
7384 /* Use that monster */
7385 if (r_ptr->name) who[n++] = i;
7388 /* Select the sort method */
7389 ang_sort_comp = ang_sort_comp_hook;
7390 ang_sort_swap = ang_sort_swap_hook;
7392 /* Sort the array by dungeon depth of monsters */
7393 ang_sort(who, &why, n);
7395 /* Scan the monster races */
7396 for (k = 0; k < n; k++)
7398 monster_race *r_ptr = &r_info[who[k]];
7400 if (r_ptr->flags1 & (RF1_UNIQUE))
7402 bool dead = (r_ptr->max_num == 0);
7406 /* Print a message */
7407 fprintf(fff, " %s\n",
7408 (r_name + r_ptr->name));
7414 s16b This = r_ptr->r_pkills;
7419 /* p,t¤Ï¿Í¤È¿ô¤¨¤ë by ita */
7420 if (my_strchr("pt", r_ptr->d_char))
7421 fprintf(fff, " %3d ¿Í¤Î %s\n", This, r_name + r_ptr->name);
7423 fprintf(fff, " %3d ÂΤΠ%s\n", This, r_name + r_ptr->name);
7427 if (my_strstr(r_name + r_ptr->name, "coins"))
7429 fprintf(fff, " 1 pile of %s\n", (r_name + r_ptr->name));
7433 fprintf(fff, " 1 %s\n", (r_name + r_ptr->name));
7439 strcpy(ToPlural, (r_name + r_ptr->name));
7440 plural_aux(ToPlural);
7441 fprintf(fff, " %d %s\n", This, ToPlural);
7451 fprintf(fff,"----------------------------------------------\n");
7453 fprintf(fff," ¹ç·×: %lu ÂΤòÅݤ·¤¿¡£\n", (unsigned long int)Total);
7455 fprintf(fff," Total: %lu creature%s killed.\n",
7456 (unsigned long int)Total, (Total == 1 ? "" : "s"));
7460 /* Free the "who" array */
7461 C_KILL(who, max_r_idx, s16b);
7463 /* Close the file */
7466 /* Display the file contents */
7468 show_file(TRUE, file_name, "Åݤ·¤¿Å¨¤Î¿ô", 0, 0);
7470 show_file(TRUE, file_name, "Kill Count", 0, 0);
7474 /* Remove the file */
7480 * @brief ¥â¥ó¥¹¥¿¡¼¾ðÊó¥ê¥¹¥ÈÃæ¤Î¥°¥ë¡¼¥×¤òɽ¼¨¤¹¤ë /
7481 * Display the object groups.
7484 * @brief wid ɽ¼¨Ê¸»ú¿ôÉý
7485 * @brief per_page ¥ê¥¹¥È¤Îɽ¼¨¹Ô
7486 * @brief grp_idx ¥°¥ë¡¼¥×¤ÎIDÇÛÎó
7487 * @brief group_text ¥°¥ë¡¼¥×̾¤Îʸ»úÎóÇÛÎó
7488 * @brie grp_cur ¸½ºß¤ÎÁªÂòID
7489 * @brief grp_top ¸½ºß¤ÎÁªÂò¥ê¥¹¥ÈºÇ¾åÉôID
7492 static void display_group_list(int col, int row, int wid, int per_page,
7493 int grp_idx[], cptr group_text[], int grp_cur, int grp_top)
7497 /* Display lines until done */
7498 for (i = 0; i < per_page && (grp_idx[i] >= 0); i++)
7500 /* Get the group index */
7501 int grp = grp_idx[grp_top + i];
7503 /* Choose a color */
7504 byte attr = (grp_top + i == grp_cur) ? TERM_L_BLUE : TERM_WHITE;
7506 /* Erase the entire line */
7507 Term_erase(col, row + i, wid);
7509 /* Display the group label */
7510 c_put_str(attr, group_text[grp], row + i, col);
7516 * Move the cursor in a browser window
7518 static void browser_cursor(char ch, int *column, int *grp_cur, int grp_cnt,
7519 int *list_cur, int list_cnt)
7524 int list = *list_cur;
7526 /* Extract direction */
7529 /* Hack -- scroll up full screen */
7534 /* Hack -- scroll down full screen */
7539 d = get_keymap_dir(ch);
7544 /* Diagonals - hack */
7545 if ((ddx[d] > 0) && ddy[d])
7551 Term_get_size(&wid, &hgt);
7553 browser_rows = hgt - 8;
7555 /* Browse group list */
7560 /* Move up or down */
7561 grp += ddy[d] * (browser_rows - 1);
7564 if (grp >= grp_cnt) grp = grp_cnt - 1;
7565 if (grp < 0) grp = 0;
7566 if (grp != old_grp) list = 0;
7569 /* Browse sub-list list */
7572 /* Move up or down */
7573 list += ddy[d] * browser_rows;
7576 if (list >= list_cnt) list = list_cnt - 1;
7577 if (list < 0) list = 0;
7589 if (col < 0) col = 0;
7590 if (col > 1) col = 1;
7597 /* Browse group list */
7602 /* Move up or down */
7606 if (grp >= grp_cnt) grp = grp_cnt - 1;
7607 if (grp < 0) grp = 0;
7608 if (grp != old_grp) list = 0;
7611 /* Browse sub-list list */
7614 /* Move up or down */
7618 if (list >= list_cnt) list = list_cnt - 1;
7619 if (list < 0) list = 0;
7630 static void display_visual_list(int col, int row, int height, int width, byte attr_top, byte char_left)
7634 /* Clear the display lines */
7635 for (i = 0; i < height; i++)
7637 Term_erase(col, row + i, width);
7640 /* Bigtile mode uses double width */
7641 if (use_bigtile) width /= 2;
7643 /* Display lines until done */
7644 for (i = 0; i < height; i++)
7646 /* Display columns until done */
7647 for (j = 0; j < width; j++)
7655 /* Bigtile mode uses double width */
7656 if (use_bigtile) x += j;
7661 /* Ignore illegal characters */
7662 if (ia > 0x7f || ic > 0xff || ic < ' ' ||
7663 (!use_graphics && ic > 0x7f))
7669 /* Force correct code for both ASCII character and tile */
7670 if (c & 0x80) a |= 0x80;
7672 /* Display symbol */
7673 Term_queue_bigchar(x, y, a, c, 0, 0);
7680 * Place the cursor at the collect position for visual mode
7682 static void place_visual_list_cursor(int col, int row, byte a, byte c, byte attr_top, byte char_left)
7684 int i = (a & 0x7f) - attr_top;
7685 int j = c - char_left;
7690 /* Bigtile mode uses double width */
7691 if (use_bigtile) x += j;
7693 /* Place the cursor */
7699 * Clipboard variables for copy&paste in visual mode
7701 static byte attr_idx = 0;
7702 static byte char_idx = 0;
7704 /* Hack -- for feature lighting */
7705 static byte attr_idx_feat[F_LIT_MAX];
7706 static byte char_idx_feat[F_LIT_MAX];
7709 * Do visual mode command -- Change symbols
7711 static bool visual_mode_command(char ch, bool *visual_list_ptr,
7712 int height, int width,
7713 byte *attr_top_ptr, byte *char_left_ptr,
7714 byte *cur_attr_ptr, byte *cur_char_ptr, bool *need_redraw)
7716 static byte attr_old = 0, char_old = 0;
7721 if (*visual_list_ptr)
7724 *cur_attr_ptr = attr_old;
7725 *cur_char_ptr = char_old;
7726 *visual_list_ptr = FALSE;
7734 if (*visual_list_ptr)
7737 *visual_list_ptr = FALSE;
7738 *need_redraw = TRUE;
7746 if (!*visual_list_ptr)
7748 *visual_list_ptr = TRUE;
7750 *attr_top_ptr = MAX(0, (*cur_attr_ptr & 0x7f) - 5);
7751 *char_left_ptr = MAX(0, *cur_char_ptr - 10);
7753 attr_old = *cur_attr_ptr;
7754 char_old = *cur_char_ptr;
7765 /* Set the visual */
7766 attr_idx = *cur_attr_ptr;
7767 char_idx = *cur_char_ptr;
7769 /* Hack -- for feature lighting */
7770 for (i = 0; i < F_LIT_MAX; i++)
7772 attr_idx_feat[i] = 0;
7773 char_idx_feat[i] = 0;
7780 if (attr_idx || (!(char_idx & 0x80) && char_idx)) /* Allow TERM_DARK text */
7783 *cur_attr_ptr = attr_idx;
7784 *attr_top_ptr = MAX(0, (*cur_attr_ptr & 0x7f) - 5);
7785 if (!*visual_list_ptr) *need_redraw = TRUE;
7791 *cur_char_ptr = char_idx;
7792 *char_left_ptr = MAX(0, *cur_char_ptr - 10);
7793 if (!*visual_list_ptr) *need_redraw = TRUE;
7799 if (*visual_list_ptr)
7802 int d = get_keymap_dir(ch);
7803 byte a = (*cur_attr_ptr & 0x7f);
7804 byte c = *cur_char_ptr;
7806 if (use_bigtile) eff_width = width / 2;
7807 else eff_width = width;
7809 /* Restrict direction */
7810 if ((a == 0) && (ddy[d] < 0)) d = 0;
7811 if ((c == 0) && (ddx[d] < 0)) d = 0;
7812 if ((a == 0x7f) && (ddy[d] > 0)) d = 0;
7813 if ((c == 0xff) && (ddx[d] > 0)) d = 0;
7818 /* Force correct code for both ASCII character and tile */
7819 if (c & 0x80) a |= 0x80;
7821 /* Set the visual */
7826 /* Move the frame */
7827 if ((ddx[d] < 0) && *char_left_ptr > MAX(0, (int)c - 10)) (*char_left_ptr)--;
7828 if ((ddx[d] > 0) && *char_left_ptr + eff_width < MIN(0xff, (int)c + 10)) (*char_left_ptr)++;
7829 if ((ddy[d] < 0) && *attr_top_ptr > MAX(0, (int)(a & 0x7f) - 4)) (*attr_top_ptr)--;
7830 if ((ddy[d] > 0) && *attr_top_ptr + height < MIN(0x7f, (a & 0x7f) + 4)) (*attr_top_ptr)++;
7836 /* Visual mode command is not used */
7842 * Display the monsters in a group.
7844 static void display_monster_list(int col, int row, int per_page, s16b mon_idx[],
7845 int mon_cur, int mon_top, bool visual_only)
7849 /* Display lines until done */
7850 for (i = 0; i < per_page && (mon_idx[mon_top + i] >= 0); i++)
7854 /* Get the race index */
7855 int r_idx = mon_idx[mon_top + i] ;
7857 /* Access the race */
7858 monster_race *r_ptr = &r_info[r_idx];
7860 /* Choose a color */
7861 attr = ((i + mon_top == mon_cur) ? TERM_L_BLUE : TERM_WHITE);
7863 /* Display the name */
7864 c_prt(attr, (r_name + r_ptr->name), row + i, col);
7866 /* Hack -- visual_list mode */
7869 c_prt(attr, format("%02x/%02x", r_ptr->x_attr, r_ptr->x_char), row + i, (p_ptr->wizard || visual_only) ? 56 : 61);
7871 if (p_ptr->wizard || visual_only)
7873 c_prt(attr, format("%d", r_idx), row + i, 62);
7876 /* Erase chars before overwritten by the race letter */
7877 Term_erase(69, row + i, 255);
7879 /* Display symbol */
7880 Term_queue_bigchar(use_bigtile ? 69 : 70, row + i, r_ptr->x_attr, r_ptr->x_char, 0, 0);
7885 if (!(r_ptr->flags1 & RF1_UNIQUE)) put_str(format("%5d", r_ptr->r_pkills), row + i, 73);
7887 else c_put_str((r_ptr->max_num == 0 ? TERM_L_DARK : TERM_WHITE), (r_ptr->max_num == 0 ? "»àË´" : "À¸Â¸"), row + i, 74);
7889 else c_put_str((r_ptr->max_num == 0 ? TERM_L_DARK : TERM_WHITE), (r_ptr->max_num == 0 ? " dead" : "alive"), row + i, 73);
7894 /* Clear remaining lines */
7895 for (; i < per_page; i++)
7897 Term_erase(col, row + i, 255);
7903 * Display known monsters.
7905 static void do_cmd_knowledge_monsters(bool *need_redraw, bool visual_only, int direct_r_idx)
7908 int grp_cur, grp_top, old_grp_cur;
7909 int mon_cur, mon_top;
7910 int grp_cnt, grp_idx[100];
7918 bool visual_list = FALSE;
7919 byte attr_top = 0, char_left = 0;
7927 Term_get_size(&wid, &hgt);
7929 browser_rows = hgt - 8;
7931 /* Allocate the "mon_idx" array */
7932 C_MAKE(mon_idx, max_r_idx, s16b);
7937 if (direct_r_idx < 0)
7939 mode = visual_only ? 0x03 : 0x01;
7941 /* Check every group */
7942 for (i = 0; monster_group_text[i] != NULL; i++)
7944 /* Measure the label */
7945 len = strlen(monster_group_text[i]);
7947 /* Save the maximum length */
7948 if (len > max) max = len;
7950 /* See if any monsters are known */
7951 if ((monster_group_char[i] == ((char *) -1L)) || collect_monsters(i, mon_idx, mode))
7953 /* Build a list of groups with known monsters */
7954 grp_idx[grp_cnt++] = i;
7962 mon_idx[0] = direct_r_idx;
7965 /* Terminate the list */
7968 (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
7969 &attr_top, &char_left, &r_info[direct_r_idx].x_attr, &r_info[direct_r_idx].x_char, need_redraw);
7972 /* Terminate the list */
7973 grp_idx[grp_cnt] = -1;
7976 grp_cur = grp_top = 0;
7977 mon_cur = mon_top = 0;
7982 mode = visual_only ? 0x02 : 0x00;
7987 monster_race *r_ptr;
7994 prt(format("%s - ¥â¥ó¥¹¥¿¡¼", !visual_only ? "Ãμ±" : "ɽ¼¨"), 2, 0);
7995 if (direct_r_idx < 0) prt("¥°¥ë¡¼¥×", 4, 0);
7996 prt("̾Á°", 4, max + 3);
7997 if (p_ptr->wizard || visual_only) prt("Idx", 4, 62);
7999 if (!visual_only) prt("»¦³²¿ô", 4, 72);
8001 prt(format("%s - monsters", !visual_only ? "Knowledge" : "Visuals"), 2, 0);
8002 if (direct_r_idx < 0) prt("Group", 4, 0);
8003 prt("Name", 4, max + 3);
8004 if (p_ptr->wizard || visual_only) prt("Idx", 4, 62);
8006 if (!visual_only) prt("Kills", 4, 73);
8009 for (i = 0; i < 78; i++)
8011 Term_putch(i, 5, TERM_WHITE, '=');
8014 if (direct_r_idx < 0)
8016 for (i = 0; i < browser_rows; i++)
8018 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
8025 if (direct_r_idx < 0)
8027 /* Scroll group list */
8028 if (grp_cur < grp_top) grp_top = grp_cur;
8029 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
8031 /* Display a list of monster groups */
8032 display_group_list(0, 6, max, browser_rows, grp_idx, monster_group_text, grp_cur, grp_top);
8034 if (old_grp_cur != grp_cur)
8036 old_grp_cur = grp_cur;
8038 /* Get a list of monsters in the current group */
8039 mon_cnt = collect_monsters(grp_idx[grp_cur], mon_idx, mode);
8042 /* Scroll monster list */
8043 while (mon_cur < mon_top)
8044 mon_top = MAX(0, mon_top - browser_rows/2);
8045 while (mon_cur >= mon_top + browser_rows)
8046 mon_top = MIN(mon_cnt - browser_rows, mon_top + browser_rows/2);
8051 /* Display a list of monsters in the current group */
8052 display_monster_list(max + 3, 6, browser_rows, mon_idx, mon_cur, mon_top, visual_only);
8058 /* Display a monster name */
8059 display_monster_list(max + 3, 6, 1, mon_idx, mon_cur, mon_top, visual_only);
8061 /* Display visual list below first monster */
8062 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
8067 prt(format("<Êý¸þ>%s%s%s, ESC",
8068 (!visual_list && !visual_only) ? ", 'r'¤Ç»×¤¤½Ð¤ò¸«¤ë" : "",
8069 visual_list ? ", ENTER¤Ç·èÄê" : ", 'v'¤Ç¥·¥ó¥Ü¥ëÊѹ¹",
8070 (attr_idx || char_idx) ? ", 'c', 'p'¤Ç¥Ú¡¼¥¹¥È" : ", 'c'¤Ç¥³¥Ô¡¼"),
8073 prt(format("<dir>%s%s%s, ESC",
8074 (!visual_list && !visual_only) ? ", 'r' to recall" : "",
8075 visual_list ? ", ENTER to accept" : ", 'v' for visuals",
8076 (attr_idx || char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"),
8080 /* Get the current monster */
8081 r_ptr = &r_info[mon_idx[mon_cur]];
8085 /* Mega Hack -- track this monster race */
8086 if (mon_cnt) monster_race_track(mon_idx[mon_cur]);
8088 /* Hack -- handle stuff */
8094 place_visual_list_cursor(max + 3, 7, r_ptr->x_attr, r_ptr->x_char, attr_top, char_left);
8098 Term_gotoxy(0, 6 + (grp_cur - grp_top));
8102 Term_gotoxy(max + 3, 6 + (mon_cur - mon_top));
8107 /* Do visual mode command if needed */
8108 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))
8110 if (direct_r_idx >= 0)
8135 /* Recall on screen */
8136 if (!visual_list && !visual_only && (mon_idx[mon_cur] > 0))
8138 screen_roff(mon_idx[mon_cur], 0);
8149 /* Move the cursor */
8150 browser_cursor(ch, &column, &grp_cur, grp_cnt, &mon_cur, mon_cnt);
8157 /* Free the "mon_idx" array */
8158 C_KILL(mon_idx, max_r_idx, s16b);
8163 * Display the objects in a group.
8165 static void display_object_list(int col, int row, int per_page, int object_idx[],
8166 int object_cur, int object_top, bool visual_only)
8170 /* Display lines until done */
8171 for (i = 0; i < per_page && (object_idx[object_top + i] >= 0); i++)
8175 object_kind *flavor_k_ptr;
8177 /* Get the object index */
8178 int k_idx = object_idx[object_top + i];
8180 /* Access the object */
8181 object_kind *k_ptr = &k_info[k_idx];
8183 /* Choose a color */
8184 byte attr = ((k_ptr->aware || visual_only) ? TERM_WHITE : TERM_SLATE);
8185 byte cursor = ((k_ptr->aware || visual_only) ? TERM_L_BLUE : TERM_BLUE);
8188 if (!visual_only && k_ptr->flavor)
8190 /* Appearance of this object is shuffled */
8191 flavor_k_ptr = &k_info[k_ptr->flavor];
8195 /* Appearance of this object is very normal */
8196 flavor_k_ptr = k_ptr;
8201 attr = ((i + object_top == object_cur) ? cursor : attr);
8203 if (!k_ptr->flavor || (!visual_only && k_ptr->aware))
8206 strip_name(o_name, k_idx);
8211 strcpy(o_name, k_name + flavor_k_ptr->flavor_name);
8214 /* Display the name */
8215 c_prt(attr, o_name, row + i, col);
8217 /* Hack -- visual_list mode */
8220 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);
8222 if (p_ptr->wizard || visual_only)
8224 c_prt(attr, format("%d", k_idx), row + i, 70);
8227 a = flavor_k_ptr->x_attr;
8228 c = flavor_k_ptr->x_char;
8230 /* Display symbol */
8231 Term_queue_bigchar(use_bigtile ? 76 : 77, row + i, a, c, 0, 0);
8234 /* Clear remaining lines */
8235 for (; i < per_page; i++)
8237 Term_erase(col, row + i, 255);
8242 * Describe fake object
8244 static void desc_obj_fake(int k_idx)
8247 object_type object_type_body;
8249 /* Get local object */
8250 o_ptr = &object_type_body;
8252 /* Wipe the object */
8255 /* Create the artifact */
8256 object_prep(o_ptr, k_idx);
8258 /* It's fully know */
8259 o_ptr->ident |= IDENT_KNOWN;
8261 /* Track the object */
8262 /* object_actual_track(o_ptr); */
8264 /* Hack - mark as fake */
8265 /* term_obj_real = FALSE; */
8267 /* Hack -- Handle stuff */
8270 if (!screen_object(o_ptr, SCROBJ_FAKE_OBJECT | SCROBJ_FORCE_DETAIL))
8273 msg_print("ÆäËÊѤï¤Ã¤¿¤È¤³¤í¤Ï¤Ê¤¤¤è¤¦¤À¡£");
8275 msg_print("You see nothing special.");
8284 * Display known objects
8286 static void do_cmd_knowledge_objects(bool *need_redraw, bool visual_only, int direct_k_idx)
8289 int grp_cur, grp_top, old_grp_cur;
8290 int object_old, object_cur, object_top;
8291 int grp_cnt, grp_idx[100];
8299 bool visual_list = FALSE;
8300 byte attr_top = 0, char_left = 0;
8308 Term_get_size(&wid, &hgt);
8310 browser_rows = hgt - 8;
8312 /* Allocate the "object_idx" array */
8313 C_MAKE(object_idx, max_k_idx, int);
8318 if (direct_k_idx < 0)
8320 mode = visual_only ? 0x03 : 0x01;
8322 /* Check every group */
8323 for (i = 0; object_group_text[i] != NULL; i++)
8325 /* Measure the label */
8326 len = strlen(object_group_text[i]);
8328 /* Save the maximum length */
8329 if (len > max) max = len;
8331 /* See if any monsters are known */
8332 if (collect_objects(i, object_idx, mode))
8334 /* Build a list of groups with known monsters */
8335 grp_idx[grp_cnt++] = i;
8344 object_kind *k_ptr = &k_info[direct_k_idx];
8345 object_kind *flavor_k_ptr;
8347 if (!visual_only && k_ptr->flavor)
8349 /* Appearance of this object is shuffled */
8350 flavor_k_ptr = &k_info[k_ptr->flavor];
8354 /* Appearance of this object is very normal */
8355 flavor_k_ptr = k_ptr;
8358 object_idx[0] = direct_k_idx;
8359 object_old = direct_k_idx;
8362 /* Terminate the list */
8365 (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
8366 &attr_top, &char_left, &flavor_k_ptr->x_attr, &flavor_k_ptr->x_char, need_redraw);
8369 /* Terminate the list */
8370 grp_idx[grp_cnt] = -1;
8373 grp_cur = grp_top = 0;
8374 object_cur = object_top = 0;
8379 mode = visual_only ? 0x02 : 0x00;
8384 object_kind *k_ptr, *flavor_k_ptr;
8391 prt(format("%s - ¥¢¥¤¥Æ¥à", !visual_only ? "Ãμ±" : "ɽ¼¨"), 2, 0);
8392 if (direct_k_idx < 0) prt("¥°¥ë¡¼¥×", 4, 0);
8393 prt("̾Á°", 4, max + 3);
8394 if (p_ptr->wizard || visual_only) prt("Idx", 4, 70);
8397 prt(format("%s - objects", !visual_only ? "Knowledge" : "Visuals"), 2, 0);
8398 if (direct_k_idx < 0) prt("Group", 4, 0);
8399 prt("Name", 4, max + 3);
8400 if (p_ptr->wizard || visual_only) prt("Idx", 4, 70);
8404 for (i = 0; i < 78; i++)
8406 Term_putch(i, 5, TERM_WHITE, '=');
8409 if (direct_k_idx < 0)
8411 for (i = 0; i < browser_rows; i++)
8413 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
8420 if (direct_k_idx < 0)
8422 /* Scroll group list */
8423 if (grp_cur < grp_top) grp_top = grp_cur;
8424 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
8426 /* Display a list of object groups */
8427 display_group_list(0, 6, max, browser_rows, grp_idx, object_group_text, grp_cur, grp_top);
8429 if (old_grp_cur != grp_cur)
8431 old_grp_cur = grp_cur;
8433 /* Get a list of objects in the current group */
8434 object_cnt = collect_objects(grp_idx[grp_cur], object_idx, mode);
8437 /* Scroll object list */
8438 while (object_cur < object_top)
8439 object_top = MAX(0, object_top - browser_rows/2);
8440 while (object_cur >= object_top + browser_rows)
8441 object_top = MIN(object_cnt - browser_rows, object_top + browser_rows/2);
8446 /* Display a list of objects in the current group */
8447 display_object_list(max + 3, 6, browser_rows, object_idx, object_cur, object_top, visual_only);
8451 object_top = object_cur;
8453 /* Display a list of objects in the current group */
8454 display_object_list(max + 3, 6, 1, object_idx, object_cur, object_top, visual_only);
8456 /* Display visual list below first object */
8457 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
8460 /* Get the current object */
8461 k_ptr = &k_info[object_idx[object_cur]];
8463 if (!visual_only && k_ptr->flavor)
8465 /* Appearance of this object is shuffled */
8466 flavor_k_ptr = &k_info[k_ptr->flavor];
8470 /* Appearance of this object is very normal */
8471 flavor_k_ptr = k_ptr;
8476 prt(format("<Êý¸þ>%s%s%s, ESC",
8477 (!visual_list && !visual_only) ? ", 'r'¤Ç¾ÜºÙ¤ò¸«¤ë" : "",
8478 visual_list ? ", ENTER¤Ç·èÄê" : ", 'v'¤Ç¥·¥ó¥Ü¥ëÊѹ¹",
8479 (attr_idx || char_idx) ? ", 'c', 'p'¤Ç¥Ú¡¼¥¹¥È" : ", 'c'¤Ç¥³¥Ô¡¼"),
8482 prt(format("<dir>%s%s%s, ESC",
8483 (!visual_list && !visual_only) ? ", 'r' to recall" : "",
8484 visual_list ? ", ENTER to accept" : ", 'v' for visuals",
8485 (attr_idx || char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"),
8491 /* Mega Hack -- track this object */
8492 if (object_cnt) object_kind_track(object_idx[object_cur]);
8494 /* The "current" object changed */
8495 if (object_old != object_idx[object_cur])
8497 /* Hack -- handle stuff */
8500 /* Remember the "current" object */
8501 object_old = object_idx[object_cur];
8507 place_visual_list_cursor(max + 3, 7, flavor_k_ptr->x_attr, flavor_k_ptr->x_char, attr_top, char_left);
8511 Term_gotoxy(0, 6 + (grp_cur - grp_top));
8515 Term_gotoxy(max + 3, 6 + (object_cur - object_top));
8520 /* Do visual mode command if needed */
8521 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))
8523 if (direct_k_idx >= 0)
8548 /* Recall on screen */
8549 if (!visual_list && !visual_only && (grp_cnt > 0))
8551 desc_obj_fake(object_idx[object_cur]);
8559 /* Move the cursor */
8560 browser_cursor(ch, &column, &grp_cur, grp_cnt, &object_cur, object_cnt);
8566 /* Free the "object_idx" array */
8567 C_KILL(object_idx, max_k_idx, int);
8572 * Display the features in a group.
8574 static void display_feature_list(int col, int row, int per_page, int *feat_idx,
8575 int feat_cur, int feat_top, bool visual_only, int lighting_level)
8577 int lit_col[F_LIT_MAX], i, j;
8578 int f_idx_col = use_bigtile ? 62 : 64;
8580 /* Correct columns 1 and 4 */
8581 lit_col[F_LIT_STANDARD] = use_bigtile ? (71 - F_LIT_MAX) : 71;
8582 for (i = F_LIT_NS_BEGIN; i < F_LIT_MAX; i++)
8583 lit_col[i] = lit_col[F_LIT_STANDARD] + 2 + (i - F_LIT_NS_BEGIN) * 2 + (use_bigtile ? i : 0);
8585 /* Display lines until done */
8586 for (i = 0; i < per_page && (feat_idx[feat_top + i] >= 0); i++)
8591 int f_idx = feat_idx[feat_top + i];
8593 /* Access the index */
8594 feature_type *f_ptr = &f_info[f_idx];
8596 int row_i = row + i;
8598 /* Choose a color */
8599 attr = ((i + feat_top == feat_cur) ? TERM_L_BLUE : TERM_WHITE);
8601 /* Display the name */
8602 c_prt(attr, f_name + f_ptr->name, row_i, col);
8604 /* Hack -- visual_list mode */
8607 /* Display lighting level */
8608 c_prt(attr, format("(%s)", lighting_level_str[lighting_level]), row_i, col + 1 + strlen(f_name + f_ptr->name));
8610 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));
8612 if (p_ptr->wizard || visual_only)
8614 c_prt(attr, format("%d", f_idx), row_i, f_idx_col);
8617 /* Display symbol */
8618 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);
8620 Term_putch(lit_col[F_LIT_NS_BEGIN], row_i, TERM_SLATE, '(');
8621 for (j = F_LIT_NS_BEGIN + 1; j < F_LIT_MAX; j++)
8623 Term_putch(lit_col[j], row_i, TERM_SLATE, '/');
8625 Term_putch(lit_col[F_LIT_MAX - 1] + (use_bigtile ? 3 : 2), row_i, TERM_SLATE, ')');
8627 /* Mega-hack -- Use non-standard colour */
8628 for (j = F_LIT_NS_BEGIN; j < F_LIT_MAX; j++)
8630 Term_queue_bigchar(lit_col[j] + 1, row_i, f_ptr->x_attr[j], f_ptr->x_char[j], 0, 0);
8634 /* Clear remaining lines */
8635 for (; i < per_page; i++)
8637 Term_erase(col, row + i, 255);
8643 * Interact with feature visuals.
8645 static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, int direct_f_idx, int *lighting_level)
8648 int grp_cur, grp_top, old_grp_cur;
8649 int feat_cur, feat_top;
8650 int grp_cnt, grp_idx[100];
8658 bool visual_list = FALSE;
8659 byte attr_top = 0, char_left = 0;
8664 byte attr_old[F_LIT_MAX];
8665 byte char_old[F_LIT_MAX];
8666 byte *cur_attr_ptr, *cur_char_ptr;
8668 (void)C_WIPE(attr_old, F_LIT_MAX, byte);
8669 (void)C_WIPE(char_old, F_LIT_MAX, byte);
8672 Term_get_size(&wid, &hgt);
8674 browser_rows = hgt - 8;
8676 /* Allocate the "feat_idx" array */
8677 C_MAKE(feat_idx, max_f_idx, int);
8682 if (direct_f_idx < 0)
8684 /* Check every group */
8685 for (i = 0; feature_group_text[i] != NULL; i++)
8687 /* Measure the label */
8688 len = strlen(feature_group_text[i]);
8690 /* Save the maximum length */
8691 if (len > max) max = len;
8693 /* See if any features are known */
8694 if (collect_features(i, feat_idx, 0x01))
8696 /* Build a list of groups with known features */
8697 grp_idx[grp_cnt++] = i;
8705 feature_type *f_ptr = &f_info[direct_f_idx];
8707 feat_idx[0] = direct_f_idx;
8710 /* Terminate the list */
8713 (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
8714 &attr_top, &char_left, &f_ptr->x_attr[*lighting_level], &f_ptr->x_char[*lighting_level], need_redraw);
8716 for (i = 0; i < F_LIT_MAX; i++)
8718 attr_old[i] = f_ptr->x_attr[i];
8719 char_old[i] = f_ptr->x_char[i];
8723 /* Terminate the list */
8724 grp_idx[grp_cnt] = -1;
8727 grp_cur = grp_top = 0;
8728 feat_cur = feat_top = 0;
8736 feature_type *f_ptr;
8743 prt("ɽ¼¨ - ÃÏ·Á", 2, 0);
8744 if (direct_f_idx < 0) prt("¥°¥ë¡¼¥×", 4, 0);
8745 prt("̾Á°", 4, max + 3);
8748 if (p_ptr->wizard || visual_only) prt("Idx", 4, 62);
8749 prt("ʸ»ú ( l/ d)", 4, 66);
8753 if (p_ptr->wizard || visual_only) prt("Idx", 4, 64);
8754 prt("ʸ»ú (l/d)", 4, 68);
8757 prt("Visuals - features", 2, 0);
8758 if (direct_f_idx < 0) prt("Group", 4, 0);
8759 prt("Name", 4, max + 3);
8762 if (p_ptr->wizard || visual_only) prt("Idx", 4, 62);
8763 prt("Sym ( l/ d)", 4, 67);
8767 if (p_ptr->wizard || visual_only) prt("Idx", 4, 64);
8768 prt("Sym (l/d)", 4, 69);
8772 for (i = 0; i < 78; i++)
8774 Term_putch(i, 5, TERM_WHITE, '=');
8777 if (direct_f_idx < 0)
8779 for (i = 0; i < browser_rows; i++)
8781 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
8788 if (direct_f_idx < 0)
8790 /* Scroll group list */
8791 if (grp_cur < grp_top) grp_top = grp_cur;
8792 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
8794 /* Display a list of feature groups */
8795 display_group_list(0, 6, max, browser_rows, grp_idx, feature_group_text, grp_cur, grp_top);
8797 if (old_grp_cur != grp_cur)
8799 old_grp_cur = grp_cur;
8801 /* Get a list of features in the current group */
8802 feat_cnt = collect_features(grp_idx[grp_cur], feat_idx, 0x00);
8805 /* Scroll feature list */
8806 while (feat_cur < feat_top)
8807 feat_top = MAX(0, feat_top - browser_rows/2);
8808 while (feat_cur >= feat_top + browser_rows)
8809 feat_top = MIN(feat_cnt - browser_rows, feat_top + browser_rows/2);
8814 /* Display a list of features in the current group */
8815 display_feature_list(max + 3, 6, browser_rows, feat_idx, feat_cur, feat_top, visual_only, F_LIT_STANDARD);
8819 feat_top = feat_cur;
8821 /* Display a list of features in the current group */
8822 display_feature_list(max + 3, 6, 1, feat_idx, feat_cur, feat_top, visual_only, *lighting_level);
8824 /* Display visual list below first object */
8825 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
8830 prt(format("<Êý¸þ>%s, 'd'¤Çɸ½à¸÷¸»¸ú²Ì%s, ESC",
8831 visual_list ? ", ENTER¤Ç·èÄê, 'a'¤ÇÂоÝÌÀÅÙÊѹ¹" : ", 'v'¤Ç¥·¥ó¥Ü¥ëÊѹ¹",
8832 (attr_idx || char_idx) ? ", 'c', 'p'¤Ç¥Ú¡¼¥¹¥È" : ", 'c'¤Ç¥³¥Ô¡¼"),
8835 prt(format("<dir>%s, 'd' for default lighting%s, ESC",
8836 visual_list ? ", ENTER to accept, 'a' for lighting level" : ", 'v' for visuals",
8837 (attr_idx || char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"),
8841 /* Get the current feature */
8842 f_ptr = &f_info[feat_idx[feat_cur]];
8843 cur_attr_ptr = &f_ptr->x_attr[*lighting_level];
8844 cur_char_ptr = &f_ptr->x_char[*lighting_level];
8848 place_visual_list_cursor(max + 3, 7, *cur_attr_ptr, *cur_char_ptr, attr_top, char_left);
8852 Term_gotoxy(0, 6 + (grp_cur - grp_top));
8856 Term_gotoxy(max + 3, 6 + (feat_cur - feat_top));
8861 if (visual_list && ((ch == 'A') || (ch == 'a')))
8863 int prev_lighting_level = *lighting_level;
8867 if (*lighting_level <= 0) *lighting_level = F_LIT_MAX - 1;
8868 else (*lighting_level)--;
8872 if (*lighting_level >= F_LIT_MAX - 1) *lighting_level = 0;
8873 else (*lighting_level)++;
8876 if (f_ptr->x_attr[prev_lighting_level] != f_ptr->x_attr[*lighting_level])
8877 attr_top = MAX(0, (f_ptr->x_attr[*lighting_level] & 0x7f) - 5);
8879 if (f_ptr->x_char[prev_lighting_level] != f_ptr->x_char[*lighting_level])
8880 char_left = MAX(0, f_ptr->x_char[*lighting_level] - 10);
8885 else if ((ch == 'D') || (ch == 'd'))
8887 byte prev_x_attr = f_ptr->x_attr[*lighting_level];
8888 byte prev_x_char = f_ptr->x_char[*lighting_level];
8890 apply_default_feat_lighting(f_ptr->x_attr, f_ptr->x_char);
8894 if (prev_x_attr != f_ptr->x_attr[*lighting_level])
8895 attr_top = MAX(0, (f_ptr->x_attr[*lighting_level] & 0x7f) - 5);
8897 if (prev_x_char != f_ptr->x_char[*lighting_level])
8898 char_left = MAX(0, f_ptr->x_char[*lighting_level] - 10);
8900 else *need_redraw = TRUE;
8905 /* Do visual mode command if needed */
8906 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))
8910 /* Restore previous visual settings */
8912 for (i = 0; i < F_LIT_MAX; i++)
8914 f_ptr->x_attr[i] = attr_old[i];
8915 f_ptr->x_char[i] = char_old[i];
8922 if (direct_f_idx >= 0) flag = TRUE;
8923 else *lighting_level = F_LIT_STANDARD;
8926 /* Preserve current visual settings */
8929 for (i = 0; i < F_LIT_MAX; i++)
8931 attr_old[i] = f_ptr->x_attr[i];
8932 char_old[i] = f_ptr->x_char[i];
8934 *lighting_level = F_LIT_STANDARD;
8941 for (i = 0; i < F_LIT_MAX; i++)
8943 attr_idx_feat[i] = f_ptr->x_attr[i];
8944 char_idx_feat[i] = f_ptr->x_char[i];
8953 /* Allow TERM_DARK text */
8954 for (i = F_LIT_NS_BEGIN; i < F_LIT_MAX; i++)
8956 if (attr_idx_feat[i] || (!(char_idx_feat[i] & 0x80) && char_idx_feat[i])) f_ptr->x_attr[i] = attr_idx_feat[i];
8957 if (char_idx_feat[i]) f_ptr->x_char[i] = char_idx_feat[i];
8975 /* Move the cursor */
8976 browser_cursor(ch, &column, &grp_cur, grp_cnt, &feat_cur, feat_cnt);
8982 /* Free the "feat_idx" array */
8983 C_KILL(feat_idx, max_f_idx, int);
8988 * List wanted monsters
8990 static void do_cmd_knowledge_kubi(void)
8995 char file_name[1024];
8998 /* Open a new file */
8999 fff = my_fopen_temp(file_name, 1024);
9002 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
9004 msg_format("Failed to create temporary file %s.", file_name);
9012 bool listed = FALSE;
9015 fprintf(fff, "º£Æü¤Î¥¿¡¼¥²¥Ã¥È : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "ÉÔÌÀ"));
9017 fprintf(fff, "¾Þ¶â¼ó¥ê¥¹¥È\n");
9019 fprintf(fff, "Today target : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "unknown"));
9021 fprintf(fff, "List of wanted monsters\n");
9023 fprintf(fff, "----------------------------------------------\n");
9025 for (i = 0; i < MAX_KUBI; i++)
9027 if (kubi_r_idx[i] <= 10000)
9029 fprintf(fff,"%s\n", r_name + r_info[kubi_r_idx[i]].name);
9038 fprintf(fff,"\n%s\n", "¾Þ¶â¼ó¤Ï¤â¤¦»Ä¤Ã¤Æ¤¤¤Þ¤»¤ó¡£");
9040 fprintf(fff,"\n%s\n", "There is no more wanted monster.");
9045 /* Close the file */
9048 /* Display the file contents */
9050 show_file(TRUE, file_name, "¾Þ¶â¼ó¤Î°ìÍ÷", 0, 0);
9052 show_file(TRUE, file_name, "Wanted monsters", 0, 0);
9056 /* Remove the file */
9061 * List virtues & status
9063 static void do_cmd_knowledge_virtues(void)
9067 char file_name[1024];
9070 /* Open a new file */
9071 fff = my_fopen_temp(file_name, 1024);
9074 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
9076 msg_format("Failed to create temporary file %s.", file_name);
9085 fprintf(fff, "¸½ºß¤Î°À : %s\n\n", your_alignment());
9087 fprintf(fff, "Your alighnment : %s\n\n", your_alignment());
9092 /* Close the file */
9095 /* Display the file contents */
9097 show_file(TRUE, file_name, "Ȭ¤Ä¤ÎÆÁ", 0, 0);
9099 show_file(TRUE, file_name, "Virtues", 0, 0);
9103 /* Remove the file */
9111 static void do_cmd_knowledge_dungeon(void)
9115 char file_name[1024];
9119 /* Open a new file */
9120 fff = my_fopen_temp(file_name, 1024);
9123 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
9125 msg_format("Failed to create temporary file %s.", file_name);
9133 for (i = 1; i < max_d_idx; i++)
9137 if (!d_info[i].maxdepth) continue;
9138 if (!max_dlv[i]) continue;
9139 if (d_info[i].final_guardian)
9141 if (!r_info[d_info[i].final_guardian].max_num) seiha = TRUE;
9143 else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
9145 fprintf(fff,"%c%-12s : %3d ³¬\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
9147 fprintf(fff,"%c%-16s : level %3d\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
9152 /* Close the file */
9155 /* Display the file contents */
9157 show_file(TRUE, file_name, "º£¤Þ¤Ç¤ËÆþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó", 0, 0);
9159 show_file(TRUE, file_name, "Dungeon", 0, 0);
9163 /* Remove the file */
9168 * List virtues & status
9171 static void do_cmd_knowledge_stat(void)
9175 char file_name[1024];
9178 /* Open a new file */
9179 fff = my_fopen_temp(file_name, 1024);
9182 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
9184 msg_format("Failed to create temporary file %s.", file_name);
9192 percent = (int)(((long)p_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
9193 (2 * p_ptr->hitdie +
9194 ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
9197 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : %d/100\n\n", percent);
9198 else fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : ???\n\n");
9199 fprintf(fff, "ǽÎϤκÇÂçÃÍ\n\n");
9201 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "Your current Life Rating is %d/100.\n\n", percent);
9202 else fprintf(fff, "Your current Life Rating is ???.\n\n");
9203 fprintf(fff, "Limits of maximum stats\n\n");
9205 for (v_nr = 0; v_nr < 6; v_nr++)
9207 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);
9208 else fprintf(fff, "%s ???\n", stat_names[v_nr]);
9214 /* Close the file */
9217 /* Display the file contents */
9219 show_file(TRUE, file_name, "¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó", 0, 0);
9221 show_file(TRUE, file_name, "HP-rate & Max stat", 0, 0);
9225 /* Remove the file */
9231 * Print all active quests
9233 static void do_cmd_knowledge_quests_current(FILE *fff)
9236 char rand_tmp_str[120] = "\0";
9238 monster_race *r_ptr;
9240 int rand_level = 100;
9244 fprintf(fff, "¡Ô¿ë¹ÔÃæ¤Î¥¯¥¨¥¹¥È¡Õ\n");
9246 fprintf(fff, "< Current Quest >\n");
9249 for (i = 1; i < max_quests; i++)
9251 if ((quest[i].status == QUEST_STATUS_TAKEN) ||
9252 ((quest[i].status == QUEST_STATUS_STAGE_COMPLETED) && (quest[i].type == QUEST_TYPE_TOWER)) ||
9253 (quest[i].status == QUEST_STATUS_COMPLETED))
9255 /* Set the quest number temporary */
9256 int old_quest = p_ptr->inside_quest;
9259 /* Clear the text */
9260 for (j = 0; j < 10; j++) quest_text[j][0] = '\0';
9261 quest_text_line = 0;
9263 p_ptr->inside_quest = i;
9265 /* Get the quest text */
9266 init_flags = INIT_SHOW_TEXT;
9268 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
9270 /* Reset the old quest number */
9271 p_ptr->inside_quest = old_quest;
9273 /* No info from "silent" quests */
9274 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
9278 if (quest[i].type != QUEST_TYPE_RANDOM)
9280 char note[80] = "\0";
9282 if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_STAGE_COMPLETED)
9284 switch (quest[i].type)
9286 case QUEST_TYPE_KILL_LEVEL:
9287 case QUEST_TYPE_KILL_ANY_LEVEL:
9288 r_ptr = &r_info[quest[i].r_idx];
9289 strcpy(name, r_name + r_ptr->name);
9290 if (quest[i].max_num > 1)
9293 sprintf(note," - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",
9294 quest[i].max_num, name, quest[i].max_num - quest[i].cur_num);
9297 sprintf(note," - kill %d %s, have killed %d.",
9298 quest[i].max_num, name, quest[i].cur_num);
9303 sprintf(note," - %s¤òÅݤ¹¡£",name);
9305 sprintf(note," - kill %s.",name);
9309 case QUEST_TYPE_FIND_ARTIFACT:
9312 artifact_type *a_ptr = &a_info[quest[i].k_idx];
9314 object_type *q_ptr = &forge;
9315 int k_idx = lookup_kind(a_ptr->tval, a_ptr->sval);
9316 object_prep(q_ptr, k_idx);
9317 q_ptr->name1 = quest[i].k_idx;
9318 q_ptr->ident = IDENT_STORE;
9319 object_desc(name, q_ptr, OD_NAME_ONLY);
9322 sprintf(note,"\n - %s¤ò¸«¤Ä¤±½Ð¤¹¡£", name);
9324 sprintf(note,"\n - Find out %s.", name);
9327 case QUEST_TYPE_FIND_EXIT:
9329 sprintf(note," - ½Ð¸ý¤ËÅþ㤹¤ë¡£");
9331 sprintf(note," - Reach to Exit.");
9335 case QUEST_TYPE_KILL_NUMBER:
9337 sprintf(note," - %d ÂΤΥâ¥ó¥¹¥¿¡¼¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",
9338 quest[i].max_num, quest[i].max_num - quest[i].cur_num);
9340 sprintf(note," - Kill %d monsters, have killed %d.",
9341 quest[i].max_num, quest[i].cur_num);
9345 case QUEST_TYPE_KILL_ALL:
9346 case QUEST_TYPE_TOWER:
9348 sprintf(note," - Á´¤Æ¤Î¥â¥ó¥¹¥¿¡¼¤òÅݤ¹¡£");
9350 sprintf(note," - Kill all monsters.");
9356 /* Print the quest info */
9358 sprintf(tmp_str, " %s (´í¸±ÅÙ:%d³¬ÁêÅö)%s\n",
9359 quest[i].name, quest[i].level, note);
9361 sprintf(tmp_str, " %s (Danger level: %d)%s\n",
9362 quest[i].name, quest[i].level, note);
9365 fputs(tmp_str, fff);
9367 if (quest[i].status == QUEST_STATUS_COMPLETED)
9370 sprintf(tmp_str, " ¥¯¥¨¥¹¥ÈãÀ® - ¤Þ¤ÀÊó½·¤ò¼õ¤±¤È¤Ã¤Æ¤Ê¤¤¡£\n");
9372 sprintf(tmp_str, " Quest Completed - Unrewarded\n");
9374 fputs(tmp_str, fff);
9380 while (quest_text[j][0] && j < 10)
9382 fprintf(fff, " %s\n", quest_text[j]);
9387 else if (quest[i].level < rand_level) /* QUEST_TYPE_RANDOM */
9390 rand_level = quest[i].level;
9392 if (max_dlv[DUNGEON_ANGBAND] >= rand_level)
9394 /* Print the quest info */
9395 r_ptr = &r_info[quest[i].r_idx];
9396 strcpy(name, r_name + r_ptr->name);
9398 if (quest[i].max_num > 1)
9401 sprintf(rand_tmp_str," %s (%d ³¬) - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)\n",
9402 quest[i].name, quest[i].level,
9403 quest[i].max_num, name, quest[i].max_num - quest[i].cur_num);
9407 sprintf(rand_tmp_str," %s (Dungeon level: %d)\n Kill %d %s, have killed %d.\n",
9408 quest[i].name, quest[i].level,
9409 quest[i].max_num, name, quest[i].cur_num);
9415 sprintf(rand_tmp_str," %s (%d ³¬) - %s¤òÅݤ¹¡£\n",
9416 quest[i].name, quest[i].level, name);
9418 sprintf(rand_tmp_str," %s (Dungeon level: %d)\n Kill %s.\n",
9419 quest[i].name, quest[i].level, name);
9427 /* Print the current random quest */
9428 if (rand_tmp_str[0]) fputs(rand_tmp_str, fff);
9431 if (!total) fprintf(fff, " ¤Ê¤·\n");
9433 if (!total) fprintf(fff, " Nothing.\n");
9438 static bool do_cmd_knowledge_quests_aux(FILE *fff, int q_idx)
9441 char playtime_str[16];
9442 quest_type* const q_ptr = &quest[q_idx];
9444 if (is_fixed_quest_idx(q_idx))
9446 /* Set the quest number temporary */
9447 int old_quest = p_ptr->inside_quest;
9449 p_ptr->inside_quest = q_idx;
9452 init_flags = INIT_NAME_ONLY;
9454 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
9456 /* Reset the old quest number */
9457 p_ptr->inside_quest = old_quest;
9459 /* No info from "silent" quests */
9460 if (q_ptr->flags & QUEST_FLAG_SILENT) return FALSE;
9463 strnfmt(playtime_str, sizeof(playtime_str), "%02d:%02d:%02d",
9464 q_ptr->comptime/(60*60), (q_ptr->comptime/60)%60, q_ptr->comptime%60);
9466 if (!is_fixed_quest_idx(q_idx) && q_ptr->r_idx)
9468 /* Print the quest info */
9469 if (q_ptr->complev == 0)
9472 _(" %-35s (%3d³¬) - ÉÔÀᄀ - %s\n",
9473 " %-35s (Dungeon level: %3d) - Unearned - %s\n") ,
9474 r_name+r_info[q_ptr->r_idx].name,
9475 q_ptr->level, playtime_str);
9480 _(" %-35s (%3d³¬) - ¥ì¥Ù¥ë%2d - %s\n",
9481 " %-35s (Dungeon level: %3d) - level %2d - %s\n") ,
9482 r_name+r_info[q_ptr->r_idx].name,
9490 /* Print the quest info */
9492 _(" %-35s (´í¸±ÅÙ:%3d³¬ÁêÅö) - ¥ì¥Ù¥ë%2d - %s\n",
9493 " %-35s (Danger level: %3d) - level %2d - %s\n") ,
9494 q_ptr->name, q_ptr->level, q_ptr->complev, playtime_str);
9497 fputs(tmp_str, fff);
9503 * Print all finished quests
9505 void do_cmd_knowledge_quests_completed(FILE *fff, int quest_num[])
9511 fprintf(fff, "¡ÔãÀ®¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
9513 fprintf(fff, "< Completed Quest >\n");
9515 for (i = 1; i < max_quests; i++)
9517 int q_idx = quest_num[i];
9518 quest_type* const q_ptr = &quest[q_idx];
9520 if (q_ptr->status == QUEST_STATUS_FINISHED &&
9521 do_cmd_knowledge_quests_aux(fff, q_idx))
9527 if (!total) fprintf(fff, " ¤Ê¤·\n");
9529 if (!total) fprintf(fff, " Nothing.\n");
9535 * Print all failed quests
9537 void do_cmd_knowledge_quests_failed(FILE *fff, int quest_num[])
9543 fprintf(fff, "¡Ô¼ºÇÔ¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
9545 fprintf(fff, "< Failed Quest >\n");
9547 for (i = 1; i < max_quests; i++)
9549 int q_idx = quest_num[i];
9550 quest_type* const q_ptr = &quest[q_idx];
9552 if (((q_ptr->status == QUEST_STATUS_FAILED_DONE) || (q_ptr->status == QUEST_STATUS_FAILED)) &&
9553 do_cmd_knowledge_quests_aux(fff, q_idx))
9559 if (!total) fprintf(fff, " ¤Ê¤·\n");
9561 if (!total) fprintf(fff, " Nothing.\n");
9567 * Print all random quests
9569 static void do_cmd_knowledge_quests_wiz_random(FILE *fff)
9576 fprintf(fff, "¡Ô»Ä¤ê¤Î¥é¥ó¥À¥à¥¯¥¨¥¹¥È¡Õ\n");
9578 fprintf(fff, "< Remaining Random Quest >\n");
9580 for (i = 1; i < max_quests; i++)
9582 /* No info from "silent" quests */
9583 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
9585 if ((quest[i].type == QUEST_TYPE_RANDOM) && (quest[i].status == QUEST_STATUS_TAKEN))
9589 /* Print the quest info */
9591 sprintf(tmp_str, " %s (%d³¬, %s)\n",
9592 quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
9594 sprintf(tmp_str, " %s (%d, %s)\n",
9595 quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
9597 fputs(tmp_str, fff);
9601 if (!total) fprintf(fff, " ¤Ê¤·\n");
9603 if (!total) fprintf(fff, " Nothing.\n");
9608 bool ang_sort_comp_quest_num(vptr u, vptr v, int a, int b)
9610 int *q_num = (int *)u;
9611 quest_type *qa = &quest[q_num[a]];
9612 quest_type *qb = &quest[q_num[b]];
9617 return (qa->comptime <= qb->comptime);
9620 void ang_sort_swap_quest_num(vptr u, vptr v, int a, int b)
9622 int *q_num = (int *)u;
9629 q_num[a] = q_num[b];
9635 * Print quest status of all active quests
9637 static void do_cmd_knowledge_quests(void)
9640 char file_name[1024];
9641 int *quest_num, dummy, i;
9643 /* Open a new file */
9644 fff = my_fopen_temp(file_name, 1024);
9648 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
9650 msg_format("Failed to create temporary file %s.", file_name);
9656 /* Allocate Memory */
9657 C_MAKE(quest_num, max_quests, int);
9659 /* Sort by compete level */
9660 for (i = 1; i < max_quests; i++) quest_num[i] = i;
9661 ang_sort_comp = ang_sort_comp_quest_num;
9662 ang_sort_swap = ang_sort_swap_quest_num;
9663 ang_sort(quest_num, &dummy, max_quests);
9665 /* Dump Quest Information */
9666 do_cmd_knowledge_quests_current(fff);
9668 do_cmd_knowledge_quests_completed(fff, quest_num);
9670 do_cmd_knowledge_quests_failed(fff, quest_num);
9674 do_cmd_knowledge_quests_wiz_random(fff);
9677 /* Close the file */
9680 /* Display the file contents */
9682 show_file(TRUE, file_name, "¥¯¥¨¥¹¥ÈãÀ®¾õ¶·", 0, 0);
9684 show_file(TRUE, file_name, "Quest status", 0, 0);
9687 /* Remove the file */
9691 C_KILL(quest_num, max_quests, int);
9698 static void do_cmd_knowledge_home(void)
9703 char file_name[1024];
9705 char o_name[MAX_NLEN];
9708 process_dungeon_file("w_info.txt", 0, 0, max_wild_y, max_wild_x);
9710 /* Open a new file */
9711 fff = my_fopen_temp(file_name, 1024);
9714 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
9716 msg_format("Failed to create temporary file %s.", file_name);
9724 /* Print all homes in the different towns */
9725 st_ptr = &town[1].store[STORE_HOME];
9727 /* Home -- if anything there */
9728 if (st_ptr->stock_num)
9733 /* Header with name of the town */
9735 fprintf(fff, " [ ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ]\n");
9737 fprintf(fff, " [Home Inventory]\n");
9740 /* Dump all available items */
9741 for (i = 0; i < st_ptr->stock_num; i++)
9744 if ((i % 12) == 0) fprintf(fff, "\n ( %d ¥Ú¡¼¥¸ )\n", x++);
9745 object_desc(o_name, &st_ptr->stock[i], 0);
9746 if (strlen(o_name) <= 80-3)
9748 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
9754 for (n = 0, t = o_name; n < 80-3; n++, t++)
9755 if(iskanji(*t)) {t++; n++;}
9756 if (n == 81-3) n = 79-3; /* ºÇ¸å¤¬´Á»úȾʬ */
9758 fprintf(fff, "%c%s %.*s\n", I2A(i%12), paren, n, o_name);
9759 fprintf(fff, " %.77s\n", o_name+n);
9762 object_desc(o_name, &st_ptr->stock[i], 0);
9763 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
9768 /* Add an empty line */
9769 fprintf(fff, "\n\n");
9773 /* Close the file */
9776 /* Display the file contents */
9778 show_file(TRUE, file_name, "²æ¤¬²È¤Î¥¢¥¤¥Æ¥à", 0, 0);
9780 show_file(TRUE, file_name, "Home Inventory", 0, 0);
9784 /* Remove the file */
9790 * Check the status of "autopick"
9792 static void do_cmd_knowledge_autopick(void)
9796 char file_name[1024];
9798 /* Open a new file */
9799 fff = my_fopen_temp(file_name, 1024);
9804 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
9806 msg_format("Failed to create temporary file %s.", file_name);
9815 fprintf(fff, "¼«Æ°Ç˲õ/½¦¤¤¤Ë¤Ï²¿¤âÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
9817 fprintf(fff, "No preference for auto picker/destroyer.");
9823 fprintf(fff, " ¼«Æ°½¦¤¤/Ç˲õ¤Ë¤Ï¸½ºß %d¹ÔÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£\n\n", max_autopick);
9825 fprintf(fff, " There are %d registered lines for auto picker/destroyer.\n\n", max_autopick);
9829 for (k = 0; k < max_autopick; k++)
9832 byte act = autopick_list[k].action;
9833 if (act & DONT_AUTOPICK)
9841 else if (act & DO_AUTODESTROY)
9849 else if (act & DO_AUTOPICK)
9857 else /* if (act & DO_QUERY_AUTOPICK) */ /* Obvious */
9866 if (act & DO_DISPLAY)
9867 fprintf(fff, "%11s", format("[%s]", tmp));
9869 fprintf(fff, "%11s", format("(%s)", tmp));
9871 tmp = autopick_line_from_entry(&autopick_list[k]);
9872 fprintf(fff, " %s", tmp);
9876 /* Close the file */
9878 /* Display the file contents */
9880 show_file(TRUE, file_name, "¼«Æ°½¦¤¤/Ç˲õ ÀßÄê¥ê¥¹¥È", 0, 0);
9882 show_file(TRUE, file_name, "Auto-picker/Destroyer", 0, 0);
9885 /* Remove the file */
9891 * Interact with "knowledge"
9893 void do_cmd_knowledge(void)
9896 bool need_redraw = FALSE;
9898 /* File type is "TEXT" */
9899 FILE_TYPE(FILE_TYPE_TEXT);
9901 /* Save the screen */
9904 /* Interact until done */
9910 /* Ask for a choice */
9912 prt(format("%d/2 ¥Ú¡¼¥¸", (p+1)), 2, 65);
9913 prt("¸½ºß¤ÎÃ챤ò³Îǧ¤¹¤ë", 3, 0);
9915 prt(format("page %d/2", (p+1)), 2, 65);
9916 prt("Display current knowledge", 3, 0);
9919 /* Give some choices */
9923 prt("(1) ´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 6, 5);
9924 prt("(2) ´ûÃΤΥ¢¥¤¥Æ¥à ¤Î°ìÍ÷", 7, 5);
9925 prt("(3) ´ûÃΤÎÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 8, 5);
9926 prt("(4) ´ûÃΤΥâ¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 9, 5);
9927 prt("(5) Åݤ·¤¿Å¨¤Î¿ô ¤Î°ìÍ÷", 10, 5);
9928 if (!vanilla_town) prt("(6) ¾Þ¶â¼ó ¤Î°ìÍ÷", 11, 5);
9929 prt("(7) ¸½ºß¤Î¥Ú¥Ã¥È ¤Î°ìÍ÷", 12, 5);
9930 prt("(8) ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 13, 5);
9931 prt("(9) *´ÕÄê*ºÑ¤ßÁõÈ÷¤ÎÂÑÀ ¤Î°ìÍ÷", 14, 5);
9932 prt("(0) ÃÏ·Á¤Îɽ¼¨Ê¸»ú/¥¿¥¤¥ë ¤Î°ìÍ÷", 15, 5);
9936 prt("(a) ¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó ¤Î°ìÍ÷", 6, 5);
9937 prt("(b) ÆÍÁ³ÊÑ°Û ¤Î°ìÍ÷", 7, 5);
9938 prt("(c) Éð´ï¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 8, 5);
9939 prt("(d) ËâË¡¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 9, 5);
9940 prt("(e) µ»Ç½¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 10, 5);
9941 prt("(f) ¥×¥ì¥¤¥ä¡¼¤ÎÆÁ ¤Î°ìÍ÷", 11, 5);
9942 prt("(g) Æþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó ¤Î°ìÍ÷", 12, 5);
9943 prt("(h) ¼Â¹ÔÃæ¤Î¥¯¥¨¥¹¥È ¤Î°ìÍ÷", 13, 5);
9944 prt("(i) ¸½ºß¤Î¼«Æ°½¦¤¤/Ç˲õÀßÄê ¤Î°ìÍ÷", 14, 5);
9949 prt("(1) Display known artifacts", 6, 5);
9950 prt("(2) Display known objects", 7, 5);
9951 prt("(3) Display remaining uniques", 8, 5);
9952 prt("(4) Display known monster", 9, 5);
9953 prt("(5) Display kill count", 10, 5);
9954 if (!vanilla_town) prt("(6) Display wanted monsters", 11, 5);
9955 prt("(7) Display current pets", 12, 5);
9956 prt("(8) Display home inventory", 13, 5);
9957 prt("(9) Display *identified* equip.", 14, 5);
9958 prt("(0) Display terrain symbols.", 15, 5);
9962 prt("(a) Display about yourself", 6, 5);
9963 prt("(b) Display mutations", 7, 5);
9964 prt("(c) Display weapon proficiency", 8, 5);
9965 prt("(d) Display spell proficiency", 9, 5);
9966 prt("(e) Display misc. proficiency", 10, 5);
9967 prt("(f) Display virtues", 11, 5);
9968 prt("(g) Display dungeons", 12, 5);
9969 prt("(h) Display current quests", 13, 5);
9970 prt("(i) Display auto pick/destroy", 14, 5);
9975 prt("-³¤¯-", 17, 8);
9976 prt("ESC) È´¤±¤ë", 21, 1);
9977 prt("SPACE) ¼¡¥Ú¡¼¥¸", 21, 30);
9978 /*prt("-) Á°¥Ú¡¼¥¸", 21, 60);*/
9979 prt("¥³¥Þ¥ó¥É:", 20, 0);
9981 prt("-more-", 17, 8);
9982 prt("ESC) Exit menu", 21, 1);
9983 prt("SPACE) Next page", 21, 30);
9984 /*prt("-) Previous page", 21, 60);*/
9985 prt("Command: ", 20, 0);
9992 if (i == ESCAPE) break;
9995 case ' ': /* Page change */
9999 case '1': /* Artifacts */
10000 do_cmd_knowledge_artifacts();
10002 case '2': /* Objects */
10003 do_cmd_knowledge_objects(&need_redraw, FALSE, -1);
10005 case '3': /* Uniques */
10006 do_cmd_knowledge_uniques();
10008 case '4': /* Monsters */
10009 do_cmd_knowledge_monsters(&need_redraw, FALSE, -1);
10011 case '5': /* Kill count */
10012 do_cmd_knowledge_kill_count();
10014 case '6': /* wanted */
10015 if (!vanilla_town) do_cmd_knowledge_kubi();
10017 case '7': /* Pets */
10018 do_cmd_knowledge_pets();
10020 case '8': /* Home */
10021 do_cmd_knowledge_home();
10023 case '9': /* Resist list */
10024 do_cmd_knowledge_inven();
10026 case '0': /* Feature list */
10028 int lighting_level = F_LIT_STANDARD;
10029 do_cmd_knowledge_features(&need_redraw, FALSE, -1, &lighting_level);
10033 case 'a': /* Max stat */
10034 do_cmd_knowledge_stat();
10036 case 'b': /* Mutations */
10037 do_cmd_knowledge_mutations();
10039 case 'c': /* weapon-exp */
10040 do_cmd_knowledge_weapon_exp();
10042 case 'd': /* spell-exp */
10043 do_cmd_knowledge_spell_exp();
10045 case 'e': /* skill-exp */
10046 do_cmd_knowledge_skill_exp();
10048 case 'f': /* Virtues */
10049 do_cmd_knowledge_virtues();
10051 case 'g': /* Dungeon */
10052 do_cmd_knowledge_dungeon();
10054 case 'h': /* Quests */
10055 do_cmd_knowledge_quests();
10057 case 'i': /* Autopick */
10058 do_cmd_knowledge_autopick();
10060 default: /* Unknown option */
10064 /* Flush messages */
10068 /* Restore the screen */
10071 if (need_redraw) do_cmd_redraw();
10076 * Check on the status of an active quest
10078 void do_cmd_checkquest(void)
10080 /* File type is "TEXT" */
10081 FILE_TYPE(FILE_TYPE_TEXT);
10083 /* Save the screen */
10087 do_cmd_knowledge_quests();
10089 /* Restore the screen */
10095 * Display the time and date
10097 void do_cmd_time(void)
10099 int day, hour, min, full, start, end, num;
10107 extract_day_hour_min(&day, &hour, &min);
10109 full = hour * 100 + min;
10117 strcpy(desc, "ÊѤʻþ¹ï¤À¡£");
10119 strcpy(desc, "It is a strange time.");
10123 if (day < MAX_DAYS) sprintf(day_buf, "%d", day);
10124 else strcpy(day_buf, "*****");
10128 msg_format("%sÆüÌÜ, »þ¹ï¤Ï%d:%02d %s¤Ç¤¹¡£",
10129 day_buf, (hour % 12 == 0) ? 12 : (hour % 12),
10130 min, (hour < 12) ? "AM" : "PM");
10132 msg_format("This is day %s. The time is %d:%02d %s.",
10133 day_buf, (hour % 12 == 0) ? 12 : (hour % 12),
10134 min, (hour < 12) ? "AM" : "PM");
10138 /* Find the path */
10139 if (!randint0(10) || p_ptr->image)
10142 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timefun_j.txt");
10144 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timefun.txt");
10151 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timenorm_j.txt");
10153 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timenorm.txt");
10158 /* Open this file */
10159 fff = my_fopen(buf, "rt");
10164 /* Find this time */
10165 while (!my_fgets(fff, buf, sizeof(buf)))
10167 /* Ignore comments */
10168 if (!buf[0] || (buf[0] == '#')) continue;
10170 /* Ignore invalid lines */
10171 if (buf[1] != ':') continue;
10173 /* Process 'Start' */
10176 /* Extract the starting time */
10177 start = atoi(buf + 2);
10179 /* Assume valid for an hour */
10186 /* Process 'End' */
10189 /* Extract the ending time */
10190 end = atoi(buf + 2);
10196 /* Ignore incorrect range */
10197 if ((start > full) || (full > end)) continue;
10199 /* Process 'Description' */
10204 /* Apply the randomizer */
10205 if (!randint0(num)) strcpy(desc, buf + 2);
10215 /* Close the file */