3 * @brief プレイヤーのインターフェイスに関するコマンドの実装 / Interface commands
7 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research,
9 * and not for profit purposes provided that this copyright and statement
10 * are included in all such copies. Other copyrights may also apply.
14 * A set of functions to maintain automatic dumps of various kinds.
16 * remove_auto_dump(orig_file, mark)
17 * Remove the old automatic dump of type "mark".
18 * auto_dump_printf(fmt, ...)
19 * Dump a formatted string using fprintf().
20 * open_auto_dump(buf, mark)
21 * Open a file, remove old dump, and add new header.
22 * close_auto_dump(void)
23 * Add a footer, and close the file.
24 * The dump commands of original Angband simply add new lines to
25 * existing files; these files will become bigger and bigger unless
26 * an user deletes some or all of these files by hand at some
28 * These three functions automatically delete old dumped lines
29 * before adding new ones. Since there are various kinds of automatic
30 * dumps in a single file, we add a header and a footer with a type
31 * name for every automatic dump, and kill old lines only when the
32 * lines have the correct type of header and footer.
33 * We need to be quite paranoid about correctness; the user might
34 * (mistakenly) edit the file by hand, and see all their work come
35 * to nothing on the next auto dump otherwise. The current code only
36 * detects changes by noting inconsistencies between the actual number
37 * of lines and the number written in the footer. Note that this will
38 * not catch single-line edits.
50 * Mark strings for auto dump
52 static char auto_dump_header[] = "# vvvvvvv== %s ==vvvvvvv";
53 static char auto_dump_footer[] = "# ^^^^^^^== %s ==^^^^^^^";
56 * Variables for auto dump
58 static FILE *auto_dump_stream;
59 static cptr auto_dump_mark;
60 static int auto_dump_line_num;
64 * @brief prf出力内容を消去する /
65 * Remove old lines automatically generated before.
66 * @param orig_file 消去を行うファイル名
68 static void remove_auto_dump(cptr orig_file)
70 FILE *tmp_fff, *orig_fff;
74 bool between_mark = FALSE;
77 long header_location = 0;
78 char header_mark_str[80];
79 char footer_mark_str[80];
82 /* Prepare a header/footer mark string */
83 sprintf(header_mark_str, auto_dump_header, auto_dump_mark);
84 sprintf(footer_mark_str, auto_dump_footer, auto_dump_mark);
86 mark_len = strlen(footer_mark_str);
88 /* Open an old dump file in read-only mode */
89 orig_fff = my_fopen(orig_file, "r");
91 /* If original file does not exist, nothing to do */
92 if (!orig_fff) return;
94 /* Open a new (temporary) file */
95 tmp_fff = my_fopen_temp(tmp_file, 1024);
99 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), tmp_file);
104 /* Loop for every line */
108 if (my_fgets(orig_fff, buf, sizeof(buf)))
110 /* Read error: Assume End of File */
113 * Was looking for the footer, but not found.
115 * Since automatic dump might be edited by hand,
116 * it's dangerous to kill these lines.
117 * Seek back to the next line of the (pseudo) header,
122 fseek(orig_fff, header_location, SEEK_SET);
123 between_mark = FALSE;
127 /* Success -- End the loop */
134 /* We are looking for the header mark of automatic dump */
137 /* Is this line a header? */
138 if (!strcmp(buf, header_mark_str))
140 /* Memorise seek point of this line */
141 header_location = ftell(orig_fff);
143 /* Initialize counter for number of lines */
146 /* Look for the footer from now */
149 /* There are some changes */
156 /* Copy orginally lines */
157 fprintf(tmp_fff, "%s\n", buf);
161 /* We are looking for the footer mark of automatic dump */
164 /* Is this line a footer? */
165 if (!strncmp(buf, footer_mark_str, mark_len))
170 * Compare the number of lines
172 * If there is an inconsistency between
173 * actual number of lines and the
174 * number here, the automatic dump
175 * might be edited by hand. So it's
176 * dangerous to kill these lines.
177 * Seek back to the next line of the
178 * (pseudo) header, and read again.
180 if (!sscanf(buf + mark_len, " (%d)", &tmp)
183 fseek(orig_fff, header_location, SEEK_SET);
186 /* Look for another header */
187 between_mark = FALSE;
193 /* Ignore old line, and count number of lines */
203 /* If there are some changes, overwrite the original file with new one */
206 /* Copy contents of temporary file */
208 tmp_fff = my_fopen(tmp_file, "r");
209 orig_fff = my_fopen(orig_file, "w");
211 while (!my_fgets(tmp_fff, buf, sizeof(buf)))
212 fprintf(orig_fff, "%s\n", buf);
218 /* Kill the temporary file */
226 * @brief prfファイルのフォーマットに従った内容を出力する /
227 * Dump a formatted line, using "vstrnfmt()".
230 static void auto_dump_printf(cptr fmt, ...)
237 /* Begin the Varargs Stuff */
240 /* Format the args, save the length */
241 (void)vstrnfmt(buf, sizeof(buf), fmt, vp);
243 /* End the Varargs Stuff */
246 /* Count number of lines */
247 for (p = buf; *p; p++)
249 if (*p == '\n') auto_dump_line_num++;
253 fprintf(auto_dump_stream, "%s", buf);
258 * @brief prfファイルをファイルオープンする /
259 * Open file to append auto dump.
261 * @param mark 出力するヘッダマーク
262 * @return ファイルポインタを取得できたらTRUEを返す
264 static bool open_auto_dump(cptr buf, cptr mark)
267 char header_mark_str[80];
269 /* Save the mark string */
270 auto_dump_mark = mark;
272 /* Prepare a header mark string */
273 sprintf(header_mark_str, auto_dump_header, auto_dump_mark);
275 /* Remove old macro dumps */
276 remove_auto_dump(buf);
278 /* Append to the file */
279 auto_dump_stream = my_fopen(buf, "a");
282 if (!auto_dump_stream) {
283 msg_format(_("%s を開くことができませんでした。", "Failed to open %s."), buf);
291 fprintf(auto_dump_stream, "%s\n", header_mark_str);
293 /* Initialize counter */
294 auto_dump_line_num = 0;
296 auto_dump_printf(_("# *警告!!* 以降の行は自動生成されたものです。\n",
297 "# *Warning!* The lines below are an automatic dump.\n"));
298 auto_dump_printf(_("# *警告!!* 後で自動的に削除されるので編集しないでください。\n",
299 "# Don't edit them; changes will be deleted and replaced automatically.\n"));
305 * @brief prfファイルをファイルクローズする /
306 * Append foot part and close auto dump.
309 static void close_auto_dump(void)
311 char footer_mark_str[80];
313 /* Prepare a footer mark string */
314 sprintf(footer_mark_str, auto_dump_footer, auto_dump_mark);
316 auto_dump_printf(_("# *警告!!* 以降の行は自動生成されたものです。\n",
317 "# *Warning!* The lines below are an automatic dump.\n"));
318 auto_dump_printf(_("# *警告!!* 後で自動的に削除されるので編集しないでください。\n",
319 "# Don't edit them; changes will be deleted and replaced automatically.\n"));
321 fprintf(auto_dump_stream, "%s (%d)\n", footer_mark_str, auto_dump_line_num);
324 my_fclose(auto_dump_stream);
333 * @brief Return suffix of ordinal number
335 * @return pointer of suffix string.
337 cptr get_ordinal_number_suffix(int num)
339 num = ABS(num) % 100;
343 return (num == 11) ? "th" : "st";
345 return (num == 12) ? "th" : "nd";
347 return (num == 13) ? "th" : "rd";
356 * @brief 日記にメッセージを追加する /
357 * Take note to the diary.
358 * @param type 日記内容のID
359 * @param num 日記内容のIDに応じた数値
360 * @param note 日記内容のIDに応じた文字列参照ポインタ
363 errr do_cmd_write_nikki(int type, int num, cptr note)
369 cptr note_level = "";
370 bool do_level = TRUE;
371 char note_level_buf[40];
374 static bool disable_nikki = FALSE;
376 extract_day_hour_min(&day, &hour, &min);
378 if (disable_nikki) return(-1);
380 if (type == NIKKI_FIX_QUEST_C ||
381 type == NIKKI_FIX_QUEST_F ||
382 type == NIKKI_RAND_QUEST_C ||
383 type == NIKKI_RAND_QUEST_F ||
384 type == NIKKI_TO_QUEST)
388 old_quest = p_ptr->inside_quest;
389 p_ptr->inside_quest = (quest[num].type == QUEST_TYPE_RANDOM) ? 0 : num;
391 /* Get the quest text */
392 init_flags = INIT_NAME_ONLY;
394 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
396 /* Reset the old quest number */
397 p_ptr->inside_quest = old_quest;
400 /* different filne name to avoid mixing */
401 sprintf(file_name,_("playrecord-%s.txt", "playrec-%s.txt"),savefile_base);
403 /* Build the filename */
404 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
406 /* File type is "TEXT" */
407 FILE_TYPE(FILE_TYPE_TEXT);
409 fff = my_fopen(buf, "a");
414 msg_format(_("%s を開くことができませんでした。プレイ記録を一時停止します。", "Failed to open %s. Play-Record is disabled temporally."), buf);
420 q_idx = quest_number(dun_level);
424 if (p_ptr->inside_arena)
425 note_level = _("アリーナ:", "Arane:");
427 note_level = _("地上:", "Surface:");
428 else if (q_idx && (is_fixed_quest_idx(q_idx)
429 && !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
430 note_level = _("クエスト:", "Quest:");
434 sprintf(note_level_buf, "%d階(%s):", (int)dun_level, d_name+d_info[dungeon_type].name);
436 sprintf(note_level_buf, "%s L%d:", d_name+d_info[dungeon_type].name, (int)dun_level);
438 note_level = note_level_buf;
446 if (day < MAX_DAYS) fprintf(fff, _("%d日目\n", "Day %d\n"), day);
447 else fputs(_("*****日目\n", "Day *****\n"), fff);
455 fprintf(fff, "%s\n",note);
459 fprintf(fff, " %2d:%02d %20s %s\n",hour, min, note_level, note);
464 fprintf(fff, _(" %2d:%02d %20s %sを発見した。\n", " %2d:%02d %20s discovered %s.\n"), hour, min, note_level, note);
467 case NIKKI_ART_SCROLL:
469 fprintf(fff, _(" %2d:%02d %20s 巻物によって%sを生成した。\n", " %2d:%02d %20s created %s by scroll.\n"), hour, min, note_level, note);
474 fprintf(fff, _(" %2d:%02d %20s %sを倒した。\n", " %2d:%02d %20s defeated %s.\n"), hour, min, note_level, note);
477 case NIKKI_FIX_QUEST_C:
479 if (quest[num].flags & QUEST_FLAG_SILENT) break;
480 fprintf(fff, _(" %2d:%02d %20s クエスト「%s」を達成した。\n",
481 " %2d:%02d %20s completed quest '%s'.\n"), hour, min, note_level, quest[num].name);
484 case NIKKI_FIX_QUEST_F:
486 if (quest[num].flags & QUEST_FLAG_SILENT) break;
487 fprintf(fff, _(" %2d:%02d %20s クエスト「%s」から命からがら逃げ帰った。\n",
488 " %2d:%02d %20s run away from quest '%s'.\n"), hour, min, note_level, quest[num].name);
491 case NIKKI_RAND_QUEST_C:
494 strcpy(name, r_name+r_info[quest[num].r_idx].name);
495 fprintf(fff, _(" %2d:%02d %20s ランダムクエスト(%s)を達成した。\n",
496 " %2d:%02d %20s completed random quest '%s'\n"), hour, min, note_level, name);
499 case NIKKI_RAND_QUEST_F:
502 strcpy(name, r_name+r_info[quest[num].r_idx].name);
503 fprintf(fff, _(" %2d:%02d %20s ランダムクエスト(%s)から逃げ出した。\n",
504 " %2d:%02d %20s ran away from quest '%s'.\n"), hour, min, note_level, name);
507 case NIKKI_MAXDEAPTH:
509 fprintf(fff, _(" %2d:%02d %20s %sの最深階%d階に到達した。\n",
510 " %2d:%02d %20s reached level %d of %s for the first time.\n"), hour, min, note_level,
511 _(d_name+d_info[dungeon_type].name, num),
512 _(num, d_name+d_info[dungeon_type].name));
517 fprintf(fff, _(" %2d:%02d %20s %s%sの最深階を%d階にセットした。\n",
518 " %2d:%02d %20s reset recall level of %s to %d %s.\n"), hour, min, note_level, note,
519 _(d_name + d_info[num].name, (int)max_dlv[num]),
520 _((int)max_dlv[num], d_name + d_info[num].name));
526 if (q_idx && (is_fixed_quest_idx(q_idx)
527 && !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
529 to = _("地上", "the surface");
533 if (!(dun_level+num)) to = _("地上", "the surface");
534 else to = format(_("%d階", "level %d"), dun_level+num);
536 fprintf(fff, _(" %2d:%02d %20s %sへ%s。\n", " %2d:%02d %20s %s %s.\n"), hour, min, note_level, _(to, note), _(note, to));
542 fprintf(fff, _(" %2d:%02d %20s 帰還を使って%sの%d階へ下りた。\n", " %2d:%02d %20s recalled to dungeon level %d of %s.\n"),
543 hour, min, note_level, _(d_name+d_info[dungeon_type].name, (int)max_dlv[dungeon_type]),
544 _((int)max_dlv[dungeon_type], d_name+d_info[dungeon_type].name));
546 fprintf(fff, _(" %2d:%02d %20s 帰還を使って地上へと戻った。\n", " %2d:%02d %20s recalled from dungeon to surface.\n"), hour, min, note_level);
551 if (quest[num].flags & QUEST_FLAG_SILENT) break;
552 fprintf(fff, _(" %2d:%02d %20s クエスト「%s」へと突入した。\n", " %2d:%02d %20s entered the quest '%s'.\n"),
553 hour, min, note_level, quest[num].name);
558 fprintf(fff, _(" %2d:%02d %20s レベル・テレポートで脱出した。\n", " %2d:%02d %20s Got out using teleport level.\n"),
559 hour, min, note_level);
564 fprintf(fff, _(" %2d:%02d %20s %sを購入した。\n", " %2d:%02d %20s bought %s.\n"), hour, min, note_level, note);
569 fprintf(fff, _(" %2d:%02d %20s %sを売却した。\n", " %2d:%02d %20s sold %s.\n"), hour, min, note_level, note);
577 fprintf(fff, _(" %2d:%02d %20s 闘技場の%d%s回戦で、%sの前に敗れ去った。\n", " %2d:%02d %20s beaten by %s in the %d%s fight.\n"),
578 hour, min, note_level, _(n, note), _("", n), _(note, get_ordinal_number_suffix(n)));
581 fprintf(fff, _(" %2d:%02d %20s 闘技場の%d%s回戦(%s)に勝利した。\n", " %2d:%02d %20s won the %d%s fight (%s).\n"),
582 hour, min, note_level, num, _("", get_ordinal_number_suffix(num)), note);
584 if (num == MAX_ARENA_MONS)
586 fprintf(fff, _(" 闘技場のすべての敵に勝利し、チャンピオンとなった。\n",
587 " won all fight to become a Chanpion.\n"));
594 fprintf(fff, _(" %2d:%02d %20s %sを識別した。\n", " %2d:%02d %20s identified %s.\n"), hour, min, note_level, note);
601 to = _("地上", "the surface");
603 to = format(_("%d階(%s)", "level %d of %s"), dun_level, d_name+d_info[dungeon_type].name);
605 fprintf(fff, _(" %2d:%02d %20s %sへとウィザード・テレポートで移動した。\n",
606 " %2d:%02d %20s wizard-teleport to %s.\n"), hour, min, note_level, to);
613 to = _("地上", "the surface");
615 to = format(_("%d階(%s)", "level %d of %s"), dun_level, d_name+d_info[dungeon_type].name);
617 fprintf(fff, _(" %2d:%02d %20s %sへとパターンの力で移動した。\n",
618 " %2d:%02d %20s used Pattern to teleport to %s.\n"), hour, min, note_level, to);
623 fprintf(fff, _(" %2d:%02d %20s レベルが%dに上がった。\n", " %2d:%02d %20s reached player level %d.\n"), hour, min, note_level, num);
626 case NIKKI_GAMESTART:
628 time_t ct = time((time_t*)0);
632 fprintf(fff, "%s %s",note, ctime(&ct));
635 fprintf(fff, " %2d:%02d %20s %s %s",hour, min, note_level, note, ctime(&ct));
638 case NIKKI_NAMED_PET:
640 fprintf(fff, " %2d:%02d %20s ", hour, min, note_level);
643 case RECORD_NAMED_PET_NAME:
644 fprintf(fff, _("%sを旅の友にすることに決めた。\n", "decided to travel together with %s.\n"), note);
646 case RECORD_NAMED_PET_UNNAME:
647 fprintf(fff, _("%sの名前を消した。\n", "unnamed %s.\n"), note);
649 case RECORD_NAMED_PET_DISMISS:
650 fprintf(fff, _("%sを解放した。\n", "dismissed %s.\n"), note);
652 case RECORD_NAMED_PET_DEATH:
653 fprintf(fff, _("%sが死んでしまった。\n", "%s died.\n"), note);
655 case RECORD_NAMED_PET_MOVED:
656 fprintf(fff, _("%sをおいて別のマップへ移動した。\n", "moved to another map leaving %s behind.\n"), note);
658 case RECORD_NAMED_PET_LOST_SIGHT:
659 fprintf(fff, _("%sとはぐれてしまった。\n", "lost sight of %s.\n"), note);
661 case RECORD_NAMED_PET_DESTROY:
662 fprintf(fff, _("%sが*破壊*によって消え去った。\n", "%s was made disappeared by *destruction*.\n"), note);
664 case RECORD_NAMED_PET_EARTHQUAKE:
665 fprintf(fff, _("%sが岩石に押し潰された。\n", "%s was crushed by falling rocks.\n"), note);
667 case RECORD_NAMED_PET_GENOCIDE:
668 fprintf(fff, _("%sが抹殺によって消え去った。\n", "%s was made disappeared by genocide.\n"), note);
670 case RECORD_NAMED_PET_WIZ_ZAP:
671 fprintf(fff, _("%sがデバッグコマンドによって消え去った。\n", "%s was removed by debug command.\n"), note);
673 case RECORD_NAMED_PET_TELE_LEVEL:
674 fprintf(fff, _("%sがテレポート・レベルによって消え去った。\n", "%s was made disappeared by teleport level.\n"), note);
676 case RECORD_NAMED_PET_BLAST:
677 fprintf(fff, _("%sを爆破した。\n", "blasted %s.\n"), note);
679 case RECORD_NAMED_PET_HEAL_LEPER:
680 fprintf(fff, _("%sの病気が治り旅から外れた。\n", "%s was healed and left.\n"), note);
682 case RECORD_NAMED_PET_COMPACT:
683 fprintf(fff, _("%sがモンスター情報圧縮によって消え去った。\n", "%s was made disappeared by compacting monsters.\n"), note);
685 case RECORD_NAMED_PET_LOSE_PARENT:
686 fprintf(fff, _("%sの召喚者が既にいないため消え去った。\n", "%s disappeared because there does not exist summoner.\n"), note);
697 case NIKKI_WIZARD_LOG:
698 fprintf(fff, "%s\n", note);
707 if (do_level) write_level = FALSE;
713 #define MAX_SUBTITLE (sizeof(subtitle)/sizeof(subtitle[0]))
716 * @brief 日記のタイトル表記と内容出力 /
719 * 日記のタイトルは本関数の subtitle ローカル変数で定義されている。
721 static void do_cmd_disp_nikki(void)
723 char nikki_title[256];
729 static const char subtitle[][30] = {"最強の肉体を求めて",
760 static const char subtitle[][51] ={"Quest of The World's Toughest Body",
761 "Attack is the best form of defence.",
763 "An unexpected windfall",
764 "A drowning man will catch at a straw",
765 "Don't count your chickens before they are hatched.",
766 "It is no use crying over spilt milk.",
767 "Seeing is believing.",
768 "Strike the iron while it is hot.",
769 "I don't care what follows.",
770 "To dig a well to put out a house on fire.",
771 "Tomorrow is another day.",
772 "Easy come, easy go.",
773 "The more haste, the less speed.",
774 "Where there is life, there is hope.",
775 "There is no royal road to *WINNER*.",
776 "Danger past, God forgotten.",
777 "The best thing to do now is to run away.",
778 "Life is but an empty dream.",
779 "Dead men tell no tales.",
780 "A book that remains shut is but a block.",
781 "Misfortunes never come singly.",
782 "A little knowledge is a dangerous thing.",
783 "History repeats itself.",
784 "*WINNER* was not built in a day.",
785 "Ignorance is bliss.",
786 "To lose is to win?",
787 "No medicine can cure folly.",
788 "All good things come to an end.",
789 "M$ Empire strikes back.",
790 "To see is to believe",
792 "Quest of The World's Greatest Brain"};
794 sprintf(file_name,_("playrecord-%s.txt", "playrec-%s.txt"),savefile_base);
796 /* Build the filename */
797 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
799 if (p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_MONK || p_ptr->pclass == CLASS_SAMURAI || p_ptr->pclass == CLASS_BERSERKER)
800 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)]);
801 else if (p_ptr->pclass == CLASS_MAGE || p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER)
802 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)+1]);
803 else strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-2)+1]);
806 sprintf(nikki_title, "「%s%s%sの伝説 -%s-」",
807 ap_ptr->title, ap_ptr->no ? "の" : "", p_ptr->name, tmp);
809 sprintf(nikki_title, "Legend of %s %s '%s'",
810 ap_ptr->title, p_ptr->name, tmp);
813 /* Display the file contents */
814 show_file(FALSE, buf, nikki_title, -1, 0);
818 * @brief 日記に任意の内容を表記するコマンドのメインルーチン /
821 static void do_cmd_bunshou(void)
824 char bunshou[80] = "\0";
826 if (get_string(_("内容: ", "diary note: "), tmp, 79))
828 strcpy(bunshou, tmp);
830 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, bunshou);
835 * @brief 最後に取得したアイテムの情報を日記に追加するメインルーチン /
838 static void do_cmd_last_get(void)
843 if (record_o_name[0] == '\0') return;
845 sprintf(buf,_("%sの入手を記録します。", "Do you really want to record getting %s? "),record_o_name);
846 if (!get_check(buf)) return;
850 sprintf(buf,_("%sを手に入れた。", "descover %s."), record_o_name);
851 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, buf);
856 * @brief ファイル中の全日記記録を消去する /
859 static void do_cmd_erase_nikki(void)
865 if (!get_check(_("本当に記録を消去しますか?", "Do you really want to delete all your record? "))) return;
866 sprintf(file_name,_("playrecord-%s.txt", "playrec-%s.txt"),savefile_base);
868 /* Build the filename */
869 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
871 /* Remove the file */
874 fff = my_fopen(buf, "w");
877 msg_format(_("記録を消去しました。", "deleted record."));
879 msg_format(_("%s の消去に失敗しました。", "failed to delete %s."), buf);
888 void do_cmd_nikki(void)
892 /* File type is "TEXT" */
893 FILE_TYPE(FILE_TYPE_TEXT);
895 /* Save the screen */
898 /* Interact until done */
904 /* Ask for a choice */
905 prt(_("[ 記録の設定 ]", "[ Play Record ]"), 2, 0);
907 /* Give some choices */
908 prt(_("(1) 記録を見る", "(1) Display your record"), 4, 5);
909 prt(_("(2) 文章を記録する", "(2) Add record"), 5, 5);
910 prt(_("(3) 直前に入手又は鑑定したものを記録する", "(3) Record item you last get/identify"), 6, 5);
911 prt(_("(4) 記録を消去する", "(4) Delete your record"), 7, 5);
913 prt(_("(R) プレイ動画を記録する/中止する", "(R) Record playing movie / or stop it"), 9, 5);
916 prt(_("コマンド:", "Command: "), 18, 0);
922 if (i == ESCAPE) break;
936 do_cmd_erase_nikki();
940 prepare_movie_hooks();
942 default: /* Unknown option */
950 /* Restore the screen */
955 * @brief 画面を再描画するコマンドのメインルーチン
956 * Hack -- redraw the screen
960 * This command performs various low level updates, clears all the "extra"
961 * windows, does a total redraw of the main window, and requests all of the
962 * interesting updates and redraws that I can think of.
964 * This command is also used to "instantiate" the results of the user
965 * selecting various things, such as graphics mode, so it must call
966 * the "TERM_XTRA_REACT" hook before redrawing the windows.
969 void do_cmd_redraw(void)
976 /* Hack -- react to changes */
977 Term_xtra(TERM_XTRA_REACT, 0);
980 /* Combine and Reorder the pack (later) */
981 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
985 p_ptr->update |= (PU_TORCH);
988 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
990 /* Forget lite/view */
991 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
993 /* Update lite/view */
994 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
996 /* Update monsters */
997 p_ptr->update |= (PU_MONSTERS);
999 /* Redraw everything */
1000 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1003 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
1006 p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
1010 /* Hack -- update */
1013 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
1016 /* Redraw every window */
1017 for (j = 0; j < 8; j++)
1020 if (!angband_term[j]) continue;
1023 Term_activate(angband_term[j]);
1038 * @brief 名前を変更するコマンドのメインルーチン
1039 * Hack -- change name
1042 void do_cmd_change_name(void)
1051 /* Save the screen */
1059 /* Display the player */
1060 display_player(mode);
1065 display_player(mode);
1070 Term_putstr(2, 23, -1, TERM_WHITE,
1071 "['c'で名前変更, 'f'でファイルへ書出, 'h'でモード変更, ESCで終了]");
1073 Term_putstr(2, 23, -1, TERM_WHITE,
1074 "['c' to change name, 'f' to file, 'h' to change mode, or ESC]");
1082 if (c == ESCAPE) break;
1089 /* Process the player name */
1090 process_player_name(FALSE);
1096 sprintf(tmp, "%s.txt", player_base);
1097 if (get_string(_("ファイル名: ", "File name: "), tmp, 80))
1099 if (tmp[0] && (tmp[0] != ' '))
1101 file_character(tmp);
1118 /* Flush messages */
1122 /* Restore the screen */
1125 /* Redraw everything */
1126 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1133 * @brief 最近表示されたメッセージを再表示するコマンドのメインルーチン
1134 * Recall the most recent message
1137 void do_cmd_message_one(void)
1139 /* Recall one message XXX XXX XXX */
1140 prt(format("> %s", message_str(0)), 0, 0);
1145 * @brief メッセージのログを表示するコマンドのメインルーチン
1146 * Recall the most recent message
1150 * Show previous messages to the user -BEN-
1152 * The screen format uses line 0 and 23 for headers and prompts,
1153 * skips line 1 and 22, and uses line 2 thru 21 for old messages.
1155 * This command shows you which commands you are viewing, and allows
1156 * you to "search" for strings in the recall.
1158 * Note that messages may be longer than 80 characters, but they are
1159 * displayed using "infinite" length, with a special sub-command to
1160 * "slide" the virtual display to the left or right.
1162 * Attempt to only hilite the matching portions of the string.
1165 void do_cmd_messages(int num_now)
1169 char shower_str[81];
1170 char finder_str[81];
1177 Term_get_size(&wid, &hgt);
1179 /* Number of message lines in a screen */
1180 num_lines = hgt - 4;
1183 strcpy(finder_str, "");
1186 strcpy(shower_str, "");
1188 /* Total messages */
1191 /* Start on first message */
1194 /* Save the screen */
1200 /* Process requests until done */
1206 /* Dump up to 20 lines of messages */
1207 for (j = 0; (j < num_lines) && (i + j < n); j++)
1209 cptr msg = message_str(i+j);
1211 /* Dump the messages, bottom to top */
1212 c_prt((i + j < num_now ? TERM_WHITE : TERM_SLATE), msg, num_lines + 1 - j, 0);
1214 /* Hilite "shower" */
1215 if (shower && shower[0])
1219 /* Display matches */
1220 while ((str = my_strstr(str, shower)) != NULL)
1222 int len = strlen(shower);
1224 /* Display the match */
1225 Term_putstr(str-msg, num_lines + 1 - j, len, TERM_YELLOW, shower);
1233 /* Erase remaining lines */
1234 for (; j < num_lines; j++)
1236 Term_erase(0, num_lines + 1 - j, 255);
1239 /* Display header XXX XXX XXX */
1241 prt(format(_("以前のメッセージ %d-%d 全部で(%d)", "Message Recall (%d-%d of %d)"),
1242 i, i + j - 1, n), 0, 0);
1244 /* Display prompt (not very informative) */
1245 prt(_("[ 'p' で更に古いもの, 'n' で更に新しいもの, '/' で検索, ESC で中断 ]",
1246 "[Press 'p' for older, 'n' for newer, ..., or ESCAPE]"), hgt - 1, 0);
1249 skey = inkey_special(TRUE);
1251 /* Exit on Escape */
1252 if (skey == ESCAPE) break;
1254 /* Hack -- Save the old index */
1259 /* Hack -- handle show */
1262 prt(_("強調: ", "Show: "), hgt - 1, 0);
1264 /* Get a "shower" string, or continue */
1265 strcpy(back_str, shower_str);
1266 if (askfor(shower_str, 80))
1269 shower = shower_str[0] ? shower_str : NULL;
1271 else strcpy(shower_str, back_str);
1276 /* Hack -- handle find */
1283 prt(_("検索: ", "Find: "), hgt - 1, 0);
1285 /* Get a "finder" string, or continue */
1286 strcpy(back_str, finder_str);
1287 if (!askfor(finder_str, 80))
1289 strcpy(finder_str, back_str);
1292 else if (!finder_str[0])
1294 shower = NULL; /* Stop showing */
1299 shower = finder_str;
1302 for (z = i + 1; z < n; z++)
1304 cptr msg = message_str(z);
1307 if (my_strstr(msg, finder_str))
1319 /* Recall 1 older message */
1321 /* Go to the oldest line */
1325 /* Recall 1 newer message */
1327 /* Go to the newest line */
1331 /* Recall 1 older message */
1336 /* Go older if legal */
1337 i = MIN(i + 1, n - num_lines);
1340 /* Recall 10 older messages */
1342 /* Go older if legal */
1343 i = MIN(i + 10, n - num_lines);
1346 /* Recall 20 older messages */
1351 /* Go older if legal */
1352 i = MIN(i + num_lines, n - num_lines);
1355 /* Recall 20 newer messages */
1359 /* Go newer (if able) */
1360 i = MAX(0, i - num_lines);
1363 /* Recall 10 newer messages */
1365 /* Go newer (if able) */
1369 /* Recall 1 newer messages */
1372 /* Go newer (if able) */
1377 /* Hack -- Error of some kind */
1381 /* Restore the screen */
1387 * @brief チートオプションを変更するコマンドのメインルーチン
1388 * Interact with some options for cheating
1389 * @param info 表示メッセージ
1392 static void do_cmd_options_cheat(cptr info)
1395 int i, k = 0, n = CHEAT_MAX;
1401 /* Interact with the player */
1406 /* Prompt XXX XXX XXX */
1407 sprintf(buf, _("%s ( リターンで次へ, y/n でセット, ESC で決定 )", "%s (RET to advance, y/n to set, ESC to accept) "), info);
1412 /* 詐欺オプションをうっかりいじってしまう人がいるようなので注意 */
1413 prt(" << 注意 >>", 11, 0);
1414 prt(" 詐欺オプションを一度でも設定すると、スコア記録が残らなくなります!", 12, 0);
1415 prt(" 後に解除してもダメですので、勝利者を目指す方はここのオプションはい", 13, 0);
1416 prt(" じらないようにして下さい。", 14, 0);
1418 /* Display the options */
1419 for (i = 0; i < n; i++)
1421 byte a = TERM_WHITE;
1423 /* Color current option */
1424 if (i == k) a = TERM_L_BLUE;
1426 /* Display the option text */
1427 sprintf(buf, "%-48s: %s (%s)",
1428 cheat_info[i].o_desc,
1429 (*cheat_info[i].o_var ? _("はい ", "yes") : _("いいえ", "no ")),
1430 cheat_info[i].o_text);
1431 c_prt(a, buf, i + 2, 0);
1434 /* Hilite current option */
1435 move_cursor(k + 2, 50);
1441 * HACK - Try to translate the key into a direction
1442 * to allow using the roguelike keys for navigation.
1444 dir = get_keymap_dir(ch);
1445 if ((dir == 2) || (dir == 4) || (dir == 6) || (dir == 8))
1459 k = (n + k - 1) % n;
1477 do_cmd_write_nikki(NIKKI_BUNSHOU, 0,
1478 _("詐欺オプションをONにして、スコアを残せなくなった。", "give up sending score to use cheating options."));
1479 p_ptr->noscore |= (cheat_info[k].o_set * 256 + cheat_info[k].o_bit);
1480 (*cheat_info[k].o_var) = TRUE;
1489 (*cheat_info[k].o_var) = FALSE;
1496 strnfmt(buf, sizeof(buf), _("joption.txt#%s", "option.txt#%s"), cheat_info[k].o_text);
1497 /* Peruse the help file */
1498 (void)show_file(TRUE, buf, NULL, 0, 0);
1517 static option_type autosave_info[2] =
1519 { &autosave_l, FALSE, 255, 0x01, 0x00,
1520 "autosave_l", _("新しい階に入る度に自動セーブする", "Autosave when entering new levels") },
1522 { &autosave_t, FALSE, 255, 0x02, 0x00,
1523 "autosave_t", _("一定ターン毎に自動セーブする", "Timed autosave") },
1527 * @brief セーブ頻度ターンの次の値を返す
1528 * @param current 現在のセーブ頻度ターン値
1529 * @return 次のセーブ頻度ターン値
1531 static s16b toggle_frequency(s16b current)
1536 case 50: return 100;
1537 case 100: return 250;
1538 case 250: return 500;
1539 case 500: return 1000;
1540 case 1000: return 2500;
1541 case 2500: return 5000;
1542 case 5000: return 10000;
1543 case 10000: return 25000;
1550 * @brief 自動セーブオプションを変更するコマンドのメインルーチン
1551 * @param info 表示メッセージ
1554 static void do_cmd_options_autosave(cptr info)
1558 int i, k = 0, n = 2;
1566 /* Interact with the player */
1569 /* Prompt XXX XXX XXX */
1570 sprintf(buf, _("%s ( リターンで次へ, y/n でセット, F で頻度を入力, ESC で決定 ) ",
1571 "%s (RET to advance, y/n to set, 'F' for frequency, ESC to accept) "), info);
1575 /* Display the options */
1576 for (i = 0; i < n; i++)
1578 byte a = TERM_WHITE;
1580 /* Color current option */
1581 if (i == k) a = TERM_L_BLUE;
1583 /* Display the option text */
1584 sprintf(buf, "%-48s: %s (%s)",
1585 autosave_info[i].o_desc,
1586 (*autosave_info[i].o_var ? _("はい ", "yes") : _("いいえ", "no ")),
1587 autosave_info[i].o_text);
1588 c_prt(a, buf, i + 2, 0);
1590 prt(format(_("自動セーブの頻度: %d ターン毎", "Timed autosave frequency: every %d turns"), autosave_freq), 5, 0);
1592 /* Hilite current option */
1593 move_cursor(k + 2, 50);
1609 k = (n + k - 1) % n;
1627 (*autosave_info[k].o_var) = TRUE;
1636 (*autosave_info[k].o_var) = FALSE;
1644 autosave_freq = toggle_frequency(autosave_freq);
1645 prt(format(_("自動セーブの頻度: %d ターン毎", "Timed autosave frequency: every %d turns"), autosave_freq), 5, 0);
1651 (void)show_file(TRUE, _("joption.txt#Autosave", "option.txt#Autosave"), NULL, 0, 0);
1667 * @brief 標準オプションを変更するコマンドのサブルーチン /
1668 * Interact with some options
1669 * @param page オプションページ番号
1670 * @param info 表示メッセージ
1673 void do_cmd_options_aux(int page, cptr info)
1676 int i, k = 0, n = 0, l;
1679 bool browse_only = (page == OPT_PAGE_BIRTH) && character_generated &&
1680 (!p_ptr->wizard || !allow_debug_opts);
1683 /* Lookup the options */
1684 for (i = 0; i < 24; i++) opt[i] = 0;
1686 /* Scan the options */
1687 for (i = 0; option_info[i].o_desc; i++)
1689 /* Notice options on this "page" */
1690 if (option_info[i].o_page == page) opt[n++] = i;
1697 /* Interact with the player */
1702 /* Prompt XXX XXX XXX */
1703 sprintf(buf, _("%s (リターン:次, %sESC:終了, ?:ヘルプ) ", "%s (RET:next, %s, ?:help) "),
1704 info, browse_only ? _("", "ESC:exit") : _("y/n:変更, ", "y/n:change, ESC:accept"));
1707 /* HACK -- description for easy-auto-destroy options */
1708 if (page == OPT_PAGE_AUTODESTROY)
1709 c_prt(TERM_YELLOW, _("以下のオプションは、簡易自動破壊を使用するときのみ有効",
1710 "Following options will protect items from easy auto-destroyer."), 6, _(6, 3));
1712 /* Display the options */
1713 for (i = 0; i < n; i++)
1715 byte a = TERM_WHITE;
1717 /* Color current option */
1718 if (i == k) a = TERM_L_BLUE;
1720 /* Display the option text */
1721 sprintf(buf, "%-48s: %s (%.19s)",
1722 option_info[opt[i]].o_desc,
1723 (*option_info[opt[i]].o_var ? _("はい ", "yes") : _("いいえ", "no ")),
1724 option_info[opt[i]].o_text);
1725 if ((page == OPT_PAGE_AUTODESTROY) && i > 2) c_prt(a, buf, i + 5, 0);
1726 else c_prt(a, buf, i + 2, 0);
1729 if ((page == OPT_PAGE_AUTODESTROY) && (k > 2)) l = 3;
1732 /* Hilite current option */
1733 move_cursor(k + 2 + l, 50);
1739 * HACK - Try to translate the key into a direction
1740 * to allow using the roguelike keys for navigation.
1742 dir = get_keymap_dir(ch);
1743 if ((dir == 2) || (dir == 4) || (dir == 6) || (dir == 8))
1757 k = (n + k - 1) % n;
1774 if (browse_only) break;
1775 (*option_info[opt[k]].o_var) = TRUE;
1784 if (browse_only) break;
1785 (*option_info[opt[k]].o_var) = FALSE;
1793 if (!browse_only) (*option_info[opt[k]].o_var) = !(*option_info[opt[k]].o_var);
1799 strnfmt(buf, sizeof(buf), _("joption.txt#%s", "option.txt#%s"), option_info[opt[k]].o_text);
1800 /* Peruse the help file */
1801 (void)show_file(TRUE, buf, NULL, 0, 0);
1818 * @brief ウィンドウオプションを変更するコマンドのメインルーチン /
1819 * Modify the "window" options
1822 static void do_cmd_options_win(void)
1832 /* Memorize old flags */
1833 for (j = 0; j < 8; j++)
1835 /* Acquire current flags */
1836 old_flag[j] = window_flag[j];
1846 /* Prompt XXX XXX XXX */
1847 prt(_("ウィンドウ・フラグ (<方向>で移動, tでチェンジ, y/n でセット, ESC)", "Window Flags (<dir>, t, y, n, ESC) "), 0, 0);
1849 /* Display the windows */
1850 for (j = 0; j < 8; j++)
1852 byte a = TERM_WHITE;
1854 cptr s = angband_term_name[j];
1857 if (j == x) a = TERM_L_BLUE;
1859 /* Window name, staggered, centered */
1860 Term_putstr(35 + j * 5 - strlen(s) / 2, 2 + j % 2, -1, a, s);
1863 /* Display the options */
1864 for (i = 0; i < 16; i++)
1866 byte a = TERM_WHITE;
1868 cptr str = window_flag_desc[i];
1871 if (i == y) a = TERM_L_BLUE;
1874 if (!str) str = _("(未使用)", "(Unused option)");
1877 Term_putstr(0, i + 5, -1, a, str);
1879 /* Display the windows */
1880 for (j = 0; j < 8; j++)
1886 if ((i == y) && (j == x)) a = TERM_L_BLUE;
1889 if (window_flag[j] & (1L << i)) c = 'X';
1892 Term_putch(35 + j * 5, i + 5, a, c);
1897 Term_gotoxy(35 + x * 5, y + 5);
1915 for (j = 0; j < 8; j++)
1917 window_flag[j] &= ~(1L << y);
1921 for (i = 0; i < 16; i++)
1923 window_flag[x] &= ~(1L << i);
1936 window_flag[x] |= (1L << y);
1944 window_flag[x] &= ~(1L << y);
1950 (void)show_file(TRUE, _("joption.txt#Window", "option.txt#Window"), NULL, 0, 0);
1958 d = get_keymap_dir(ch);
1960 x = (x + ddx[d] + 8) % 8;
1961 y = (y + ddy[d] + 16) % 16;
1968 /* Notice changes */
1969 for (j = 0; j < 8; j++)
1974 if (!angband_term[j]) continue;
1976 /* Ignore non-changes */
1977 if (window_flag[j] == old_flag[j]) continue;
1980 Term_activate(angband_term[j]);
2003 option_fields[OPT_NUM] =
2006 { '1', " キー入力 オプション", 3 },
2007 { '2', " マップ画面 オプション", 4 },
2008 { '3', " テキスト表示 オプション", 5 },
2009 { '4', " ゲームプレイ オプション", 6 },
2010 { '5', " 行動中止関係 オプション", 7 },
2011 { '6', " 簡易自動破壊 オプション", 8 },
2012 { 'r', " プレイ記録 オプション", 9 },
2014 { 'p', "自動拾いエディタ", 11 },
2015 { 'd', " 基本ウェイト量 ", 12 },
2016 { 'h', "低ヒットポイント", 13 },
2017 { 'm', " 低魔力色閾値 ", 14 },
2018 { 'a', " 自動セーブ オプション", 15 },
2019 { 'w', "ウインドウフラグ", 16 },
2021 { 'b', " 初期 オプション (参照のみ)", 18 },
2022 { 'c', " 詐欺 オプション", 19 },
2024 { '1', "Input Options", 3 },
2025 { '2', "Map Screen Options", 4 },
2026 { '3', "Text Display Options", 5 },
2027 { '4', "Game-Play Options", 6 },
2028 { '5', "Disturbance Options", 7 },
2029 { '6', "Easy Auto-Destroyer Options", 8 },
2030 { 'r', "Play record Options", 9 },
2032 { 'p', "Auto-picker/destroyer editor", 11 },
2033 { 'd', "Base Delay Factor", 12 },
2034 { 'h', "Hitpoint Warning", 13 },
2035 { 'm', "Mana Color Threshold", 14 },
2036 { 'a', "Autosave Options", 15 },
2037 { 'w', "Window Flags", 16 },
2039 { 'b', "Birth Options (Browse Only)", 18 },
2040 { 'c', "Cheat Options", 19 },
2046 * @brief 標準オプションを変更するコマンドのメインルーチン /
2047 * Set or unset various options.
2051 * The user must use the "Ctrl-R" command to "adapt" to changes
2052 * in any options which control "visual" aspects of the game.
2055 void do_cmd_options(void)
2061 /* Save the screen */
2069 /* Does not list cheat option when cheat option is off */
2070 if (!p_ptr->noscore && !allow_debug_opts) n--;
2075 /* Why are we here */
2076 prt(_("[ オプションの設定 ]", "TinyAngband options"), 1, 0);
2080 /* Give some choices */
2081 for (i = 0; i < n; i++)
2083 byte a = TERM_WHITE;
2084 if (i == y) a = TERM_L_BLUE;
2085 Term_putstr(5, option_fields[i].row, -1, a,
2086 format("(%c) %s", toupper(option_fields[i].key), option_fields[i].name));
2089 prt(_("<方向>で移動, Enterで決定, ESCでキャンセル, ?でヘルプ: ", "Move to <dir>, Select to Enter, Cancel to ESC, ? to help: "), 21, 0);
2092 skey = inkey_special(TRUE);
2093 if (!(skey & SKEY_MASK)) k = (char)skey;
2097 if (k == ESCAPE) break;
2099 if (my_strchr("\n\r ", k))
2101 k = option_fields[y].key;
2105 for (i = 0; i < n; i++)
2107 if (tolower(k) == option_fields[i].key) break;
2110 /* Command is found */
2113 /* Hack -- browse help */
2114 if (k == '?') break;
2118 if (skey == SKEY_UP) d = 8;
2119 if (skey == SKEY_DOWN) d = 2;
2120 y = (y + ddy[d] + n) % n;
2125 if (k == ESCAPE) break;
2132 /* Process the general options */
2133 do_cmd_options_aux(OPT_PAGE_INPUT, _("キー入力オプション", "Input Options"));
2139 /* Process the general options */
2140 do_cmd_options_aux(OPT_PAGE_MAPSCREEN, _("マップ画面オプション", "Map Screen Options"));
2147 do_cmd_options_aux(OPT_PAGE_TEXT, _("テキスト表示オプション", "Text Display Options"));
2154 do_cmd_options_aux(OPT_PAGE_GAMEPLAY, _("ゲームプレイ・オプション", "Game-Play Options"));
2161 do_cmd_options_aux(OPT_PAGE_DISTURBANCE, _("行動中止関係のオプション", "Disturbance Options"));
2168 do_cmd_options_aux(OPT_PAGE_AUTODESTROY, _("簡易自動破壊オプション", "Easy Auto-Destroyer Options"));
2172 /* Play-record Options */
2177 do_cmd_options_aux(OPT_PAGE_PLAYRECORD, _("プレイ記録オプション", "Play-record Options"));
2186 do_cmd_options_aux(OPT_PAGE_BIRTH, (!p_ptr->wizard || !allow_debug_opts) ?
2187 _("初期オプション(参照のみ)", "Birth Options(browse only)") :
2188 _("初期オプション((*)はスコアに影響)", "Birth Options((*)s effect score)"));
2192 /* Cheating Options */
2195 if (!p_ptr->noscore && !allow_debug_opts)
2197 /* Cheat options are not permitted */
2203 do_cmd_options_cheat(_("詐欺師は決して勝利できない!", "Cheaters never win"));
2210 do_cmd_options_autosave(_("自動セーブ", "Autosave"));
2219 do_cmd_options_win();
2220 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL |
2221 PW_PLAYER | PW_MESSAGE | PW_OVERHEAD |
2222 PW_MONSTER | PW_OBJECT | PW_SNAPSHOT |
2223 PW_BORG_1 | PW_BORG_2 | PW_DUNGEON |
2228 /* Auto-picker/destroyer editor */
2232 do_cmd_edit_autopick();
2236 /* Hack -- Delay Speed */
2242 prt(_("コマンド: 基本ウェイト量", "Command: Base Delay Factor"), 19, 0);
2244 /* Get a new value */
2247 int msec = delay_factor * delay_factor * delay_factor;
2248 prt(format(_("現在のウェイト: %d (%dミリ秒)", "Current base delay factor: %d (%d msec)"), delay_factor, msec), 22, 0);
2249 prt(_("ウェイト (0-9) ESCで決定: ", "Delay Factor (0-9 or ESC to accept): "), 20, 0);
2251 if (k == ESCAPE) break;
2254 (void)show_file(TRUE, _("joption.txt#BaseDelay", "option.txt#BaseDelay"), NULL, 0, 0);
2257 else if (isdigit(k)) delay_factor = D2I(k);
2264 /* Hack -- hitpoint warning factor */
2270 prt(_("コマンド: 低ヒットポイント警告", "Command: Hitpoint Warning"), 19, 0);
2272 /* Get a new value */
2275 prt(format(_("現在の低ヒットポイント警告: %d0%%", "Current hitpoint warning: %d0%%"), hitpoint_warn), 22, 0);
2276 prt(_("低ヒットポイント警告 (0-9) ESCで決定: ", "Hitpoint Warning (0-9 or ESC to accept): "), 20, 0);
2278 if (k == ESCAPE) break;
2281 (void)show_file(TRUE, _("joption.txt#Hitpoint", "option.txt#Hitpoint"), NULL, 0, 0);
2284 else if (isdigit(k)) hitpoint_warn = D2I(k);
2291 /* Hack -- mana color factor */
2297 prt(_("コマンド: 低魔力色閾値", "Command: Mana Color Threshold"), 19, 0);
2299 /* Get a new value */
2302 prt(format(_("現在の低魔力色閾値: %d0%%", "Current mana color threshold: %d0%%"), mana_warn), 22, 0);
2303 prt(_("低魔力閾値 (0-9) ESCで決定: ", "Mana color Threshold (0-9 or ESC to accept): "), 20, 0);
2305 if (k == ESCAPE) break;
2308 (void)show_file(TRUE, _("joption.txt#Manapoint", "option.txt#Manapoint"), NULL, 0, 0);
2311 else if (isdigit(k)) mana_warn = D2I(k);
2319 (void)show_file(TRUE, _("joption.txt", "option.txt"), NULL, 0, 0);
2323 /* Unknown option */
2332 /* Flush messages */
2337 /* Restore the screen */
2340 /* Hack - Redraw equippy chars */
2341 p_ptr->redraw |= (PR_EQUIPPY);
2347 * @brief prefファイルを選択して処理する /
2348 * Ask for a "user pref line" and process it
2351 * XXX XXX XXX Allow absolute file names?
2353 void do_cmd_pref(void)
2360 /* Ask for a "user pref command" */
2361 if (!get_string(_("設定変更コマンド: ", "Pref: "), buf, 80)) return;
2363 /* Process that pref command */
2364 (void)process_pref_file_command(buf);
2368 * @brief 自動拾い設定ファイルをロードするコマンドのメインルーチン /
2371 void do_cmd_reload_autopick(void)
2373 if (!get_check(_("自動拾い設定ファイルをロードしますか? ", "Reload auto-pick preference file? "))) return;
2374 /* Load the file with messages */
2375 autopick_load_pref(TRUE);
2381 * @brief マクロ情報をprefファイルに保存する /
2382 * @param fname ファイル名
2385 static errr macro_dump(cptr fname)
2387 static cptr mark = "Macro Dump";
2393 /* Build the filename */
2394 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
2396 /* File type is "TEXT" */
2397 FILE_TYPE(FILE_TYPE_TEXT);
2399 /* Append to the file */
2400 if (!open_auto_dump(buf, mark)) return (-1);
2403 auto_dump_printf(_("\n# 自動マクロセーブ\n\n", "\n# Automatic macro dump\n\n"));
2406 for (i = 0; i < macro__num; i++)
2408 /* Extract the action */
2409 ascii_to_text(buf, macro__act[i]);
2411 /* Dump the macro */
2412 auto_dump_printf("A:%s\n", buf);
2414 /* Extract the action */
2415 ascii_to_text(buf, macro__pat[i]);
2417 /* Dump normal macros */
2418 auto_dump_printf("P:%s\n", buf);
2421 auto_dump_printf("\n");
2433 * @brief マクロのトリガーキーを取得する /
2434 * Hack -- ask for a "trigger" (see below)
2435 * @param buf キー表記を保管するバッファ
2439 * Note the complex use of the "inkey()" function from "util.c".
2441 * Note that both "flush()" calls are extremely important.
2444 static void do_cmd_macro_aux(char *buf)
2453 /* Do not process macros */
2459 /* Read the pattern */
2465 /* Do not process macros */
2468 /* Do not wait for keys */
2471 /* Attempt to read a key */
2482 /* Convert the trigger */
2483 ascii_to_text(tmp, buf);
2485 /* Hack -- display the trigger */
2486 Term_addstr(-1, TERM_WHITE, tmp);
2492 * @brief マクロのキー表記からアスキーコードを得てターミナルに表示する /
2493 * Hack -- ask for a keymap "trigger" (see below)
2494 * @param buf キー表記を取得するバッファ
2498 * Note that both "flush()" calls are extremely important. This may
2499 * no longer be true, since "util.c" is much simpler now. XXX XXX XXX
2502 static void do_cmd_macro_aux_keymap(char *buf)
2516 /* Convert to ascii */
2517 ascii_to_text(tmp, buf);
2519 /* Hack -- display the trigger */
2520 Term_addstr(-1, TERM_WHITE, tmp);
2529 * @brief キーマップをprefファイルにダンプする /
2530 * Hack -- append all keymaps to the given file
2531 * @param fname ファイルネーム
2535 static errr keymap_dump(cptr fname)
2537 static cptr mark = "Keymap Dump";
2546 if (rogue_like_commands)
2548 mode = KEYMAP_MODE_ROGUE;
2554 mode = KEYMAP_MODE_ORIG;
2558 /* Build the filename */
2559 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
2561 /* File type is "TEXT" */
2562 FILE_TYPE(FILE_TYPE_TEXT);
2564 /* Append to the file */
2565 if (!open_auto_dump(buf, mark)) return -1;
2568 auto_dump_printf(_("\n# 自動キー配置セーブ\n\n", "\n# Automatic keymap dump\n\n"));
2571 for (i = 0; i < 256; i++)
2575 /* Loop up the keymap */
2576 act = keymap_act[mode][i];
2578 /* Skip empty keymaps */
2581 /* Encode the key */
2584 ascii_to_text(key, buf);
2586 /* Encode the action */
2587 ascii_to_text(buf, act);
2589 /* Dump the macro */
2590 auto_dump_printf("A:%s\n", buf);
2591 auto_dump_printf("C:%d:%s\n", mode, key);
2603 * @brief マクロを設定するコマンドのメインルーチン /
2604 * Interact with "macros"
2608 * Note that the macro "action" must be defined before the trigger.
2610 * Could use some helpful instructions on this page. XXX XXX XXX
2613 void do_cmd_macros(void)
2625 if (rogue_like_commands)
2627 mode = KEYMAP_MODE_ROGUE;
2633 mode = KEYMAP_MODE_ORIG;
2636 /* File type is "TEXT" */
2637 FILE_TYPE(FILE_TYPE_TEXT);
2644 /* Process requests until done */
2651 prt(_("[ マクロの設定 ]", "Interact with Macros"), 2, 0);
2653 /* Describe that action */
2654 prt(_("マクロ行動が(もしあれば)下に表示されます:", "Current action (if any) shown below:"), 20, 0);
2656 /* Analyze the current action */
2657 ascii_to_text(buf, macro__buf);
2659 /* Display the current action */
2664 prt(_("(1) ユーザー設定ファイルのロード", "(1) Load a user pref file"), 4, 5);
2666 prt(_("(2) ファイルにマクロを追加", "(2) Append macros to a file"), 5, 5);
2667 prt(_("(3) マクロの確認", "(3) Query a macro"), 6, 5);
2668 prt(_("(4) マクロの作成", "(4) Create a macro"), 7, 5);
2669 prt(_("(5) マクロの削除", "(5) Remove a macro"), 8, 5);
2670 prt(_("(6) ファイルにキー配置を追加", "(6) Append keymaps to a file"), 9, 5);
2671 prt(_("(7) キー配置の確認", "(7) Query a keymap"), 10, 5);
2672 prt(_("(8) キー配置の作成", "(8) Create a keymap"), 11, 5);
2673 prt(_("(9) キー配置の削除", "(9) Remove a keymap"), 12, 5);
2674 prt(_("(0) マクロ行動の入力", "(0) Enter a new action"), 13, 5);
2675 #endif /* ALLOW_MACROS */
2678 prt(_("コマンド: ", "Command: "), 16, 0);
2684 if (i == ESCAPE) break;
2686 /* Load a 'macro' file */
2692 prt(_("コマンド: ユーザー設定ファイルのロード", "Command: Load a user pref file"), 16, 0);
2695 prt(_("ファイル: ", "File: "), 18, 0);
2697 /* Default filename */
2698 sprintf(tmp, "%s.prf", player_base);
2700 /* Ask for a file */
2701 if (!askfor(tmp, 80)) continue;
2703 /* Process the given filename */
2704 err = process_pref_file(tmp);
2707 msg_format(_("標準の設定ファイル'%s'を読み込みました。", "Loaded default '%s'."), tmp);
2712 msg_format(_("'%s'の読み込みに失敗しました!", "Failed to load '%s'!"), tmp);
2716 msg_format(_("'%s'を読み込みました。", "Loaded '%s'."), tmp);
2726 prt(_("コマンド: マクロをファイルに追加する", "Command: Append macros to a file"), 16, 0);
2729 prt(_("ファイル: ", "File: "), 18, 0);
2731 /* Default filename */
2732 sprintf(tmp, "%s.prf", player_base);
2734 /* Ask for a file */
2735 if (!askfor(tmp, 80)) continue;
2737 /* Dump the macros */
2738 (void)macro_dump(tmp);
2741 msg_print(_("マクロを追加しました。", "Appended macros."));
2750 prt(_("コマンド: マクロの確認", "Command: Query a macro"), 16, 0);
2754 prt(_("トリガーキー: ", "Trigger: "), 18, 0);
2756 /* Get a macro trigger */
2757 do_cmd_macro_aux(buf);
2759 /* Acquire action */
2760 k = macro_find_exact(buf);
2766 msg_print(_("そのキーにはマクロは定義されていません。", "Found no macro."));
2772 /* Obtain the action */
2773 strcpy(macro__buf, macro__act[k]);
2775 /* Analyze the current action */
2776 ascii_to_text(buf, macro__buf);
2778 /* Display the current action */
2782 msg_print(_("マクロを確認しました。", "Found a macro."));
2786 /* Create a macro */
2790 prt(_("コマンド: マクロの作成", "Command: Create a macro"), 16, 0);
2793 prt(_("トリガーキー: ", "Trigger: "), 18, 0);
2795 /* Get a macro trigger */
2796 do_cmd_macro_aux(buf);
2802 c_prt(TERM_L_RED, _("カーソルキーの左右でカーソル位置を移動。BackspaceかDeleteで一文字削除。",
2803 "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0);
2806 prt(_("マクロ行動: ", "Action: "), 20, 0);
2808 /* Convert to text */
2809 ascii_to_text(tmp, macro__buf);
2811 /* Get an encoded action */
2812 if (askfor(tmp, 80))
2814 /* Convert to ascii */
2815 text_to_ascii(macro__buf, tmp);
2817 /* Link the macro */
2818 macro_add(buf, macro__buf);
2821 msg_print(_("マクロを追加しました。", "Added a macro."));
2825 /* Remove a macro */
2829 prt(_("コマンド: マクロの削除", "Command: Remove a macro"), 16, 0);
2832 prt(_("トリガーキー: ", "Trigger: "), 18, 0);
2834 /* Get a macro trigger */
2835 do_cmd_macro_aux(buf);
2837 /* Link the macro */
2838 macro_add(buf, buf);
2841 msg_print(_("マクロを削除しました。", "Removed a macro."));
2848 prt(_("コマンド: キー配置をファイルに追加する", "Command: Append keymaps to a file"), 16, 0);
2851 prt(_("ファイル: ", "File: "), 18, 0);
2853 /* Default filename */
2854 sprintf(tmp, "%s.prf", player_base);
2856 /* Ask for a file */
2857 if (!askfor(tmp, 80)) continue;
2859 /* Dump the macros */
2860 (void)keymap_dump(tmp);
2863 msg_print(_("キー配置を追加しました。", "Appended keymaps."));
2866 /* Query a keymap */
2872 prt(_("コマンド: キー配置の確認", "Command: Query a keymap"), 16, 0);
2875 prt(_("押すキー: ", "Keypress: "), 18, 0);
2877 /* Get a keymap trigger */
2878 do_cmd_macro_aux_keymap(buf);
2880 /* Look up the keymap */
2881 act = keymap_act[mode][(byte)(buf[0])];
2887 msg_print(_("キー配置は定義されていません。", "Found no keymap."));
2893 /* Obtain the action */
2894 strcpy(macro__buf, act);
2896 /* Analyze the current action */
2897 ascii_to_text(buf, macro__buf);
2899 /* Display the current action */
2903 msg_print(_("キー配置を確認しました。", "Found a keymap."));
2907 /* Create a keymap */
2911 prt(_("コマンド: キー配置の作成", "Command: Create a keymap"), 16, 0);
2914 prt(_("押すキー: ", "Keypress: "), 18, 0);
2916 /* Get a keymap trigger */
2917 do_cmd_macro_aux_keymap(buf);
2923 c_prt(TERM_L_RED, _("カーソルキーの左右でカーソル位置を移動。BackspaceかDeleteで一文字削除。",
2924 "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0);
2927 prt(_("行動: ", "Action: "), 20, 0);
2929 /* Convert to text */
2930 ascii_to_text(tmp, macro__buf);
2932 /* Get an encoded action */
2933 if (askfor(tmp, 80))
2935 /* Convert to ascii */
2936 text_to_ascii(macro__buf, tmp);
2938 /* Free old keymap */
2939 string_free(keymap_act[mode][(byte)(buf[0])]);
2941 /* Make new keymap */
2942 keymap_act[mode][(byte)(buf[0])] = string_make(macro__buf);
2945 msg_print(_("キー配置を追加しました。", "Added a keymap."));
2949 /* Remove a keymap */
2953 prt(_("コマンド: キー配置の削除", "Command: Remove a keymap"), 16, 0);
2956 prt(_("押すキー: ", "Keypress: "), 18, 0);
2958 /* Get a keymap trigger */
2959 do_cmd_macro_aux_keymap(buf);
2961 /* Free old keymap */
2962 string_free(keymap_act[mode][(byte)(buf[0])]);
2964 /* Make new keymap */
2965 keymap_act[mode][(byte)(buf[0])] = NULL;
2968 msg_print(_("キー配置を削除しました。", "Removed a keymap."));
2971 /* Enter a new action */
2975 prt(_("コマンド: マクロ行動の入力", "Command: Enter a new action"), 16, 0);
2981 c_prt(TERM_L_RED, _("カーソルキーの左右でカーソル位置を移動。BackspaceかDeleteで一文字削除。",
2982 "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0);
2985 prt(_("マクロ行動: ", "Action: "), 20, 0);
2987 /* Hack -- limit the value */
2990 /* Get an encoded action */
2991 if (!askfor(buf, 80)) continue;
2993 /* Extract an action */
2994 text_to_ascii(macro__buf, buf);
2997 #endif /* ALLOW_MACROS */
3006 /* Flush messages */
3015 * @brief キャラクタ色の明暗表現
3017 static cptr lighting_level_str[F_LIT_MAX] =
3032 * @brief キャラクタのビジュアルIDを変更する際の対象指定関数
3033 * @param i 指定対象となるキャラクタコード
3034 * @param num 指定されたビジュアルIDを返す参照ポインタ
3035 * @param max ビジュアルIDの最大数
3036 * @return 指定が実際に行われた場合TRUE、キャンセルされた場合FALSE
3038 static bool cmd_visuals_aux(int i, IDX *num, IDX max)
3045 sprintf(str, "%d", *num);
3047 if (!get_string(format("Input new number(0-%d): ", max-1), str, 4))
3050 tmp = (IDX)strtol(str, NULL, 0);
3051 if (tmp >= 0 && tmp < max)
3054 else if (isupper(i))
3055 *num = (*num + max - 1) % max;
3057 *num = (*num + 1) % max;
3063 * @brief キャラクタの変更メニュー表示
3064 * @param choice_msg 選択メッセージ
3067 static void print_visuals_menu(cptr choice_msg)
3069 prt(_("[ 画面表示の設定 ]", "Interact with Visuals"), 1, 0);
3071 /* Give some choices */
3072 prt(_("(0) ユーザー設定ファイルのロード", "(0) Load a user pref file"), 3, 5);
3074 #ifdef ALLOW_VISUALS
3075 prt(_("(1) モンスターの 色/文字 をファイルに書き出す", "(1) Dump monster attr/chars"), 4, 5);
3076 prt(_("(2) アイテムの 色/文字 をファイルに書き出す", "(2) Dump object attr/chars"), 5, 5);
3077 prt(_("(3) 地形の 色/文字 をファイルに書き出す", "(3) Dump feature attr/chars"), 6, 5);
3078 prt(_("(4) モンスターの 色/文字 を変更する (数値操作)", "(4) Change monster attr/chars (numeric operation)"), 7, 5);
3079 prt(_("(5) アイテムの 色/文字 を変更する (数値操作)", "(5) Change object attr/chars (numeric operation)"), 8, 5);
3080 prt(_("(6) 地形の 色/文字 を変更する (数値操作)", "(6) Change feature attr/chars (numeric operation)"), 9, 5);
3081 prt(_("(7) モンスターの 色/文字 を変更する (シンボルエディタ)", "(7) Change monster attr/chars (visual mode)"), 10, 5);
3082 prt(_("(8) アイテムの 色/文字 を変更する (シンボルエディタ)", "(8) Change object attr/chars (visual mode)"), 11, 5);
3083 prt(_("(9) 地形の 色/文字 を変更する (シンボルエディタ)", "(9) Change feature attr/chars (visual mode)"), 12, 5);
3084 #endif /* ALLOW_VISUALS */
3086 prt(_("(R) 画面表示方法の初期化", "(R) Reset visuals"), 13, 5);
3089 prt(format("コマンド: %s", choice_msg ? choice_msg : _("", "")), 15, 0);
3092 static void do_cmd_knowledge_monsters(bool *need_redraw, bool visual_only, IDX direct_r_idx);
3093 static void do_cmd_knowledge_objects(bool *need_redraw, bool visual_only, IDX direct_k_idx);
3094 static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX direct_f_idx, IDX *lighting_level);
3097 * Interact with "visuals"
3099 void do_cmd_visuals(void)
3104 bool need_redraw = FALSE;
3105 const char *empty_symbol = "<< ? >>";
3107 if (use_bigtile) empty_symbol = "<< ?? >>";
3109 /* File type is "TEXT" */
3110 FILE_TYPE(FILE_TYPE_TEXT);
3112 /* Save the screen */
3115 /* Interact until done */
3121 /* Ask for a choice */
3122 print_visuals_menu(NULL);
3128 if (i == ESCAPE) break;
3132 /* Load a 'pref' file */
3135 prt(_("コマンド: ユーザー設定ファイルのロード", "Command: Load a user pref file"), 15, 0);
3138 prt(_("ファイル: ", "File: "), 17, 0);
3140 /* Default filename */
3141 sprintf(tmp, "%s.prf", player_base);
3144 if (!askfor(tmp, 70)) continue;
3146 /* Process the given filename */
3147 (void)process_pref_file(tmp);
3152 #ifdef ALLOW_VISUALS
3154 /* Dump monster attr/chars */
3157 static cptr mark = "Monster attr/chars";
3160 prt(_("コマンド: モンスターの[色/文字]をファイルに書き出します", "Command: Dump monster attr/chars"), 15, 0);
3163 prt(_("ファイル: ", "File: "), 17, 0);
3165 /* Default filename */
3166 sprintf(tmp, "%s.prf", player_base);
3168 /* Get a filename */
3169 if (!askfor(tmp, 70)) continue;
3171 /* Build the filename */
3172 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3174 /* Append to the file */
3175 if (!open_auto_dump(buf, mark)) continue;
3178 auto_dump_printf(_("\n# モンスターの[色/文字]の設定\n\n", "\n# Monster attr/char definitions\n\n"));
3181 for (i = 0; i < max_r_idx; i++)
3183 monster_race *r_ptr = &r_info[i];
3185 /* Skip non-entries */
3186 if (!r_ptr->name) continue;
3188 /* Dump a comment */
3189 auto_dump_printf("# %s\n", (r_name + r_ptr->name));
3191 /* Dump the monster attr/char info */
3192 auto_dump_printf("R:%d:0x%02X/0x%02X\n\n", i,
3193 (byte)(r_ptr->x_attr), (byte)(r_ptr->x_char));
3200 msg_print(_("モンスターの[色/文字]をファイルに書き出しました。", "Dumped monster attr/chars."));
3205 /* Dump object attr/chars */
3208 static cptr mark = "Object attr/chars";
3212 prt(_("コマンド: アイテムの[色/文字]をファイルに書き出します", "Command: Dump object attr/chars"), 15, 0);
3215 prt(_("ファイル: ", "File: "), 17, 0);
3217 /* Default filename */
3218 sprintf(tmp, "%s.prf", player_base);
3220 /* Get a filename */
3221 if (!askfor(tmp, 70)) continue;
3223 /* Build the filename */
3224 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3226 /* Append to the file */
3227 if (!open_auto_dump(buf, mark)) continue;
3230 auto_dump_printf(_("\n# アイテムの[色/文字]の設定\n\n", "\n# Object attr/char definitions\n\n"));
3233 for (k_idx = 0; k_idx < max_k_idx; k_idx++)
3236 object_kind *k_ptr = &k_info[k_idx];
3238 /* Skip non-entries */
3239 if (!k_ptr->name) continue;
3244 strip_name(o_name, k_idx);
3250 /* Prepare dummy object */
3251 object_prep(&forge, k_idx);
3253 /* Get un-shuffled flavor name */
3254 object_desc(o_name, &forge, OD_FORCE_FLAVOR);
3257 /* Dump a comment */
3258 auto_dump_printf("# %s\n", o_name);
3260 /* Dump the object attr/char info */
3261 auto_dump_printf("K:%d:0x%02X/0x%02X\n\n", (int)k_idx,
3262 (byte)(k_ptr->x_attr), (byte)(k_ptr->x_char));
3269 msg_print(_("アイテムの[色/文字]をファイルに書き出しました。", "Dumped object attr/chars."));
3274 /* Dump feature attr/chars */
3277 static cptr mark = "Feature attr/chars";
3280 prt(_("コマンド: 地形の[色/文字]をファイルに書き出します", "Command: Dump feature attr/chars"), 15, 0);
3283 prt(_("ファイル: ", "File: "), 17, 0);
3285 /* Default filename */
3286 sprintf(tmp, "%s.prf", player_base);
3288 /* Get a filename */
3289 if (!askfor(tmp, 70)) continue;
3291 /* Build the filename */
3292 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3294 /* Append to the file */
3295 if (!open_auto_dump(buf, mark)) continue;
3298 auto_dump_printf(_("\n# 地形の[色/文字]の設定\n\n", "\n# Feature attr/char definitions\n\n"));
3301 for (i = 0; i < max_f_idx; i++)
3303 feature_type *f_ptr = &f_info[i];
3305 /* Skip non-entries */
3306 if (!f_ptr->name) continue;
3308 /* Skip mimiccing features */
3309 if (f_ptr->mimic != i) continue;
3311 /* Dump a comment */
3312 auto_dump_printf("# %s\n", (f_name + f_ptr->name));
3314 /* Dump the feature attr/char info */
3315 auto_dump_printf("F:%d:0x%02X/0x%02X:0x%02X/0x%02X:0x%02X/0x%02X\n\n", i,
3316 (byte)(f_ptr->x_attr[F_LIT_STANDARD]), (byte)(f_ptr->x_char[F_LIT_STANDARD]),
3317 (byte)(f_ptr->x_attr[F_LIT_LITE]), (byte)(f_ptr->x_char[F_LIT_LITE]),
3318 (byte)(f_ptr->x_attr[F_LIT_DARK]), (byte)(f_ptr->x_char[F_LIT_DARK]));
3325 msg_print(_("地形の[色/文字]をファイルに書き出しました。", "Dumped feature attr/chars."));
3330 /* Modify monster attr/chars (numeric operation) */
3333 static cptr choice_msg = _("モンスターの[色/文字]を変更します", "Change monster attr/chars");
3336 prt(format(_("コマンド: %s", "Command: %s"), choice_msg), 15, 0);
3338 /* Hack -- query until done */
3341 monster_race *r_ptr = &r_info[r];
3345 byte da = r_ptr->d_attr;
3346 byte dc = r_ptr->d_char;
3347 byte ca = r_ptr->x_attr;
3348 byte cc = r_ptr->x_char;
3350 /* Label the object */
3351 Term_putstr(5, 17, -1, TERM_WHITE,
3352 format(_("モンスター = %d, 名前 = %-40.40s", "Monster = %d, Name = %-40.40s"), r, (r_name + r_ptr->name)));
3354 /* Label the Default values */
3355 Term_putstr(10, 19, -1, TERM_WHITE,
3356 format(_("初期値 色 / 文字 = %3u / %3u", "Default attr/char = %3u / %3u"), da, dc));
3358 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
3359 Term_queue_bigchar(43, 19, da, dc, 0, 0);
3361 /* Label the Current values */
3362 Term_putstr(10, 20, -1, TERM_WHITE,
3363 format(_("現在値 色 / 文字 = %3u / %3u", "Current attr/char = %3u / %3u"), ca, cc));
3365 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
3366 Term_queue_bigchar(43, 20, ca, cc, 0, 0);
3369 Term_putstr(0, 22, -1, TERM_WHITE,
3370 _("コマンド (n/N/^N/a/A/^A/c/C/^C/v/V/^V): ", "Command (n/N/^N/a/A/^A/c/C/^C/v/V/^V): "));
3376 if (i == ESCAPE) break;
3378 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3379 else if (isupper(i)) c = 'a' + i - 'A';
3389 if (!cmd_visuals_aux(i, &r, max_r_idx))
3395 while (!r_info[r].name);
3399 t = (int)r_ptr->x_attr;
3400 (void)cmd_visuals_aux(i, &t, 256);
3401 r_ptr->x_attr = (byte)t;
3405 t = (int)r_ptr->x_char;
3406 (void)cmd_visuals_aux(i, &t, 256);
3407 r_ptr->x_char = (byte)t;
3411 do_cmd_knowledge_monsters(&need_redraw, TRUE, r);
3415 print_visuals_menu(choice_msg);
3423 /* Modify object attr/chars (numeric operation) */
3426 static cptr choice_msg = _("アイテムの[色/文字]を変更します", "Change object attr/chars");
3428 prt(format(_("コマンド: %s", "Command: %s"), choice_msg), 15, 0);
3430 /* Hack -- query until done */
3433 object_kind *k_ptr = &k_info[k];
3437 SYMBOL_COLOR da = k_ptr->d_attr;
3438 SYMBOL_CODE dc = k_ptr->d_char;
3439 SYMBOL_COLOR ca = k_ptr->x_attr;
3440 SYMBOL_CODE cc = k_ptr->x_char;
3442 /* Label the object */
3443 Term_putstr(5, 17, -1, TERM_WHITE,
3444 format(_("アイテム = %d, 名前 = %-40.40s", "Object = %d, Name = %-40.40s"),
3445 k, k_name + (!k_ptr->flavor ? k_ptr->name : k_ptr->flavor_name)));
3447 /* Label the Default values */
3448 Term_putstr(10, 19, -1, TERM_WHITE,
3449 format(_("初期値 色 / 文字 = %3d / %3d", "Default attr/char = %3d / %3d"), da, dc));
3451 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
3452 Term_queue_bigchar(43, 19, da, dc, 0, 0);
3454 /* Label the Current values */
3455 Term_putstr(10, 20, -1, TERM_WHITE,
3456 format(_("現在値 色 / 文字 = %3d / %3d", "Current attr/char = %3d / %3d"), ca, cc));
3458 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
3459 Term_queue_bigchar(43, 20, ca, cc, 0, 0);
3462 Term_putstr(0, 22, -1, TERM_WHITE,
3463 _("コマンド (n/N/^N/a/A/^A/c/C/^C/v/V/^V): ", "Command (n/N/^N/a/A/^A/c/C/^C/v/V/^V): "));
3469 if (i == ESCAPE) break;
3471 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3472 else if (isupper(i)) c = 'a' + i - 'A';
3482 if (!cmd_visuals_aux(i, &k, max_k_idx))
3488 while (!k_info[k].name);
3492 t = (int)k_ptr->x_attr;
3493 (void)cmd_visuals_aux(i, &t, 256);
3494 k_ptr->x_attr = (byte)t;
3498 t = (int)k_ptr->x_char;
3499 (void)cmd_visuals_aux(i, &t, 256);
3500 k_ptr->x_char = (byte)t;
3504 do_cmd_knowledge_objects(&need_redraw, TRUE, k);
3508 print_visuals_menu(choice_msg);
3516 /* Modify feature attr/chars (numeric operation) */
3519 static cptr choice_msg = _("地形の[色/文字]を変更します", "Change feature attr/chars");
3521 static IDX lighting_level = F_LIT_STANDARD;
3522 prt(format(_("コマンド: %s", "Command: %s"), choice_msg), 15, 0);
3524 /* Hack -- query until done */
3527 feature_type *f_ptr = &f_info[f];
3531 byte da = f_ptr->d_attr[lighting_level];
3532 byte dc = f_ptr->d_char[lighting_level];
3533 byte ca = f_ptr->x_attr[lighting_level];
3534 byte cc = f_ptr->x_char[lighting_level];
3536 /* Label the object */
3538 Term_putstr(5, 17, -1, TERM_WHITE,
3539 format(_("地形 = %d, 名前 = %s, 明度 = %s", "Terrain = %d, Name = %s, Lighting = %s"),
3540 f, (f_name + f_ptr->name), lighting_level_str[lighting_level]));
3542 /* Label the Default values */
3543 Term_putstr(10, 19, -1, TERM_WHITE,
3544 format(_("初期値 色 / 文字 = %3d / %3d", "Default attr/char = %3d / %3d"), da, dc));
3546 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
3547 Term_queue_bigchar(43, 19, da, dc, 0, 0);
3549 /* Label the Current values */
3551 Term_putstr(10, 20, -1, TERM_WHITE,
3552 format("現在値 色 / 文字 = %3d / %3d", ca, cc));
3554 Term_putstr(10, 20, -1, TERM_WHITE,
3555 format("Current attr/char = %3d / %3d", ca, cc));
3558 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
3559 Term_queue_bigchar(43, 20, ca, cc, 0, 0);
3563 Term_putstr(0, 22, -1, TERM_WHITE,
3564 "コマンド (n/N/^N/a/A/^A/c/C/^C/l/L/^L/d/D/^D/v/V/^V): ");
3566 Term_putstr(0, 22, -1, TERM_WHITE,
3567 "Command (n/N/^N/a/A/^A/c/C/^C/l/L/^L/d/D/^D/v/V/^V): ");
3574 if (i == ESCAPE) break;
3576 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3577 else if (isupper(i)) c = 'a' + i - 'A';
3587 if (!cmd_visuals_aux(i, &f, max_f_idx))
3593 while (!f_info[f].name || (f_info[f].mimic != f));
3597 t = (int)f_ptr->x_attr[lighting_level];
3598 (void)cmd_visuals_aux(i, &t, 256);
3599 f_ptr->x_attr[lighting_level] = (byte)t;
3603 t = (int)f_ptr->x_char[lighting_level];
3604 (void)cmd_visuals_aux(i, &t, 256);
3605 f_ptr->x_char[lighting_level] = (byte)t;
3609 (void)cmd_visuals_aux(i, &lighting_level, F_LIT_MAX);
3612 apply_default_feat_lighting(f_ptr->x_attr, f_ptr->x_char);
3616 do_cmd_knowledge_features(&need_redraw, TRUE, f, &lighting_level);
3620 print_visuals_menu(choice_msg);
3628 /* Modify monster attr/chars (visual mode) */
3630 do_cmd_knowledge_monsters(&need_redraw, TRUE, -1);
3633 /* Modify object attr/chars (visual mode) */
3635 do_cmd_knowledge_objects(&need_redraw, TRUE, -1);
3638 /* Modify feature attr/chars (visual mode) */
3641 IDX lighting_level = F_LIT_STANDARD;
3642 do_cmd_knowledge_features(&need_redraw, TRUE, -1, &lighting_level);
3646 #endif /* ALLOW_VISUALS */
3655 msg_print(_("画面上の[色/文字]を初期値にリセットしました。", "Visual attr/char tables reset."));
3659 /* Unknown option */
3665 /* Flush messages */
3669 /* Restore the screen */
3672 if (need_redraw) do_cmd_redraw();
3677 * Interact with "colors"
3679 void do_cmd_colors(void)
3688 /* File type is "TEXT" */
3689 FILE_TYPE(FILE_TYPE_TEXT);
3692 /* Save the screen */
3696 /* Interact until done */
3702 /* Ask for a choice */
3703 prt(_("[ カラーの設定 ]", "Interact with Colors"), 2, 0);
3705 /* Give some choices */
3706 prt(_("(1) ユーザー設定ファイルのロード", "(1) Load a user pref file"), 4, 5);
3709 prt(_("(2) カラーの設定をファイルに書き出す", "(2) Dump colors"), 5, 5);
3710 prt(_("(3) カラーの設定を変更する", "(3) Modify colors"), 6, 5);
3714 prt(_("コマンド: ", "Command: "), 8, 0);
3719 if (i == ESCAPE) break;
3721 /* Load a 'pref' file */
3725 prt(_("コマンド: ユーザー設定ファイルをロードします", "Command: Load a user pref file"), 8, 0);
3728 prt(_("ファイル: ", "File: "), 10, 0);
3731 sprintf(tmp, "%s.prf", player_base);
3734 if (!askfor(tmp, 70)) continue;
3736 /* Process the given filename */
3737 (void)process_pref_file(tmp);
3739 /* Mega-Hack -- react to changes */
3740 Term_xtra(TERM_XTRA_REACT, 0);
3742 /* Mega-Hack -- redraw */
3751 static cptr mark = "Colors";
3754 prt(_("コマンド: カラーの設定をファイルに書き出します", "Command: Dump colors"), 8, 0);
3757 prt(_("ファイル: ", "File: "), 10, 0);
3759 /* Default filename */
3760 sprintf(tmp, "%s.prf", player_base);
3762 /* Get a filename */
3763 if (!askfor(tmp, 70)) continue;
3765 /* Build the filename */
3766 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3768 /* Append to the file */
3769 if (!open_auto_dump(buf, mark)) continue;
3772 auto_dump_printf(_("\n# カラーの設定\n\n", "\n# Color redefinitions\n\n"));
3775 for (i = 0; i < 256; i++)
3777 int kv = angband_color_table[i][0];
3778 int rv = angband_color_table[i][1];
3779 int gv = angband_color_table[i][2];
3780 int bv = angband_color_table[i][3];
3782 cptr name = _("未知", "unknown");
3784 /* Skip non-entries */
3785 if (!kv && !rv && !gv && !bv) continue;
3787 /* Extract the color name */
3788 if (i < 16) name = color_names[i];
3790 /* Dump a comment */
3791 auto_dump_printf(_("# カラー '%s'\n", "# Color '%s'\n"), name);
3793 /* Dump the monster attr/char info */
3794 auto_dump_printf("V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n",
3802 msg_print(_("カラーの設定をファイルに書き出しました。", "Dumped color redefinitions."));
3811 prt(_("コマンド: カラーの設定を変更します", "Command: Modify colors"), 8, 0);
3813 /* Hack -- query until done */
3822 /* Exhibit the normal colors */
3823 for (j = 0; j < 16; j++)
3825 /* Exhibit this color */
3826 Term_putstr(j*4, 20, -1, a, "###");
3828 /* Exhibit all colors */
3829 Term_putstr(j*4, 22, -1, j, format("%3d", j));
3832 /* Describe the color */
3833 name = ((a < 16) ? color_names[a] : _("未定義", "undefined"));
3835 /* Describe the color */
3836 Term_putstr(5, 10, -1, TERM_WHITE,
3837 format(_("カラー = %d, 名前 = %s", "Color = %d, Name = %s"), a, name));
3839 /* Label the Current values */
3840 Term_putstr(5, 12, -1, TERM_WHITE,
3841 format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x",
3842 angband_color_table[a][0],
3843 angband_color_table[a][1],
3844 angband_color_table[a][2],
3845 angband_color_table[a][3]));
3848 Term_putstr(0, 14, -1, TERM_WHITE,
3849 _("コマンド (n/N/k/K/r/R/g/G/b/B): ", "Command (n/N/k/K/r/R/g/G/b/B): "));
3856 if (i == ESCAPE) break;
3859 if (i == 'n') a = (byte)(a + 1);
3860 if (i == 'N') a = (byte)(a - 1);
3861 if (i == 'k') angband_color_table[a][0] = (byte)(angband_color_table[a][0] + 1);
3862 if (i == 'K') angband_color_table[a][0] = (byte)(angband_color_table[a][0] - 1);
3863 if (i == 'r') angband_color_table[a][1] = (byte)(angband_color_table[a][1] + 1);
3864 if (i == 'R') angband_color_table[a][1] = (byte)(angband_color_table[a][1] - 1);
3865 if (i == 'g') angband_color_table[a][2] = (byte)(angband_color_table[a][2] + 1);
3866 if (i == 'G') angband_color_table[a][2] = (byte)(angband_color_table[a][2] - 1);
3867 if (i == 'b') angband_color_table[a][3] = (byte)(angband_color_table[a][3] + 1);
3868 if (i == 'B') angband_color_table[a][3] = (byte)(angband_color_table[a][3] - 1);
3870 /* Hack -- react to changes */
3871 Term_xtra(TERM_XTRA_REACT, 0);
3873 /* Hack -- redraw */
3880 /* Unknown option */
3886 /* Flush messages */
3891 /* Restore the screen */
3897 * Note something in the message recall
3899 void do_cmd_note(void)
3907 if (!get_string(_("メモ: ", "Note: "), buf, 60)) return;
3909 /* Ignore empty notes */
3910 if (!buf[0] || (buf[0] == ' ')) return;
3912 /* Add the note to the message recall */
3913 msg_format(_("メモ: %s", "Note: %s"), buf);
3918 * Mention the current version
3920 void do_cmd_version(void)
3924 #if FAKE_VER_EXTRA > 0
3925 msg_format(_("変愚蛮怒(Hengband) %d.%d.%d.%d", "You are playing Hengband %d.%d.%d.%d."),
3926 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH, FAKE_VER_EXTRA);
3928 msg_format(_("変愚蛮怒(Hengband) %d.%d.%d", "You are playing Hengband %d.%d.%d."),
3929 FAKE_VER_MAJOR - 10, FAKE_VER_MINOR, FAKE_VER_PATCH);
3936 * Array of feeling strings
3938 static cptr do_cmd_feeling_text[11] =
3940 _("この階の雰囲気を感じとれなかった...", "Looks like any other level."),
3941 _("この階には何か特別なものがあるような気がする。", "You feel there is something special about this level."),
3942 _("恐ろしい死の幻が目に浮かび、気絶しそうになった!", "You nearly faint as horrible visions of death fill your mind!"),
3943 _("この階はとても危険なようだ。", "This level looks very dangerous."),
3944 _("とても悪い予感がする...", "You have a very bad feeling..."),
3945 _("悪い予感がする...", "You have a bad feeling..."),
3946 _("何か緊張する。", "You feel nervous."),
3947 _("少し不運な気がする...", "You feel your luck is turning..."),
3948 _("この場所は好きになれない。", "You don't like the look of this place."),
3949 _("この階はそれなりに安全なようだ。", "This level looks reasonably safe."),
3950 _("なんて退屈なところだ...", "What a boring place...")
3953 static cptr do_cmd_feeling_text_combat[11] =
3955 _("この階の雰囲気を感じとれなかった...", "Looks like any other level."),
3956 _("この階には何か特別なものがあるような気がする。", "You feel there is something special about this level."),
3957 _("今夜もまた、誰かが命を落とす...", "You nearly faint as horrible visions of death fill your mind!"),
3958 _("この階はとても危険なようだ。", "This level looks very dangerous."),
3959 _("とても悪い予感がする...", "You have a very bad feeling..."),
3960 _("悪い予感がする...", "You have a bad feeling..."),
3961 _("何か緊張する。", "You feel nervous."),
3962 _("少し不運な気がする...", "You feel your luck is turning..."),
3963 _("この場所は好きになれない。", "You don't like the look of this place."),
3964 _("この階はそれなりに安全なようだ。", "This level looks reasonably safe."),
3965 _("なんて退屈なところだ...", "What a boring place...")
3968 static cptr do_cmd_feeling_text_lucky[11] =
3970 _("この階の雰囲気を感じとれなかった...", "Looks like any other level."),
3971 _("この階には何か特別なものがあるような気がする。", "You feel there is something special about this level."),
3972 _("この階はこの上なく素晴らしい感じがする。", "You have a superb feeling about this level."),
3973 _("素晴らしい感じがする...", "You have an excellent feeling..."),
3974 _("とても良い感じがする...", "You have a very good feeling..."),
3975 _("良い感じがする...", "You have a good feeling..."),
3976 _("ちょっと幸運な感じがする...", "You feel strangely lucky..."),
3977 _("多少は運が向いてきたか...", "You feel your luck is turning..."),
3978 _("見た感じ悪くはない...", "You like the look of this place..."),
3979 _("全然駄目ということはないが...", "This level can't be all bad..."),
3980 _("なんて退屈なところだ...", "What a boring place...")
3985 * Note that "feeling" is set to zero unless some time has passed.
3986 * Note that this is done when the level is GENERATED, not entered.
3988 void do_cmd_feeling(void)
3990 /* No useful feeling in quests */
3991 if (p_ptr->inside_quest && !random_quest_number(dun_level))
3993 msg_print(_("典型的なクエストのダンジョンのようだ。", "Looks like a typical quest level."));
3997 /* No useful feeling in town */
3998 else if (p_ptr->town_num && !dun_level)
4000 if (!strcmp(town[p_ptr->town_num].name, _("荒野", "wilderness")))
4002 msg_print(_("何かありそうな荒野のようだ。", "Looks like a strange wilderness."));
4007 msg_print(_("典型的な町のようだ。", "Looks like a typical town."));
4012 /* No useful feeling in the wilderness */
4013 else if (!dun_level)
4015 msg_print(_("典型的な荒野のようだ。", "Looks like a typical wilderness."));
4019 /* Display the feeling */
4020 if (p_ptr->muta3 & MUT3_GOOD_LUCK)
4021 msg_print(do_cmd_feeling_text_lucky[p_ptr->feeling]);
4022 else if (p_ptr->pseikaku == SEIKAKU_COMBAT ||
4023 inventory[INVEN_BOW].name1 == ART_CRIMSON)
4024 msg_print(do_cmd_feeling_text_combat[p_ptr->feeling]);
4026 msg_print(do_cmd_feeling_text[p_ptr->feeling]);
4032 * Description of each monster group.
4034 static cptr monster_group_text[] =
4037 "ユニーク", /* "Uniques" */
4038 "乗馬可能なモンスター", /* "Riding" */
4039 "賞金首", /* "Wanted */
4040 "アンバーの王族", /* "Ambertite" */
4069 /* "古代ドラゴン/ワイアーム", */
4130 /* "Ancient Dragon/Wyrm", */
4139 "Multi-Headed Reptile",
4144 "Reptile/Amphibian",
4145 "Spider/Scorpion/Tick",
4147 /* "Major Demon", */
4164 * Symbols of monsters in each group. Note the "Uniques" group
4165 * is handled differently.
4167 static cptr monster_group_char[] =
4224 "!$&()+./=>?[\\]`{|~",
4234 * hook function to sort monsters by level
4236 static bool ang_sort_comp_monster_level(vptr u, vptr v, int a, int b)
4238 u16b *who = (u16b*)(u);
4243 monster_race *r_ptr1 = &r_info[w1];
4244 monster_race *r_ptr2 = &r_info[w2];
4249 if (r_ptr2->level > r_ptr1->level) return TRUE;
4250 if (r_ptr1->level > r_ptr2->level) return FALSE;
4252 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return TRUE;
4253 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return FALSE;
4258 * Build a list of monster indexes in the given group. Return the number
4259 * of monsters in the group.
4261 * mode & 0x01 : check for non-empty group
4262 * mode & 0x02 : visual operation only
4264 static IDX collect_monsters(IDX grp_cur, IDX mon_idx[], BIT_FLAGS8 mode)
4270 /* Get a list of x_char in this group */
4271 cptr group_char = monster_group_char[grp_cur];
4273 /* XXX Hack -- Check if this is the "Uniques" group */
4274 bool grp_unique = (monster_group_char[grp_cur] == (char *) -1L);
4276 /* XXX Hack -- Check if this is the "Riding" group */
4277 bool grp_riding = (monster_group_char[grp_cur] == (char *) -2L);
4279 /* XXX Hack -- Check if this is the "Wanted" group */
4280 bool grp_wanted = (monster_group_char[grp_cur] == (char *) -3L);
4282 /* XXX Hack -- Check if this is the "Amberite" group */
4283 bool grp_amberite = (monster_group_char[grp_cur] == (char *) -4L);
4286 /* Check every race */
4287 for (i = 0; i < max_r_idx; i++)
4289 /* Access the race */
4290 monster_race *r_ptr = &r_info[i];
4292 /* Skip empty race */
4293 if (!r_ptr->name) continue ;
4295 /* Require known monsters */
4296 if (!(mode & 0x02) && !cheat_know && !r_ptr->r_sights) continue;
4300 if (!(r_ptr->flags1 & RF1_UNIQUE)) continue;
4303 else if (grp_riding)
4305 if (!(r_ptr->flags7 & RF7_RIDING)) continue;
4308 else if (grp_wanted)
4310 bool wanted = FALSE;
4312 for (j = 0; j < MAX_KUBI; j++)
4314 if (kubi_r_idx[j] == i || kubi_r_idx[j] - 10000 == i ||
4315 (p_ptr->today_mon && p_ptr->today_mon == i))
4321 if (!wanted) continue;
4324 else if (grp_amberite)
4326 if (!(r_ptr->flags3 & RF3_AMBERITE)) continue;
4331 /* Check for race in the group */
4332 if (!my_strchr(group_char, r_ptr->d_char)) continue;
4336 mon_idx[mon_cnt++] = i;
4338 /* XXX Hack -- Just checking for non-empty group */
4339 if (mode & 0x01) break;
4342 /* Terminate the list */
4343 mon_idx[mon_cnt] = -1;
4345 /* Select the sort method */
4346 ang_sort_comp = ang_sort_comp_monster_level;
4347 ang_sort_swap = ang_sort_swap_hook;
4349 /* Sort by monster level */
4350 ang_sort(mon_idx, &dummy_why, mon_cnt);
4352 /* Return the number of races */
4358 * Description of each monster group.
4360 static cptr object_group_text[] =
4363 "キノコ", /* "Mushrooms" */
4364 "薬", /* "Potions" */
4365 "油つぼ", /* "Flasks" */
4366 "巻物", /* "Scrolls" */
4368 "アミュレット", /* "Amulets" */
4369 "笛", /* "Whistle" */
4370 "光源", /* "Lanterns" */
4371 "魔法棒", /* "Wands" */
4374 "カード", /* "Cards" */
4385 "刀剣類", /* "Swords" */
4386 "鈍器", /* "Blunt Weapons" */
4387 "長柄武器", /* "Polearms" */
4388 "採掘道具", /* "Diggers" */
4389 "飛び道具", /* "Bows" */
4393 "軽装鎧", /* "Soft Armor" */
4394 "重装鎧", /* "Hard Armor" */
4395 "ドラゴン鎧", /* "Dragon Armor" */
4396 "盾", /* "Shields" */
4397 "クローク", /* "Cloaks" */
4398 "籠手", /* "Gloves" */
4399 "ヘルメット", /* "Helms" */
4401 "ブーツ", /* "Boots" */
4454 * TVALs of items in each group
4456 static byte object_group_tval[] =
4497 TV_LIFE_BOOK, /* Hack -- all spellbooks */
4505 * Build a list of object indexes in the given group. Return the number
4506 * of objects in the group.
4508 * mode & 0x01 : check for non-empty group
4509 * mode & 0x02 : visual operation only
4511 static int collect_objects(int grp_cur, IDX object_idx[], BIT_FLAGS8 mode)
4514 int j, k, object_cnt = 0;
4516 /* Get a list of x_char in this group */
4517 byte group_tval = object_group_tval[grp_cur];
4519 /* Check every object */
4520 for (i = 0; i < max_k_idx; i++)
4522 /* Access the object */
4523 object_kind *k_ptr = &k_info[i];
4525 /* Skip empty objects */
4526 if (!k_ptr->name) continue;
4530 /* Any objects will be displayed */
4536 /* Skip non-flavoured objects */
4537 if (!k_ptr->flavor) continue;
4539 /* Require objects ever seen */
4540 if (!k_ptr->aware) continue;
4543 /* Skip items with no distribution (special artifacts) */
4544 for (j = 0, k = 0; j < 4; j++) k += k_ptr->chance[j];
4548 /* Check for objects in the group */
4549 if (TV_LIFE_BOOK == group_tval)
4551 /* Hack -- All spell books */
4552 if (TV_LIFE_BOOK <= k_ptr->tval && k_ptr->tval <= TV_HEX_BOOK)
4554 /* Add the object */
4555 object_idx[object_cnt++] = i;
4559 else if (k_ptr->tval == group_tval)
4561 /* Add the object */
4562 object_idx[object_cnt++] = i;
4566 /* XXX Hack -- Just checking for non-empty group */
4567 if (mode & 0x01) break;
4570 /* Terminate the list */
4571 object_idx[object_cnt] = -1;
4573 /* Return the number of objects */
4579 * Description of each feature group.
4581 static cptr feature_group_text[] =
4589 * Build a list of feature indexes in the given group. Return the number
4590 * of features in the group.
4592 * mode & 0x01 : check for non-empty group
4594 static int collect_features(int grp_cur, IDX *feat_idx, BIT_FLAGS8 mode)
4599 /* Unused; There is a single group. */
4602 /* Check every feature */
4603 for (i = 0; i < max_f_idx; i++)
4605 /* Access the index */
4606 feature_type *f_ptr = &f_info[i];
4608 /* Skip empty index */
4609 if (!f_ptr->name) continue;
4611 /* Skip mimiccing features */
4612 if (f_ptr->mimic != i) continue;
4615 feat_idx[feat_cnt++] = i;
4617 /* XXX Hack -- Just checking for non-empty group */
4618 if (mode & 0x01) break;
4621 /* Terminate the list */
4622 feat_idx[feat_cnt] = -1;
4624 /* Return the number of races */
4631 * Build a list of monster indexes in the given group. Return the number
4632 * of monsters in the group.
4634 static int collect_artifacts(int grp_cur, int object_idx[])
4636 int i, object_cnt = 0;
4638 /* Get a list of x_char in this group */
4639 byte group_tval = object_group_tval[grp_cur];
4641 /* Check every object */
4642 for (i = 0; i < max_a_idx; i++)
4644 /* Access the artifact */
4645 artifact_type *a_ptr = &a_info[i];
4647 /* Skip empty artifacts */
4648 if (!a_ptr->name) continue;
4650 /* Skip "uncreated" artifacts */
4651 if (!a_ptr->cur_num) continue;
4653 /* Check for race in the group */
4654 if (a_ptr->tval == group_tval)
4657 object_idx[object_cnt++] = i;
4661 /* Terminate the list */
4662 object_idx[object_cnt] = 0;
4664 /* Return the number of races */
4671 * Encode the screen colors
4673 static char hack[17] = "dwsorgbuDWvyRGBU";
4677 * Hack -- load a screen dump from a file
4679 void do_cmd_load_screen(void)
4694 Term_get_size(&wid, &hgt);
4696 /* Build the filename */
4697 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
4699 /* Append to the file */
4700 fff = my_fopen(buf, "r");
4704 msg_format(_("%s を開くことができませんでした。", "Failed to open %s."), buf);
4710 /* Save the screen */
4713 /* Clear the screen */
4717 /* Load the screen */
4718 for (y = 0; okay; y++)
4720 /* Get a line of data including control code */
4721 if (!fgets(buf, 1024, fff)) okay = FALSE;
4723 /* Get the blank line */
4724 if (buf[0] == '\n' || buf[0] == '\0') break;
4726 /* Ignore too large screen image */
4727 if (y >= hgt) continue;
4730 for (x = 0; x < wid - 1; x++)
4733 if (buf[x] == '\n' || buf[x] == '\0') break;
4735 /* Put the attr/char */
4736 Term_draw(x, y, TERM_WHITE, buf[x]);
4740 /* Dump the screen */
4741 for (y = 0; okay; y++)
4743 /* Get a line of data including control code */
4744 if (!fgets(buf, 1024, fff)) okay = FALSE;
4746 /* Get the blank line */
4747 if (buf[0] == '\n' || buf[0] == '\0') break;
4749 /* Ignore too large screen image */
4750 if (y >= hgt) continue;
4753 for (x = 0; x < wid - 1; x++)
4756 if (buf[x] == '\n' || buf[x] == '\0') break;
4758 /* Get the attr/char */
4759 (void)(Term_what(x, y, &a, &c));
4761 /* Look up the attr */
4762 for (i = 0; i < 16; i++)
4764 /* Use attr matches */
4765 if (hack[i] == buf[x]) a = (byte_hack)i;
4768 /* Put the attr/char */
4769 Term_draw(x, y, a, c);
4779 prt(_("ファイルに書き出された画面(記念撮影)をロードしました。", "Screen dump loaded."), 0, 0);
4785 /* Restore the screen */
4792 cptr inven_res_label = _(" 酸電火冷毒光闇破轟獄因沌劣 盲怖乱痺透命感消復浮",
4793 " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv");
4796 #define IM_FLAG_STR _("*", "* ")
4797 #define HAS_FLAG_STR _("+", "+ ")
4798 #define NO_FLAG_STR _("・", ". ")
4800 #define print_im_or_res_flag(IM, RES) \
4802 fputs(have_flag(flgs, (IM)) ? IM_FLAG_STR : \
4803 (have_flag(flgs, (RES)) ? HAS_FLAG_STR : NO_FLAG_STR), fff); \
4806 #define print_flag(TR) \
4808 fputs(have_flag(flgs, (TR)) ? HAS_FLAG_STR : NO_FLAG_STR, fff); \
4812 /* XTRA HACK RESLIST */
4813 static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr, int *j, byte tval, char *where)
4815 char o_name[MAX_NLEN];
4816 u32b flgs[TR_FLAG_SIZE];
4818 if (!o_ptr->k_idx) return;
4819 if (o_ptr->tval != tval) return;
4821 /* Identified items only */
4822 if (!object_is_known(o_ptr)) return;
4825 * HACK:Ring of Lordly protection and Dragon equipment
4826 * have random resistances.
4828 if ((object_is_wearable(o_ptr) && object_is_ego(o_ptr))
4829 || ((tval == TV_AMULET) && (o_ptr->sval == SV_AMULET_RESISTANCE))
4830 || ((tval == TV_RING) && (o_ptr->sval == SV_RING_LORDLY))
4831 || ((tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD))
4832 || ((tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM))
4833 || ((tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES))
4834 || ((tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE))
4835 || object_is_artifact(o_ptr))
4838 object_desc(o_name, o_ptr, OD_NAME_ONLY);
4840 while (o_name[i] && (i < 26))
4843 if (iskanji(o_name[i])) i++;
4852 o_name[i] = ' '; i++;
4857 fprintf(fff, "%s %s", where, o_name);
4859 if (!(o_ptr->ident & (IDENT_MENTAL)))
4861 fputs(_("-------不明--------------- -------不明---------\n",
4862 "-------unknown------------ -------unknown------\n"), fff);
4866 object_flags_known(o_ptr, flgs);
4868 print_im_or_res_flag(TR_IM_ACID, TR_RES_ACID);
4869 print_im_or_res_flag(TR_IM_ELEC, TR_RES_ELEC);
4870 print_im_or_res_flag(TR_IM_FIRE, TR_RES_FIRE);
4871 print_im_or_res_flag(TR_IM_COLD, TR_RES_COLD);
4872 print_flag(TR_RES_POIS);
4873 print_flag(TR_RES_LITE);
4874 print_flag(TR_RES_DARK);
4875 print_flag(TR_RES_SHARDS);
4876 print_flag(TR_RES_SOUND);
4877 print_flag(TR_RES_NETHER);
4878 print_flag(TR_RES_NEXUS);
4879 print_flag(TR_RES_CHAOS);
4880 print_flag(TR_RES_DISEN);
4884 print_flag(TR_RES_BLIND);
4885 print_flag(TR_RES_FEAR);
4886 print_flag(TR_RES_CONF);
4887 print_flag(TR_FREE_ACT);
4888 print_flag(TR_SEE_INVIS);
4889 print_flag(TR_HOLD_EXP);
4890 print_flag(TR_TELEPATHY);
4891 print_flag(TR_SLOW_DIGEST);
4892 print_flag(TR_REGEN);
4893 print_flag(TR_LEVITATION);
4901 fprintf(fff, "%s\n", inven_res_label);
4907 * Display *ID* ed weapons/armors's resistances
4909 static void do_cmd_knowledge_inven(void)
4913 char file_name[1024];
4923 /* Open a new file */
4924 fff = my_fopen_temp(file_name, 1024);
4927 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
4931 fprintf(fff, "%s\n", inven_res_label);
4933 for (tval = TV_WEARABLE_BEGIN; tval <= TV_WEARABLE_END; tval++)
4937 for (; j < 9; j++) fputc('\n', fff);
4939 fprintf(fff, "%s\n", inven_res_label);
4941 strcpy(where, _("装", "E "));
4942 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
4944 do_cmd_knowledge_inven_aux(fff, &inventory[i], &j, tval, where);
4946 strcpy(where, _("持", "I "));
4947 for (i = 0; i < INVEN_PACK; i++)
4949 do_cmd_knowledge_inven_aux(fff, &inventory[i], &j, tval, where);
4952 st_ptr = &town[1].store[STORE_HOME];
4953 strcpy(where, _("家", "H "));
4954 for (i = 0; i < st_ptr->stock_num; i++)
4956 do_cmd_knowledge_inven_aux(fff, &st_ptr->stock[i], &j, tval, where);
4960 /* Close the file */
4963 /* Display the file contents */
4964 show_file(TRUE, file_name, _("*鑑定*済み武器/防具の耐性リスト", "Resistances of *identified* equipment"), 0, 0);
4966 /* Remove the file */
4971 void do_cmd_save_screen_html_aux(char *filename, int message)
4975 byte a = 0, old_a = 0;
4989 cptr html_head[] = {
4990 "<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
4994 cptr html_foot[] = {
4996 "</body>\n</html>\n",
5002 Term_get_size(&wid, &hgt);
5004 /* File type is "TEXT" */
5005 FILE_TYPE(FILE_TYPE_TEXT);
5007 /* Append to the file */
5008 fff = my_fopen(filename, "w");
5013 msg_format(_("ファイル %s を開けませんでした。", "Failed to open file %s."), filename);
5020 /* Save the screen */
5024 /* Build the filename */
5025 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "htmldump.prf");
5026 tmpfff = my_fopen(buf, "r");
5028 for (i = 0; html_head[i]; i++)
5029 fputs(html_head[i], fff);
5033 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
5035 if (strncmp(buf, tags[0], strlen(tags[0])) == 0)
5039 if (strncmp(buf, tags[1], strlen(tags[1])) == 0)
5041 fprintf(fff, "%s\n", buf);
5046 /* Dump the screen */
5047 for (y = 0; y < hgt; y++)
5054 for (x = 0; x < wid - 1; x++)
5058 /* Get the attr/char */
5059 (void)(Term_what(x, y, &a, &c));
5063 case '&': cc = "&"; break;
5064 case '<': cc = "<"; break;
5065 case '>': cc = ">"; break;
5067 case 0x1f: c = '.'; break;
5068 case 0x7f: c = (a == 0x09) ? '%' : '#'; break;
5073 if ((y == 0 && x == 0) || a != old_a) {
5074 rv = angband_color_table[a][1];
5075 gv = angband_color_table[a][2];
5076 bv = angband_color_table[a][3];
5077 fprintf(fff, "%s<font color=\"#%02x%02x%02x\">",
5078 ((y == 0 && x == 0) ? "" : "</font>"), rv, gv, bv);
5082 fprintf(fff, "%s", cc);
5084 fprintf(fff, "%c", c);
5087 fprintf(fff, "</font>");
5090 for (i = 0; html_foot[i]; i++)
5091 fputs(html_foot[i], fff);
5096 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
5098 if (strncmp(buf, tags[2], strlen(tags[2])) == 0)
5102 if (strncmp(buf, tags[3], strlen(tags[3])) == 0)
5104 fprintf(fff, "%s\n", buf);
5118 msg_print(_("画面(記念撮影)をファイルに書き出しました。", "Screen dump saved."));
5122 /* Restore the screen */
5128 * Hack -- save a screen dump to a file
5130 static void do_cmd_save_screen_html(void)
5132 char buf[1024], tmp[256] = "screen.html";
5134 if (!get_string(_("ファイル名: ", "File name: "), tmp, 80))
5137 /* Build the filename */
5138 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
5142 do_cmd_save_screen_html_aux(buf, 1);
5147 * Redefinable "save_screen" action
5149 void (*screendump_aux)(void) = NULL;
5153 * Hack -- save a screen dump to a file
5155 void do_cmd_save_screen(void)
5157 bool old_use_graphics = use_graphics;
5158 bool html_dump = FALSE;
5162 prt(_("記念撮影しますか? [(y)es/(h)tml/(n)o] ", "Save screen dump? [(y)es/(h)tml/(n)o] "), 0, 0);
5166 if (c == 'Y' || c == 'y')
5168 else if (c == 'H' || c == 'h')
5180 Term_get_size(&wid, &hgt);
5182 if (old_use_graphics)
5184 use_graphics = FALSE;
5187 /* Redraw everything */
5188 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
5190 /* Hack -- update */
5196 do_cmd_save_screen_html();
5200 /* Do we use a special screendump function ? */
5201 else if (screendump_aux)
5203 /* Dump the screen to a graphics file */
5204 (*screendump_aux)();
5206 else /* Dump the screen as text */
5217 /* Build the filename */
5218 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
5220 /* File type is "TEXT" */
5221 FILE_TYPE(FILE_TYPE_TEXT);
5223 /* Append to the file */
5224 fff = my_fopen(buf, "w");
5229 msg_format(_("ファイル %s を開けませんでした。", "Failed to open file %s."), buf);
5235 /* Save the screen */
5239 /* Dump the screen */
5240 for (y = 0; y < hgt; y++)
5243 for (x = 0; x < wid - 1; x++)
5245 /* Get the attr/char */
5246 (void)(Term_what(x, y, &a, &c));
5256 fprintf(fff, "%s\n", buf);
5263 /* Dump the screen */
5264 for (y = 0; y < hgt; y++)
5267 for (x = 0; x < wid - 1; x++)
5269 /* Get the attr/char */
5270 (void)(Term_what(x, y, &a, &c));
5273 buf[x] = hack[a&0x0F];
5280 fprintf(fff, "%s\n", buf);
5291 msg_print(_("画面(記念撮影)をファイルに書き出しました。", "Screen dump saved."));
5294 /* Restore the screen */
5298 if (old_use_graphics)
5300 use_graphics = TRUE;
5303 /* Redraw everything */
5304 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
5306 /* Hack -- update */
5313 * Sorting hook -- Comp function -- see below
5315 * We use "u" to point to array of monster indexes,
5316 * and "v" to select the type of sorting to perform on "u".
5318 static bool ang_sort_art_comp(vptr u, vptr v, int a, int b)
5320 u16b *who = (u16b*)(u);
5322 u16b *why = (u16b*)(v);
5329 /* Sort by total kills */
5332 /* Extract total kills */
5333 z1 = a_info[w1].tval;
5334 z2 = a_info[w2].tval;
5336 /* Compare total kills */
5337 if (z1 < z2) return (TRUE);
5338 if (z1 > z2) return (FALSE);
5342 /* Sort by monster level */
5345 /* Extract levels */
5346 z1 = a_info[w1].sval;
5347 z2 = a_info[w2].sval;
5349 /* Compare levels */
5350 if (z1 < z2) return (TRUE);
5351 if (z1 > z2) return (FALSE);
5355 /* Sort by monster experience */
5358 /* Extract experience */
5359 z1 = a_info[w1].level;
5360 z2 = a_info[w2].level;
5362 /* Compare experience */
5363 if (z1 < z2) return (TRUE);
5364 if (z1 > z2) return (FALSE);
5368 /* Compare indexes */
5374 * Sorting hook -- Swap function -- see below
5376 * We use "u" to point to array of monster indexes,
5377 * and "v" to select the type of sorting to perform.
5379 static void ang_sort_art_swap(vptr u, vptr v, int a, int b)
5381 u16b *who = (u16b*)(u);
5396 * Check the status of "artifacts"
5398 static void do_cmd_knowledge_artifacts(void)
5409 char file_name[1024];
5411 char base_name[MAX_NLEN];
5415 /* Open a new file */
5416 fff = my_fopen_temp(file_name, 1024);
5419 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
5424 /* Allocate the "who" array */
5425 C_MAKE(who, max_a_idx, s16b);
5427 /* Allocate the "okay" array */
5428 C_MAKE(okay, max_a_idx, bool);
5430 /* Scan the artifacts */
5431 for (k = 0; k < max_a_idx; k++)
5433 artifact_type *a_ptr = &a_info[k];
5438 /* Skip "empty" artifacts */
5439 if (!a_ptr->name) continue;
5441 /* Skip "uncreated" artifacts */
5442 if (!a_ptr->cur_num) continue;
5448 /* Check the dungeon */
5449 for (y = 0; y < cur_hgt; y++)
5451 for (x = 0; x < cur_wid; x++)
5453 cave_type *c_ptr = &cave[y][x];
5455 s16b this_o_idx, next_o_idx = 0;
5457 /* Scan all objects in the grid */
5458 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
5462 /* Acquire object */
5463 o_ptr = &o_list[this_o_idx];
5465 /* Acquire next object */
5466 next_o_idx = o_ptr->next_o_idx;
5468 /* Ignore non-artifacts */
5469 if (!object_is_fixed_artifact(o_ptr)) continue;
5471 /* Ignore known items */
5472 if (object_is_known(o_ptr)) continue;
5474 /* Note the artifact */
5475 okay[o_ptr->name1] = FALSE;
5480 /* Check the inventory and equipment */
5481 for (i = 0; i < INVEN_TOTAL; i++)
5483 object_type *o_ptr = &inventory[i];
5485 /* Ignore non-objects */
5486 if (!o_ptr->k_idx) continue;
5488 /* Ignore non-artifacts */
5489 if (!object_is_fixed_artifact(o_ptr)) continue;
5491 /* Ignore known items */
5492 if (object_is_known(o_ptr)) continue;
5494 /* Note the artifact */
5495 okay[o_ptr->name1] = FALSE;
5498 for (k = 0; k < max_a_idx; k++)
5500 if (okay[k]) who[n++] = k;
5503 /* Select the sort method */
5504 ang_sort_comp = ang_sort_art_comp;
5505 ang_sort_swap = ang_sort_art_swap;
5507 /* Sort the array by dungeon depth of monsters */
5508 ang_sort(who, &why, n);
5510 /* Scan the artifacts */
5511 for (k = 0; k < n; k++)
5513 artifact_type *a_ptr = &a_info[who[k]];
5516 strcpy(base_name, _("未知の伝説のアイテム", "Unknown Artifact"));
5518 /* Obtain the base object type */
5519 z = lookup_kind(a_ptr->tval, a_ptr->sval);
5527 /* Get local object */
5530 /* Create fake object */
5531 object_prep(q_ptr, z);
5533 /* Make it an artifact */
5534 q_ptr->name1 = (byte)who[k];
5536 /* Display as if known */
5537 q_ptr->ident |= IDENT_STORE;
5539 /* Describe the artifact */
5540 object_desc(base_name, q_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
5543 /* Hack -- Build the artifact name */
5544 fprintf(fff, _(" %s\n", " The %s\n"), base_name);
5547 /* Free the "who" array */
5548 C_KILL(who, max_a_idx, s16b);
5550 /* Free the "okay" array */
5551 C_KILL(okay, max_a_idx, bool);
5553 /* Close the file */
5556 /* Display the file contents */
5557 show_file(TRUE, file_name, _("既知の伝説のアイテム", "Artifacts Seen"), 0, 0);
5559 /* Remove the file */
5565 * Display known uniques
5566 * With "XTRA HACK UNIQHIST" (Originally from XAngband)
5568 static void do_cmd_knowledge_uniques(void)
5577 char file_name[1024];
5580 int n_alive_surface = 0;
5581 int n_alive_over100 = 0;
5582 int n_alive_total = 0;
5585 for (i = 0; i < 10; i++) n_alive[i] = 0;
5587 /* Open a new file */
5588 fff = my_fopen_temp(file_name, 1024);
5592 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
5597 /* Allocate the "who" array */
5598 C_MAKE(who, max_r_idx, s16b);
5600 /* Scan the monsters */
5601 for (i = 1; i < max_r_idx; i++)
5603 monster_race *r_ptr = &r_info[i];
5606 if (!r_ptr->name) continue;
5608 /* Require unique monsters */
5609 if (!(r_ptr->flags1 & RF1_UNIQUE)) continue;
5611 /* Only display "known" uniques */
5612 if (!cheat_know && !r_ptr->r_sights) continue;
5614 /* Only print rarity <= 100 uniques */
5615 if (!r_ptr->rarity || ((r_ptr->rarity > 100) && !(r_ptr->flags1 & RF1_QUESTOR))) continue;
5617 /* Only "alive" uniques */
5618 if (r_ptr->max_num == 0) continue;
5622 lev = (r_ptr->level - 1) / 10;
5626 if (max_lev < lev) max_lev = lev;
5628 else n_alive_over100++;
5630 else n_alive_surface++;
5632 /* Collect "appropriate" monsters */
5636 /* Select the sort method */
5637 ang_sort_comp = ang_sort_comp_hook;
5638 ang_sort_swap = ang_sort_swap_hook;
5640 /* Sort the array by dungeon depth of monsters */
5641 ang_sort(who, &why, n);
5643 if (n_alive_surface)
5645 fprintf(fff, _(" 地上 生存: %3d体\n", " Surface alive: %3d\n"), n_alive_surface);
5646 n_alive_total += n_alive_surface;
5648 for (i = 0; i <= max_lev; i++)
5650 fprintf(fff, _("%3d-%3d階 生存: %3d体\n", "Level %3d-%3d alive: %3d\n"), 1 + i * 10, 10 + i * 10, n_alive[i]);
5651 n_alive_total += n_alive[i];
5653 if (n_alive_over100)
5655 fprintf(fff, _("101- 階 生存: %3d体\n", "Level 101- alive: %3d\n"), n_alive_over100);
5656 n_alive_total += n_alive_over100;
5661 fputs(_("--------- -----------\n", "------------- ----------\n"), fff);
5662 fprintf(fff, _(" 合計 生存: %3d体\n\n", " Total alive: %3d\n\n"), n_alive_total);
5666 fputs(_("現在は既知の生存ユニークはいません。\n", "No known uniques alive.\n"), fff);
5669 /* Scan the monster races */
5670 for (k = 0; k < n; k++)
5672 monster_race *r_ptr = &r_info[who[k]];
5674 /* Print a message */
5675 fprintf(fff, _(" %s (レベル%d)\n", " %s (level %d)\n"), r_name + r_ptr->name, (int)r_ptr->level);
5678 /* Free the "who" array */
5679 C_KILL(who, max_r_idx, s16b);
5681 /* Close the file */
5684 /* Display the file contents */
5685 show_file(TRUE, file_name, _("まだ生きているユニーク・モンスター", "Alive Uniques"), 0, 0);
5687 /* Remove the file */
5693 * Display weapon-exp
5695 static void do_cmd_knowledge_weapon_exp(void)
5697 int i, num, weapon_exp;
5702 char file_name[1024];
5705 /* Open a new file */
5706 fff = my_fopen_temp(file_name, 1024);
5708 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
5713 for (i = 0; i < 5; i++)
5715 for (num = 0; num < 64; num++)
5717 for (j = 0; j < max_k_idx; j++)
5719 object_kind *k_ptr = &k_info[j];
5721 if ((k_ptr->tval == TV_SWORD - i) && (k_ptr->sval == num))
5723 if ((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON || k_ptr->sval == SV_HARP)) continue;
5725 weapon_exp = p_ptr->weapon_exp[4 - i][num];
5727 fprintf(fff, "%-25s ", tmp);
5728 if (weapon_exp >= s_info[p_ptr->pclass].w_max[4 - i][num]) fprintf(fff, "!");
5729 else fprintf(fff, " ");
5730 fprintf(fff, "%s", exp_level_str[weapon_exp_level(weapon_exp)]);
5731 if (cheat_xtra) fprintf(fff, " %d", weapon_exp);
5739 /* Close the file */
5742 /* Display the file contents */
5743 show_file(TRUE, file_name, _("武器の経験値", "Weapon Proficiency"), 0, 0);
5745 /* Remove the file */
5751 * @brief 魔法の経験値を表示するコマンドのメインルーチン
5755 static void do_cmd_knowledge_spell_exp(void)
5758 int spell_exp, exp_level;
5761 const magic_type *s_ptr;
5763 char file_name[1024];
5765 /* Open a new file */
5766 fff = my_fopen_temp(file_name, 1024);
5768 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
5773 if (p_ptr->realm1 != REALM_NONE)
5775 fprintf(fff, _("%sの魔法書\n", "%s Spellbook\n"), realm_names[p_ptr->realm1]);
5776 for (i = 0; i < 32; i++)
5778 if (!is_magic(p_ptr->realm1))
5780 s_ptr = &technic_info[p_ptr->realm1 - MIN_TECHNIC][i];
5784 s_ptr = &mp_ptr->info[p_ptr->realm1 - 1][i];
5786 if (s_ptr->slevel >= 99) continue;
5787 spell_exp = p_ptr->spell_exp[i];
5788 exp_level = spell_exp_level(spell_exp);
5789 fprintf(fff, "%-25s ", do_spell(p_ptr->realm1, i, SPELL_NAME));
5790 if (p_ptr->realm1 == REALM_HISSATSU)
5791 fprintf(fff, "[--]");
5794 if (exp_level >= EXP_LEVEL_MASTER) fprintf(fff, "!");
5795 else fprintf(fff, " ");
5796 fprintf(fff, "%s", exp_level_str[exp_level]);
5798 if (cheat_xtra) fprintf(fff, " %d", spell_exp);
5803 if (p_ptr->realm2 != REALM_NONE)
5805 fprintf(fff, _("%sの魔法書\n", "\n%s Spellbook\n"), realm_names[p_ptr->realm2]);
5806 for (i = 0; i < 32; i++)
5808 if (!is_magic(p_ptr->realm1))
5810 s_ptr = &technic_info[p_ptr->realm2 - MIN_TECHNIC][i];
5814 s_ptr = &mp_ptr->info[p_ptr->realm2 - 1][i];
5816 if (s_ptr->slevel >= 99) continue;
5818 spell_exp = p_ptr->spell_exp[i + 32];
5819 exp_level = spell_exp_level(spell_exp);
5820 fprintf(fff, "%-25s ", do_spell(p_ptr->realm2, i, SPELL_NAME));
5821 if (exp_level >= EXP_LEVEL_EXPERT) fprintf(fff, "!");
5822 else fprintf(fff, " ");
5823 fprintf(fff, "%s", exp_level_str[exp_level]);
5824 if (cheat_xtra) fprintf(fff, " %d", spell_exp);
5829 /* Close the file */
5832 /* Display the file contents */
5833 show_file(TRUE, file_name, _("魔法の経験値", "Spell Proficiency"), 0, 0);
5835 /* Remove the file */
5841 * @brief スキル情報を表示するコマンドのメインルーチン /
5845 static void do_cmd_knowledge_skill_exp(void)
5847 int i = 0, skill_exp;
5851 char file_name[1024];
5852 char skill_name[3][20]={_("マーシャルアーツ", "Martial Arts "),
5853 _("二刀流 ", "Dual Wielding "),
5854 _("乗馬 ", "Riding ")};
5856 /* Open a new file */
5857 fff = my_fopen_temp(file_name, 1024);
5859 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
5864 for (i = 0; i < 3; i++)
5866 skill_exp = p_ptr->skill_exp[i];
5867 fprintf(fff, "%-20s ", skill_name[i]);
5868 if (skill_exp >= s_info[p_ptr->pclass].s_max[i]) fprintf(fff, "!");
5869 else fprintf(fff, " ");
5870 fprintf(fff, "%s", exp_level_str[(i == GINOU_RIDING) ? riding_exp_level(skill_exp) : weapon_exp_level(skill_exp)]);
5871 if (cheat_xtra) fprintf(fff, " %d", skill_exp);
5875 /* Close the file */
5878 /* Display the file contents */
5879 show_file(TRUE, file_name, _("技能の経験値", "Miscellaneous Proficiency"), 0, 0);
5881 /* Remove the file */
5887 * @brief 英単語、句、説を複数形を変換する / Pluralize a monster name
5888 * @param Name 変換したい文字列の参照ポインタ
5891 void plural_aux(char *Name)
5893 int NameLen = strlen(Name);
5895 if (my_strstr(Name, "Disembodied hand"))
5897 strcpy(Name, "Disembodied hands that strangled people");
5899 else if (my_strstr(Name, "Colour out of space"))
5901 strcpy(Name, "Colours out of space");
5903 else if (my_strstr(Name, "stairway to hell"))
5905 strcpy(Name, "stairways to hell");
5907 else if (my_strstr(Name, "Dweller on the threshold"))
5909 strcpy(Name, "Dwellers on the threshold");
5911 else if (my_strstr(Name, " of "))
5913 cptr aider = my_strstr(Name, " of ");
5924 if (dummy[i-1] == 's')
5926 strcpy(&(dummy[i]), "es");
5931 strcpy(&(dummy[i]), "s");
5934 strcpy(&(dummy[i+1]), aider);
5935 strcpy(Name, dummy);
5937 else if (my_strstr(Name, "coins"))
5940 strcpy(dummy, "piles of ");
5941 strcat(dummy, Name);
5942 strcpy(Name, dummy);
5945 else if (my_strstr(Name, "Manes"))
5949 else if (streq(&(Name[NameLen - 2]), "ey"))
5951 strcpy(&(Name[NameLen - 2]), "eys");
5953 else if (Name[NameLen - 1] == 'y')
5955 strcpy(&(Name[NameLen - 1]), "ies");
5957 else if (streq(&(Name[NameLen - 4]), "ouse"))
5959 strcpy(&(Name[NameLen - 4]), "ice");
5961 else if (streq(&(Name[NameLen - 2]), "us"))
5963 strcpy(&(Name[NameLen - 2]), "i");
5965 else if (streq(&(Name[NameLen - 6]), "kelman"))
5967 strcpy(&(Name[NameLen - 6]), "kelmen");
5969 else if (streq(&(Name[NameLen - 8]), "wordsman"))
5971 strcpy(&(Name[NameLen - 8]), "wordsmen");
5973 else if (streq(&(Name[NameLen - 7]), "oodsman"))
5975 strcpy(&(Name[NameLen - 7]), "oodsmen");
5977 else if (streq(&(Name[NameLen - 7]), "eastman"))
5979 strcpy(&(Name[NameLen - 7]), "eastmen");
5981 else if (streq(&(Name[NameLen - 8]), "izardman"))
5983 strcpy(&(Name[NameLen - 8]), "izardmen");
5985 else if (streq(&(Name[NameLen - 5]), "geist"))
5987 strcpy(&(Name[NameLen - 5]), "geister");
5989 else if (streq(&(Name[NameLen - 2]), "ex"))
5991 strcpy(&(Name[NameLen - 2]), "ices");
5993 else if (streq(&(Name[NameLen - 2]), "lf"))
5995 strcpy(&(Name[NameLen - 2]), "lves");
5997 else if (suffix(Name, "ch") ||
5998 suffix(Name, "sh") ||
5999 suffix(Name, "nx") ||
6000 suffix(Name, "s") ||
6003 strcpy(&(Name[NameLen]), "es");
6007 strcpy(&(Name[NameLen]), "s");
6012 * @brief 現在のペットを表示するコマンドのメインルーチン /
6013 * Display current pets
6016 static void do_cmd_knowledge_pets(void)
6020 monster_type *m_ptr;
6023 int show_upkeep = 0;
6024 char file_name[1024];
6027 /* Open a new file */
6028 fff = my_fopen_temp(file_name, 1024);
6030 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
6035 /* Process the monsters (backwards) */
6036 for (i = m_max - 1; i >= 1; i--)
6038 /* Access the monster */
6041 /* Ignore "dead" monsters */
6042 if (!m_ptr->r_idx) continue;
6044 /* Calculate "upkeep" for pets */
6048 monster_desc(pet_name, m_ptr, MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
6049 fprintf(fff, "%s (%s)\n", pet_name, look_mon_desc(m_ptr, 0x00));
6053 show_upkeep = calculate_upkeep();
6055 fprintf(fff, "----------------------------------------------\n");
6057 fprintf(fff, " 合計: %d 体のペット\n", t_friends);
6058 fprintf(fff, " 維持コスト: %d%% MP\n", show_upkeep);
6060 fprintf(fff, " Total: %d pet%s.\n",
6061 t_friends, (t_friends == 1 ? "" : "s"));
6062 fprintf(fff, " Upkeep: %d%% mana.\n", show_upkeep);
6067 /* Close the file */
6070 /* Display the file contents */
6071 show_file(TRUE, file_name, _("現在のペット", "Current Pets"), 0, 0);
6073 /* Remove the file */
6079 * @brief 現在のペットを表示するコマンドのメインルーチン /
6082 * @note the player ghosts are ignored. XXX XXX XXX
6084 static void do_cmd_knowledge_kill_count(void)
6093 char file_name[1024];
6098 /* Open a new file */
6099 fff = my_fopen_temp(file_name, 1024);
6102 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
6107 /* Allocate the "who" array */
6108 C_MAKE(who, max_r_idx, s16b);
6111 /* Monsters slain */
6114 for (kk = 1; kk < max_r_idx; kk++)
6116 monster_race *r_ptr = &r_info[kk];
6118 if (r_ptr->flags1 & (RF1_UNIQUE))
6120 bool dead = (r_ptr->max_num == 0);
6129 MONSTER_NUMBER This = r_ptr->r_pkills;
6139 fprintf(fff,_("あなたはまだ敵を倒していない。\n\n", "You have defeated no enemies yet.\n\n"));
6142 fprintf(fff,"あなたは%ld体の敵を倒している。\n\n", (long int)Total);
6144 fprintf(fff,"You have defeated %ld %s.\n\n", (long int)Total, (Total == 1) ? "enemy" : "enemies");
6150 /* Scan the monsters */
6151 for (i = 1; i < max_r_idx; i++)
6153 monster_race *r_ptr = &r_info[i];
6155 /* Use that monster */
6156 if (r_ptr->name) who[n++] = i;
6159 /* Select the sort method */
6160 ang_sort_comp = ang_sort_comp_hook;
6161 ang_sort_swap = ang_sort_swap_hook;
6163 /* Sort the array by dungeon depth of monsters */
6164 ang_sort(who, &why, n);
6166 /* Scan the monster races */
6167 for (k = 0; k < n; k++)
6169 monster_race *r_ptr = &r_info[who[k]];
6171 if (r_ptr->flags1 & (RF1_UNIQUE))
6173 bool dead = (r_ptr->max_num == 0);
6177 /* Print a message */
6178 fprintf(fff, " %s\n",
6179 (r_name + r_ptr->name));
6185 MONSTER_NUMBER This = r_ptr->r_pkills;
6190 /* p,tは人と数える by ita */
6191 if (my_strchr("pt", r_ptr->d_char))
6192 fprintf(fff, " %3d 人の %s\n", (int)This, r_name + r_ptr->name);
6194 fprintf(fff, " %3d 体の %s\n", (int)This, r_name + r_ptr->name);
6198 if (my_strstr(r_name + r_ptr->name, "coins"))
6200 fprintf(fff, " 1 pile of %s\n", (r_name + r_ptr->name));
6204 fprintf(fff, " 1 %s\n", (r_name + r_ptr->name));
6210 strcpy(ToPlural, (r_name + r_ptr->name));
6211 plural_aux(ToPlural);
6212 fprintf(fff, " %d %s\n", This, ToPlural);
6222 fprintf(fff,"----------------------------------------------\n");
6224 fprintf(fff," 合計: %lu 体を倒した。\n", (unsigned long int)Total);
6226 fprintf(fff," Total: %lu creature%s killed.\n",
6227 (unsigned long int)Total, (Total == 1 ? "" : "s"));
6231 /* Free the "who" array */
6232 C_KILL(who, max_r_idx, s16b);
6234 /* Close the file */
6237 /* Display the file contents */
6238 show_file(TRUE, file_name, _("倒した敵の数", "Kill Count"), 0, 0);
6240 /* Remove the file */
6246 * @brief モンスター情報リスト中のグループを表示する /
6247 * Display the object groups.
6251 * @param per_page リストの表示行
6252 * @param grp_idx グループのID配列
6253 * @param group_text グループ名の文字列配列
6254 * @param grp_cur 現在の選択ID
6255 * @param grp_top 現在の選択リスト最上部ID
6258 static void display_group_list(int col, int row, int wid, int per_page,
6259 IDX grp_idx[], cptr group_text[], int grp_cur, int grp_top)
6263 /* Display lines until done */
6264 for (i = 0; i < per_page && (grp_idx[i] >= 0); i++)
6266 /* Get the group index */
6267 int grp = grp_idx[grp_top + i];
6269 /* Choose a color */
6270 byte attr = (grp_top + i == grp_cur) ? TERM_L_BLUE : TERM_WHITE;
6272 /* Erase the entire line */
6273 Term_erase(col, row + i, wid);
6275 /* Display the group label */
6276 c_put_str(attr, group_text[grp], row + i, col);
6282 * Move the cursor in a browser window
6284 static void browser_cursor(char ch, int *column, IDX *grp_cur, int grp_cnt,
6285 IDX *list_cur, int list_cnt)
6290 IDX list = *list_cur;
6292 /* Extract direction */
6295 /* Hack -- scroll up full screen */
6300 /* Hack -- scroll down full screen */
6305 d = get_keymap_dir(ch);
6310 /* Diagonals - hack */
6311 if ((ddx[d] > 0) && ddy[d])
6317 Term_get_size(&wid, &hgt);
6319 browser_rows = hgt - 8;
6321 /* Browse group list */
6326 /* Move up or down */
6327 grp += ddy[d] * (browser_rows - 1);
6330 if (grp >= grp_cnt) grp = grp_cnt - 1;
6331 if (grp < 0) grp = 0;
6332 if (grp != old_grp) list = 0;
6335 /* Browse sub-list list */
6338 /* Move up or down */
6339 list += ddy[d] * browser_rows;
6342 if (list >= list_cnt) list = list_cnt - 1;
6343 if (list < 0) list = 0;
6355 if (col < 0) col = 0;
6356 if (col > 1) col = 1;
6363 /* Browse group list */
6368 /* Move up or down */
6372 if (grp >= grp_cnt) grp = grp_cnt - 1;
6373 if (grp < 0) grp = 0;
6374 if (grp != old_grp) list = 0;
6377 /* Browse sub-list list */
6380 /* Move up or down */
6384 if (list >= list_cnt) list = list_cnt - 1;
6385 if (list < 0) list = 0;
6396 static void display_visual_list(int col, int row, int height, int width, byte attr_top, byte char_left)
6400 /* Clear the display lines */
6401 for (i = 0; i < height; i++)
6403 Term_erase(col, row + i, width);
6406 /* Bigtile mode uses double width */
6407 if (use_bigtile) width /= 2;
6409 /* Display lines until done */
6410 for (i = 0; i < height; i++)
6412 /* Display columns until done */
6413 for (j = 0; j < width; j++)
6421 /* Bigtile mode uses double width */
6422 if (use_bigtile) x += j;
6427 /* Ignore illegal characters */
6428 if (ia > 0x7f || ic > 0xff || ic < ' ' ||
6429 (!use_graphics && ic > 0x7f))
6435 /* Force correct code for both ASCII character and tile */
6436 if (c & 0x80) a |= 0x80;
6438 /* Display symbol */
6439 Term_queue_bigchar(x, y, a, c, 0, 0);
6446 * Place the cursor at the collect position for visual mode
6448 static void place_visual_list_cursor(int col, int row, byte a, byte c, byte attr_top, byte char_left)
6450 int i = (a & 0x7f) - attr_top;
6451 int j = c - char_left;
6456 /* Bigtile mode uses double width */
6457 if (use_bigtile) x += j;
6459 /* Place the cursor */
6465 * Clipboard variables for copy&paste in visual mode
6467 static byte attr_idx = 0;
6468 static byte char_idx = 0;
6470 /* Hack -- for feature lighting */
6471 static byte attr_idx_feat[F_LIT_MAX];
6472 static byte char_idx_feat[F_LIT_MAX];
6475 * Do visual mode command -- Change symbols
6477 static bool visual_mode_command(char ch, bool *visual_list_ptr,
6478 int height, int width,
6479 byte *attr_top_ptr, byte *char_left_ptr,
6480 byte *cur_attr_ptr, byte *cur_char_ptr, bool *need_redraw)
6482 static byte attr_old = 0, char_old = 0;
6487 if (*visual_list_ptr)
6490 *cur_attr_ptr = attr_old;
6491 *cur_char_ptr = char_old;
6492 *visual_list_ptr = FALSE;
6500 if (*visual_list_ptr)
6503 *visual_list_ptr = FALSE;
6504 *need_redraw = TRUE;
6512 if (!*visual_list_ptr)
6514 *visual_list_ptr = TRUE;
6516 *attr_top_ptr = MAX(0, (*cur_attr_ptr & 0x7f) - 5);
6517 *char_left_ptr = MAX(0, *cur_char_ptr - 10);
6519 attr_old = *cur_attr_ptr;
6520 char_old = *cur_char_ptr;
6531 /* Set the visual */
6532 attr_idx = *cur_attr_ptr;
6533 char_idx = *cur_char_ptr;
6535 /* Hack -- for feature lighting */
6536 for (i = 0; i < F_LIT_MAX; i++)
6538 attr_idx_feat[i] = 0;
6539 char_idx_feat[i] = 0;
6546 if (attr_idx || (!(char_idx & 0x80) && char_idx)) /* Allow TERM_DARK text */
6549 *cur_attr_ptr = attr_idx;
6550 *attr_top_ptr = MAX(0, (*cur_attr_ptr & 0x7f) - 5);
6551 if (!*visual_list_ptr) *need_redraw = TRUE;
6557 *cur_char_ptr = char_idx;
6558 *char_left_ptr = MAX(0, *cur_char_ptr - 10);
6559 if (!*visual_list_ptr) *need_redraw = TRUE;
6565 if (*visual_list_ptr)
6568 int d = get_keymap_dir(ch);
6569 byte a = (*cur_attr_ptr & 0x7f);
6570 byte c = *cur_char_ptr;
6572 if (use_bigtile) eff_width = width / 2;
6573 else eff_width = width;
6575 /* Restrict direction */
6576 if ((a == 0) && (ddy[d] < 0)) d = 0;
6577 if ((c == 0) && (ddx[d] < 0)) d = 0;
6578 if ((a == 0x7f) && (ddy[d] > 0)) d = 0;
6579 if ((c == 0xff) && (ddx[d] > 0)) d = 0;
6584 /* Force correct code for both ASCII character and tile */
6585 if (c & 0x80) a |= 0x80;
6587 /* Set the visual */
6592 /* Move the frame */
6593 if ((ddx[d] < 0) && *char_left_ptr > MAX(0, (int)c - 10)) (*char_left_ptr)--;
6594 if ((ddx[d] > 0) && *char_left_ptr + eff_width < MIN(0xff, (int)c + 10)) (*char_left_ptr)++;
6595 if ((ddy[d] < 0) && *attr_top_ptr > MAX(0, (int)(a & 0x7f) - 4)) (*attr_top_ptr)--;
6596 if ((ddy[d] > 0) && *attr_top_ptr + height < MIN(0x7f, (a & 0x7f) + 4)) (*attr_top_ptr)++;
6602 /* Visual mode command is not used */
6608 * Display the monsters in a group.
6610 static void display_monster_list(int col, int row, int per_page, s16b mon_idx[],
6611 int mon_cur, int mon_top, bool visual_only)
6615 /* Display lines until done */
6616 for (i = 0; i < per_page && (mon_idx[mon_top + i] >= 0); i++)
6620 /* Get the race index */
6621 MONRACE_IDX r_idx = mon_idx[mon_top + i] ;
6623 /* Access the race */
6624 monster_race *r_ptr = &r_info[r_idx];
6626 /* Choose a color */
6627 attr = ((i + mon_top == mon_cur) ? TERM_L_BLUE : TERM_WHITE);
6629 /* Display the name */
6630 c_prt(attr, (r_name + r_ptr->name), row + i, col);
6632 /* Hack -- visual_list mode */
6635 c_prt(attr, format("%02x/%02x", r_ptr->x_attr, r_ptr->x_char), row + i, (p_ptr->wizard || visual_only) ? 56 : 61);
6637 if (p_ptr->wizard || visual_only)
6639 c_prt(attr, format("%d", r_idx), row + i, 62);
6642 /* Erase chars before overwritten by the race letter */
6643 Term_erase(69, row + i, 255);
6645 /* Display symbol */
6646 Term_queue_bigchar(use_bigtile ? 69 : 70, row + i, r_ptr->x_attr, r_ptr->x_char, 0, 0);
6651 if (!(r_ptr->flags1 & RF1_UNIQUE))
6652 put_str(format("%5d", r_ptr->r_pkills), row + i, 73);
6654 c_put_str((r_ptr->max_num == 0 ? TERM_L_DARK : TERM_WHITE),
6655 (r_ptr->max_num == 0 ? _("死亡", " dead") : _("生存", "alive")), row + i, 74);
6659 /* Clear remaining lines */
6660 for (; i < per_page; i++)
6662 Term_erase(col, row + i, 255);
6668 * Display known monsters.
6670 static void do_cmd_knowledge_monsters(bool *need_redraw, bool visual_only, IDX direct_r_idx)
6674 IDX grp_cur, grp_top, old_grp_cur;
6675 IDX mon_cur, mon_top;
6676 IDX grp_cnt, grp_idx[100];
6684 bool visual_list = FALSE;
6685 byte attr_top = 0, char_left = 0;
6688 TERM_POSITION wid, hgt;
6693 Term_get_size(&wid, &hgt);
6695 browser_rows = hgt - 8;
6697 /* Allocate the "mon_idx" array */
6698 C_MAKE(mon_idx, max_r_idx, s16b);
6703 if (direct_r_idx < 0)
6705 mode = visual_only ? 0x03 : 0x01;
6707 /* Check every group */
6708 for (i = 0; monster_group_text[i] != NULL; i++)
6710 /* Measure the label */
6711 len = strlen(monster_group_text[i]);
6713 /* Save the maximum length */
6714 if (len > max) max = len;
6716 /* See if any monsters are known */
6717 if ((monster_group_char[i] == ((char *) -1L)) || collect_monsters(i, mon_idx, mode))
6719 /* Build a list of groups with known monsters */
6720 grp_idx[grp_cnt++] = i;
6728 mon_idx[0] = direct_r_idx;
6731 /* Terminate the list */
6734 (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
6735 &attr_top, &char_left, &r_info[direct_r_idx].x_attr, &r_info[direct_r_idx].x_char, need_redraw);
6738 /* Terminate the list */
6739 grp_idx[grp_cnt] = -1;
6742 grp_cur = grp_top = 0;
6743 mon_cur = mon_top = 0;
6748 mode = visual_only ? 0x02 : 0x00;
6753 monster_race *r_ptr;
6760 prt(format("%s - モンスター", !visual_only ? "知識" : "表示"), 2, 0);
6761 if (direct_r_idx < 0) prt("グループ", 4, 0);
6762 prt("名前", 4, max + 3);
6763 if (p_ptr->wizard || visual_only) prt("Idx", 4, 62);
6765 if (!visual_only) prt("殺害数", 4, 72);
6767 prt(format("%s - monsters", !visual_only ? "Knowledge" : "Visuals"), 2, 0);
6768 if (direct_r_idx < 0) prt("Group", 4, 0);
6769 prt("Name", 4, max + 3);
6770 if (p_ptr->wizard || visual_only) prt("Idx", 4, 62);
6772 if (!visual_only) prt("Kills", 4, 73);
6775 for (i = 0; i < 78; i++)
6777 Term_putch(i, 5, TERM_WHITE, '=');
6780 if (direct_r_idx < 0)
6782 for (i = 0; i < browser_rows; i++)
6784 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
6791 if (direct_r_idx < 0)
6793 /* Scroll group list */
6794 if (grp_cur < grp_top) grp_top = grp_cur;
6795 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
6797 /* Display a list of monster groups */
6798 display_group_list(0, 6, max, browser_rows, grp_idx, monster_group_text, grp_cur, grp_top);
6800 if (old_grp_cur != grp_cur)
6802 old_grp_cur = grp_cur;
6804 /* Get a list of monsters in the current group */
6805 mon_cnt = collect_monsters(grp_idx[grp_cur], mon_idx, mode);
6808 /* Scroll monster list */
6809 while (mon_cur < mon_top)
6810 mon_top = MAX(0, mon_top - browser_rows/2);
6811 while (mon_cur >= mon_top + browser_rows)
6812 mon_top = MIN(mon_cnt - browser_rows, mon_top + browser_rows/2);
6817 /* Display a list of monsters in the current group */
6818 display_monster_list(max + 3, 6, browser_rows, mon_idx, mon_cur, mon_top, visual_only);
6824 /* Display a monster name */
6825 display_monster_list(max + 3, 6, 1, mon_idx, mon_cur, mon_top, visual_only);
6827 /* Display visual list below first monster */
6828 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
6833 prt(format("<方向>%s%s%s, ESC",
6834 (!visual_list && !visual_only) ? ", 'r'で思い出を見る" : "",
6835 visual_list ? ", ENTERで決定" : ", 'v'でシンボル変更",
6836 (attr_idx || char_idx) ? ", 'c', 'p'でペースト" : ", 'c'でコピー"),
6839 prt(format("<dir>%s%s%s, ESC",
6840 (!visual_list && !visual_only) ? ", 'r' to recall" : "",
6841 visual_list ? ", ENTER to accept" : ", 'v' for visuals",
6842 (attr_idx || char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"),
6846 /* Get the current monster */
6847 r_ptr = &r_info[mon_idx[mon_cur]];
6851 /* Mega Hack -- track this monster race */
6852 if (mon_cnt) monster_race_track(mon_idx[mon_cur]);
6854 /* Hack -- handle stuff */
6860 place_visual_list_cursor(max + 3, 7, r_ptr->x_attr, r_ptr->x_char, attr_top, char_left);
6864 Term_gotoxy(0, 6 + (grp_cur - grp_top));
6868 Term_gotoxy(max + 3, 6 + (mon_cur - mon_top));
6873 /* Do visual mode command if needed */
6874 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))
6876 if (direct_r_idx >= 0)
6901 /* Recall on screen */
6902 if (!visual_list && !visual_only && (mon_idx[mon_cur] > 0))
6904 screen_roff(mon_idx[mon_cur], 0);
6915 /* Move the cursor */
6916 browser_cursor(ch, &column, &grp_cur, grp_cnt, &mon_cur, mon_cnt);
6923 /* Free the "mon_idx" array */
6924 C_KILL(mon_idx, max_r_idx, s16b);
6929 * Display the objects in a group.
6931 static void display_object_list(int col, int row, int per_page, IDX object_idx[],
6932 int object_cur, int object_top, bool visual_only)
6936 /* Display lines until done */
6937 for (i = 0; i < per_page && (object_idx[object_top + i] >= 0); i++)
6941 object_kind *flavor_k_ptr;
6943 /* Get the object index */
6944 KIND_OBJECT_IDX k_idx = object_idx[object_top + i];
6946 /* Access the object */
6947 object_kind *k_ptr = &k_info[k_idx];
6949 /* Choose a color */
6950 byte attr = ((k_ptr->aware || visual_only) ? TERM_WHITE : TERM_SLATE);
6951 byte cursor = ((k_ptr->aware || visual_only) ? TERM_L_BLUE : TERM_BLUE);
6954 if (!visual_only && k_ptr->flavor)
6956 /* Appearance of this object is shuffled */
6957 flavor_k_ptr = &k_info[k_ptr->flavor];
6961 /* Appearance of this object is very normal */
6962 flavor_k_ptr = k_ptr;
6967 attr = ((i + object_top == object_cur) ? cursor : attr);
6969 if (!k_ptr->flavor || (!visual_only && k_ptr->aware))
6972 strip_name(o_name, k_idx);
6977 strcpy(o_name, k_name + flavor_k_ptr->flavor_name);
6980 /* Display the name */
6981 c_prt(attr, o_name, row + i, col);
6983 /* Hack -- visual_list mode */
6986 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);
6988 if (p_ptr->wizard || visual_only)
6990 c_prt(attr, format("%d", k_idx), row + i, 70);
6993 a = flavor_k_ptr->x_attr;
6994 c = flavor_k_ptr->x_char;
6996 /* Display symbol */
6997 Term_queue_bigchar(use_bigtile ? 76 : 77, row + i, a, c, 0, 0);
7000 /* Clear remaining lines */
7001 for (; i < per_page; i++)
7003 Term_erase(col, row + i, 255);
7008 * Describe fake object
7010 static void desc_obj_fake(IDX k_idx)
7013 object_type object_type_body;
7015 /* Get local object */
7016 o_ptr = &object_type_body;
7018 /* Wipe the object */
7021 /* Create the artifact */
7022 object_prep(o_ptr, k_idx);
7024 /* It's fully know */
7025 o_ptr->ident |= IDENT_KNOWN;
7027 /* Track the object */
7028 /* object_actual_track(o_ptr); */
7030 /* Hack - mark as fake */
7031 /* term_obj_real = FALSE; */
7033 /* Hack -- Handle stuff */
7036 if (!screen_object(o_ptr, SCROBJ_FAKE_OBJECT | SCROBJ_FORCE_DETAIL))
7038 msg_print(_("特に変わったところはないようだ。", "You see nothing special."));
7046 * Display known objects
7048 static void do_cmd_knowledge_objects(bool *need_redraw, bool visual_only, IDX direct_k_idx)
7052 IDX grp_cur, grp_top, old_grp_cur;
7053 IDX object_old, object_cur, object_top;
7063 bool visual_list = FALSE;
7064 byte attr_top = 0, char_left = 0;
7072 Term_get_size(&wid, &hgt);
7074 browser_rows = hgt - 8;
7076 /* Allocate the "object_idx" array */
7077 C_MAKE(object_idx, max_k_idx, IDX);
7082 if (direct_k_idx < 0)
7084 mode = visual_only ? 0x03 : 0x01;
7086 /* Check every group */
7087 for (i = 0; object_group_text[i] != NULL; i++)
7089 /* Measure the label */
7090 len = strlen(object_group_text[i]);
7092 /* Save the maximum length */
7093 if (len > max) max = len;
7095 /* See if any monsters are known */
7096 if (collect_objects(i, object_idx, mode))
7098 /* Build a list of groups with known monsters */
7099 grp_idx[grp_cnt++] = i;
7108 object_kind *k_ptr = &k_info[direct_k_idx];
7109 object_kind *flavor_k_ptr;
7111 if (!visual_only && k_ptr->flavor)
7113 /* Appearance of this object is shuffled */
7114 flavor_k_ptr = &k_info[k_ptr->flavor];
7118 /* Appearance of this object is very normal */
7119 flavor_k_ptr = k_ptr;
7122 object_idx[0] = direct_k_idx;
7123 object_old = direct_k_idx;
7126 /* Terminate the list */
7129 (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
7130 &attr_top, &char_left, &flavor_k_ptr->x_attr, &flavor_k_ptr->x_char, need_redraw);
7133 /* Terminate the list */
7134 grp_idx[grp_cnt] = -1;
7137 grp_cur = grp_top = 0;
7138 object_cur = object_top = 0;
7143 mode = visual_only ? 0x02 : 0x00;
7148 object_kind *k_ptr, *flavor_k_ptr;
7155 prt(format("%s - アイテム", !visual_only ? "知識" : "表示"), 2, 0);
7156 if (direct_k_idx < 0) prt("グループ", 4, 0);
7157 prt("名前", 4, max + 3);
7158 if (p_ptr->wizard || visual_only) prt("Idx", 4, 70);
7161 prt(format("%s - objects", !visual_only ? "Knowledge" : "Visuals"), 2, 0);
7162 if (direct_k_idx < 0) prt("Group", 4, 0);
7163 prt("Name", 4, max + 3);
7164 if (p_ptr->wizard || visual_only) prt("Idx", 4, 70);
7168 for (i = 0; i < 78; i++)
7170 Term_putch(i, 5, TERM_WHITE, '=');
7173 if (direct_k_idx < 0)
7175 for (i = 0; i < browser_rows; i++)
7177 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
7184 if (direct_k_idx < 0)
7186 /* Scroll group list */
7187 if (grp_cur < grp_top) grp_top = grp_cur;
7188 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
7190 /* Display a list of object groups */
7191 display_group_list(0, 6, max, browser_rows, grp_idx, object_group_text, grp_cur, grp_top);
7193 if (old_grp_cur != grp_cur)
7195 old_grp_cur = grp_cur;
7197 /* Get a list of objects in the current group */
7198 object_cnt = collect_objects(grp_idx[grp_cur], object_idx, mode);
7201 /* Scroll object list */
7202 while (object_cur < object_top)
7203 object_top = MAX(0, object_top - browser_rows/2);
7204 while (object_cur >= object_top + browser_rows)
7205 object_top = MIN(object_cnt - browser_rows, object_top + browser_rows/2);
7210 /* Display a list of objects in the current group */
7211 display_object_list(max + 3, 6, browser_rows, object_idx, object_cur, object_top, visual_only);
7215 object_top = object_cur;
7217 /* Display a list of objects in the current group */
7218 display_object_list(max + 3, 6, 1, object_idx, object_cur, object_top, visual_only);
7220 /* Display visual list below first object */
7221 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
7224 /* Get the current object */
7225 k_ptr = &k_info[object_idx[object_cur]];
7227 if (!visual_only && k_ptr->flavor)
7229 /* Appearance of this object is shuffled */
7230 flavor_k_ptr = &k_info[k_ptr->flavor];
7234 /* Appearance of this object is very normal */
7235 flavor_k_ptr = k_ptr;
7240 prt(format("<方向>%s%s%s, ESC",
7241 (!visual_list && !visual_only) ? ", 'r'で詳細を見る" : "",
7242 visual_list ? ", ENTERで決定" : ", 'v'でシンボル変更",
7243 (attr_idx || char_idx) ? ", 'c', 'p'でペースト" : ", 'c'でコピー"),
7246 prt(format("<dir>%s%s%s, ESC",
7247 (!visual_list && !visual_only) ? ", 'r' to recall" : "",
7248 visual_list ? ", ENTER to accept" : ", 'v' for visuals",
7249 (attr_idx || char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"),
7255 /* Mega Hack -- track this object */
7256 if (object_cnt) object_kind_track(object_idx[object_cur]);
7258 /* The "current" object changed */
7259 if (object_old != object_idx[object_cur])
7261 /* Hack -- handle stuff */
7264 /* Remember the "current" object */
7265 object_old = object_idx[object_cur];
7271 place_visual_list_cursor(max + 3, 7, flavor_k_ptr->x_attr, flavor_k_ptr->x_char, attr_top, char_left);
7275 Term_gotoxy(0, 6 + (grp_cur - grp_top));
7279 Term_gotoxy(max + 3, 6 + (object_cur - object_top));
7284 /* Do visual mode command if needed */
7285 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))
7287 if (direct_k_idx >= 0)
7312 /* Recall on screen */
7313 if (!visual_list && !visual_only && (grp_cnt > 0))
7315 desc_obj_fake(object_idx[object_cur]);
7323 /* Move the cursor */
7324 browser_cursor(ch, &column, &grp_cur, grp_cnt, &object_cur, object_cnt);
7330 /* Free the "object_idx" array */
7331 C_KILL(object_idx, max_k_idx, IDX);
7336 * Display the features in a group.
7338 static void display_feature_list(int col, int row, int per_page, FEAT_IDX *feat_idx,
7339 FEAT_IDX feat_cur, FEAT_IDX feat_top, bool visual_only, int lighting_level)
7341 int lit_col[F_LIT_MAX], i, j;
7342 int f_idx_col = use_bigtile ? 62 : 64;
7344 /* Correct columns 1 and 4 */
7345 lit_col[F_LIT_STANDARD] = use_bigtile ? (71 - F_LIT_MAX) : 71;
7346 for (i = F_LIT_NS_BEGIN; i < F_LIT_MAX; i++)
7347 lit_col[i] = lit_col[F_LIT_STANDARD] + 2 + (i - F_LIT_NS_BEGIN) * 2 + (use_bigtile ? i : 0);
7349 /* Display lines until done */
7350 for (i = 0; i < per_page && (feat_idx[feat_top + i] >= 0); i++)
7355 FEAT_IDX f_idx = feat_idx[feat_top + i];
7357 /* Access the index */
7358 feature_type *f_ptr = &f_info[f_idx];
7360 int row_i = row + i;
7362 /* Choose a color */
7363 attr = ((i + feat_top == feat_cur) ? TERM_L_BLUE : TERM_WHITE);
7365 /* Display the name */
7366 c_prt(attr, f_name + f_ptr->name, row_i, col);
7368 /* Hack -- visual_list mode */
7371 /* Display lighting level */
7372 c_prt(attr, format("(%s)", lighting_level_str[lighting_level]), row_i, col + 1 + strlen(f_name + f_ptr->name));
7374 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));
7376 if (p_ptr->wizard || visual_only)
7378 c_prt(attr, format("%d", f_idx), row_i, f_idx_col);
7381 /* Display symbol */
7382 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);
7384 Term_putch(lit_col[F_LIT_NS_BEGIN], row_i, TERM_SLATE, '(');
7385 for (j = F_LIT_NS_BEGIN + 1; j < F_LIT_MAX; j++)
7387 Term_putch(lit_col[j], row_i, TERM_SLATE, '/');
7389 Term_putch(lit_col[F_LIT_MAX - 1] + (use_bigtile ? 3 : 2), row_i, TERM_SLATE, ')');
7391 /* Mega-hack -- Use non-standard colour */
7392 for (j = F_LIT_NS_BEGIN; j < F_LIT_MAX; j++)
7394 Term_queue_bigchar(lit_col[j] + 1, row_i, f_ptr->x_attr[j], f_ptr->x_char[j], 0, 0);
7398 /* Clear remaining lines */
7399 for (; i < per_page; i++)
7401 Term_erase(col, row + i, 255);
7407 * Interact with feature visuals.
7409 static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX direct_f_idx, IDX *lighting_level)
7413 IDX grp_cur, grp_top, old_grp_cur;
7414 IDX feat_cur, feat_top;
7424 bool visual_list = FALSE;
7425 byte attr_top = 0, char_left = 0;
7430 byte attr_old[F_LIT_MAX];
7431 byte char_old[F_LIT_MAX];
7432 byte *cur_attr_ptr, *cur_char_ptr;
7434 (void)C_WIPE(attr_old, F_LIT_MAX, byte);
7435 (void)C_WIPE(char_old, F_LIT_MAX, byte);
7438 Term_get_size(&wid, &hgt);
7440 browser_rows = hgt - 8;
7442 /* Allocate the "feat_idx" array */
7443 C_MAKE(feat_idx, max_f_idx, IDX);
7448 if (direct_f_idx < 0)
7450 /* Check every group */
7451 for (i = 0; feature_group_text[i] != NULL; i++)
7453 /* Measure the label */
7454 len = strlen(feature_group_text[i]);
7456 /* Save the maximum length */
7457 if (len > max) max = len;
7459 /* See if any features are known */
7460 if (collect_features(i, feat_idx, 0x01))
7462 /* Build a list of groups with known features */
7463 grp_idx[grp_cnt++] = i;
7471 feature_type *f_ptr = &f_info[direct_f_idx];
7473 feat_idx[0] = direct_f_idx;
7476 /* Terminate the list */
7479 (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
7480 &attr_top, &char_left, &f_ptr->x_attr[*lighting_level], &f_ptr->x_char[*lighting_level], need_redraw);
7482 for (i = 0; i < F_LIT_MAX; i++)
7484 attr_old[i] = f_ptr->x_attr[i];
7485 char_old[i] = f_ptr->x_char[i];
7489 /* Terminate the list */
7490 grp_idx[grp_cnt] = -1;
7493 grp_cur = grp_top = 0;
7494 feat_cur = feat_top = 0;
7502 feature_type *f_ptr;
7509 prt("表示 - 地形", 2, 0);
7510 if (direct_f_idx < 0) prt("グループ", 4, 0);
7511 prt("名前", 4, max + 3);
7514 if (p_ptr->wizard || visual_only) prt("Idx", 4, 62);
7515 prt("文字 ( l/ d)", 4, 66);
7519 if (p_ptr->wizard || visual_only) prt("Idx", 4, 64);
7520 prt("文字 (l/d)", 4, 68);
7523 prt("Visuals - features", 2, 0);
7524 if (direct_f_idx < 0) prt("Group", 4, 0);
7525 prt("Name", 4, max + 3);
7528 if (p_ptr->wizard || visual_only) prt("Idx", 4, 62);
7529 prt("Sym ( l/ d)", 4, 67);
7533 if (p_ptr->wizard || visual_only) prt("Idx", 4, 64);
7534 prt("Sym (l/d)", 4, 69);
7538 for (i = 0; i < 78; i++)
7540 Term_putch(i, 5, TERM_WHITE, '=');
7543 if (direct_f_idx < 0)
7545 for (i = 0; i < browser_rows; i++)
7547 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
7554 if (direct_f_idx < 0)
7556 /* Scroll group list */
7557 if (grp_cur < grp_top) grp_top = grp_cur;
7558 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
7560 /* Display a list of feature groups */
7561 display_group_list(0, 6, max, browser_rows, grp_idx, feature_group_text, grp_cur, grp_top);
7563 if (old_grp_cur != grp_cur)
7565 old_grp_cur = grp_cur;
7567 /* Get a list of features in the current group */
7568 feat_cnt = collect_features(grp_idx[grp_cur], feat_idx, 0x00);
7571 /* Scroll feature list */
7572 while (feat_cur < feat_top)
7573 feat_top = MAX(0, feat_top - browser_rows/2);
7574 while (feat_cur >= feat_top + browser_rows)
7575 feat_top = MIN(feat_cnt - browser_rows, feat_top + browser_rows/2);
7580 /* Display a list of features in the current group */
7581 display_feature_list(max + 3, 6, browser_rows, feat_idx, feat_cur, feat_top, visual_only, F_LIT_STANDARD);
7585 feat_top = feat_cur;
7587 /* Display a list of features in the current group */
7588 display_feature_list(max + 3, 6, 1, feat_idx, feat_cur, feat_top, visual_only, *lighting_level);
7590 /* Display visual list below first object */
7591 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
7596 prt(format("<方向>%s, 'd'で標準光源効果%s, ESC",
7597 visual_list ? ", ENTERで決定, 'a'で対象明度変更" : ", 'v'でシンボル変更",
7598 (attr_idx || char_idx) ? ", 'c', 'p'でペースト" : ", 'c'でコピー"),
7601 prt(format("<dir>%s, 'd' for default lighting%s, ESC",
7602 visual_list ? ", ENTER to accept, 'a' for lighting level" : ", 'v' for visuals",
7603 (attr_idx || char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"),
7607 /* Get the current feature */
7608 f_ptr = &f_info[feat_idx[feat_cur]];
7609 cur_attr_ptr = &f_ptr->x_attr[*lighting_level];
7610 cur_char_ptr = &f_ptr->x_char[*lighting_level];
7614 place_visual_list_cursor(max + 3, 7, *cur_attr_ptr, *cur_char_ptr, attr_top, char_left);
7618 Term_gotoxy(0, 6 + (grp_cur - grp_top));
7622 Term_gotoxy(max + 3, 6 + (feat_cur - feat_top));
7627 if (visual_list && ((ch == 'A') || (ch == 'a')))
7629 int prev_lighting_level = *lighting_level;
7633 if (*lighting_level <= 0) *lighting_level = F_LIT_MAX - 1;
7634 else (*lighting_level)--;
7638 if (*lighting_level >= F_LIT_MAX - 1) *lighting_level = 0;
7639 else (*lighting_level)++;
7642 if (f_ptr->x_attr[prev_lighting_level] != f_ptr->x_attr[*lighting_level])
7643 attr_top = MAX(0, (f_ptr->x_attr[*lighting_level] & 0x7f) - 5);
7645 if (f_ptr->x_char[prev_lighting_level] != f_ptr->x_char[*lighting_level])
7646 char_left = MAX(0, f_ptr->x_char[*lighting_level] - 10);
7651 else if ((ch == 'D') || (ch == 'd'))
7653 byte prev_x_attr = f_ptr->x_attr[*lighting_level];
7654 byte prev_x_char = f_ptr->x_char[*lighting_level];
7656 apply_default_feat_lighting(f_ptr->x_attr, f_ptr->x_char);
7660 if (prev_x_attr != f_ptr->x_attr[*lighting_level])
7661 attr_top = MAX(0, (f_ptr->x_attr[*lighting_level] & 0x7f) - 5);
7663 if (prev_x_char != f_ptr->x_char[*lighting_level])
7664 char_left = MAX(0, f_ptr->x_char[*lighting_level] - 10);
7666 else *need_redraw = TRUE;
7671 /* Do visual mode command if needed */
7672 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))
7676 /* Restore previous visual settings */
7678 for (i = 0; i < F_LIT_MAX; i++)
7680 f_ptr->x_attr[i] = attr_old[i];
7681 f_ptr->x_char[i] = char_old[i];
7688 if (direct_f_idx >= 0) flag = TRUE;
7689 else *lighting_level = F_LIT_STANDARD;
7692 /* Preserve current visual settings */
7695 for (i = 0; i < F_LIT_MAX; i++)
7697 attr_old[i] = f_ptr->x_attr[i];
7698 char_old[i] = f_ptr->x_char[i];
7700 *lighting_level = F_LIT_STANDARD;
7707 for (i = 0; i < F_LIT_MAX; i++)
7709 attr_idx_feat[i] = f_ptr->x_attr[i];
7710 char_idx_feat[i] = f_ptr->x_char[i];
7719 /* Allow TERM_DARK text */
7720 for (i = F_LIT_NS_BEGIN; i < F_LIT_MAX; i++)
7722 if (attr_idx_feat[i] || (!(char_idx_feat[i] & 0x80) && char_idx_feat[i])) f_ptr->x_attr[i] = attr_idx_feat[i];
7723 if (char_idx_feat[i]) f_ptr->x_char[i] = char_idx_feat[i];
7741 /* Move the cursor */
7742 browser_cursor(ch, &column, &grp_cur, grp_cnt, &feat_cur, feat_cnt);
7748 /* Free the "feat_idx" array */
7749 C_KILL(feat_idx, max_f_idx, IDX);
7754 * List wanted monsters
7756 static void do_cmd_knowledge_kubi(void)
7761 char file_name[1024];
7764 /* Open a new file */
7765 fff = my_fopen_temp(file_name, 1024);
7767 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
7774 bool listed = FALSE;
7777 fprintf(fff, "今日のターゲット : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "不明"));
7779 fprintf(fff, "賞金首リスト\n");
7781 fprintf(fff, "Today target : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "unknown"));
7783 fprintf(fff, "List of wanted monsters\n");
7785 fprintf(fff, "----------------------------------------------\n");
7787 for (i = 0; i < MAX_KUBI; i++)
7789 if (kubi_r_idx[i] <= 10000)
7791 fprintf(fff,"%s\n", r_name + r_info[kubi_r_idx[i]].name);
7799 fprintf(fff,"\n%s\n", _("賞金首はもう残っていません。", "There is no more wanted monster."));
7803 /* Close the file */
7806 /* Display the file contents */
7807 show_file(TRUE, file_name, _("賞金首の一覧", "Wanted monsters"), 0, 0);
7809 /* Remove the file */
7814 * List virtues & status
7816 static void do_cmd_knowledge_virtues(void)
7820 char file_name[1024];
7823 /* Open a new file */
7824 fff = my_fopen_temp(file_name, 1024);
7826 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
7833 fprintf(fff, _("現在の属性 : %s\n\n", "Your alighnment : %s\n\n"), your_alignment());
7837 /* Close the file */
7840 /* Display the file contents */
7841 show_file(TRUE, file_name, _("八つの徳", "Virtues"), 0, 0);
7843 /* Remove the file */
7851 static void do_cmd_knowledge_dungeon(void)
7855 char file_name[1024];
7859 /* Open a new file */
7860 fff = my_fopen_temp(file_name, 1024);
7862 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
7869 for (i = 1; i < max_d_idx; i++)
7873 if (!d_info[i].maxdepth) continue;
7874 if (!max_dlv[i]) continue;
7875 if (d_info[i].final_guardian)
7877 if (!r_info[d_info[i].final_guardian].max_num) seiha = TRUE;
7879 else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
7881 fprintf(fff, _("%c%-12s : %3d 階\n", "%c%-16s : level %3d\n"), seiha ? '!' : ' ', d_name + d_info[i].name, (int)max_dlv[i]);
7885 /* Close the file */
7888 /* Display the file contents */
7889 show_file(TRUE, file_name, _("今までに入ったダンジョン", "Dungeon"), 0, 0);
7891 /* Remove the file */
7896 * List virtues & status
7899 static void do_cmd_knowledge_stat(void)
7903 char file_name[1024];
7906 /* Open a new file */
7907 fff = my_fopen_temp(file_name, 1024);
7909 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
7916 percent = (int)(((long)p_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
7917 (2 * p_ptr->hitdie +
7918 ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
7921 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "現在の体力ランク : %d/100\n\n", percent);
7922 else fprintf(fff, "現在の体力ランク : ???\n\n");
7923 fprintf(fff, "能力の最大値\n\n");
7925 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "Your current Life Rating is %d/100.\n\n", percent);
7926 else fprintf(fff, "Your current Life Rating is ???.\n\n");
7927 fprintf(fff, "Limits of maximum stats\n\n");
7929 for (v_nr = 0; v_nr < 6; v_nr++)
7931 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);
7932 else fprintf(fff, "%s ???\n", stat_names[v_nr]);
7938 /* Close the file */
7941 /* Display the file contents */
7942 show_file(TRUE, file_name, _("自分に関する情報", "HP-rate & Max stat"), 0, 0);
7944 /* Remove the file */
7950 * Print all active quests
7952 static void do_cmd_knowledge_quests_current(FILE *fff)
7955 char rand_tmp_str[120] = "\0";
7957 monster_race *r_ptr;
7959 int rand_level = 100;
7962 fprintf(fff, _("《遂行中のクエスト》\n", "< Current Quest >\n"));
7964 for (i = 1; i < max_q_idx; i++)
7966 if ((quest[i].status == QUEST_STATUS_TAKEN) ||
7967 ((quest[i].status == QUEST_STATUS_STAGE_COMPLETED) && (quest[i].type == QUEST_TYPE_TOWER)) ||
7968 (quest[i].status == QUEST_STATUS_COMPLETED))
7970 /* Set the quest number temporary */
7971 IDX old_quest = p_ptr->inside_quest;
7974 /* Clear the text */
7975 for (j = 0; j < 10; j++) quest_text[j][0] = '\0';
7976 quest_text_line = 0;
7978 p_ptr->inside_quest = i;
7980 /* Get the quest text */
7981 init_flags = INIT_SHOW_TEXT;
7983 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
7985 /* Reset the old quest number */
7986 p_ptr->inside_quest = old_quest;
7988 /* No info from "silent" quests */
7989 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7993 if (quest[i].type != QUEST_TYPE_RANDOM)
7995 char note[80] = "\0";
7997 if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_STAGE_COMPLETED)
7999 switch (quest[i].type)
8001 case QUEST_TYPE_KILL_LEVEL:
8002 case QUEST_TYPE_KILL_ANY_LEVEL:
8003 r_ptr = &r_info[quest[i].r_idx];
8004 strcpy(name, r_name + r_ptr->name);
8005 if (quest[i].max_num > 1)
8008 sprintf(note," - %d 体の%sを倒す。(あと %d 体)",
8009 (int)quest[i].max_num, name, (int)(quest[i].max_num - quest[i].cur_num));
8012 sprintf(note," - kill %d %s, have killed %d.",
8013 (int)quest[i].max_num, name, (int)quest[i].cur_num);
8017 sprintf(note,_(" - %sを倒す。", " - kill %s."),name);
8020 case QUEST_TYPE_FIND_ARTIFACT:
8023 artifact_type *a_ptr = &a_info[quest[i].k_idx];
8025 object_type *q_ptr = &forge;
8026 IDX k_idx = lookup_kind(a_ptr->tval, a_ptr->sval);
8027 object_prep(q_ptr, k_idx);
8028 q_ptr->name1 = quest[i].k_idx;
8029 q_ptr->ident = IDENT_STORE;
8030 object_desc(name, q_ptr, OD_NAME_ONLY);
8032 sprintf(note,_("\n - %sを見つけ出す。", "\n - Find out %s."), name);
8034 case QUEST_TYPE_FIND_EXIT:
8035 sprintf(note,_(" - 出口に到達する。", " - Reach to Exit."));
8038 case QUEST_TYPE_KILL_NUMBER:
8040 sprintf(note," - %d 体のモンスターを倒す。(あと %d 体)",
8041 (int)quest[i].max_num, (int)(quest[i].max_num - quest[i].cur_num));
8043 sprintf(note," - Kill %d monsters, have killed %d.",
8044 (int)quest[i].max_num, (int)quest[i].cur_num);
8048 case QUEST_TYPE_KILL_ALL:
8049 case QUEST_TYPE_TOWER:
8050 sprintf(note,_(" - 全てのモンスターを倒す。", " - Kill all monsters."));
8055 /* Print the quest info */
8056 sprintf(tmp_str, _(" %s (危険度:%d階相当)%s\n", " %s (Danger level: %d)%s\n"),
8057 quest[i].name, (int)quest[i].level, note);
8059 fputs(tmp_str, fff);
8061 if (quest[i].status == QUEST_STATUS_COMPLETED)
8063 sprintf(tmp_str, _(" クエスト達成 - まだ報酬を受けとってない。\n", " Quest Completed - Unrewarded\n"));
8064 fputs(tmp_str, fff);
8070 while (quest_text[j][0] && j < 10)
8072 fprintf(fff, " %s\n", quest_text[j]);
8077 else if (quest[i].level < rand_level) /* QUEST_TYPE_RANDOM */
8080 rand_level = quest[i].level;
8082 if (max_dlv[DUNGEON_ANGBAND] >= rand_level)
8084 /* Print the quest info */
8085 r_ptr = &r_info[quest[i].r_idx];
8086 strcpy(name, r_name + r_ptr->name);
8088 if (quest[i].max_num > 1)
8091 sprintf(rand_tmp_str," %s (%d 階) - %d 体の%sを倒す。(あと %d 体)\n",
8092 quest[i].name, (int)quest[i].level,
8093 (int)quest[i].max_num, name, (int)(quest[i].max_num - quest[i].cur_num));
8097 sprintf(rand_tmp_str," %s (Dungeon level: %d)\n Kill %d %s, have killed %d.\n",
8098 quest[i].name, (int)quest[i].level,
8099 (int)quest[i].max_num, name, (int)quest[i].cur_num);
8104 sprintf(rand_tmp_str,_(" %s (%d 階) - %sを倒す。\n", " %s (Dungeon level: %d)\n Kill %s.\n"),
8105 quest[i].name, (int)quest[i].level, name);
8112 /* Print the current random quest */
8113 if (rand_tmp_str[0]) fputs(rand_tmp_str, fff);
8115 if (!total) fprintf(fff, _(" なし\n", " Nothing.\n"));
8119 static bool do_cmd_knowledge_quests_aux(FILE *fff, IDX q_idx)
8122 char playtime_str[16];
8123 quest_type* const q_ptr = &quest[q_idx];
8125 if (is_fixed_quest_idx(q_idx))
8127 /* Set the quest number temporary */
8128 IDX old_quest = p_ptr->inside_quest;
8130 p_ptr->inside_quest = q_idx;
8133 init_flags = INIT_NAME_ONLY;
8135 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
8137 /* Reset the old quest number */
8138 p_ptr->inside_quest = old_quest;
8140 /* No info from "silent" quests */
8141 if (q_ptr->flags & QUEST_FLAG_SILENT) return FALSE;
8144 strnfmt(playtime_str, sizeof(playtime_str), "%02d:%02d:%02d",
8145 q_ptr->comptime/(60*60), (q_ptr->comptime/60)%60, q_ptr->comptime%60);
8147 if (!is_fixed_quest_idx(q_idx) && q_ptr->r_idx)
8149 /* Print the quest info */
8150 if (q_ptr->complev == 0)
8153 _(" %-35s (%3d階) - 不戦勝 - %s\n",
8154 " %-35s (Dungeon level: %3d) - Unearned - %s\n") ,
8155 r_name+r_info[q_ptr->r_idx].name,
8156 (int)q_ptr->level, playtime_str);
8161 _(" %-35s (%3d階) - レベル%2d - %s\n",
8162 " %-35s (Dungeon level: %3d) - level %2d - %s\n") ,
8163 r_name+r_info[q_ptr->r_idx].name,
8171 /* Print the quest info */
8173 _(" %-35s (危険度:%3d階相当) - レベル%2d - %s\n",
8174 " %-35s (Danger level: %3d) - level %2d - %s\n") ,
8175 q_ptr->name, (int)q_ptr->level, q_ptr->complev, playtime_str);
8178 fputs(tmp_str, fff);
8184 * Print all finished quests
8186 void do_cmd_knowledge_quests_completed(FILE *fff, IDX quest_num[])
8191 fprintf(fff, _("《達成したクエスト》\n", "< Completed Quest >\n"));
8192 for (i = 1; i < max_q_idx; i++)
8194 IDX q_idx = quest_num[i];
8195 quest_type* const q_ptr = &quest[q_idx];
8197 if (q_ptr->status == QUEST_STATUS_FINISHED &&
8198 do_cmd_knowledge_quests_aux(fff, q_idx))
8203 if (!total) fprintf(fff, _(" なし\n", " Nothing.\n"));
8208 * Print all failed quests
8210 void do_cmd_knowledge_quests_failed(FILE *fff, IDX quest_num[])
8215 fprintf(fff, _("《失敗したクエスト》\n", "< Failed Quest >\n"));
8216 for (i = 1; i < max_q_idx; i++)
8218 IDX q_idx = quest_num[i];
8219 quest_type* const q_ptr = &quest[q_idx];
8221 if (((q_ptr->status == QUEST_STATUS_FAILED_DONE) || (q_ptr->status == QUEST_STATUS_FAILED)) &&
8222 do_cmd_knowledge_quests_aux(fff, q_idx))
8227 if (!total) fprintf(fff, _(" なし\n", " Nothing.\n"));
8232 * Print all random quests
8234 static void do_cmd_knowledge_quests_wiz_random(FILE *fff)
8240 fprintf(fff, _("《残りのランダムクエスト》\n", "< Remaining Random Quest >\n"));
8241 for (i = 1; i < max_q_idx; i++)
8243 /* No info from "silent" quests */
8244 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
8246 if ((quest[i].type == QUEST_TYPE_RANDOM) && (quest[i].status == QUEST_STATUS_TAKEN))
8250 /* Print the quest info */
8251 sprintf(tmp_str, _(" %s (%d階, %s)\n", " %s (%d, %s)\n"),
8252 quest[i].name, (int)quest[i].level, r_name+r_info[quest[i].r_idx].name);
8253 fputs(tmp_str, fff);
8256 if (!total) fprintf(fff, _(" なし\n", " Nothing.\n"));
8260 bool ang_sort_comp_quest_num(vptr u, vptr v, int a, int b)
8262 QUEST_IDX *q_num = (QUEST_IDX *)u;
8263 quest_type *qa = &quest[q_num[a]];
8264 quest_type *qb = &quest[q_num[b]];
8269 return (qa->comptime != qb->comptime) ?
8270 (qa->comptime < qb->comptime) :
8271 (qa->level <= qb->level);
8274 void ang_sort_swap_quest_num(vptr u, vptr v, int a, int b)
8276 QUEST_IDX *q_num = (QUEST_IDX *)u;
8283 q_num[a] = q_num[b];
8289 * Print quest status of all active quests
8291 static void do_cmd_knowledge_quests(void)
8294 char file_name[1024];
8299 /* Open a new file */
8300 fff = my_fopen_temp(file_name, 1024);
8303 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
8308 /* Allocate Memory */
8309 C_MAKE(quest_num, max_q_idx, IDX);
8311 /* Sort by compete level */
8312 for (i = 1; i < max_q_idx; i++) quest_num[i] = i;
8313 ang_sort_comp = ang_sort_comp_quest_num;
8314 ang_sort_swap = ang_sort_swap_quest_num;
8315 ang_sort(quest_num, &dummy, max_q_idx);
8317 /* Dump Quest Information */
8318 do_cmd_knowledge_quests_current(fff);
8320 do_cmd_knowledge_quests_completed(fff, quest_num);
8322 do_cmd_knowledge_quests_failed(fff, quest_num);
8326 do_cmd_knowledge_quests_wiz_random(fff);
8329 /* Close the file */
8332 /* Display the file contents */
8333 show_file(TRUE, file_name, _("クエスト達成状況", "Quest status"), 0, 0);
8335 /* Remove the file */
8339 C_KILL(quest_num, max_q_idx, IDX);
8346 static void do_cmd_knowledge_home(void)
8351 char file_name[1024];
8353 char o_name[MAX_NLEN];
8356 process_dungeon_file("w_info.txt", 0, 0, max_wild_y, max_wild_x);
8358 /* Open a new file */
8359 fff = my_fopen_temp(file_name, 1024);
8361 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
8368 /* Print all homes in the different towns */
8369 st_ptr = &town[1].store[STORE_HOME];
8371 /* Home -- if anything there */
8372 if (st_ptr->stock_num)
8377 /* Header with name of the town */
8378 fprintf(fff, _(" [ 我が家のアイテム ]\n", " [Home Inventory]\n"));
8380 /* Dump all available items */
8381 for (i = 0; i < st_ptr->stock_num; i++)
8384 if ((i % 12) == 0) fprintf(fff, "\n ( %d ページ )\n", x++);
8385 object_desc(o_name, &st_ptr->stock[i], 0);
8386 if (strlen(o_name) <= 80-3)
8388 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
8394 for (n = 0, t = o_name; n < 80-3; n++, t++)
8395 if(iskanji(*t)) {t++; n++;}
8396 if (n == 81-3) n = 79-3; /* 最後が漢字半分 */
8398 fprintf(fff, "%c%s %.*s\n", I2A(i%12), paren, n, o_name);
8399 fprintf(fff, " %.77s\n", o_name+n);
8402 object_desc(o_name, &st_ptr->stock[i], 0);
8403 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
8408 /* Add an empty line */
8409 fprintf(fff, "\n\n");
8413 /* Close the file */
8416 /* Display the file contents */
8417 show_file(TRUE, file_name, _("我が家のアイテム", "Home Inventory"), 0, 0);
8419 /* Remove the file */
8425 * Check the status of "autopick"
8427 static void do_cmd_knowledge_autopick(void)
8431 char file_name[1024];
8433 /* Open a new file */
8434 fff = my_fopen_temp(file_name, 1024);
8438 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
8445 fprintf(fff, _("自動破壊/拾いには何も登録されていません。", "No preference for auto picker/destroyer."));
8449 fprintf(fff, _(" 自動拾い/破壊には現在 %d行登録されています。\n\n",
8450 " There are %d registered lines for auto picker/destroyer.\n\n"), max_autopick);
8453 for (k = 0; k < max_autopick; k++)
8456 byte act = autopick_list[k].action;
8457 if (act & DONT_AUTOPICK)
8459 tmp = _("放置", "Leave");
8461 else if (act & DO_AUTODESTROY)
8463 tmp = _("破壊", "Destroy");
8465 else if (act & DO_AUTOPICK)
8467 tmp = _("拾う", "Pickup");
8469 else /* if (act & DO_QUERY_AUTOPICK) */ /* Obvious */
8471 tmp = _("確認", "Query");
8474 if (act & DO_DISPLAY)
8475 fprintf(fff, "%11s", format("[%s]", tmp));
8477 fprintf(fff, "%11s", format("(%s)", tmp));
8479 tmp = autopick_line_from_entry(&autopick_list[k]);
8480 fprintf(fff, " %s", tmp);
8484 /* Close the file */
8486 /* Display the file contents */
8487 show_file(TRUE, file_name, _("自動拾い/破壊 設定リスト", "Auto-picker/Destroyer"), 0, 0);
8489 /* Remove the file */
8495 * Interact with "knowledge"
8497 void do_cmd_knowledge(void)
8500 bool need_redraw = FALSE;
8502 /* File type is "TEXT" */
8503 FILE_TYPE(FILE_TYPE_TEXT);
8505 /* Save the screen */
8508 /* Interact until done */
8514 /* Ask for a choice */
8516 prt(format("%d/2 ページ", (p+1)), 2, 65);
8517 prt("現在の知識を確認する", 3, 0);
8519 prt(format("page %d/2", (p+1)), 2, 65);
8520 prt("Display current knowledge", 3, 0);
8523 /* Give some choices */
8527 prt("(1) 既知の伝説のアイテム の一覧", 6, 5);
8528 prt("(2) 既知のアイテム の一覧", 7, 5);
8529 prt("(3) 既知の生きているユニーク・モンスター の一覧", 8, 5);
8530 prt("(4) 既知のモンスター の一覧", 9, 5);
8531 prt("(5) 倒した敵の数 の一覧", 10, 5);
8532 if (!vanilla_town) prt("(6) 賞金首 の一覧", 11, 5);
8533 prt("(7) 現在のペット の一覧", 12, 5);
8534 prt("(8) 我が家のアイテム の一覧", 13, 5);
8535 prt("(9) *鑑定*済み装備の耐性 の一覧", 14, 5);
8536 prt("(0) 地形の表示文字/タイル の一覧", 15, 5);
8540 prt("(a) 自分に関する情報 の一覧", 6, 5);
8541 prt("(b) 突然変異 の一覧", 7, 5);
8542 prt("(c) 武器の経験値 の一覧", 8, 5);
8543 prt("(d) 魔法の経験値 の一覧", 9, 5);
8544 prt("(e) 技能の経験値 の一覧", 10, 5);
8545 prt("(f) プレイヤーの徳 の一覧", 11, 5);
8546 prt("(g) 入ったダンジョン の一覧", 12, 5);
8547 prt("(h) 実行中のクエスト の一覧", 13, 5);
8548 prt("(i) 現在の自動拾い/破壊設定 の一覧", 14, 5);
8553 prt("(1) Display known artifacts", 6, 5);
8554 prt("(2) Display known objects", 7, 5);
8555 prt("(3) Display remaining uniques", 8, 5);
8556 prt("(4) Display known monster", 9, 5);
8557 prt("(5) Display kill count", 10, 5);
8558 if (!vanilla_town) prt("(6) Display wanted monsters", 11, 5);
8559 prt("(7) Display current pets", 12, 5);
8560 prt("(8) Display home inventory", 13, 5);
8561 prt("(9) Display *identified* equip.", 14, 5);
8562 prt("(0) Display terrain symbols.", 15, 5);
8566 prt("(a) Display about yourself", 6, 5);
8567 prt("(b) Display mutations", 7, 5);
8568 prt("(c) Display weapon proficiency", 8, 5);
8569 prt("(d) Display spell proficiency", 9, 5);
8570 prt("(e) Display misc. proficiency", 10, 5);
8571 prt("(f) Display virtues", 11, 5);
8572 prt("(g) Display dungeons", 12, 5);
8573 prt("(h) Display current quests", 13, 5);
8574 prt("(i) Display auto pick/destroy", 14, 5);
8580 prt("ESC) 抜ける", 21, 1);
8581 prt("SPACE) 次ページ", 21, 30);
8582 /*prt("-) 前ページ", 21, 60);*/
8583 prt("コマンド:", 20, 0);
8585 prt("-more-", 17, 8);
8586 prt("ESC) Exit menu", 21, 1);
8587 prt("SPACE) Next page", 21, 30);
8588 /*prt("-) Previous page", 21, 60);*/
8589 prt("Command: ", 20, 0);
8596 if (i == ESCAPE) break;
8599 case ' ': /* Page change */
8603 case '1': /* Artifacts */
8604 do_cmd_knowledge_artifacts();
8606 case '2': /* Objects */
8607 do_cmd_knowledge_objects(&need_redraw, FALSE, -1);
8609 case '3': /* Uniques */
8610 do_cmd_knowledge_uniques();
8612 case '4': /* Monsters */
8613 do_cmd_knowledge_monsters(&need_redraw, FALSE, -1);
8615 case '5': /* Kill count */
8616 do_cmd_knowledge_kill_count();
8618 case '6': /* wanted */
8619 if (!vanilla_town) do_cmd_knowledge_kubi();
8621 case '7': /* Pets */
8622 do_cmd_knowledge_pets();
8624 case '8': /* Home */
8625 do_cmd_knowledge_home();
8627 case '9': /* Resist list */
8628 do_cmd_knowledge_inven();
8630 case '0': /* Feature list */
8632 IDX lighting_level = F_LIT_STANDARD;
8633 do_cmd_knowledge_features(&need_redraw, FALSE, -1, &lighting_level);
8637 case 'a': /* Max stat */
8638 do_cmd_knowledge_stat();
8640 case 'b': /* Mutations */
8641 do_cmd_knowledge_mutations();
8643 case 'c': /* weapon-exp */
8644 do_cmd_knowledge_weapon_exp();
8646 case 'd': /* spell-exp */
8647 do_cmd_knowledge_spell_exp();
8649 case 'e': /* skill-exp */
8650 do_cmd_knowledge_skill_exp();
8652 case 'f': /* Virtues */
8653 do_cmd_knowledge_virtues();
8655 case 'g': /* Dungeon */
8656 do_cmd_knowledge_dungeon();
8658 case 'h': /* Quests */
8659 do_cmd_knowledge_quests();
8661 case 'i': /* Autopick */
8662 do_cmd_knowledge_autopick();
8664 default: /* Unknown option */
8668 /* Flush messages */
8672 /* Restore the screen */
8675 if (need_redraw) do_cmd_redraw();
8680 * Check on the status of an active quest
8682 void do_cmd_checkquest(void)
8684 /* File type is "TEXT" */
8685 FILE_TYPE(FILE_TYPE_TEXT);
8687 /* Save the screen */
8691 do_cmd_knowledge_quests();
8693 /* Restore the screen */
8699 * Display the time and date
8701 void do_cmd_time(void)
8703 int day, hour, min, full, start, end, num;
8711 extract_day_hour_min(&day, &hour, &min);
8713 full = hour * 100 + min;
8720 strcpy(desc, _("変な時刻だ。", "It is a strange time."));
8722 if (day < MAX_DAYS) sprintf(day_buf, "%d", day);
8723 else strcpy(day_buf, "*****");
8727 msg_format("%s日目, 時刻は%d:%02d %sです。",
8728 day_buf, (hour % 12 == 0) ? 12 : (hour % 12),
8729 min, (hour < 12) ? "AM" : "PM");
8731 msg_format("This is day %s. The time is %d:%02d %s.",
8732 day_buf, (hour % 12 == 0) ? 12 : (hour % 12),
8733 min, (hour < 12) ? "AM" : "PM");
8738 if (!randint0(10) || p_ptr->image)
8740 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, _("timefun_j.txt", "timefun.txt"));
8744 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, _("timenorm_j.txt", "timenorm.txt"));
8747 /* Open this file */
8748 fff = my_fopen(buf, "rt");
8753 /* Find this time */
8754 while (!my_fgets(fff, buf, sizeof(buf)))
8756 /* Ignore comments */
8757 if (!buf[0] || (buf[0] == '#')) continue;
8759 /* Ignore invalid lines */
8760 if (buf[1] != ':') continue;
8762 /* Process 'Start' */
8765 /* Extract the starting time */
8766 start = atoi(buf + 2);
8768 /* Assume valid for an hour */
8778 /* Extract the ending time */
8779 end = atoi(buf + 2);
8785 /* Ignore incorrect range */
8786 if ((start > full) || (full > end)) continue;
8788 /* Process 'Description' */
8793 /* Apply the randomizer */
8794 if (!randint0(num)) strcpy(desc, buf + 2);
8804 /* Close the file */