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):", dun_level, d_name+d_info[dungeon_type].name);
436 sprintf(note_level_buf, "%s L%d:", d_name+d_info[dungeon_type].name, 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, max_dlv[num]),
520 _(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, max_dlv[dungeon_type]),
544 _(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 */
1388 * チートオプションの最大数 / Number of cheating options
1393 * チーとオプションの定義テーブル / Cheating options
1395 static option_type cheat_info[CHEAT_MAX] =
1397 { &cheat_peek, FALSE, 255, 0x01, 0x00,
1398 "cheat_peek", _("アイテムの生成をのぞき見る", "Peek into object creation")
1401 { &cheat_hear, FALSE, 255, 0x02, 0x00,
1402 "cheat_hear", _("モンスターの生成をのぞき見る", "Peek into monster creation")
1405 { &cheat_room, FALSE, 255, 0x04, 0x00,
1406 "cheat_room", _("ダンジョンの生成をのぞき見る", "Peek into dungeon creation")
1409 { &cheat_xtra, FALSE, 255, 0x08, 0x00,
1410 "cheat_xtra", _("その他の事をのぞき見る", "Peek into something else")
1413 { &cheat_know, FALSE, 255, 0x10, 0x00,
1414 "cheat_know", _("完全なモンスターの思い出を知る", "Know complete monster info")
1417 { &cheat_live, FALSE, 255, 0x20, 0x00,
1418 "cheat_live", _("死を回避することを可能にする", "Allow player to avoid death")
1421 { &cheat_save, FALSE, 255, 0x40, 0x00,
1422 "cheat_save", _("死んだ時セーブするか確認する", "Ask for saving death")
1425 { &cheat_diary_output, FALSE, 255, 0x80, 0x00,
1426 "cheat_diary_output", _("ウィザードログを日記に出力する", "Output wizard log to diary.")
1429 { &cheat_turn, FALSE, 255, 0x81, 0x00,
1430 "cheat_turn", _("ゲームメッセージにターン表示を行う", "Put turn to game message.")
1437 * @brief チートオプションを変更するコマンドのメインルーチン
1438 * Interact with some options for cheating
1439 * @param info 表示メッセージ
1442 static void do_cmd_options_cheat(cptr info)
1446 int i, k = 0, n = CHEAT_MAX;
1454 /* Interact with the player */
1459 /* Prompt XXX XXX XXX */
1460 sprintf(buf, _("%s ( リターンで次へ, y/n でセット, ESC で決定 )", "%s (RET to advance, y/n to set, ESC to accept) "), info);
1465 /* 詐欺オプションをうっかりいじってしまう人がいるようなので注意 */
1466 prt(" << 注意 >>", 11, 0);
1467 prt(" 詐欺オプションを一度でも設定すると、スコア記録が残らなくなります!", 12, 0);
1468 prt(" 後に解除してもダメですので、勝利者を目指す方はここのオプションはい", 13, 0);
1469 prt(" じらないようにして下さい。", 14, 0);
1471 /* Display the options */
1472 for (i = 0; i < n; i++)
1474 byte a = TERM_WHITE;
1476 /* Color current option */
1477 if (i == k) a = TERM_L_BLUE;
1479 /* Display the option text */
1480 sprintf(buf, "%-48s: %s (%s)",
1481 cheat_info[i].o_desc,
1482 (*cheat_info[i].o_var ? _("はい ", "yes") : _("いいえ", "no ")),
1483 cheat_info[i].o_text);
1484 c_prt(a, buf, i + 2, 0);
1487 /* Hilite current option */
1488 move_cursor(k + 2, 50);
1494 * HACK - Try to translate the key into a direction
1495 * to allow using the roguelike keys for navigation.
1497 dir = get_keymap_dir(ch);
1498 if ((dir == 2) || (dir == 4) || (dir == 6) || (dir == 8))
1512 k = (n + k - 1) % n;
1530 do_cmd_write_nikki(NIKKI_BUNSHOU, 0,
1531 _("詐欺オプションをONにして、スコアを残せなくなった。", "give up sending score to use cheating options."));
1532 p_ptr->noscore |= (cheat_info[k].o_set * 256 + cheat_info[k].o_bit);
1533 (*cheat_info[k].o_var) = TRUE;
1542 (*cheat_info[k].o_var) = FALSE;
1549 strnfmt(buf, sizeof(buf), _("joption.txt#%s", "option.txt#%s"), cheat_info[k].o_text);
1550 /* Peruse the help file */
1551 (void)show_file(TRUE, buf, NULL, 0, 0);
1570 static option_type autosave_info[2] =
1572 { &autosave_l, FALSE, 255, 0x01, 0x00,
1573 "autosave_l", _("新しい階に入る度に自動セーブする", "Autosave when entering new levels") },
1575 { &autosave_t, FALSE, 255, 0x02, 0x00,
1576 "autosave_t", _("一定ターン毎に自動セーブする", "Timed autosave") },
1580 * @brief セーブ頻度ターンの次の値を返す
1581 * @param current 現在のセーブ頻度ターン値
1582 * @return 次のセーブ頻度ターン値
1584 static s16b toggle_frequency(s16b current)
1589 case 50: return 100;
1590 case 100: return 250;
1591 case 250: return 500;
1592 case 500: return 1000;
1593 case 1000: return 2500;
1594 case 2500: return 5000;
1595 case 5000: return 10000;
1596 case 10000: return 25000;
1603 * @brief 自動セーブオプションを変更するコマンドのメインルーチン
1604 * @param info 表示メッセージ
1607 static void do_cmd_options_autosave(cptr info)
1611 int i, k = 0, n = 2;
1619 /* Interact with the player */
1622 /* Prompt XXX XXX XXX */
1623 sprintf(buf, _("%s ( リターンで次へ, y/n でセット, F で頻度を入力, ESC で決定 ) ",
1624 "%s (RET to advance, y/n to set, 'F' for frequency, ESC to accept) "), info);
1628 /* Display the options */
1629 for (i = 0; i < n; i++)
1631 byte a = TERM_WHITE;
1633 /* Color current option */
1634 if (i == k) a = TERM_L_BLUE;
1636 /* Display the option text */
1637 sprintf(buf, "%-48s: %s (%s)",
1638 autosave_info[i].o_desc,
1639 (*autosave_info[i].o_var ? _("はい ", "yes") : _("いいえ", "no ")),
1640 autosave_info[i].o_text);
1641 c_prt(a, buf, i + 2, 0);
1643 prt(format(_("自動セーブの頻度: %d ターン毎", "Timed autosave frequency: every %d turns"), autosave_freq), 5, 0);
1645 /* Hilite current option */
1646 move_cursor(k + 2, 50);
1662 k = (n + k - 1) % n;
1680 (*autosave_info[k].o_var) = TRUE;
1689 (*autosave_info[k].o_var) = FALSE;
1697 autosave_freq = toggle_frequency(autosave_freq);
1698 prt(format(_("自動セーブの頻度: %d ターン毎", "Timed autosave frequency: every %d turns"), autosave_freq), 5, 0);
1704 (void)show_file(TRUE, _("joption.txt#Autosave", "option.txt#Autosave"), NULL, 0, 0);
1720 * @brief 標準オプションを変更するコマンドのサブルーチン /
1721 * Interact with some options
1722 * @param page オプションページ番号
1723 * @param info 表示メッセージ
1726 void do_cmd_options_aux(int page, cptr info)
1729 int i, k = 0, n = 0, l;
1732 bool browse_only = (page == OPT_PAGE_BIRTH) && character_generated &&
1733 (!p_ptr->wizard || !allow_debug_opts);
1736 /* Lookup the options */
1737 for (i = 0; i < 24; i++) opt[i] = 0;
1739 /* Scan the options */
1740 for (i = 0; option_info[i].o_desc; i++)
1742 /* Notice options on this "page" */
1743 if (option_info[i].o_page == page) opt[n++] = i;
1750 /* Interact with the player */
1755 /* Prompt XXX XXX XXX */
1756 sprintf(buf, _("%s (リターン:次, %sESC:終了, ?:ヘルプ) ", "%s (RET:next, %s, ?:help) "),
1757 info, browse_only ? _("", "ESC:exit") : _("y/n:変更, ", "y/n:change, ESC:accept"));
1760 /* HACK -- description for easy-auto-destroy options */
1761 if (page == OPT_PAGE_AUTODESTROY)
1762 c_prt(TERM_YELLOW, _("以下のオプションは、簡易自動破壊を使用するときのみ有効",
1763 "Following options will protect items from easy auto-destroyer."), 6, _(6, 3));
1765 /* Display the options */
1766 for (i = 0; i < n; i++)
1768 byte a = TERM_WHITE;
1770 /* Color current option */
1771 if (i == k) a = TERM_L_BLUE;
1773 /* Display the option text */
1774 sprintf(buf, "%-48s: %s (%.19s)",
1775 option_info[opt[i]].o_desc,
1776 (*option_info[opt[i]].o_var ? _("はい ", "yes") : _("いいえ", "no ")),
1777 option_info[opt[i]].o_text);
1778 if ((page == OPT_PAGE_AUTODESTROY) && i > 2) c_prt(a, buf, i + 5, 0);
1779 else c_prt(a, buf, i + 2, 0);
1782 if ((page == OPT_PAGE_AUTODESTROY) && (k > 2)) l = 3;
1785 /* Hilite current option */
1786 move_cursor(k + 2 + l, 50);
1792 * HACK - Try to translate the key into a direction
1793 * to allow using the roguelike keys for navigation.
1795 dir = get_keymap_dir(ch);
1796 if ((dir == 2) || (dir == 4) || (dir == 6) || (dir == 8))
1810 k = (n + k - 1) % n;
1827 if (browse_only) break;
1828 (*option_info[opt[k]].o_var) = TRUE;
1837 if (browse_only) break;
1838 (*option_info[opt[k]].o_var) = FALSE;
1846 if (!browse_only) (*option_info[opt[k]].o_var) = !(*option_info[opt[k]].o_var);
1852 strnfmt(buf, sizeof(buf), _("joption.txt#%s", "option.txt#%s"), option_info[opt[k]].o_text);
1853 /* Peruse the help file */
1854 (void)show_file(TRUE, buf, NULL, 0, 0);
1871 * @brief ウィンドウオプションを変更するコマンドのメインルーチン /
1872 * Modify the "window" options
1875 static void do_cmd_options_win(void)
1885 /* Memorize old flags */
1886 for (j = 0; j < 8; j++)
1888 /* Acquire current flags */
1889 old_flag[j] = window_flag[j];
1899 /* Prompt XXX XXX XXX */
1900 prt(_("ウィンドウ・フラグ (<方向>で移動, tでチェンジ, y/n でセット, ESC)", "Window Flags (<dir>, t, y, n, ESC) "), 0, 0);
1902 /* Display the windows */
1903 for (j = 0; j < 8; j++)
1905 byte a = TERM_WHITE;
1907 cptr s = angband_term_name[j];
1910 if (j == x) a = TERM_L_BLUE;
1912 /* Window name, staggered, centered */
1913 Term_putstr(35 + j * 5 - strlen(s) / 2, 2 + j % 2, -1, a, s);
1916 /* Display the options */
1917 for (i = 0; i < 16; i++)
1919 byte a = TERM_WHITE;
1921 cptr str = window_flag_desc[i];
1924 if (i == y) a = TERM_L_BLUE;
1927 if (!str) str = _("(未使用)", "(Unused option)");
1930 Term_putstr(0, i + 5, -1, a, str);
1932 /* Display the windows */
1933 for (j = 0; j < 8; j++)
1939 if ((i == y) && (j == x)) a = TERM_L_BLUE;
1942 if (window_flag[j] & (1L << i)) c = 'X';
1945 Term_putch(35 + j * 5, i + 5, a, c);
1950 Term_gotoxy(35 + x * 5, y + 5);
1968 for (j = 0; j < 8; j++)
1970 window_flag[j] &= ~(1L << y);
1974 for (i = 0; i < 16; i++)
1976 window_flag[x] &= ~(1L << i);
1989 window_flag[x] |= (1L << y);
1997 window_flag[x] &= ~(1L << y);
2003 (void)show_file(TRUE, _("joption.txt#Window", "option.txt#Window"), NULL, 0, 0);
2011 d = get_keymap_dir(ch);
2013 x = (x + ddx[d] + 8) % 8;
2014 y = (y + ddy[d] + 16) % 16;
2021 /* Notice changes */
2022 for (j = 0; j < 8; j++)
2027 if (!angband_term[j]) continue;
2029 /* Ignore non-changes */
2030 if (window_flag[j] == old_flag[j]) continue;
2033 Term_activate(angband_term[j]);
2056 option_fields[OPT_NUM] =
2059 { '1', " キー入力 オプション", 3 },
2060 { '2', " マップ画面 オプション", 4 },
2061 { '3', " テキスト表示 オプション", 5 },
2062 { '4', " ゲームプレイ オプション", 6 },
2063 { '5', " 行動中止関係 オプション", 7 },
2064 { '6', " 簡易自動破壊 オプション", 8 },
2065 { 'r', " プレイ記録 オプション", 9 },
2067 { 'p', "自動拾いエディタ", 11 },
2068 { 'd', " 基本ウェイト量 ", 12 },
2069 { 'h', "低ヒットポイント", 13 },
2070 { 'm', " 低魔力色閾値 ", 14 },
2071 { 'a', " 自動セーブ オプション", 15 },
2072 { 'w', "ウインドウフラグ", 16 },
2074 { 'b', " 初期 オプション (参照のみ)", 18 },
2075 { 'c', " 詐欺 オプション", 19 },
2077 { '1', "Input Options", 3 },
2078 { '2', "Map Screen Options", 4 },
2079 { '3', "Text Display Options", 5 },
2080 { '4', "Game-Play Options", 6 },
2081 { '5', "Disturbance Options", 7 },
2082 { '6', "Easy Auto-Destroyer Options", 8 },
2083 { 'r', "Play record Options", 9 },
2085 { 'p', "Auto-picker/destroyer editor", 11 },
2086 { 'd', "Base Delay Factor", 12 },
2087 { 'h', "Hitpoint Warning", 13 },
2088 { 'm', "Mana Color Threshold", 14 },
2089 { 'a', "Autosave Options", 15 },
2090 { 'w', "Window Flags", 16 },
2092 { 'b', "Birth Options (Browse Only)", 18 },
2093 { 'c', "Cheat Options", 19 },
2099 * @brief 標準オプションを変更するコマンドのメインルーチン /
2100 * Set or unset various options.
2104 * The user must use the "Ctrl-R" command to "adapt" to changes
2105 * in any options which control "visual" aspects of the game.
2108 void do_cmd_options(void)
2114 /* Save the screen */
2122 /* Does not list cheat option when cheat option is off */
2123 if (!p_ptr->noscore && !allow_debug_opts) n--;
2128 /* Why are we here */
2129 prt(_("[ オプションの設定 ]", "TinyAngband options"), 1, 0);
2133 /* Give some choices */
2134 for (i = 0; i < n; i++)
2136 byte a = TERM_WHITE;
2137 if (i == y) a = TERM_L_BLUE;
2138 Term_putstr(5, option_fields[i].row, -1, a,
2139 format("(%c) %s", toupper(option_fields[i].key), option_fields[i].name));
2142 prt(_("<方向>で移動, Enterで決定, ESCでキャンセル, ?でヘルプ: ", "Move to <dir>, Select to Enter, Cancel to ESC, ? to help: "), 21, 0);
2145 skey = inkey_special(TRUE);
2146 if (!(skey & SKEY_MASK)) k = (char)skey;
2150 if (k == ESCAPE) break;
2152 if (my_strchr("\n\r ", k))
2154 k = option_fields[y].key;
2158 for (i = 0; i < n; i++)
2160 if (tolower(k) == option_fields[i].key) break;
2163 /* Command is found */
2166 /* Hack -- browse help */
2167 if (k == '?') break;
2171 if (skey == SKEY_UP) d = 8;
2172 if (skey == SKEY_DOWN) d = 2;
2173 y = (y + ddy[d] + n) % n;
2178 if (k == ESCAPE) break;
2185 /* Process the general options */
2186 do_cmd_options_aux(OPT_PAGE_INPUT, _("キー入力オプション", "Input Options"));
2192 /* Process the general options */
2193 do_cmd_options_aux(OPT_PAGE_MAPSCREEN, _("マップ画面オプション", "Map Screen Options"));
2200 do_cmd_options_aux(OPT_PAGE_TEXT, _("テキスト表示オプション", "Text Display Options"));
2207 do_cmd_options_aux(OPT_PAGE_GAMEPLAY, _("ゲームプレイ・オプション", "Game-Play Options"));
2214 do_cmd_options_aux(OPT_PAGE_DISTURBANCE, _("行動中止関係のオプション", "Disturbance Options"));
2221 do_cmd_options_aux(OPT_PAGE_AUTODESTROY, _("簡易自動破壊オプション", "Easy Auto-Destroyer Options"));
2225 /* Play-record Options */
2230 do_cmd_options_aux(OPT_PAGE_PLAYRECORD, _("プレイ記録オプション", "Play-record Options"));
2239 do_cmd_options_aux(OPT_PAGE_BIRTH, (!p_ptr->wizard || !allow_debug_opts) ?
2240 _("初期オプション(参照のみ)", "Birth Options(browse only)") :
2241 _("初期オプション((*)はスコアに影響)", "Birth Options((*)s effect score)"));
2245 /* Cheating Options */
2248 if (!p_ptr->noscore && !allow_debug_opts)
2250 /* Cheat options are not permitted */
2256 do_cmd_options_cheat(_("詐欺師は決して勝利できない!", "Cheaters never win"));
2263 do_cmd_options_autosave(_("自動セーブ", "Autosave"));
2272 do_cmd_options_win();
2273 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL |
2274 PW_PLAYER | PW_MESSAGE | PW_OVERHEAD |
2275 PW_MONSTER | PW_OBJECT | PW_SNAPSHOT |
2276 PW_BORG_1 | PW_BORG_2 | PW_DUNGEON |
2281 /* Auto-picker/destroyer editor */
2285 do_cmd_edit_autopick();
2289 /* Hack -- Delay Speed */
2295 prt(_("コマンド: 基本ウェイト量", "Command: Base Delay Factor"), 19, 0);
2297 /* Get a new value */
2300 int msec = delay_factor * delay_factor * delay_factor;
2301 prt(format(_("現在のウェイト: %d (%dミリ秒)", "Current base delay factor: %d (%d msec)"), delay_factor, msec), 22, 0);
2302 prt(_("ウェイト (0-9) ESCで決定: ", "Delay Factor (0-9 or ESC to accept): "), 20, 0);
2304 if (k == ESCAPE) break;
2307 (void)show_file(TRUE, _("joption.txt#BaseDelay", "option.txt#BaseDelay"), NULL, 0, 0);
2310 else if (isdigit(k)) delay_factor = D2I(k);
2317 /* Hack -- hitpoint warning factor */
2323 prt(_("コマンド: 低ヒットポイント警告", "Command: Hitpoint Warning"), 19, 0);
2325 /* Get a new value */
2328 prt(format(_("現在の低ヒットポイント警告: %d0%%", "Current hitpoint warning: %d0%%"), hitpoint_warn), 22, 0);
2329 prt(_("低ヒットポイント警告 (0-9) ESCで決定: ", "Hitpoint Warning (0-9 or ESC to accept): "), 20, 0);
2331 if (k == ESCAPE) break;
2334 (void)show_file(TRUE, _("joption.txt#Hitpoint", "option.txt#Hitpoint"), NULL, 0, 0);
2337 else if (isdigit(k)) hitpoint_warn = D2I(k);
2344 /* Hack -- mana color factor */
2350 prt(_("コマンド: 低魔力色閾値", "Command: Mana Color Threshold"), 19, 0);
2352 /* Get a new value */
2355 prt(format(_("現在の低魔力色閾値: %d0%%", "Current mana color threshold: %d0%%"), mana_warn), 22, 0);
2356 prt(_("低魔力閾値 (0-9) ESCで決定: ", "Mana color Threshold (0-9 or ESC to accept): "), 20, 0);
2358 if (k == ESCAPE) break;
2361 (void)show_file(TRUE, _("joption.txt#Manapoint", "option.txt#Manapoint"), NULL, 0, 0);
2364 else if (isdigit(k)) mana_warn = D2I(k);
2372 (void)show_file(TRUE, _("joption.txt", "option.txt"), NULL, 0, 0);
2376 /* Unknown option */
2385 /* Flush messages */
2390 /* Restore the screen */
2393 /* Hack - Redraw equippy chars */
2394 p_ptr->redraw |= (PR_EQUIPPY);
2400 * @brief prefファイルを選択して処理する /
2401 * Ask for a "user pref line" and process it
2404 * XXX XXX XXX Allow absolute file names?
2406 void do_cmd_pref(void)
2413 /* Ask for a "user pref command" */
2414 if (!get_string(_("設定変更コマンド: ", "Pref: "), buf, 80)) return;
2416 /* Process that pref command */
2417 (void)process_pref_file_command(buf);
2421 * @brief 自動拾い設定ファイルをロードするコマンドのメインルーチン /
2424 void do_cmd_reload_autopick(void)
2426 if (!get_check(_("自動拾い設定ファイルをロードしますか? ", "Reload auto-pick preference file? "))) return;
2427 /* Load the file with messages */
2428 autopick_load_pref(TRUE);
2434 * @brief マクロ情報をprefファイルに保存する /
2435 * @param fname ファイル名
2438 static errr macro_dump(cptr fname)
2440 static cptr mark = "Macro Dump";
2446 /* Build the filename */
2447 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
2449 /* File type is "TEXT" */
2450 FILE_TYPE(FILE_TYPE_TEXT);
2452 /* Append to the file */
2453 if (!open_auto_dump(buf, mark)) return (-1);
2456 auto_dump_printf(_("\n# 自動マクロセーブ\n\n", "\n# Automatic macro dump\n\n"));
2459 for (i = 0; i < macro__num; i++)
2461 /* Extract the action */
2462 ascii_to_text(buf, macro__act[i]);
2464 /* Dump the macro */
2465 auto_dump_printf("A:%s\n", buf);
2467 /* Extract the action */
2468 ascii_to_text(buf, macro__pat[i]);
2470 /* Dump normal macros */
2471 auto_dump_printf("P:%s\n", buf);
2474 auto_dump_printf("\n");
2486 * @brief マクロのトリガーキーを取得する /
2487 * Hack -- ask for a "trigger" (see below)
2488 * @param buf キー表記を保管するバッファ
2492 * Note the complex use of the "inkey()" function from "util.c".
2494 * Note that both "flush()" calls are extremely important.
2497 static void do_cmd_macro_aux(char *buf)
2506 /* Do not process macros */
2512 /* Read the pattern */
2518 /* Do not process macros */
2521 /* Do not wait for keys */
2524 /* Attempt to read a key */
2535 /* Convert the trigger */
2536 ascii_to_text(tmp, buf);
2538 /* Hack -- display the trigger */
2539 Term_addstr(-1, TERM_WHITE, tmp);
2545 * @brief マクロのキー表記からアスキーコードを得てターミナルに表示する /
2546 * Hack -- ask for a keymap "trigger" (see below)
2547 * @param buf キー表記を取得するバッファ
2551 * Note that both "flush()" calls are extremely important. This may
2552 * no longer be true, since "util.c" is much simpler now. XXX XXX XXX
2555 static void do_cmd_macro_aux_keymap(char *buf)
2569 /* Convert to ascii */
2570 ascii_to_text(tmp, buf);
2572 /* Hack -- display the trigger */
2573 Term_addstr(-1, TERM_WHITE, tmp);
2582 * @brief キーマップをprefファイルにダンプする /
2583 * Hack -- append all keymaps to the given file
2584 * @param fname ファイルネーム
2588 static errr keymap_dump(cptr fname)
2590 static cptr mark = "Keymap Dump";
2599 if (rogue_like_commands)
2601 mode = KEYMAP_MODE_ROGUE;
2607 mode = KEYMAP_MODE_ORIG;
2611 /* Build the filename */
2612 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
2614 /* File type is "TEXT" */
2615 FILE_TYPE(FILE_TYPE_TEXT);
2617 /* Append to the file */
2618 if (!open_auto_dump(buf, mark)) return -1;
2621 auto_dump_printf(_("\n# 自動キー配置セーブ\n\n", "\n# Automatic keymap dump\n\n"));
2624 for (i = 0; i < 256; i++)
2628 /* Loop up the keymap */
2629 act = keymap_act[mode][i];
2631 /* Skip empty keymaps */
2634 /* Encode the key */
2637 ascii_to_text(key, buf);
2639 /* Encode the action */
2640 ascii_to_text(buf, act);
2642 /* Dump the macro */
2643 auto_dump_printf("A:%s\n", buf);
2644 auto_dump_printf("C:%d:%s\n", mode, key);
2656 * @brief マクロを設定するコマンドのメインルーチン /
2657 * Interact with "macros"
2661 * Note that the macro "action" must be defined before the trigger.
2663 * Could use some helpful instructions on this page. XXX XXX XXX
2666 void do_cmd_macros(void)
2678 if (rogue_like_commands)
2680 mode = KEYMAP_MODE_ROGUE;
2686 mode = KEYMAP_MODE_ORIG;
2689 /* File type is "TEXT" */
2690 FILE_TYPE(FILE_TYPE_TEXT);
2697 /* Process requests until done */
2704 prt(_("[ マクロの設定 ]", "Interact with Macros"), 2, 0);
2706 /* Describe that action */
2707 prt(_("マクロ行動が(もしあれば)下に表示されます:", "Current action (if any) shown below:"), 20, 0);
2709 /* Analyze the current action */
2710 ascii_to_text(buf, macro__buf);
2712 /* Display the current action */
2717 prt(_("(1) ユーザー設定ファイルのロード", "(1) Load a user pref file"), 4, 5);
2719 prt(_("(2) ファイルにマクロを追加", "(2) Append macros to a file"), 5, 5);
2720 prt(_("(3) マクロの確認", "(3) Query a macro"), 6, 5);
2721 prt(_("(4) マクロの作成", "(4) Create a macro"), 7, 5);
2722 prt(_("(5) マクロの削除", "(5) Remove a macro"), 8, 5);
2723 prt(_("(6) ファイルにキー配置を追加", "(6) Append keymaps to a file"), 9, 5);
2724 prt(_("(7) キー配置の確認", "(7) Query a keymap"), 10, 5);
2725 prt(_("(8) キー配置の作成", "(8) Create a keymap"), 11, 5);
2726 prt(_("(9) キー配置の削除", "(9) Remove a keymap"), 12, 5);
2727 prt(_("(0) マクロ行動の入力", "(0) Enter a new action"), 13, 5);
2728 #endif /* ALLOW_MACROS */
2731 prt(_("コマンド: ", "Command: "), 16, 0);
2737 if (i == ESCAPE) break;
2739 /* Load a 'macro' file */
2745 prt(_("コマンド: ユーザー設定ファイルのロード", "Command: Load a user pref file"), 16, 0);
2748 prt(_("ファイル: ", "File: "), 18, 0);
2750 /* Default filename */
2751 sprintf(tmp, "%s.prf", player_base);
2753 /* Ask for a file */
2754 if (!askfor(tmp, 80)) continue;
2756 /* Process the given filename */
2757 err = process_pref_file(tmp);
2760 msg_format(_("標準の設定ファイル'%s'を読み込みました。", "Loaded default '%s'."), tmp);
2765 msg_format(_("'%s'の読み込みに失敗しました!", "Failed to load '%s'!"), tmp);
2769 msg_format(_("'%s'を読み込みました。", "Loaded '%s'."), tmp);
2779 prt(_("コマンド: マクロをファイルに追加する", "Command: Append macros to a file"), 16, 0);
2782 prt(_("ファイル: ", "File: "), 18, 0);
2784 /* Default filename */
2785 sprintf(tmp, "%s.prf", player_base);
2787 /* Ask for a file */
2788 if (!askfor(tmp, 80)) continue;
2790 /* Dump the macros */
2791 (void)macro_dump(tmp);
2794 msg_print(_("マクロを追加しました。", "Appended macros."));
2803 prt(_("コマンド: マクロの確認", "Command: Query a macro"), 16, 0);
2807 prt(_("トリガーキー: ", "Trigger: "), 18, 0);
2809 /* Get a macro trigger */
2810 do_cmd_macro_aux(buf);
2812 /* Acquire action */
2813 k = macro_find_exact(buf);
2819 msg_print(_("そのキーにはマクロは定義されていません。", "Found no macro."));
2825 /* Obtain the action */
2826 strcpy(macro__buf, macro__act[k]);
2828 /* Analyze the current action */
2829 ascii_to_text(buf, macro__buf);
2831 /* Display the current action */
2835 msg_print(_("マクロを確認しました。", "Found a macro."));
2839 /* Create a macro */
2843 prt(_("コマンド: マクロの作成", "Command: Create a macro"), 16, 0);
2846 prt(_("トリガーキー: ", "Trigger: "), 18, 0);
2848 /* Get a macro trigger */
2849 do_cmd_macro_aux(buf);
2855 c_prt(TERM_L_RED, _("カーソルキーの左右でカーソル位置を移動。BackspaceかDeleteで一文字削除。",
2856 "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0);
2859 prt(_("マクロ行動: ", "Action: "), 20, 0);
2861 /* Convert to text */
2862 ascii_to_text(tmp, macro__buf);
2864 /* Get an encoded action */
2865 if (askfor(tmp, 80))
2867 /* Convert to ascii */
2868 text_to_ascii(macro__buf, tmp);
2870 /* Link the macro */
2871 macro_add(buf, macro__buf);
2874 msg_print(_("マクロを追加しました。", "Added a macro."));
2878 /* Remove a macro */
2882 prt(_("コマンド: マクロの削除", "Command: Remove a macro"), 16, 0);
2885 prt(_("トリガーキー: ", "Trigger: "), 18, 0);
2887 /* Get a macro trigger */
2888 do_cmd_macro_aux(buf);
2890 /* Link the macro */
2891 macro_add(buf, buf);
2894 msg_print(_("マクロを削除しました。", "Removed a macro."));
2901 prt(_("コマンド: キー配置をファイルに追加する", "Command: Append keymaps to a file"), 16, 0);
2904 prt(_("ファイル: ", "File: "), 18, 0);
2906 /* Default filename */
2907 sprintf(tmp, "%s.prf", player_base);
2909 /* Ask for a file */
2910 if (!askfor(tmp, 80)) continue;
2912 /* Dump the macros */
2913 (void)keymap_dump(tmp);
2916 msg_print(_("キー配置を追加しました。", "Appended keymaps."));
2919 /* Query a keymap */
2925 prt(_("コマンド: キー配置の確認", "Command: Query a keymap"), 16, 0);
2928 prt(_("押すキー: ", "Keypress: "), 18, 0);
2930 /* Get a keymap trigger */
2931 do_cmd_macro_aux_keymap(buf);
2933 /* Look up the keymap */
2934 act = keymap_act[mode][(byte)(buf[0])];
2940 msg_print(_("キー配置は定義されていません。", "Found no keymap."));
2946 /* Obtain the action */
2947 strcpy(macro__buf, act);
2949 /* Analyze the current action */
2950 ascii_to_text(buf, macro__buf);
2952 /* Display the current action */
2956 msg_print(_("キー配置を確認しました。", "Found a keymap."));
2960 /* Create a keymap */
2964 prt(_("コマンド: キー配置の作成", "Command: Create a keymap"), 16, 0);
2967 prt(_("押すキー: ", "Keypress: "), 18, 0);
2969 /* Get a keymap trigger */
2970 do_cmd_macro_aux_keymap(buf);
2976 c_prt(TERM_L_RED, _("カーソルキーの左右でカーソル位置を移動。BackspaceかDeleteで一文字削除。",
2977 "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0);
2980 prt(_("行動: ", "Action: "), 20, 0);
2982 /* Convert to text */
2983 ascii_to_text(tmp, macro__buf);
2985 /* Get an encoded action */
2986 if (askfor(tmp, 80))
2988 /* Convert to ascii */
2989 text_to_ascii(macro__buf, tmp);
2991 /* Free old keymap */
2992 string_free(keymap_act[mode][(byte)(buf[0])]);
2994 /* Make new keymap */
2995 keymap_act[mode][(byte)(buf[0])] = string_make(macro__buf);
2998 msg_print(_("キー配置を追加しました。", "Added a keymap."));
3002 /* Remove a keymap */
3006 prt(_("コマンド: キー配置の削除", "Command: Remove a keymap"), 16, 0);
3009 prt(_("押すキー: ", "Keypress: "), 18, 0);
3011 /* Get a keymap trigger */
3012 do_cmd_macro_aux_keymap(buf);
3014 /* Free old keymap */
3015 string_free(keymap_act[mode][(byte)(buf[0])]);
3017 /* Make new keymap */
3018 keymap_act[mode][(byte)(buf[0])] = NULL;
3021 msg_print(_("キー配置を削除しました。", "Removed a keymap."));
3024 /* Enter a new action */
3028 prt(_("コマンド: マクロ行動の入力", "Command: Enter a new action"), 16, 0);
3034 c_prt(TERM_L_RED, _("カーソルキーの左右でカーソル位置を移動。BackspaceかDeleteで一文字削除。",
3035 "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0);
3038 prt(_("マクロ行動: ", "Action: "), 20, 0);
3040 /* Hack -- limit the value */
3043 /* Get an encoded action */
3044 if (!askfor(buf, 80)) continue;
3046 /* Extract an action */
3047 text_to_ascii(macro__buf, buf);
3050 #endif /* ALLOW_MACROS */
3059 /* Flush messages */
3068 * @brief キャラクタ色の明暗表現
3070 static cptr lighting_level_str[F_LIT_MAX] =
3085 * @brief キャラクタのビジュアルIDを変更する際の対象指定関数
3086 * @param i 指定対象となるキャラクタコード
3087 * @param num 指定されたビジュアルIDを返す参照ポインタ
3088 * @param max ビジュアルIDの最大数
3089 * @return 指定が実際に行われた場合TRUE、キャンセルされた場合FALSE
3091 static bool cmd_visuals_aux(int i, int *num, int max)
3098 sprintf(str, "%d", *num);
3100 if (!get_string(format("Input new number(0-%d): ", max-1), str, 4))
3103 tmp = strtol(str, NULL, 0);
3104 if (tmp >= 0 && tmp < max)
3107 else if (isupper(i))
3108 *num = (*num + max - 1) % max;
3110 *num = (*num + 1) % max;
3116 * @brief キャラクタの変更メニュー表示
3117 * @param choice_msg 選択メッセージ
3120 static void print_visuals_menu(cptr choice_msg)
3122 prt(_("[ 画面表示の設定 ]", "Interact with Visuals"), 1, 0);
3124 /* Give some choices */
3125 prt(_("(0) ユーザー設定ファイルのロード", "(0) Load a user pref file"), 3, 5);
3127 #ifdef ALLOW_VISUALS
3128 prt(_("(1) モンスターの 色/文字 をファイルに書き出す", "(1) Dump monster attr/chars"), 4, 5);
3129 prt(_("(2) アイテムの 色/文字 をファイルに書き出す", "(2) Dump object attr/chars"), 5, 5);
3130 prt(_("(3) 地形の 色/文字 をファイルに書き出す", "(3) Dump feature attr/chars"), 6, 5);
3131 prt(_("(4) モンスターの 色/文字 を変更する (数値操作)", "(4) Change monster attr/chars (numeric operation)"), 7, 5);
3132 prt(_("(5) アイテムの 色/文字 を変更する (数値操作)", "(5) Change object attr/chars (numeric operation)"), 8, 5);
3133 prt(_("(6) 地形の 色/文字 を変更する (数値操作)", "(6) Change feature attr/chars (numeric operation)"), 9, 5);
3134 prt(_("(7) モンスターの 色/文字 を変更する (シンボルエディタ)", "(7) Change monster attr/chars (visual mode)"), 10, 5);
3135 prt(_("(8) アイテムの 色/文字 を変更する (シンボルエディタ)", "(8) Change object attr/chars (visual mode)"), 11, 5);
3136 prt(_("(9) 地形の 色/文字 を変更する (シンボルエディタ)", "(9) Change feature attr/chars (visual mode)"), 12, 5);
3137 #endif /* ALLOW_VISUALS */
3139 prt(_("(R) 画面表示方法の初期化", "(R) Reset visuals"), 13, 5);
3142 prt(format("コマンド: %s", choice_msg ? choice_msg : _("", "")), 15, 0);
3145 static void do_cmd_knowledge_monsters(bool *need_redraw, bool visual_only, int direct_r_idx);
3146 static void do_cmd_knowledge_objects(bool *need_redraw, bool visual_only, int direct_k_idx);
3147 static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, int direct_f_idx, int *lighting_level);
3150 * Interact with "visuals"
3152 void do_cmd_visuals(void)
3157 bool need_redraw = FALSE;
3158 const char *empty_symbol = "<< ? >>";
3160 if (use_bigtile) empty_symbol = "<< ?? >>";
3162 /* File type is "TEXT" */
3163 FILE_TYPE(FILE_TYPE_TEXT);
3165 /* Save the screen */
3168 /* Interact until done */
3174 /* Ask for a choice */
3175 print_visuals_menu(NULL);
3181 if (i == ESCAPE) break;
3185 /* Load a 'pref' file */
3188 prt(_("コマンド: ユーザー設定ファイルのロード", "Command: Load a user pref file"), 15, 0);
3191 prt(_("ファイル: ", "File: "), 17, 0);
3193 /* Default filename */
3194 sprintf(tmp, "%s.prf", player_base);
3197 if (!askfor(tmp, 70)) continue;
3199 /* Process the given filename */
3200 (void)process_pref_file(tmp);
3205 #ifdef ALLOW_VISUALS
3207 /* Dump monster attr/chars */
3210 static cptr mark = "Monster attr/chars";
3213 prt(_("コマンド: モンスターの[色/文字]をファイルに書き出します", "Command: Dump monster attr/chars"), 15, 0);
3216 prt(_("ファイル: ", "File: "), 17, 0);
3218 /* Default filename */
3219 sprintf(tmp, "%s.prf", player_base);
3221 /* Get a filename */
3222 if (!askfor(tmp, 70)) continue;
3224 /* Build the filename */
3225 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3227 /* Append to the file */
3228 if (!open_auto_dump(buf, mark)) continue;
3231 auto_dump_printf(_("\n# モンスターの[色/文字]の設定\n\n", "\n# Monster attr/char definitions\n\n"));
3234 for (i = 0; i < max_r_idx; i++)
3236 monster_race *r_ptr = &r_info[i];
3238 /* Skip non-entries */
3239 if (!r_ptr->name) continue;
3241 /* Dump a comment */
3242 auto_dump_printf("# %s\n", (r_name + r_ptr->name));
3244 /* Dump the monster attr/char info */
3245 auto_dump_printf("R:%d:0x%02X/0x%02X\n\n", i,
3246 (byte)(r_ptr->x_attr), (byte)(r_ptr->x_char));
3253 msg_print(_("モンスターの[色/文字]をファイルに書き出しました。", "Dumped monster attr/chars."));
3258 /* Dump object attr/chars */
3261 static cptr mark = "Object attr/chars";
3264 prt(_("コマンド: アイテムの[色/文字]をファイルに書き出します", "Command: Dump object attr/chars"), 15, 0);
3267 prt(_("ファイル: ", "File: "), 17, 0);
3269 /* Default filename */
3270 sprintf(tmp, "%s.prf", player_base);
3272 /* Get a filename */
3273 if (!askfor(tmp, 70)) continue;
3275 /* Build the filename */
3276 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3278 /* Append to the file */
3279 if (!open_auto_dump(buf, mark)) continue;
3282 auto_dump_printf(_("\n# アイテムの[色/文字]の設定\n\n", "\n# Object attr/char definitions\n\n"));
3285 for (i = 0; i < max_k_idx; i++)
3288 object_kind *k_ptr = &k_info[i];
3290 /* Skip non-entries */
3291 if (!k_ptr->name) continue;
3296 strip_name(o_name, i);
3302 /* Prepare dummy object */
3303 object_prep(&forge, i);
3305 /* Get un-shuffled flavor name */
3306 object_desc(o_name, &forge, OD_FORCE_FLAVOR);
3309 /* Dump a comment */
3310 auto_dump_printf("# %s\n", o_name);
3312 /* Dump the object attr/char info */
3313 auto_dump_printf("K:%d:0x%02X/0x%02X\n\n", i,
3314 (byte)(k_ptr->x_attr), (byte)(k_ptr->x_char));
3321 msg_print(_("アイテムの[色/文字]をファイルに書き出しました。", "Dumped object attr/chars."));
3326 /* Dump feature attr/chars */
3329 static cptr mark = "Feature attr/chars";
3332 prt(_("コマンド: 地形の[色/文字]をファイルに書き出します", "Command: Dump feature attr/chars"), 15, 0);
3335 prt(_("ファイル: ", "File: "), 17, 0);
3337 /* Default filename */
3338 sprintf(tmp, "%s.prf", player_base);
3340 /* Get a filename */
3341 if (!askfor(tmp, 70)) continue;
3343 /* Build the filename */
3344 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3346 /* Append to the file */
3347 if (!open_auto_dump(buf, mark)) continue;
3350 auto_dump_printf(_("\n# 地形の[色/文字]の設定\n\n", "\n# Feature attr/char definitions\n\n"));
3353 for (i = 0; i < max_f_idx; i++)
3355 feature_type *f_ptr = &f_info[i];
3357 /* Skip non-entries */
3358 if (!f_ptr->name) continue;
3360 /* Skip mimiccing features */
3361 if (f_ptr->mimic != i) continue;
3363 /* Dump a comment */
3364 auto_dump_printf("# %s\n", (f_name + f_ptr->name));
3366 /* Dump the feature attr/char info */
3367 auto_dump_printf("F:%d:0x%02X/0x%02X:0x%02X/0x%02X:0x%02X/0x%02X\n\n", i,
3368 (byte)(f_ptr->x_attr[F_LIT_STANDARD]), (byte)(f_ptr->x_char[F_LIT_STANDARD]),
3369 (byte)(f_ptr->x_attr[F_LIT_LITE]), (byte)(f_ptr->x_char[F_LIT_LITE]),
3370 (byte)(f_ptr->x_attr[F_LIT_DARK]), (byte)(f_ptr->x_char[F_LIT_DARK]));
3377 msg_print(_("地形の[色/文字]をファイルに書き出しました。", "Dumped feature attr/chars."));
3382 /* Modify monster attr/chars (numeric operation) */
3385 static cptr choice_msg = _("モンスターの[色/文字]を変更します", "Change monster attr/chars");
3388 prt(format(_("コマンド: %s", "Command: %s"), choice_msg), 15, 0);
3390 /* Hack -- query until done */
3393 monster_race *r_ptr = &r_info[r];
3397 byte da = r_ptr->d_attr;
3398 byte dc = r_ptr->d_char;
3399 byte ca = r_ptr->x_attr;
3400 byte cc = r_ptr->x_char;
3402 /* Label the object */
3403 Term_putstr(5, 17, -1, TERM_WHITE,
3404 format(_("モンスター = %d, 名前 = %-40.40s", "Monster = %d, Name = %-40.40s"), r, (r_name + r_ptr->name)));
3406 /* Label the Default values */
3407 Term_putstr(10, 19, -1, TERM_WHITE,
3408 format(_("初期値 色 / 文字 = %3u / %3u", "Default attr/char = %3u / %3u"), da, dc));
3410 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
3411 Term_queue_bigchar(43, 19, da, dc, 0, 0);
3413 /* Label the Current values */
3414 Term_putstr(10, 20, -1, TERM_WHITE,
3415 format(_("現在値 色 / 文字 = %3u / %3u", "Current attr/char = %3u / %3u"), ca, cc));
3417 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
3418 Term_queue_bigchar(43, 20, ca, cc, 0, 0);
3421 Term_putstr(0, 22, -1, TERM_WHITE,
3422 _("コマンド (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): "));
3428 if (i == ESCAPE) break;
3430 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3431 else if (isupper(i)) c = 'a' + i - 'A';
3441 if (!cmd_visuals_aux(i, &r, max_r_idx))
3447 while (!r_info[r].name);
3451 t = (int)r_ptr->x_attr;
3452 (void)cmd_visuals_aux(i, &t, 256);
3453 r_ptr->x_attr = (byte)t;
3457 t = (int)r_ptr->x_char;
3458 (void)cmd_visuals_aux(i, &t, 256);
3459 r_ptr->x_char = (byte)t;
3463 do_cmd_knowledge_monsters(&need_redraw, TRUE, r);
3467 print_visuals_menu(choice_msg);
3475 /* Modify object attr/chars (numeric operation) */
3478 static cptr choice_msg = _("アイテムの[色/文字]を変更します", "Change object attr/chars");
3480 prt(format(_("コマンド: %s", "Command: %s"), choice_msg), 15, 0);
3482 /* Hack -- query until done */
3485 object_kind *k_ptr = &k_info[k];
3489 byte da = k_ptr->d_attr;
3490 byte dc = k_ptr->d_char;
3491 byte ca = k_ptr->x_attr;
3492 byte cc = k_ptr->x_char;
3494 /* Label the object */
3495 Term_putstr(5, 17, -1, TERM_WHITE,
3496 format(_("アイテム = %d, 名前 = %-40.40s", "Object = %d, Name = %-40.40s"),
3497 k, k_name + (!k_ptr->flavor ? k_ptr->name : k_ptr->flavor_name)));
3499 /* Label the Default values */
3500 Term_putstr(10, 19, -1, TERM_WHITE,
3501 format(_("初期値 色 / 文字 = %3d / %3d", "Default attr/char = %3d / %3d"), da, dc));
3503 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
3504 Term_queue_bigchar(43, 19, da, dc, 0, 0);
3506 /* Label the Current values */
3507 Term_putstr(10, 20, -1, TERM_WHITE,
3508 format(_("現在値 色 / 文字 = %3d / %3d", "Current attr/char = %3d / %3d"), ca, cc));
3510 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
3511 Term_queue_bigchar(43, 20, ca, cc, 0, 0);
3514 Term_putstr(0, 22, -1, TERM_WHITE,
3515 _("コマンド (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): "));
3521 if (i == ESCAPE) break;
3523 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3524 else if (isupper(i)) c = 'a' + i - 'A';
3534 if (!cmd_visuals_aux(i, &k, max_k_idx))
3540 while (!k_info[k].name);
3544 t = (int)k_ptr->x_attr;
3545 (void)cmd_visuals_aux(i, &t, 256);
3546 k_ptr->x_attr = (byte)t;
3550 t = (int)k_ptr->x_char;
3551 (void)cmd_visuals_aux(i, &t, 256);
3552 k_ptr->x_char = (byte)t;
3556 do_cmd_knowledge_objects(&need_redraw, TRUE, k);
3560 print_visuals_menu(choice_msg);
3568 /* Modify feature attr/chars (numeric operation) */
3571 static cptr choice_msg = _("地形の[色/文字]を変更します", "Change feature attr/chars");
3573 static int lighting_level = F_LIT_STANDARD;
3574 prt(format(_("コマンド: %s", "Command: %s"), choice_msg), 15, 0);
3576 /* Hack -- query until done */
3579 feature_type *f_ptr = &f_info[f];
3583 byte da = f_ptr->d_attr[lighting_level];
3584 byte dc = f_ptr->d_char[lighting_level];
3585 byte ca = f_ptr->x_attr[lighting_level];
3586 byte cc = f_ptr->x_char[lighting_level];
3588 /* Label the object */
3590 Term_putstr(5, 17, -1, TERM_WHITE,
3591 format(_("地形 = %d, 名前 = %s, 明度 = %s", "Terrain = %d, Name = %s, Lighting = %s"),
3592 f, (f_name + f_ptr->name), lighting_level_str[lighting_level]));
3594 /* Label the Default values */
3595 Term_putstr(10, 19, -1, TERM_WHITE,
3596 format(_("初期値 色 / 文字 = %3d / %3d", "Default attr/char = %3d / %3d"), da, dc));
3598 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
3599 Term_queue_bigchar(43, 19, da, dc, 0, 0);
3601 /* Label the Current values */
3603 Term_putstr(10, 20, -1, TERM_WHITE,
3604 format("現在値 色 / 文字 = %3d / %3d", ca, cc));
3606 Term_putstr(10, 20, -1, TERM_WHITE,
3607 format("Current attr/char = %3d / %3d", ca, cc));
3610 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
3611 Term_queue_bigchar(43, 20, ca, cc, 0, 0);
3615 Term_putstr(0, 22, -1, TERM_WHITE,
3616 "コマンド (n/N/^N/a/A/^A/c/C/^C/l/L/^L/d/D/^D/v/V/^V): ");
3618 Term_putstr(0, 22, -1, TERM_WHITE,
3619 "Command (n/N/^N/a/A/^A/c/C/^C/l/L/^L/d/D/^D/v/V/^V): ");
3626 if (i == ESCAPE) break;
3628 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3629 else if (isupper(i)) c = 'a' + i - 'A';
3639 if (!cmd_visuals_aux(i, &f, max_f_idx))
3645 while (!f_info[f].name || (f_info[f].mimic != f));
3649 t = (int)f_ptr->x_attr[lighting_level];
3650 (void)cmd_visuals_aux(i, &t, 256);
3651 f_ptr->x_attr[lighting_level] = (byte)t;
3655 t = (int)f_ptr->x_char[lighting_level];
3656 (void)cmd_visuals_aux(i, &t, 256);
3657 f_ptr->x_char[lighting_level] = (byte)t;
3661 (void)cmd_visuals_aux(i, &lighting_level, F_LIT_MAX);
3664 apply_default_feat_lighting(f_ptr->x_attr, f_ptr->x_char);
3668 do_cmd_knowledge_features(&need_redraw, TRUE, f, &lighting_level);
3672 print_visuals_menu(choice_msg);
3680 /* Modify monster attr/chars (visual mode) */
3682 do_cmd_knowledge_monsters(&need_redraw, TRUE, -1);
3685 /* Modify object attr/chars (visual mode) */
3687 do_cmd_knowledge_objects(&need_redraw, TRUE, -1);
3690 /* Modify feature attr/chars (visual mode) */
3693 int lighting_level = F_LIT_STANDARD;
3694 do_cmd_knowledge_features(&need_redraw, TRUE, -1, &lighting_level);
3698 #endif /* ALLOW_VISUALS */
3707 msg_print(_("画面上の[色/文字]を初期値にリセットしました。", "Visual attr/char tables reset."));
3711 /* Unknown option */
3717 /* Flush messages */
3721 /* Restore the screen */
3724 if (need_redraw) do_cmd_redraw();
3729 * Interact with "colors"
3731 void do_cmd_colors(void)
3740 /* File type is "TEXT" */
3741 FILE_TYPE(FILE_TYPE_TEXT);
3744 /* Save the screen */
3748 /* Interact until done */
3754 /* Ask for a choice */
3755 prt(_("[ カラーの設定 ]", "Interact with Colors"), 2, 0);
3757 /* Give some choices */
3758 prt(_("(1) ユーザー設定ファイルのロード", "(1) Load a user pref file"), 4, 5);
3761 prt(_("(2) カラーの設定をファイルに書き出す", "(2) Dump colors"), 5, 5);
3762 prt(_("(3) カラーの設定を変更する", "(3) Modify colors"), 6, 5);
3766 prt(_("コマンド: ", "Command: "), 8, 0);
3771 if (i == ESCAPE) break;
3773 /* Load a 'pref' file */
3777 prt(_("コマンド: ユーザー設定ファイルをロードします", "Command: Load a user pref file"), 8, 0);
3780 prt(_("ファイル: ", "File: "), 10, 0);
3783 sprintf(tmp, "%s.prf", player_base);
3786 if (!askfor(tmp, 70)) continue;
3788 /* Process the given filename */
3789 (void)process_pref_file(tmp);
3791 /* Mega-Hack -- react to changes */
3792 Term_xtra(TERM_XTRA_REACT, 0);
3794 /* Mega-Hack -- redraw */
3803 static cptr mark = "Colors";
3806 prt(_("コマンド: カラーの設定をファイルに書き出します", "Command: Dump colors"), 8, 0);
3809 prt(_("ファイル: ", "File: "), 10, 0);
3811 /* Default filename */
3812 sprintf(tmp, "%s.prf", player_base);
3814 /* Get a filename */
3815 if (!askfor(tmp, 70)) continue;
3817 /* Build the filename */
3818 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3820 /* Append to the file */
3821 if (!open_auto_dump(buf, mark)) continue;
3824 auto_dump_printf(_("\n# カラーの設定\n\n", "\n# Color redefinitions\n\n"));
3827 for (i = 0; i < 256; i++)
3829 int kv = angband_color_table[i][0];
3830 int rv = angband_color_table[i][1];
3831 int gv = angband_color_table[i][2];
3832 int bv = angband_color_table[i][3];
3834 cptr name = _("未知", "unknown");
3836 /* Skip non-entries */
3837 if (!kv && !rv && !gv && !bv) continue;
3839 /* Extract the color name */
3840 if (i < 16) name = color_names[i];
3842 /* Dump a comment */
3843 auto_dump_printf(_("# カラー '%s'\n", "# Color '%s'\n"), name);
3845 /* Dump the monster attr/char info */
3846 auto_dump_printf("V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n",
3854 msg_print(_("カラーの設定をファイルに書き出しました。", "Dumped color redefinitions."));
3863 prt(_("コマンド: カラーの設定を変更します", "Command: Modify colors"), 8, 0);
3865 /* Hack -- query until done */
3874 /* Exhibit the normal colors */
3875 for (j = 0; j < 16; j++)
3877 /* Exhibit this color */
3878 Term_putstr(j*4, 20, -1, a, "###");
3880 /* Exhibit all colors */
3881 Term_putstr(j*4, 22, -1, j, format("%3d", j));
3884 /* Describe the color */
3885 name = ((a < 16) ? color_names[a] : _("未定義", "undefined"));
3887 /* Describe the color */
3888 Term_putstr(5, 10, -1, TERM_WHITE,
3889 format(_("カラー = %d, 名前 = %s", "Color = %d, Name = %s"), a, name));
3891 /* Label the Current values */
3892 Term_putstr(5, 12, -1, TERM_WHITE,
3893 format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x",
3894 angband_color_table[a][0],
3895 angband_color_table[a][1],
3896 angband_color_table[a][2],
3897 angband_color_table[a][3]));
3900 Term_putstr(0, 14, -1, TERM_WHITE,
3901 _("コマンド (n/N/k/K/r/R/g/G/b/B): ", "Command (n/N/k/K/r/R/g/G/b/B): "));
3908 if (i == ESCAPE) break;
3911 if (i == 'n') a = (byte)(a + 1);
3912 if (i == 'N') a = (byte)(a - 1);
3913 if (i == 'k') angband_color_table[a][0] = (byte)(angband_color_table[a][0] + 1);
3914 if (i == 'K') angband_color_table[a][0] = (byte)(angband_color_table[a][0] - 1);
3915 if (i == 'r') angband_color_table[a][1] = (byte)(angband_color_table[a][1] + 1);
3916 if (i == 'R') angband_color_table[a][1] = (byte)(angband_color_table[a][1] - 1);
3917 if (i == 'g') angband_color_table[a][2] = (byte)(angband_color_table[a][2] + 1);
3918 if (i == 'G') angband_color_table[a][2] = (byte)(angband_color_table[a][2] - 1);
3919 if (i == 'b') angband_color_table[a][3] = (byte)(angband_color_table[a][3] + 1);
3920 if (i == 'B') angband_color_table[a][3] = (byte)(angband_color_table[a][3] - 1);
3922 /* Hack -- react to changes */
3923 Term_xtra(TERM_XTRA_REACT, 0);
3925 /* Hack -- redraw */
3932 /* Unknown option */
3938 /* Flush messages */
3943 /* Restore the screen */
3949 * Note something in the message recall
3951 void do_cmd_note(void)
3959 if (!get_string(_("メモ: ", "Note: "), buf, 60)) return;
3961 /* Ignore empty notes */
3962 if (!buf[0] || (buf[0] == ' ')) return;
3964 /* Add the note to the message recall */
3965 msg_format(_("メモ: %s", "Note: %s"), buf);
3970 * Mention the current version
3972 void do_cmd_version(void)
3976 #if FAKE_VER_EXTRA > 0
3977 msg_format(_("変愚蛮怒(Hengband) %d.%d.%d.%d", "You are playing Hengband %d.%d.%d.%d."),
3978 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH, FAKE_VER_EXTRA);
3980 msg_format(_("変愚蛮怒(Hengband) %d.%d.%d", "You are playing Hengband %d.%d.%d."),
3981 FAKE_VER_MAJOR - 10, FAKE_VER_MINOR, FAKE_VER_PATCH);
3988 * Array of feeling strings
3990 static cptr do_cmd_feeling_text[11] =
3992 _("この階の雰囲気を感じとれなかった...", "Looks like any other level."),
3993 _("この階には何か特別なものがあるような気がする。", "You feel there is something special about this level."),
3994 _("恐ろしい死の幻が目に浮かび、気絶しそうになった!", "You nearly faint as horrible visions of death fill your mind!"),
3995 _("この階はとても危険なようだ。", "This level looks very dangerous."),
3996 _("とても悪い予感がする...", "You have a very bad feeling..."),
3997 _("悪い予感がする...", "You have a bad feeling..."),
3998 _("何か緊張する。", "You feel nervous."),
3999 _("少し不運な気がする...", "You feel your luck is turning..."),
4000 _("この場所は好きになれない。", "You don't like the look of this place."),
4001 _("この階はそれなりに安全なようだ。", "This level looks reasonably safe."),
4002 _("なんて退屈なところだ...", "What a boring place...")
4005 static cptr do_cmd_feeling_text_combat[11] =
4007 _("この階の雰囲気を感じとれなかった...", "Looks like any other level."),
4008 _("この階には何か特別なものがあるような気がする。", "You feel there is something special about this level."),
4009 _("今夜もまた、誰かが命を落とす...", "You nearly faint as horrible visions of death fill your mind!"),
4010 _("この階はとても危険なようだ。", "This level looks very dangerous."),
4011 _("とても悪い予感がする...", "You have a very bad feeling..."),
4012 _("悪い予感がする...", "You have a bad feeling..."),
4013 _("何か緊張する。", "You feel nervous."),
4014 _("少し不運な気がする...", "You feel your luck is turning..."),
4015 _("この場所は好きになれない。", "You don't like the look of this place."),
4016 _("この階はそれなりに安全なようだ。", "This level looks reasonably safe."),
4017 _("なんて退屈なところだ...", "What a boring place...")
4020 static cptr do_cmd_feeling_text_lucky[11] =
4022 _("この階の雰囲気を感じとれなかった...", "Looks like any other level."),
4023 _("この階には何か特別なものがあるような気がする。", "You feel there is something special about this level."),
4024 _("この階はこの上なく素晴らしい感じがする。", "You have a superb feeling about this level."),
4025 _("素晴らしい感じがする...", "You have an excellent feeling..."),
4026 _("とても良い感じがする...", "You have a very good feeling..."),
4027 _("良い感じがする...", "You have a good feeling..."),
4028 _("ちょっと幸運な感じがする...", "You feel strangely lucky..."),
4029 _("多少は運が向いてきたか...", "You feel your luck is turning..."),
4030 _("見た感じ悪くはない...", "You like the look of this place..."),
4031 _("全然駄目ということはないが...", "This level can't be all bad..."),
4032 _("なんて退屈なところだ...", "What a boring place...")
4037 * Note that "feeling" is set to zero unless some time has passed.
4038 * Note that this is done when the level is GENERATED, not entered.
4040 void do_cmd_feeling(void)
4042 /* No useful feeling in quests */
4043 if (p_ptr->inside_quest && !random_quest_number(dun_level))
4045 msg_print(_("典型的なクエストのダンジョンのようだ。", "Looks like a typical quest level."));
4049 /* No useful feeling in town */
4050 else if (p_ptr->town_num && !dun_level)
4052 if (!strcmp(town[p_ptr->town_num].name, _("荒野", "wilderness")))
4054 msg_print(_("何かありそうな荒野のようだ。", "Looks like a strange wilderness."));
4059 msg_print(_("典型的な町のようだ。", "Looks like a typical town."));
4064 /* No useful feeling in the wilderness */
4065 else if (!dun_level)
4067 msg_print(_("典型的な荒野のようだ。", "Looks like a typical wilderness."));
4071 /* Display the feeling */
4072 if (p_ptr->muta3 & MUT3_GOOD_LUCK)
4073 msg_print(do_cmd_feeling_text_lucky[p_ptr->feeling]);
4074 else if (p_ptr->pseikaku == SEIKAKU_COMBAT ||
4075 inventory[INVEN_BOW].name1 == ART_CRIMSON)
4076 msg_print(do_cmd_feeling_text_combat[p_ptr->feeling]);
4078 msg_print(do_cmd_feeling_text[p_ptr->feeling]);
4084 * Description of each monster group.
4086 static cptr monster_group_text[] =
4089 "ユニーク", /* "Uniques" */
4090 "乗馬可能なモンスター", /* "Riding" */
4091 "賞金首", /* "Wanted */
4092 "アンバーの王族", /* "Ambertite" */
4121 /* "古代ドラゴン/ワイアーム", */
4182 /* "Ancient Dragon/Wyrm", */
4191 "Multi-Headed Reptile",
4196 "Reptile/Amphibian",
4197 "Spider/Scorpion/Tick",
4199 /* "Major Demon", */
4216 * Symbols of monsters in each group. Note the "Uniques" group
4217 * is handled differently.
4219 static cptr monster_group_char[] =
4276 "!$&()+./=>?[\\]`{|~",
4286 * hook function to sort monsters by level
4288 static bool ang_sort_comp_monster_level(vptr u, vptr v, int a, int b)
4290 u16b *who = (u16b*)(u);
4295 monster_race *r_ptr1 = &r_info[w1];
4296 monster_race *r_ptr2 = &r_info[w2];
4301 if (r_ptr2->level > r_ptr1->level) return TRUE;
4302 if (r_ptr1->level > r_ptr2->level) return FALSE;
4304 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return TRUE;
4305 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return FALSE;
4310 * Build a list of monster indexes in the given group. Return the number
4311 * of monsters in the group.
4313 * mode & 0x01 : check for non-empty group
4314 * mode & 0x02 : visual operation only
4316 static int collect_monsters(int grp_cur, s16b mon_idx[], byte mode)
4321 /* Get a list of x_char in this group */
4322 cptr group_char = monster_group_char[grp_cur];
4324 /* XXX Hack -- Check if this is the "Uniques" group */
4325 bool grp_unique = (monster_group_char[grp_cur] == (char *) -1L);
4327 /* XXX Hack -- Check if this is the "Riding" group */
4328 bool grp_riding = (monster_group_char[grp_cur] == (char *) -2L);
4330 /* XXX Hack -- Check if this is the "Wanted" group */
4331 bool grp_wanted = (monster_group_char[grp_cur] == (char *) -3L);
4333 /* XXX Hack -- Check if this is the "Amberite" group */
4334 bool grp_amberite = (monster_group_char[grp_cur] == (char *) -4L);
4337 /* Check every race */
4338 for (i = 0; i < max_r_idx; i++)
4340 /* Access the race */
4341 monster_race *r_ptr = &r_info[i];
4343 /* Skip empty race */
4344 if (!r_ptr->name) continue ;
4346 /* Require known monsters */
4347 if (!(mode & 0x02) && !cheat_know && !r_ptr->r_sights) continue;
4351 if (!(r_ptr->flags1 & RF1_UNIQUE)) continue;
4354 else if (grp_riding)
4356 if (!(r_ptr->flags7 & RF7_RIDING)) continue;
4359 else if (grp_wanted)
4361 bool wanted = FALSE;
4363 for (j = 0; j < MAX_KUBI; j++)
4365 if (kubi_r_idx[j] == i || kubi_r_idx[j] - 10000 == i ||
4366 (p_ptr->today_mon && p_ptr->today_mon == i))
4372 if (!wanted) continue;
4375 else if (grp_amberite)
4377 if (!(r_ptr->flags3 & RF3_AMBERITE)) continue;
4382 /* Check for race in the group */
4383 if (!my_strchr(group_char, r_ptr->d_char)) continue;
4387 mon_idx[mon_cnt++] = i;
4389 /* XXX Hack -- Just checking for non-empty group */
4390 if (mode & 0x01) break;
4393 /* Terminate the list */
4394 mon_idx[mon_cnt] = -1;
4396 /* Select the sort method */
4397 ang_sort_comp = ang_sort_comp_monster_level;
4398 ang_sort_swap = ang_sort_swap_hook;
4400 /* Sort by monster level */
4401 ang_sort(mon_idx, &dummy_why, mon_cnt);
4403 /* Return the number of races */
4409 * Description of each monster group.
4411 static cptr object_group_text[] =
4414 "キノコ", /* "Mushrooms" */
4415 "薬", /* "Potions" */
4416 "油つぼ", /* "Flasks" */
4417 "巻物", /* "Scrolls" */
4419 "アミュレット", /* "Amulets" */
4420 "笛", /* "Whistle" */
4421 "光源", /* "Lanterns" */
4422 "魔法棒", /* "Wands" */
4425 "カード", /* "Cards" */
4436 "刀剣類", /* "Swords" */
4437 "鈍器", /* "Blunt Weapons" */
4438 "長柄武器", /* "Polearms" */
4439 "採掘道具", /* "Diggers" */
4440 "飛び道具", /* "Bows" */
4444 "軽装鎧", /* "Soft Armor" */
4445 "重装鎧", /* "Hard Armor" */
4446 "ドラゴン鎧", /* "Dragon Armor" */
4447 "盾", /* "Shields" */
4448 "クローク", /* "Cloaks" */
4449 "籠手", /* "Gloves" */
4450 "ヘルメット", /* "Helms" */
4452 "ブーツ", /* "Boots" */
4505 * TVALs of items in each group
4507 static byte object_group_tval[] =
4548 TV_LIFE_BOOK, /* Hack -- all spellbooks */
4556 * Build a list of object indexes in the given group. Return the number
4557 * of objects in the group.
4559 * mode & 0x01 : check for non-empty group
4560 * mode & 0x02 : visual operation only
4562 static int collect_objects(int grp_cur, int object_idx[], byte mode)
4564 int i, j, k, object_cnt = 0;
4566 /* Get a list of x_char in this group */
4567 byte group_tval = object_group_tval[grp_cur];
4569 /* Check every object */
4570 for (i = 0; i < max_k_idx; i++)
4572 /* Access the object */
4573 object_kind *k_ptr = &k_info[i];
4575 /* Skip empty objects */
4576 if (!k_ptr->name) continue;
4580 /* Any objects will be displayed */
4586 /* Skip non-flavoured objects */
4587 if (!k_ptr->flavor) continue;
4589 /* Require objects ever seen */
4590 if (!k_ptr->aware) continue;
4593 /* Skip items with no distribution (special artifacts) */
4594 for (j = 0, k = 0; j < 4; j++) k += k_ptr->chance[j];
4598 /* Check for objects in the group */
4599 if (TV_LIFE_BOOK == group_tval)
4601 /* Hack -- All spell books */
4602 if (TV_LIFE_BOOK <= k_ptr->tval && k_ptr->tval <= TV_HEX_BOOK)
4604 /* Add the object */
4605 object_idx[object_cnt++] = i;
4609 else if (k_ptr->tval == group_tval)
4611 /* Add the object */
4612 object_idx[object_cnt++] = i;
4616 /* XXX Hack -- Just checking for non-empty group */
4617 if (mode & 0x01) break;
4620 /* Terminate the list */
4621 object_idx[object_cnt] = -1;
4623 /* Return the number of objects */
4629 * Description of each feature group.
4631 static cptr feature_group_text[] =
4639 * Build a list of feature indexes in the given group. Return the number
4640 * of features in the group.
4642 * mode & 0x01 : check for non-empty group
4644 static int collect_features(int grp_cur, int *feat_idx, byte mode)
4646 int i, feat_cnt = 0;
4648 /* Unused; There is a single group. */
4651 /* Check every feature */
4652 for (i = 0; i < max_f_idx; i++)
4654 /* Access the index */
4655 feature_type *f_ptr = &f_info[i];
4657 /* Skip empty index */
4658 if (!f_ptr->name) continue;
4660 /* Skip mimiccing features */
4661 if (f_ptr->mimic != i) continue;
4664 feat_idx[feat_cnt++] = i;
4666 /* XXX Hack -- Just checking for non-empty group */
4667 if (mode & 0x01) break;
4670 /* Terminate the list */
4671 feat_idx[feat_cnt] = -1;
4673 /* Return the number of races */
4680 * Build a list of monster indexes in the given group. Return the number
4681 * of monsters in the group.
4683 static int collect_artifacts(int grp_cur, int object_idx[])
4685 int i, object_cnt = 0;
4687 /* Get a list of x_char in this group */
4688 byte group_tval = object_group_tval[grp_cur];
4690 /* Check every object */
4691 for (i = 0; i < max_a_idx; i++)
4693 /* Access the artifact */
4694 artifact_type *a_ptr = &a_info[i];
4696 /* Skip empty artifacts */
4697 if (!a_ptr->name) continue;
4699 /* Skip "uncreated" artifacts */
4700 if (!a_ptr->cur_num) continue;
4702 /* Check for race in the group */
4703 if (a_ptr->tval == group_tval)
4706 object_idx[object_cnt++] = i;
4710 /* Terminate the list */
4711 object_idx[object_cnt] = 0;
4713 /* Return the number of races */
4720 * Encode the screen colors
4722 static char hack[17] = "dwsorgbuDWvyRGBU";
4726 * Hack -- load a screen dump from a file
4728 void do_cmd_load_screen(void)
4743 Term_get_size(&wid, &hgt);
4745 /* Build the filename */
4746 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
4748 /* Append to the file */
4749 fff = my_fopen(buf, "r");
4753 msg_format(_("%s を開くことができませんでした。", "Failed to open %s."), buf);
4759 /* Save the screen */
4762 /* Clear the screen */
4766 /* Load the screen */
4767 for (y = 0; okay; y++)
4769 /* Get a line of data including control code */
4770 if (!fgets(buf, 1024, fff)) okay = FALSE;
4772 /* Get the blank line */
4773 if (buf[0] == '\n' || buf[0] == '\0') break;
4775 /* Ignore too large screen image */
4776 if (y >= hgt) continue;
4779 for (x = 0; x < wid - 1; x++)
4782 if (buf[x] == '\n' || buf[x] == '\0') break;
4784 /* Put the attr/char */
4785 Term_draw(x, y, TERM_WHITE, buf[x]);
4789 /* Dump the screen */
4790 for (y = 0; okay; y++)
4792 /* Get a line of data including control code */
4793 if (!fgets(buf, 1024, fff)) okay = FALSE;
4795 /* Get the blank line */
4796 if (buf[0] == '\n' || buf[0] == '\0') break;
4798 /* Ignore too large screen image */
4799 if (y >= hgt) continue;
4802 for (x = 0; x < wid - 1; x++)
4805 if (buf[x] == '\n' || buf[x] == '\0') break;
4807 /* Get the attr/char */
4808 (void)(Term_what(x, y, &a, &c));
4810 /* Look up the attr */
4811 for (i = 0; i < 16; i++)
4813 /* Use attr matches */
4814 if (hack[i] == buf[x]) a = i;
4817 /* Put the attr/char */
4818 Term_draw(x, y, a, c);
4828 prt(_("ファイルに書き出された画面(記念撮影)をロードしました。", "Screen dump loaded."), 0, 0);
4834 /* Restore the screen */
4841 cptr inven_res_label = _(" 酸電火冷毒光闇破轟獄因沌劣 盲怖乱痺透命感消復浮",
4842 " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv");
4845 #define IM_FLAG_STR _("*", "* ")
4846 #define HAS_FLAG_STR _("+", "+ ")
4847 #define NO_FLAG_STR _("・", ". ")
4849 #define print_im_or_res_flag(IM, RES) \
4851 fputs(have_flag(flgs, (IM)) ? IM_FLAG_STR : \
4852 (have_flag(flgs, (RES)) ? HAS_FLAG_STR : NO_FLAG_STR), fff); \
4855 #define print_flag(TR) \
4857 fputs(have_flag(flgs, (TR)) ? HAS_FLAG_STR : NO_FLAG_STR, fff); \
4861 /* XTRA HACK RESLIST */
4862 static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr, int *j, byte tval, char *where)
4864 char o_name[MAX_NLEN];
4865 u32b flgs[TR_FLAG_SIZE];
4867 if (!o_ptr->k_idx) return;
4868 if (o_ptr->tval != tval) return;
4870 /* Identified items only */
4871 if (!object_is_known(o_ptr)) return;
4874 * HACK:Ring of Lordly protection and Dragon equipment
4875 * have random resistances.
4877 if ((object_is_wearable(o_ptr) && object_is_ego(o_ptr))
4878 || ((tval == TV_AMULET) && (o_ptr->sval == SV_AMULET_RESISTANCE))
4879 || ((tval == TV_RING) && (o_ptr->sval == SV_RING_LORDLY))
4880 || ((tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD))
4881 || ((tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM))
4882 || ((tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES))
4883 || ((tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE))
4884 || object_is_artifact(o_ptr))
4887 object_desc(o_name, o_ptr, OD_NAME_ONLY);
4889 while (o_name[i] && (i < 26))
4892 if (iskanji(o_name[i])) i++;
4901 o_name[i] = ' '; i++;
4906 fprintf(fff, "%s %s", where, o_name);
4908 if (!(o_ptr->ident & (IDENT_MENTAL)))
4910 fputs(_("-------不明--------------- -------不明---------\n",
4911 "-------unknown------------ -------unknown------\n"), fff);
4915 object_flags_known(o_ptr, flgs);
4917 print_im_or_res_flag(TR_IM_ACID, TR_RES_ACID);
4918 print_im_or_res_flag(TR_IM_ELEC, TR_RES_ELEC);
4919 print_im_or_res_flag(TR_IM_FIRE, TR_RES_FIRE);
4920 print_im_or_res_flag(TR_IM_COLD, TR_RES_COLD);
4921 print_flag(TR_RES_POIS);
4922 print_flag(TR_RES_LITE);
4923 print_flag(TR_RES_DARK);
4924 print_flag(TR_RES_SHARDS);
4925 print_flag(TR_RES_SOUND);
4926 print_flag(TR_RES_NETHER);
4927 print_flag(TR_RES_NEXUS);
4928 print_flag(TR_RES_CHAOS);
4929 print_flag(TR_RES_DISEN);
4933 print_flag(TR_RES_BLIND);
4934 print_flag(TR_RES_FEAR);
4935 print_flag(TR_RES_CONF);
4936 print_flag(TR_FREE_ACT);
4937 print_flag(TR_SEE_INVIS);
4938 print_flag(TR_HOLD_EXP);
4939 print_flag(TR_TELEPATHY);
4940 print_flag(TR_SLOW_DIGEST);
4941 print_flag(TR_REGEN);
4942 print_flag(TR_LEVITATION);
4950 fprintf(fff, "%s\n", inven_res_label);
4956 * Display *ID* ed weapons/armors's resistances
4958 static void do_cmd_knowledge_inven(void)
4962 char file_name[1024];
4972 /* Open a new file */
4973 fff = my_fopen_temp(file_name, 1024);
4976 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
4980 fprintf(fff, "%s\n", inven_res_label);
4982 for (tval = TV_WEARABLE_BEGIN; tval <= TV_WEARABLE_END; tval++)
4986 for (; j < 9; j++) fputc('\n', fff);
4988 fprintf(fff, "%s\n", inven_res_label);
4990 strcpy(where, _("装", "E "));
4991 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
4993 do_cmd_knowledge_inven_aux(fff, &inventory[i], &j, tval, where);
4995 strcpy(where, _("持", "I "));
4996 for (i = 0; i < INVEN_PACK; i++)
4998 do_cmd_knowledge_inven_aux(fff, &inventory[i], &j, tval, where);
5001 st_ptr = &town[1].store[STORE_HOME];
5002 strcpy(where, _("家", "H "));
5003 for (i = 0; i < st_ptr->stock_num; i++)
5005 do_cmd_knowledge_inven_aux(fff, &st_ptr->stock[i], &j, tval, where);
5009 /* Close the file */
5012 /* Display the file contents */
5013 show_file(TRUE, file_name, _("*鑑定*済み武器/防具の耐性リスト", "Resistances of *identified* equipment"), 0, 0);
5015 /* Remove the file */
5020 void do_cmd_save_screen_html_aux(char *filename, int message)
5024 byte a = 0, old_a = 0;
5038 cptr html_head[] = {
5039 "<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
5043 cptr html_foot[] = {
5045 "</body>\n</html>\n",
5051 Term_get_size(&wid, &hgt);
5053 /* File type is "TEXT" */
5054 FILE_TYPE(FILE_TYPE_TEXT);
5056 /* Append to the file */
5057 fff = my_fopen(filename, "w");
5062 msg_format(_("ファイル %s を開けませんでした。", "Failed to open file %s."), filename);
5069 /* Save the screen */
5073 /* Build the filename */
5074 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "htmldump.prf");
5075 tmpfff = my_fopen(buf, "r");
5077 for (i = 0; html_head[i]; i++)
5078 fputs(html_head[i], fff);
5082 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
5084 if (strncmp(buf, tags[0], strlen(tags[0])) == 0)
5088 if (strncmp(buf, tags[1], strlen(tags[1])) == 0)
5090 fprintf(fff, "%s\n", buf);
5095 /* Dump the screen */
5096 for (y = 0; y < hgt; y++)
5103 for (x = 0; x < wid - 1; x++)
5107 /* Get the attr/char */
5108 (void)(Term_what(x, y, &a, &c));
5112 case '&': cc = "&"; break;
5113 case '<': cc = "<"; break;
5114 case '>': cc = ">"; break;
5116 case 0x1f: c = '.'; break;
5117 case 0x7f: c = (a == 0x09) ? '%' : '#'; break;
5122 if ((y == 0 && x == 0) || a != old_a) {
5123 rv = angband_color_table[a][1];
5124 gv = angband_color_table[a][2];
5125 bv = angband_color_table[a][3];
5126 fprintf(fff, "%s<font color=\"#%02x%02x%02x\">",
5127 ((y == 0 && x == 0) ? "" : "</font>"), rv, gv, bv);
5131 fprintf(fff, "%s", cc);
5133 fprintf(fff, "%c", c);
5136 fprintf(fff, "</font>");
5139 for (i = 0; html_foot[i]; i++)
5140 fputs(html_foot[i], fff);
5145 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
5147 if (strncmp(buf, tags[2], strlen(tags[2])) == 0)
5151 if (strncmp(buf, tags[3], strlen(tags[3])) == 0)
5153 fprintf(fff, "%s\n", buf);
5167 msg_print(_("画面(記念撮影)をファイルに書き出しました。", "Screen dump saved."));
5171 /* Restore the screen */
5177 * Hack -- save a screen dump to a file
5179 static void do_cmd_save_screen_html(void)
5181 char buf[1024], tmp[256] = "screen.html";
5183 if (!get_string(_("ファイル名: ", "File name: "), tmp, 80))
5186 /* Build the filename */
5187 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
5191 do_cmd_save_screen_html_aux(buf, 1);
5196 * Redefinable "save_screen" action
5198 void (*screendump_aux)(void) = NULL;
5202 * Hack -- save a screen dump to a file
5204 void do_cmd_save_screen(void)
5206 bool old_use_graphics = use_graphics;
5207 bool html_dump = FALSE;
5211 prt(_("記念撮影しますか? [(y)es/(h)tml/(n)o] ", "Save screen dump? [(y)es/(h)tml/(n)o] "), 0, 0);
5215 if (c == 'Y' || c == 'y')
5217 else if (c == 'H' || c == 'h')
5229 Term_get_size(&wid, &hgt);
5231 if (old_use_graphics)
5233 use_graphics = FALSE;
5236 /* Redraw everything */
5237 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
5239 /* Hack -- update */
5245 do_cmd_save_screen_html();
5249 /* Do we use a special screendump function ? */
5250 else if (screendump_aux)
5252 /* Dump the screen to a graphics file */
5253 (*screendump_aux)();
5255 else /* Dump the screen as text */
5266 /* Build the filename */
5267 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
5269 /* File type is "TEXT" */
5270 FILE_TYPE(FILE_TYPE_TEXT);
5272 /* Append to the file */
5273 fff = my_fopen(buf, "w");
5278 msg_format(_("ファイル %s を開けませんでした。", "Failed to open file %s."), buf);
5284 /* Save the screen */
5288 /* Dump the screen */
5289 for (y = 0; y < hgt; y++)
5292 for (x = 0; x < wid - 1; x++)
5294 /* Get the attr/char */
5295 (void)(Term_what(x, y, &a, &c));
5305 fprintf(fff, "%s\n", buf);
5312 /* Dump the screen */
5313 for (y = 0; y < hgt; y++)
5316 for (x = 0; x < wid - 1; x++)
5318 /* Get the attr/char */
5319 (void)(Term_what(x, y, &a, &c));
5322 buf[x] = hack[a&0x0F];
5329 fprintf(fff, "%s\n", buf);
5340 msg_print(_("画面(記念撮影)をファイルに書き出しました。", "Screen dump saved."));
5343 /* Restore the screen */
5347 if (old_use_graphics)
5349 use_graphics = TRUE;
5352 /* Redraw everything */
5353 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
5355 /* Hack -- update */
5362 * Sorting hook -- Comp function -- see below
5364 * We use "u" to point to array of monster indexes,
5365 * and "v" to select the type of sorting to perform on "u".
5367 static bool ang_sort_art_comp(vptr u, vptr v, int a, int b)
5369 u16b *who = (u16b*)(u);
5371 u16b *why = (u16b*)(v);
5378 /* Sort by total kills */
5381 /* Extract total kills */
5382 z1 = a_info[w1].tval;
5383 z2 = a_info[w2].tval;
5385 /* Compare total kills */
5386 if (z1 < z2) return (TRUE);
5387 if (z1 > z2) return (FALSE);
5391 /* Sort by monster level */
5394 /* Extract levels */
5395 z1 = a_info[w1].sval;
5396 z2 = a_info[w2].sval;
5398 /* Compare levels */
5399 if (z1 < z2) return (TRUE);
5400 if (z1 > z2) return (FALSE);
5404 /* Sort by monster experience */
5407 /* Extract experience */
5408 z1 = a_info[w1].level;
5409 z2 = a_info[w2].level;
5411 /* Compare experience */
5412 if (z1 < z2) return (TRUE);
5413 if (z1 > z2) return (FALSE);
5417 /* Compare indexes */
5423 * Sorting hook -- Swap function -- see below
5425 * We use "u" to point to array of monster indexes,
5426 * and "v" to select the type of sorting to perform.
5428 static void ang_sort_art_swap(vptr u, vptr v, int a, int b)
5430 u16b *who = (u16b*)(u);
5445 * Check the status of "artifacts"
5447 static void do_cmd_knowledge_artifacts(void)
5449 int i, k, z, x, y, n = 0;
5455 char file_name[1024];
5457 char base_name[MAX_NLEN];
5461 /* Open a new file */
5462 fff = my_fopen_temp(file_name, 1024);
5465 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
5470 /* Allocate the "who" array */
5471 C_MAKE(who, max_a_idx, s16b);
5473 /* Allocate the "okay" array */
5474 C_MAKE(okay, max_a_idx, bool);
5476 /* Scan the artifacts */
5477 for (k = 0; k < max_a_idx; k++)
5479 artifact_type *a_ptr = &a_info[k];
5484 /* Skip "empty" artifacts */
5485 if (!a_ptr->name) continue;
5487 /* Skip "uncreated" artifacts */
5488 if (!a_ptr->cur_num) continue;
5494 /* Check the dungeon */
5495 for (y = 0; y < cur_hgt; y++)
5497 for (x = 0; x < cur_wid; x++)
5499 cave_type *c_ptr = &cave[y][x];
5501 s16b this_o_idx, next_o_idx = 0;
5503 /* Scan all objects in the grid */
5504 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
5508 /* Acquire object */
5509 o_ptr = &o_list[this_o_idx];
5511 /* Acquire next object */
5512 next_o_idx = o_ptr->next_o_idx;
5514 /* Ignore non-artifacts */
5515 if (!object_is_fixed_artifact(o_ptr)) continue;
5517 /* Ignore known items */
5518 if (object_is_known(o_ptr)) continue;
5520 /* Note the artifact */
5521 okay[o_ptr->name1] = FALSE;
5526 /* Check the inventory and equipment */
5527 for (i = 0; i < INVEN_TOTAL; i++)
5529 object_type *o_ptr = &inventory[i];
5531 /* Ignore non-objects */
5532 if (!o_ptr->k_idx) continue;
5534 /* Ignore non-artifacts */
5535 if (!object_is_fixed_artifact(o_ptr)) continue;
5537 /* Ignore known items */
5538 if (object_is_known(o_ptr)) continue;
5540 /* Note the artifact */
5541 okay[o_ptr->name1] = FALSE;
5544 for (k = 0; k < max_a_idx; k++)
5546 if (okay[k]) who[n++] = k;
5549 /* Select the sort method */
5550 ang_sort_comp = ang_sort_art_comp;
5551 ang_sort_swap = ang_sort_art_swap;
5553 /* Sort the array by dungeon depth of monsters */
5554 ang_sort(who, &why, n);
5556 /* Scan the artifacts */
5557 for (k = 0; k < n; k++)
5559 artifact_type *a_ptr = &a_info[who[k]];
5562 strcpy(base_name, _("未知の伝説のアイテム", "Unknown Artifact"));
5564 /* Obtain the base object type */
5565 z = lookup_kind(a_ptr->tval, a_ptr->sval);
5573 /* Get local object */
5576 /* Create fake object */
5577 object_prep(q_ptr, z);
5579 /* Make it an artifact */
5580 q_ptr->name1 = (byte)who[k];
5582 /* Display as if known */
5583 q_ptr->ident |= IDENT_STORE;
5585 /* Describe the artifact */
5586 object_desc(base_name, q_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
5589 /* Hack -- Build the artifact name */
5590 fprintf(fff, _(" %s\n", " The %s\n"), base_name);
5593 /* Free the "who" array */
5594 C_KILL(who, max_a_idx, s16b);
5596 /* Free the "okay" array */
5597 C_KILL(okay, max_a_idx, bool);
5599 /* Close the file */
5602 /* Display the file contents */
5603 show_file(TRUE, file_name, _("既知の伝説のアイテム", "Artifacts Seen"), 0, 0);
5605 /* Remove the file */
5611 * Display known uniques
5612 * With "XTRA HACK UNIQHIST" (Originally from XAngband)
5614 static void do_cmd_knowledge_uniques(void)
5622 char file_name[1024];
5625 int n_alive_surface = 0;
5626 int n_alive_over100 = 0;
5627 int n_alive_total = 0;
5630 for (i = 0; i < 10; i++) n_alive[i] = 0;
5632 /* Open a new file */
5633 fff = my_fopen_temp(file_name, 1024);
5637 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
5642 /* Allocate the "who" array */
5643 C_MAKE(who, max_r_idx, s16b);
5645 /* Scan the monsters */
5646 for (i = 1; i < max_r_idx; i++)
5648 monster_race *r_ptr = &r_info[i];
5651 if (!r_ptr->name) continue;
5653 /* Require unique monsters */
5654 if (!(r_ptr->flags1 & RF1_UNIQUE)) continue;
5656 /* Only display "known" uniques */
5657 if (!cheat_know && !r_ptr->r_sights) continue;
5659 /* Only print rarity <= 100 uniques */
5660 if (!r_ptr->rarity || ((r_ptr->rarity > 100) && !(r_ptr->flags1 & RF1_QUESTOR))) continue;
5662 /* Only "alive" uniques */
5663 if (r_ptr->max_num == 0) continue;
5667 lev = (r_ptr->level - 1) / 10;
5671 if (max_lev < lev) max_lev = lev;
5673 else n_alive_over100++;
5675 else n_alive_surface++;
5677 /* Collect "appropriate" monsters */
5681 /* Select the sort method */
5682 ang_sort_comp = ang_sort_comp_hook;
5683 ang_sort_swap = ang_sort_swap_hook;
5685 /* Sort the array by dungeon depth of monsters */
5686 ang_sort(who, &why, n);
5688 if (n_alive_surface)
5690 fprintf(fff, _(" 地上 生存: %3d体\n", " Surface alive: %3d\n"), n_alive_surface);
5691 n_alive_total += n_alive_surface;
5693 for (i = 0; i <= max_lev; i++)
5695 fprintf(fff, _("%3d-%3d階 生存: %3d体\n", "Level %3d-%3d alive: %3d\n"), 1 + i * 10, 10 + i * 10, n_alive[i]);
5696 n_alive_total += n_alive[i];
5698 if (n_alive_over100)
5700 fprintf(fff, _("101- 階 生存: %3d体\n", "Level 101- alive: %3d\n"), n_alive_over100);
5701 n_alive_total += n_alive_over100;
5706 fputs(_("--------- -----------\n", "------------- ----------\n"), fff);
5707 fprintf(fff, _(" 合計 生存: %3d体\n\n", " Total alive: %3d\n\n"), n_alive_total);
5711 fputs(_("現在は既知の生存ユニークはいません。\n", "No known uniques alive.\n"), fff);
5714 /* Scan the monster races */
5715 for (k = 0; k < n; k++)
5717 monster_race *r_ptr = &r_info[who[k]];
5719 /* Print a message */
5720 fprintf(fff, _(" %s (レベル%d)\n", " %s (level %d)\n"), r_name + r_ptr->name, r_ptr->level);
5723 /* Free the "who" array */
5724 C_KILL(who, max_r_idx, s16b);
5726 /* Close the file */
5729 /* Display the file contents */
5730 show_file(TRUE, file_name, _("まだ生きているユニーク・モンスター", "Alive Uniques"), 0, 0);
5732 /* Remove the file */
5738 * Display weapon-exp
5740 static void do_cmd_knowledge_weapon_exp(void)
5742 int i, j, num, weapon_exp;
5746 char file_name[1024];
5749 /* Open a new file */
5750 fff = my_fopen_temp(file_name, 1024);
5752 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
5757 for (i = 0; i < 5; i++)
5759 for (num = 0; num < 64; num++)
5761 for (j = 0; j < max_k_idx; j++)
5763 object_kind *k_ptr = &k_info[j];
5765 if ((k_ptr->tval == TV_SWORD - i) && (k_ptr->sval == num))
5767 if ((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON || k_ptr->sval == SV_HARP)) continue;
5769 weapon_exp = p_ptr->weapon_exp[4 - i][num];
5771 fprintf(fff, "%-25s ", tmp);
5772 if (weapon_exp >= s_info[p_ptr->pclass].w_max[4 - i][num]) fprintf(fff, "!");
5773 else fprintf(fff, " ");
5774 fprintf(fff, "%s", exp_level_str[weapon_exp_level(weapon_exp)]);
5775 if (cheat_xtra) fprintf(fff, " %d", weapon_exp);
5783 /* Close the file */
5786 /* Display the file contents */
5787 show_file(TRUE, file_name, _("武器の経験値", "Weapon Proficiency"), 0, 0);
5789 /* Remove the file */
5795 * @brief 魔法の経験値を表示するコマンドのメインルーチン
5799 static void do_cmd_knowledge_spell_exp(void)
5801 int i = 0, spell_exp, exp_level;
5804 const magic_type *s_ptr;
5806 char file_name[1024];
5808 /* Open a new file */
5809 fff = my_fopen_temp(file_name, 1024);
5811 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
5816 if (p_ptr->realm1 != REALM_NONE)
5818 fprintf(fff, _("%sの魔法書\n", "%s Spellbook\n"), realm_names[p_ptr->realm1]);
5819 for (i = 0; i < 32; i++)
5821 if (!is_magic(p_ptr->realm1))
5823 s_ptr = &technic_info[p_ptr->realm1 - MIN_TECHNIC][i];
5827 s_ptr = &mp_ptr->info[p_ptr->realm1 - 1][i];
5829 if (s_ptr->slevel >= 99) continue;
5830 spell_exp = p_ptr->spell_exp[i];
5831 exp_level = spell_exp_level(spell_exp);
5832 fprintf(fff, "%-25s ", do_spell(p_ptr->realm1, i, SPELL_NAME));
5833 if (p_ptr->realm1 == REALM_HISSATSU)
5834 fprintf(fff, "[--]");
5837 if (exp_level >= EXP_LEVEL_MASTER) fprintf(fff, "!");
5838 else fprintf(fff, " ");
5839 fprintf(fff, "%s", exp_level_str[exp_level]);
5841 if (cheat_xtra) fprintf(fff, " %d", spell_exp);
5846 if (p_ptr->realm2 != REALM_NONE)
5848 fprintf(fff, _("%sの魔法書\n", "\n%s Spellbook\n"), realm_names[p_ptr->realm2]);
5849 for (i = 0; i < 32; i++)
5851 if (!is_magic(p_ptr->realm1))
5853 s_ptr = &technic_info[p_ptr->realm2 - MIN_TECHNIC][i];
5857 s_ptr = &mp_ptr->info[p_ptr->realm2 - 1][i];
5859 if (s_ptr->slevel >= 99) continue;
5861 spell_exp = p_ptr->spell_exp[i + 32];
5862 exp_level = spell_exp_level(spell_exp);
5863 fprintf(fff, "%-25s ", do_spell(p_ptr->realm2, i, SPELL_NAME));
5864 if (exp_level >= EXP_LEVEL_EXPERT) fprintf(fff, "!");
5865 else fprintf(fff, " ");
5866 fprintf(fff, "%s", exp_level_str[exp_level]);
5867 if (cheat_xtra) fprintf(fff, " %d", spell_exp);
5872 /* Close the file */
5875 /* Display the file contents */
5876 show_file(TRUE, file_name, _("魔法の経験値", "Spell Proficiency"), 0, 0);
5878 /* Remove the file */
5884 * @brief スキル情報を表示するコマンドのメインルーチン /
5888 static void do_cmd_knowledge_skill_exp(void)
5890 int i = 0, skill_exp;
5894 char file_name[1024];
5895 char skill_name[3][20]={_("マーシャルアーツ", "Martial Arts "),
5896 _("二刀流 ", "Dual Wielding "),
5897 _("乗馬 ", "Riding ")};
5899 /* Open a new file */
5900 fff = my_fopen_temp(file_name, 1024);
5902 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
5907 for (i = 0; i < 3; i++)
5909 skill_exp = p_ptr->skill_exp[i];
5910 fprintf(fff, "%-20s ", skill_name[i]);
5911 if (skill_exp >= s_info[p_ptr->pclass].s_max[i]) fprintf(fff, "!");
5912 else fprintf(fff, " ");
5913 fprintf(fff, "%s", exp_level_str[(i == GINOU_RIDING) ? riding_exp_level(skill_exp) : weapon_exp_level(skill_exp)]);
5914 if (cheat_xtra) fprintf(fff, " %d", skill_exp);
5918 /* Close the file */
5921 /* Display the file contents */
5922 show_file(TRUE, file_name, _("技能の経験値", "Miscellaneous Proficiency"), 0, 0);
5924 /* Remove the file */
5930 * @brief 英単語、句、説を複数形を変換する / Pluralize a monster name
5931 * @param Name 変換したい文字列の参照ポインタ
5934 void plural_aux(char *Name)
5936 int NameLen = strlen(Name);
5938 if (my_strstr(Name, "Disembodied hand"))
5940 strcpy(Name, "Disembodied hands that strangled people");
5942 else if (my_strstr(Name, "Colour out of space"))
5944 strcpy(Name, "Colours out of space");
5946 else if (my_strstr(Name, "stairway to hell"))
5948 strcpy(Name, "stairways to hell");
5950 else if (my_strstr(Name, "Dweller on the threshold"))
5952 strcpy(Name, "Dwellers on the threshold");
5954 else if (my_strstr(Name, " of "))
5956 cptr aider = my_strstr(Name, " of ");
5967 if (dummy[i-1] == 's')
5969 strcpy(&(dummy[i]), "es");
5974 strcpy(&(dummy[i]), "s");
5977 strcpy(&(dummy[i+1]), aider);
5978 strcpy(Name, dummy);
5980 else if (my_strstr(Name, "coins"))
5983 strcpy(dummy, "piles of ");
5984 strcat(dummy, Name);
5985 strcpy(Name, dummy);
5988 else if (my_strstr(Name, "Manes"))
5992 else if (streq(&(Name[NameLen - 2]), "ey"))
5994 strcpy(&(Name[NameLen - 2]), "eys");
5996 else if (Name[NameLen - 1] == 'y')
5998 strcpy(&(Name[NameLen - 1]), "ies");
6000 else if (streq(&(Name[NameLen - 4]), "ouse"))
6002 strcpy(&(Name[NameLen - 4]), "ice");
6004 else if (streq(&(Name[NameLen - 2]), "us"))
6006 strcpy(&(Name[NameLen - 2]), "i");
6008 else if (streq(&(Name[NameLen - 6]), "kelman"))
6010 strcpy(&(Name[NameLen - 6]), "kelmen");
6012 else if (streq(&(Name[NameLen - 8]), "wordsman"))
6014 strcpy(&(Name[NameLen - 8]), "wordsmen");
6016 else if (streq(&(Name[NameLen - 7]), "oodsman"))
6018 strcpy(&(Name[NameLen - 7]), "oodsmen");
6020 else if (streq(&(Name[NameLen - 7]), "eastman"))
6022 strcpy(&(Name[NameLen - 7]), "eastmen");
6024 else if (streq(&(Name[NameLen - 8]), "izardman"))
6026 strcpy(&(Name[NameLen - 8]), "izardmen");
6028 else if (streq(&(Name[NameLen - 5]), "geist"))
6030 strcpy(&(Name[NameLen - 5]), "geister");
6032 else if (streq(&(Name[NameLen - 2]), "ex"))
6034 strcpy(&(Name[NameLen - 2]), "ices");
6036 else if (streq(&(Name[NameLen - 2]), "lf"))
6038 strcpy(&(Name[NameLen - 2]), "lves");
6040 else if (suffix(Name, "ch") ||
6041 suffix(Name, "sh") ||
6042 suffix(Name, "nx") ||
6043 suffix(Name, "s") ||
6046 strcpy(&(Name[NameLen]), "es");
6050 strcpy(&(Name[NameLen]), "s");
6055 * @brief 現在のペットを表示するコマンドのメインルーチン /
6056 * Display current pets
6059 static void do_cmd_knowledge_pets(void)
6063 monster_type *m_ptr;
6066 int show_upkeep = 0;
6067 char file_name[1024];
6070 /* Open a new file */
6071 fff = my_fopen_temp(file_name, 1024);
6073 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
6078 /* Process the monsters (backwards) */
6079 for (i = m_max - 1; i >= 1; i--)
6081 /* Access the monster */
6084 /* Ignore "dead" monsters */
6085 if (!m_ptr->r_idx) continue;
6087 /* Calculate "upkeep" for pets */
6091 monster_desc(pet_name, m_ptr, MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
6092 fprintf(fff, "%s (%s)\n", pet_name, look_mon_desc(m_ptr, 0x00));
6096 show_upkeep = calculate_upkeep();
6098 fprintf(fff, "----------------------------------------------\n");
6100 fprintf(fff, " 合計: %d 体のペット\n", t_friends);
6101 fprintf(fff, " 維持コスト: %d%% MP\n", show_upkeep);
6103 fprintf(fff, " Total: %d pet%s.\n",
6104 t_friends, (t_friends == 1 ? "" : "s"));
6105 fprintf(fff, " Upkeep: %d%% mana.\n", show_upkeep);
6110 /* Close the file */
6113 /* Display the file contents */
6114 show_file(TRUE, file_name, _("現在のペット", "Current Pets"), 0, 0);
6116 /* Remove the file */
6122 * @brief 現在のペットを表示するコマンドのメインルーチン /
6125 * @note the player ghosts are ignored. XXX XXX XXX
6127 static void do_cmd_knowledge_kill_count(void)
6135 char file_name[1024];
6140 /* Open a new file */
6141 fff = my_fopen_temp(file_name, 1024);
6144 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
6149 /* Allocate the "who" array */
6150 C_MAKE(who, max_r_idx, s16b);
6153 /* Monsters slain */
6156 for (kk = 1; kk < max_r_idx; kk++)
6158 monster_race *r_ptr = &r_info[kk];
6160 if (r_ptr->flags1 & (RF1_UNIQUE))
6162 bool dead = (r_ptr->max_num == 0);
6171 s16b This = r_ptr->r_pkills;
6181 fprintf(fff,_("あなたはまだ敵を倒していない。\n\n", "You have defeated no enemies yet.\n\n"));
6184 fprintf(fff,"あなたは%ld体の敵を倒している。\n\n", (long int)Total);
6186 fprintf(fff,"You have defeated %ld %s.\n\n", (long int)Total, (Total == 1) ? "enemy" : "enemies");
6192 /* Scan the monsters */
6193 for (i = 1; i < max_r_idx; i++)
6195 monster_race *r_ptr = &r_info[i];
6197 /* Use that monster */
6198 if (r_ptr->name) who[n++] = i;
6201 /* Select the sort method */
6202 ang_sort_comp = ang_sort_comp_hook;
6203 ang_sort_swap = ang_sort_swap_hook;
6205 /* Sort the array by dungeon depth of monsters */
6206 ang_sort(who, &why, n);
6208 /* Scan the monster races */
6209 for (k = 0; k < n; k++)
6211 monster_race *r_ptr = &r_info[who[k]];
6213 if (r_ptr->flags1 & (RF1_UNIQUE))
6215 bool dead = (r_ptr->max_num == 0);
6219 /* Print a message */
6220 fprintf(fff, " %s\n",
6221 (r_name + r_ptr->name));
6227 s16b This = r_ptr->r_pkills;
6232 /* p,tは人と数える by ita */
6233 if (my_strchr("pt", r_ptr->d_char))
6234 fprintf(fff, " %3d 人の %s\n", This, r_name + r_ptr->name);
6236 fprintf(fff, " %3d 体の %s\n", This, r_name + r_ptr->name);
6240 if (my_strstr(r_name + r_ptr->name, "coins"))
6242 fprintf(fff, " 1 pile of %s\n", (r_name + r_ptr->name));
6246 fprintf(fff, " 1 %s\n", (r_name + r_ptr->name));
6252 strcpy(ToPlural, (r_name + r_ptr->name));
6253 plural_aux(ToPlural);
6254 fprintf(fff, " %d %s\n", This, ToPlural);
6264 fprintf(fff,"----------------------------------------------\n");
6266 fprintf(fff," 合計: %lu 体を倒した。\n", (unsigned long int)Total);
6268 fprintf(fff," Total: %lu creature%s killed.\n",
6269 (unsigned long int)Total, (Total == 1 ? "" : "s"));
6273 /* Free the "who" array */
6274 C_KILL(who, max_r_idx, s16b);
6276 /* Close the file */
6279 /* Display the file contents */
6280 show_file(TRUE, file_name, _("倒した敵の数", "Kill Count"), 0, 0);
6282 /* Remove the file */
6288 * @brief モンスター情報リスト中のグループを表示する /
6289 * Display the object groups.
6293 * @param per_page リストの表示行
6294 * @param grp_idx グループのID配列
6295 * @param group_text グループ名の文字列配列
6296 * @param grp_cur 現在の選択ID
6297 * @param grp_top 現在の選択リスト最上部ID
6300 static void display_group_list(int col, int row, int wid, int per_page,
6301 int grp_idx[], cptr group_text[], int grp_cur, int grp_top)
6305 /* Display lines until done */
6306 for (i = 0; i < per_page && (grp_idx[i] >= 0); i++)
6308 /* Get the group index */
6309 int grp = grp_idx[grp_top + i];
6311 /* Choose a color */
6312 byte attr = (grp_top + i == grp_cur) ? TERM_L_BLUE : TERM_WHITE;
6314 /* Erase the entire line */
6315 Term_erase(col, row + i, wid);
6317 /* Display the group label */
6318 c_put_str(attr, group_text[grp], row + i, col);
6324 * Move the cursor in a browser window
6326 static void browser_cursor(char ch, int *column, int *grp_cur, int grp_cnt,
6327 int *list_cur, int list_cnt)
6332 int list = *list_cur;
6334 /* Extract direction */
6337 /* Hack -- scroll up full screen */
6342 /* Hack -- scroll down full screen */
6347 d = get_keymap_dir(ch);
6352 /* Diagonals - hack */
6353 if ((ddx[d] > 0) && ddy[d])
6359 Term_get_size(&wid, &hgt);
6361 browser_rows = hgt - 8;
6363 /* Browse group list */
6368 /* Move up or down */
6369 grp += ddy[d] * (browser_rows - 1);
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 */
6381 list += ddy[d] * browser_rows;
6384 if (list >= list_cnt) list = list_cnt - 1;
6385 if (list < 0) list = 0;
6397 if (col < 0) col = 0;
6398 if (col > 1) col = 1;
6405 /* Browse group list */
6410 /* Move up or down */
6414 if (grp >= grp_cnt) grp = grp_cnt - 1;
6415 if (grp < 0) grp = 0;
6416 if (grp != old_grp) list = 0;
6419 /* Browse sub-list list */
6422 /* Move up or down */
6426 if (list >= list_cnt) list = list_cnt - 1;
6427 if (list < 0) list = 0;
6438 static void display_visual_list(int col, int row, int height, int width, byte attr_top, byte char_left)
6442 /* Clear the display lines */
6443 for (i = 0; i < height; i++)
6445 Term_erase(col, row + i, width);
6448 /* Bigtile mode uses double width */
6449 if (use_bigtile) width /= 2;
6451 /* Display lines until done */
6452 for (i = 0; i < height; i++)
6454 /* Display columns until done */
6455 for (j = 0; j < width; j++)
6463 /* Bigtile mode uses double width */
6464 if (use_bigtile) x += j;
6469 /* Ignore illegal characters */
6470 if (ia > 0x7f || ic > 0xff || ic < ' ' ||
6471 (!use_graphics && ic > 0x7f))
6477 /* Force correct code for both ASCII character and tile */
6478 if (c & 0x80) a |= 0x80;
6480 /* Display symbol */
6481 Term_queue_bigchar(x, y, a, c, 0, 0);
6488 * Place the cursor at the collect position for visual mode
6490 static void place_visual_list_cursor(int col, int row, byte a, byte c, byte attr_top, byte char_left)
6492 int i = (a & 0x7f) - attr_top;
6493 int j = c - char_left;
6498 /* Bigtile mode uses double width */
6499 if (use_bigtile) x += j;
6501 /* Place the cursor */
6507 * Clipboard variables for copy&paste in visual mode
6509 static byte attr_idx = 0;
6510 static byte char_idx = 0;
6512 /* Hack -- for feature lighting */
6513 static byte attr_idx_feat[F_LIT_MAX];
6514 static byte char_idx_feat[F_LIT_MAX];
6517 * Do visual mode command -- Change symbols
6519 static bool visual_mode_command(char ch, bool *visual_list_ptr,
6520 int height, int width,
6521 byte *attr_top_ptr, byte *char_left_ptr,
6522 byte *cur_attr_ptr, byte *cur_char_ptr, bool *need_redraw)
6524 static byte attr_old = 0, char_old = 0;
6529 if (*visual_list_ptr)
6532 *cur_attr_ptr = attr_old;
6533 *cur_char_ptr = char_old;
6534 *visual_list_ptr = FALSE;
6542 if (*visual_list_ptr)
6545 *visual_list_ptr = FALSE;
6546 *need_redraw = TRUE;
6554 if (!*visual_list_ptr)
6556 *visual_list_ptr = TRUE;
6558 *attr_top_ptr = MAX(0, (*cur_attr_ptr & 0x7f) - 5);
6559 *char_left_ptr = MAX(0, *cur_char_ptr - 10);
6561 attr_old = *cur_attr_ptr;
6562 char_old = *cur_char_ptr;
6573 /* Set the visual */
6574 attr_idx = *cur_attr_ptr;
6575 char_idx = *cur_char_ptr;
6577 /* Hack -- for feature lighting */
6578 for (i = 0; i < F_LIT_MAX; i++)
6580 attr_idx_feat[i] = 0;
6581 char_idx_feat[i] = 0;
6588 if (attr_idx || (!(char_idx & 0x80) && char_idx)) /* Allow TERM_DARK text */
6591 *cur_attr_ptr = attr_idx;
6592 *attr_top_ptr = MAX(0, (*cur_attr_ptr & 0x7f) - 5);
6593 if (!*visual_list_ptr) *need_redraw = TRUE;
6599 *cur_char_ptr = char_idx;
6600 *char_left_ptr = MAX(0, *cur_char_ptr - 10);
6601 if (!*visual_list_ptr) *need_redraw = TRUE;
6607 if (*visual_list_ptr)
6610 int d = get_keymap_dir(ch);
6611 byte a = (*cur_attr_ptr & 0x7f);
6612 byte c = *cur_char_ptr;
6614 if (use_bigtile) eff_width = width / 2;
6615 else eff_width = width;
6617 /* Restrict direction */
6618 if ((a == 0) && (ddy[d] < 0)) d = 0;
6619 if ((c == 0) && (ddx[d] < 0)) d = 0;
6620 if ((a == 0x7f) && (ddy[d] > 0)) d = 0;
6621 if ((c == 0xff) && (ddx[d] > 0)) d = 0;
6626 /* Force correct code for both ASCII character and tile */
6627 if (c & 0x80) a |= 0x80;
6629 /* Set the visual */
6634 /* Move the frame */
6635 if ((ddx[d] < 0) && *char_left_ptr > MAX(0, (int)c - 10)) (*char_left_ptr)--;
6636 if ((ddx[d] > 0) && *char_left_ptr + eff_width < MIN(0xff, (int)c + 10)) (*char_left_ptr)++;
6637 if ((ddy[d] < 0) && *attr_top_ptr > MAX(0, (int)(a & 0x7f) - 4)) (*attr_top_ptr)--;
6638 if ((ddy[d] > 0) && *attr_top_ptr + height < MIN(0x7f, (a & 0x7f) + 4)) (*attr_top_ptr)++;
6644 /* Visual mode command is not used */
6650 * Display the monsters in a group.
6652 static void display_monster_list(int col, int row, int per_page, s16b mon_idx[],
6653 int mon_cur, int mon_top, bool visual_only)
6657 /* Display lines until done */
6658 for (i = 0; i < per_page && (mon_idx[mon_top + i] >= 0); i++)
6662 /* Get the race index */
6663 int r_idx = mon_idx[mon_top + i] ;
6665 /* Access the race */
6666 monster_race *r_ptr = &r_info[r_idx];
6668 /* Choose a color */
6669 attr = ((i + mon_top == mon_cur) ? TERM_L_BLUE : TERM_WHITE);
6671 /* Display the name */
6672 c_prt(attr, (r_name + r_ptr->name), row + i, col);
6674 /* Hack -- visual_list mode */
6677 c_prt(attr, format("%02x/%02x", r_ptr->x_attr, r_ptr->x_char), row + i, (p_ptr->wizard || visual_only) ? 56 : 61);
6679 if (p_ptr->wizard || visual_only)
6681 c_prt(attr, format("%d", r_idx), row + i, 62);
6684 /* Erase chars before overwritten by the race letter */
6685 Term_erase(69, row + i, 255);
6687 /* Display symbol */
6688 Term_queue_bigchar(use_bigtile ? 69 : 70, row + i, r_ptr->x_attr, r_ptr->x_char, 0, 0);
6693 if (!(r_ptr->flags1 & RF1_UNIQUE))
6694 put_str(format("%5d", r_ptr->r_pkills), row + i, 73);
6696 c_put_str((r_ptr->max_num == 0 ? TERM_L_DARK : TERM_WHITE),
6697 (r_ptr->max_num == 0 ? _("死亡", " dead") : _("生存", "alive")), row + i, 74);
6701 /* Clear remaining lines */
6702 for (; i < per_page; i++)
6704 Term_erase(col, row + i, 255);
6710 * Display known monsters.
6712 static void do_cmd_knowledge_monsters(bool *need_redraw, bool visual_only, int direct_r_idx)
6715 int grp_cur, grp_top, old_grp_cur;
6716 int mon_cur, mon_top;
6717 int grp_cnt, grp_idx[100];
6725 bool visual_list = FALSE;
6726 byte attr_top = 0, char_left = 0;
6734 Term_get_size(&wid, &hgt);
6736 browser_rows = hgt - 8;
6738 /* Allocate the "mon_idx" array */
6739 C_MAKE(mon_idx, max_r_idx, s16b);
6744 if (direct_r_idx < 0)
6746 mode = visual_only ? 0x03 : 0x01;
6748 /* Check every group */
6749 for (i = 0; monster_group_text[i] != NULL; i++)
6751 /* Measure the label */
6752 len = strlen(monster_group_text[i]);
6754 /* Save the maximum length */
6755 if (len > max) max = len;
6757 /* See if any monsters are known */
6758 if ((monster_group_char[i] == ((char *) -1L)) || collect_monsters(i, mon_idx, mode))
6760 /* Build a list of groups with known monsters */
6761 grp_idx[grp_cnt++] = i;
6769 mon_idx[0] = direct_r_idx;
6772 /* Terminate the list */
6775 (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
6776 &attr_top, &char_left, &r_info[direct_r_idx].x_attr, &r_info[direct_r_idx].x_char, need_redraw);
6779 /* Terminate the list */
6780 grp_idx[grp_cnt] = -1;
6783 grp_cur = grp_top = 0;
6784 mon_cur = mon_top = 0;
6789 mode = visual_only ? 0x02 : 0x00;
6794 monster_race *r_ptr;
6801 prt(format("%s - モンスター", !visual_only ? "知識" : "表示"), 2, 0);
6802 if (direct_r_idx < 0) prt("グループ", 4, 0);
6803 prt("名前", 4, max + 3);
6804 if (p_ptr->wizard || visual_only) prt("Idx", 4, 62);
6806 if (!visual_only) prt("殺害数", 4, 72);
6808 prt(format("%s - monsters", !visual_only ? "Knowledge" : "Visuals"), 2, 0);
6809 if (direct_r_idx < 0) prt("Group", 4, 0);
6810 prt("Name", 4, max + 3);
6811 if (p_ptr->wizard || visual_only) prt("Idx", 4, 62);
6813 if (!visual_only) prt("Kills", 4, 73);
6816 for (i = 0; i < 78; i++)
6818 Term_putch(i, 5, TERM_WHITE, '=');
6821 if (direct_r_idx < 0)
6823 for (i = 0; i < browser_rows; i++)
6825 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
6832 if (direct_r_idx < 0)
6834 /* Scroll group list */
6835 if (grp_cur < grp_top) grp_top = grp_cur;
6836 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
6838 /* Display a list of monster groups */
6839 display_group_list(0, 6, max, browser_rows, grp_idx, monster_group_text, grp_cur, grp_top);
6841 if (old_grp_cur != grp_cur)
6843 old_grp_cur = grp_cur;
6845 /* Get a list of monsters in the current group */
6846 mon_cnt = collect_monsters(grp_idx[grp_cur], mon_idx, mode);
6849 /* Scroll monster list */
6850 while (mon_cur < mon_top)
6851 mon_top = MAX(0, mon_top - browser_rows/2);
6852 while (mon_cur >= mon_top + browser_rows)
6853 mon_top = MIN(mon_cnt - browser_rows, mon_top + browser_rows/2);
6858 /* Display a list of monsters in the current group */
6859 display_monster_list(max + 3, 6, browser_rows, mon_idx, mon_cur, mon_top, visual_only);
6865 /* Display a monster name */
6866 display_monster_list(max + 3, 6, 1, mon_idx, mon_cur, mon_top, visual_only);
6868 /* Display visual list below first monster */
6869 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
6874 prt(format("<方向>%s%s%s, ESC",
6875 (!visual_list && !visual_only) ? ", 'r'で思い出を見る" : "",
6876 visual_list ? ", ENTERで決定" : ", 'v'でシンボル変更",
6877 (attr_idx || char_idx) ? ", 'c', 'p'でペースト" : ", 'c'でコピー"),
6880 prt(format("<dir>%s%s%s, ESC",
6881 (!visual_list && !visual_only) ? ", 'r' to recall" : "",
6882 visual_list ? ", ENTER to accept" : ", 'v' for visuals",
6883 (attr_idx || char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"),
6887 /* Get the current monster */
6888 r_ptr = &r_info[mon_idx[mon_cur]];
6892 /* Mega Hack -- track this monster race */
6893 if (mon_cnt) monster_race_track(mon_idx[mon_cur]);
6895 /* Hack -- handle stuff */
6901 place_visual_list_cursor(max + 3, 7, r_ptr->x_attr, r_ptr->x_char, attr_top, char_left);
6905 Term_gotoxy(0, 6 + (grp_cur - grp_top));
6909 Term_gotoxy(max + 3, 6 + (mon_cur - mon_top));
6914 /* Do visual mode command if needed */
6915 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))
6917 if (direct_r_idx >= 0)
6942 /* Recall on screen */
6943 if (!visual_list && !visual_only && (mon_idx[mon_cur] > 0))
6945 screen_roff(mon_idx[mon_cur], 0);
6956 /* Move the cursor */
6957 browser_cursor(ch, &column, &grp_cur, grp_cnt, &mon_cur, mon_cnt);
6964 /* Free the "mon_idx" array */
6965 C_KILL(mon_idx, max_r_idx, s16b);
6970 * Display the objects in a group.
6972 static void display_object_list(int col, int row, int per_page, int object_idx[],
6973 int object_cur, int object_top, bool visual_only)
6977 /* Display lines until done */
6978 for (i = 0; i < per_page && (object_idx[object_top + i] >= 0); i++)
6982 object_kind *flavor_k_ptr;
6984 /* Get the object index */
6985 int k_idx = object_idx[object_top + i];
6987 /* Access the object */
6988 object_kind *k_ptr = &k_info[k_idx];
6990 /* Choose a color */
6991 byte attr = ((k_ptr->aware || visual_only) ? TERM_WHITE : TERM_SLATE);
6992 byte cursor = ((k_ptr->aware || visual_only) ? TERM_L_BLUE : TERM_BLUE);
6995 if (!visual_only && k_ptr->flavor)
6997 /* Appearance of this object is shuffled */
6998 flavor_k_ptr = &k_info[k_ptr->flavor];
7002 /* Appearance of this object is very normal */
7003 flavor_k_ptr = k_ptr;
7008 attr = ((i + object_top == object_cur) ? cursor : attr);
7010 if (!k_ptr->flavor || (!visual_only && k_ptr->aware))
7013 strip_name(o_name, k_idx);
7018 strcpy(o_name, k_name + flavor_k_ptr->flavor_name);
7021 /* Display the name */
7022 c_prt(attr, o_name, row + i, col);
7024 /* Hack -- visual_list mode */
7027 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);
7029 if (p_ptr->wizard || visual_only)
7031 c_prt(attr, format("%d", k_idx), row + i, 70);
7034 a = flavor_k_ptr->x_attr;
7035 c = flavor_k_ptr->x_char;
7037 /* Display symbol */
7038 Term_queue_bigchar(use_bigtile ? 76 : 77, row + i, a, c, 0, 0);
7041 /* Clear remaining lines */
7042 for (; i < per_page; i++)
7044 Term_erase(col, row + i, 255);
7049 * Describe fake object
7051 static void desc_obj_fake(int k_idx)
7054 object_type object_type_body;
7056 /* Get local object */
7057 o_ptr = &object_type_body;
7059 /* Wipe the object */
7062 /* Create the artifact */
7063 object_prep(o_ptr, k_idx);
7065 /* It's fully know */
7066 o_ptr->ident |= IDENT_KNOWN;
7068 /* Track the object */
7069 /* object_actual_track(o_ptr); */
7071 /* Hack - mark as fake */
7072 /* term_obj_real = FALSE; */
7074 /* Hack -- Handle stuff */
7077 if (!screen_object(o_ptr, SCROBJ_FAKE_OBJECT | SCROBJ_FORCE_DETAIL))
7079 msg_print(_("特に変わったところはないようだ。", "You see nothing special."));
7087 * Display known objects
7089 static void do_cmd_knowledge_objects(bool *need_redraw, bool visual_only, int direct_k_idx)
7092 int grp_cur, grp_top, old_grp_cur;
7093 int object_old, object_cur, object_top;
7094 int grp_cnt, grp_idx[100];
7102 bool visual_list = FALSE;
7103 byte attr_top = 0, char_left = 0;
7111 Term_get_size(&wid, &hgt);
7113 browser_rows = hgt - 8;
7115 /* Allocate the "object_idx" array */
7116 C_MAKE(object_idx, max_k_idx, int);
7121 if (direct_k_idx < 0)
7123 mode = visual_only ? 0x03 : 0x01;
7125 /* Check every group */
7126 for (i = 0; object_group_text[i] != NULL; i++)
7128 /* Measure the label */
7129 len = strlen(object_group_text[i]);
7131 /* Save the maximum length */
7132 if (len > max) max = len;
7134 /* See if any monsters are known */
7135 if (collect_objects(i, object_idx, mode))
7137 /* Build a list of groups with known monsters */
7138 grp_idx[grp_cnt++] = i;
7147 object_kind *k_ptr = &k_info[direct_k_idx];
7148 object_kind *flavor_k_ptr;
7150 if (!visual_only && k_ptr->flavor)
7152 /* Appearance of this object is shuffled */
7153 flavor_k_ptr = &k_info[k_ptr->flavor];
7157 /* Appearance of this object is very normal */
7158 flavor_k_ptr = k_ptr;
7161 object_idx[0] = direct_k_idx;
7162 object_old = direct_k_idx;
7165 /* Terminate the list */
7168 (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
7169 &attr_top, &char_left, &flavor_k_ptr->x_attr, &flavor_k_ptr->x_char, need_redraw);
7172 /* Terminate the list */
7173 grp_idx[grp_cnt] = -1;
7176 grp_cur = grp_top = 0;
7177 object_cur = object_top = 0;
7182 mode = visual_only ? 0x02 : 0x00;
7187 object_kind *k_ptr, *flavor_k_ptr;
7194 prt(format("%s - アイテム", !visual_only ? "知識" : "表示"), 2, 0);
7195 if (direct_k_idx < 0) prt("グループ", 4, 0);
7196 prt("名前", 4, max + 3);
7197 if (p_ptr->wizard || visual_only) prt("Idx", 4, 70);
7200 prt(format("%s - objects", !visual_only ? "Knowledge" : "Visuals"), 2, 0);
7201 if (direct_k_idx < 0) prt("Group", 4, 0);
7202 prt("Name", 4, max + 3);
7203 if (p_ptr->wizard || visual_only) prt("Idx", 4, 70);
7207 for (i = 0; i < 78; i++)
7209 Term_putch(i, 5, TERM_WHITE, '=');
7212 if (direct_k_idx < 0)
7214 for (i = 0; i < browser_rows; i++)
7216 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
7223 if (direct_k_idx < 0)
7225 /* Scroll group list */
7226 if (grp_cur < grp_top) grp_top = grp_cur;
7227 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
7229 /* Display a list of object groups */
7230 display_group_list(0, 6, max, browser_rows, grp_idx, object_group_text, grp_cur, grp_top);
7232 if (old_grp_cur != grp_cur)
7234 old_grp_cur = grp_cur;
7236 /* Get a list of objects in the current group */
7237 object_cnt = collect_objects(grp_idx[grp_cur], object_idx, mode);
7240 /* Scroll object list */
7241 while (object_cur < object_top)
7242 object_top = MAX(0, object_top - browser_rows/2);
7243 while (object_cur >= object_top + browser_rows)
7244 object_top = MIN(object_cnt - browser_rows, object_top + browser_rows/2);
7249 /* Display a list of objects in the current group */
7250 display_object_list(max + 3, 6, browser_rows, object_idx, object_cur, object_top, visual_only);
7254 object_top = object_cur;
7256 /* Display a list of objects in the current group */
7257 display_object_list(max + 3, 6, 1, object_idx, object_cur, object_top, visual_only);
7259 /* Display visual list below first object */
7260 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
7263 /* Get the current object */
7264 k_ptr = &k_info[object_idx[object_cur]];
7266 if (!visual_only && k_ptr->flavor)
7268 /* Appearance of this object is shuffled */
7269 flavor_k_ptr = &k_info[k_ptr->flavor];
7273 /* Appearance of this object is very normal */
7274 flavor_k_ptr = k_ptr;
7279 prt(format("<方向>%s%s%s, ESC",
7280 (!visual_list && !visual_only) ? ", 'r'で詳細を見る" : "",
7281 visual_list ? ", ENTERで決定" : ", 'v'でシンボル変更",
7282 (attr_idx || char_idx) ? ", 'c', 'p'でペースト" : ", 'c'でコピー"),
7285 prt(format("<dir>%s%s%s, ESC",
7286 (!visual_list && !visual_only) ? ", 'r' to recall" : "",
7287 visual_list ? ", ENTER to accept" : ", 'v' for visuals",
7288 (attr_idx || char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"),
7294 /* Mega Hack -- track this object */
7295 if (object_cnt) object_kind_track(object_idx[object_cur]);
7297 /* The "current" object changed */
7298 if (object_old != object_idx[object_cur])
7300 /* Hack -- handle stuff */
7303 /* Remember the "current" object */
7304 object_old = object_idx[object_cur];
7310 place_visual_list_cursor(max + 3, 7, flavor_k_ptr->x_attr, flavor_k_ptr->x_char, attr_top, char_left);
7314 Term_gotoxy(0, 6 + (grp_cur - grp_top));
7318 Term_gotoxy(max + 3, 6 + (object_cur - object_top));
7323 /* Do visual mode command if needed */
7324 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))
7326 if (direct_k_idx >= 0)
7351 /* Recall on screen */
7352 if (!visual_list && !visual_only && (grp_cnt > 0))
7354 desc_obj_fake(object_idx[object_cur]);
7362 /* Move the cursor */
7363 browser_cursor(ch, &column, &grp_cur, grp_cnt, &object_cur, object_cnt);
7369 /* Free the "object_idx" array */
7370 C_KILL(object_idx, max_k_idx, int);
7375 * Display the features in a group.
7377 static void display_feature_list(int col, int row, int per_page, int *feat_idx,
7378 int feat_cur, int feat_top, bool visual_only, int lighting_level)
7380 int lit_col[F_LIT_MAX], i, j;
7381 int f_idx_col = use_bigtile ? 62 : 64;
7383 /* Correct columns 1 and 4 */
7384 lit_col[F_LIT_STANDARD] = use_bigtile ? (71 - F_LIT_MAX) : 71;
7385 for (i = F_LIT_NS_BEGIN; i < F_LIT_MAX; i++)
7386 lit_col[i] = lit_col[F_LIT_STANDARD] + 2 + (i - F_LIT_NS_BEGIN) * 2 + (use_bigtile ? i : 0);
7388 /* Display lines until done */
7389 for (i = 0; i < per_page && (feat_idx[feat_top + i] >= 0); i++)
7394 int f_idx = feat_idx[feat_top + i];
7396 /* Access the index */
7397 feature_type *f_ptr = &f_info[f_idx];
7399 int row_i = row + i;
7401 /* Choose a color */
7402 attr = ((i + feat_top == feat_cur) ? TERM_L_BLUE : TERM_WHITE);
7404 /* Display the name */
7405 c_prt(attr, f_name + f_ptr->name, row_i, col);
7407 /* Hack -- visual_list mode */
7410 /* Display lighting level */
7411 c_prt(attr, format("(%s)", lighting_level_str[lighting_level]), row_i, col + 1 + strlen(f_name + f_ptr->name));
7413 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));
7415 if (p_ptr->wizard || visual_only)
7417 c_prt(attr, format("%d", f_idx), row_i, f_idx_col);
7420 /* Display symbol */
7421 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);
7423 Term_putch(lit_col[F_LIT_NS_BEGIN], row_i, TERM_SLATE, '(');
7424 for (j = F_LIT_NS_BEGIN + 1; j < F_LIT_MAX; j++)
7426 Term_putch(lit_col[j], row_i, TERM_SLATE, '/');
7428 Term_putch(lit_col[F_LIT_MAX - 1] + (use_bigtile ? 3 : 2), row_i, TERM_SLATE, ')');
7430 /* Mega-hack -- Use non-standard colour */
7431 for (j = F_LIT_NS_BEGIN; j < F_LIT_MAX; j++)
7433 Term_queue_bigchar(lit_col[j] + 1, row_i, f_ptr->x_attr[j], f_ptr->x_char[j], 0, 0);
7437 /* Clear remaining lines */
7438 for (; i < per_page; i++)
7440 Term_erase(col, row + i, 255);
7446 * Interact with feature visuals.
7448 static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, int direct_f_idx, int *lighting_level)
7451 int grp_cur, grp_top, old_grp_cur;
7452 int feat_cur, feat_top;
7453 int grp_cnt, grp_idx[100];
7461 bool visual_list = FALSE;
7462 byte attr_top = 0, char_left = 0;
7467 byte attr_old[F_LIT_MAX];
7468 byte char_old[F_LIT_MAX];
7469 byte *cur_attr_ptr, *cur_char_ptr;
7471 (void)C_WIPE(attr_old, F_LIT_MAX, byte);
7472 (void)C_WIPE(char_old, F_LIT_MAX, byte);
7475 Term_get_size(&wid, &hgt);
7477 browser_rows = hgt - 8;
7479 /* Allocate the "feat_idx" array */
7480 C_MAKE(feat_idx, max_f_idx, int);
7485 if (direct_f_idx < 0)
7487 /* Check every group */
7488 for (i = 0; feature_group_text[i] != NULL; i++)
7490 /* Measure the label */
7491 len = strlen(feature_group_text[i]);
7493 /* Save the maximum length */
7494 if (len > max) max = len;
7496 /* See if any features are known */
7497 if (collect_features(i, feat_idx, 0x01))
7499 /* Build a list of groups with known features */
7500 grp_idx[grp_cnt++] = i;
7508 feature_type *f_ptr = &f_info[direct_f_idx];
7510 feat_idx[0] = direct_f_idx;
7513 /* Terminate the list */
7516 (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
7517 &attr_top, &char_left, &f_ptr->x_attr[*lighting_level], &f_ptr->x_char[*lighting_level], need_redraw);
7519 for (i = 0; i < F_LIT_MAX; i++)
7521 attr_old[i] = f_ptr->x_attr[i];
7522 char_old[i] = f_ptr->x_char[i];
7526 /* Terminate the list */
7527 grp_idx[grp_cnt] = -1;
7530 grp_cur = grp_top = 0;
7531 feat_cur = feat_top = 0;
7539 feature_type *f_ptr;
7546 prt("表示 - 地形", 2, 0);
7547 if (direct_f_idx < 0) prt("グループ", 4, 0);
7548 prt("名前", 4, max + 3);
7551 if (p_ptr->wizard || visual_only) prt("Idx", 4, 62);
7552 prt("文字 ( l/ d)", 4, 66);
7556 if (p_ptr->wizard || visual_only) prt("Idx", 4, 64);
7557 prt("文字 (l/d)", 4, 68);
7560 prt("Visuals - features", 2, 0);
7561 if (direct_f_idx < 0) prt("Group", 4, 0);
7562 prt("Name", 4, max + 3);
7565 if (p_ptr->wizard || visual_only) prt("Idx", 4, 62);
7566 prt("Sym ( l/ d)", 4, 67);
7570 if (p_ptr->wizard || visual_only) prt("Idx", 4, 64);
7571 prt("Sym (l/d)", 4, 69);
7575 for (i = 0; i < 78; i++)
7577 Term_putch(i, 5, TERM_WHITE, '=');
7580 if (direct_f_idx < 0)
7582 for (i = 0; i < browser_rows; i++)
7584 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
7591 if (direct_f_idx < 0)
7593 /* Scroll group list */
7594 if (grp_cur < grp_top) grp_top = grp_cur;
7595 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
7597 /* Display a list of feature groups */
7598 display_group_list(0, 6, max, browser_rows, grp_idx, feature_group_text, grp_cur, grp_top);
7600 if (old_grp_cur != grp_cur)
7602 old_grp_cur = grp_cur;
7604 /* Get a list of features in the current group */
7605 feat_cnt = collect_features(grp_idx[grp_cur], feat_idx, 0x00);
7608 /* Scroll feature list */
7609 while (feat_cur < feat_top)
7610 feat_top = MAX(0, feat_top - browser_rows/2);
7611 while (feat_cur >= feat_top + browser_rows)
7612 feat_top = MIN(feat_cnt - browser_rows, feat_top + browser_rows/2);
7617 /* Display a list of features in the current group */
7618 display_feature_list(max + 3, 6, browser_rows, feat_idx, feat_cur, feat_top, visual_only, F_LIT_STANDARD);
7622 feat_top = feat_cur;
7624 /* Display a list of features in the current group */
7625 display_feature_list(max + 3, 6, 1, feat_idx, feat_cur, feat_top, visual_only, *lighting_level);
7627 /* Display visual list below first object */
7628 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
7633 prt(format("<方向>%s, 'd'で標準光源効果%s, ESC",
7634 visual_list ? ", ENTERで決定, 'a'で対象明度変更" : ", 'v'でシンボル変更",
7635 (attr_idx || char_idx) ? ", 'c', 'p'でペースト" : ", 'c'でコピー"),
7638 prt(format("<dir>%s, 'd' for default lighting%s, ESC",
7639 visual_list ? ", ENTER to accept, 'a' for lighting level" : ", 'v' for visuals",
7640 (attr_idx || char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"),
7644 /* Get the current feature */
7645 f_ptr = &f_info[feat_idx[feat_cur]];
7646 cur_attr_ptr = &f_ptr->x_attr[*lighting_level];
7647 cur_char_ptr = &f_ptr->x_char[*lighting_level];
7651 place_visual_list_cursor(max + 3, 7, *cur_attr_ptr, *cur_char_ptr, attr_top, char_left);
7655 Term_gotoxy(0, 6 + (grp_cur - grp_top));
7659 Term_gotoxy(max + 3, 6 + (feat_cur - feat_top));
7664 if (visual_list && ((ch == 'A') || (ch == 'a')))
7666 int prev_lighting_level = *lighting_level;
7670 if (*lighting_level <= 0) *lighting_level = F_LIT_MAX - 1;
7671 else (*lighting_level)--;
7675 if (*lighting_level >= F_LIT_MAX - 1) *lighting_level = 0;
7676 else (*lighting_level)++;
7679 if (f_ptr->x_attr[prev_lighting_level] != f_ptr->x_attr[*lighting_level])
7680 attr_top = MAX(0, (f_ptr->x_attr[*lighting_level] & 0x7f) - 5);
7682 if (f_ptr->x_char[prev_lighting_level] != f_ptr->x_char[*lighting_level])
7683 char_left = MAX(0, f_ptr->x_char[*lighting_level] - 10);
7688 else if ((ch == 'D') || (ch == 'd'))
7690 byte prev_x_attr = f_ptr->x_attr[*lighting_level];
7691 byte prev_x_char = f_ptr->x_char[*lighting_level];
7693 apply_default_feat_lighting(f_ptr->x_attr, f_ptr->x_char);
7697 if (prev_x_attr != f_ptr->x_attr[*lighting_level])
7698 attr_top = MAX(0, (f_ptr->x_attr[*lighting_level] & 0x7f) - 5);
7700 if (prev_x_char != f_ptr->x_char[*lighting_level])
7701 char_left = MAX(0, f_ptr->x_char[*lighting_level] - 10);
7703 else *need_redraw = TRUE;
7708 /* Do visual mode command if needed */
7709 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))
7713 /* Restore previous visual settings */
7715 for (i = 0; i < F_LIT_MAX; i++)
7717 f_ptr->x_attr[i] = attr_old[i];
7718 f_ptr->x_char[i] = char_old[i];
7725 if (direct_f_idx >= 0) flag = TRUE;
7726 else *lighting_level = F_LIT_STANDARD;
7729 /* Preserve current visual settings */
7732 for (i = 0; i < F_LIT_MAX; i++)
7734 attr_old[i] = f_ptr->x_attr[i];
7735 char_old[i] = f_ptr->x_char[i];
7737 *lighting_level = F_LIT_STANDARD;
7744 for (i = 0; i < F_LIT_MAX; i++)
7746 attr_idx_feat[i] = f_ptr->x_attr[i];
7747 char_idx_feat[i] = f_ptr->x_char[i];
7756 /* Allow TERM_DARK text */
7757 for (i = F_LIT_NS_BEGIN; i < F_LIT_MAX; i++)
7759 if (attr_idx_feat[i] || (!(char_idx_feat[i] & 0x80) && char_idx_feat[i])) f_ptr->x_attr[i] = attr_idx_feat[i];
7760 if (char_idx_feat[i]) f_ptr->x_char[i] = char_idx_feat[i];
7778 /* Move the cursor */
7779 browser_cursor(ch, &column, &grp_cur, grp_cnt, &feat_cur, feat_cnt);
7785 /* Free the "feat_idx" array */
7786 C_KILL(feat_idx, max_f_idx, int);
7791 * List wanted monsters
7793 static void do_cmd_knowledge_kubi(void)
7798 char file_name[1024];
7801 /* Open a new file */
7802 fff = my_fopen_temp(file_name, 1024);
7804 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
7811 bool listed = FALSE;
7814 fprintf(fff, "今日のターゲット : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "不明"));
7816 fprintf(fff, "賞金首リスト\n");
7818 fprintf(fff, "Today target : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "unknown"));
7820 fprintf(fff, "List of wanted monsters\n");
7822 fprintf(fff, "----------------------------------------------\n");
7824 for (i = 0; i < MAX_KUBI; i++)
7826 if (kubi_r_idx[i] <= 10000)
7828 fprintf(fff,"%s\n", r_name + r_info[kubi_r_idx[i]].name);
7836 fprintf(fff,"\n%s\n", _("賞金首はもう残っていません。", "There is no more wanted monster."));
7840 /* Close the file */
7843 /* Display the file contents */
7844 show_file(TRUE, file_name, _("賞金首の一覧", "Wanted monsters"), 0, 0);
7846 /* Remove the file */
7851 * List virtues & status
7853 static void do_cmd_knowledge_virtues(void)
7857 char file_name[1024];
7860 /* Open a new file */
7861 fff = my_fopen_temp(file_name, 1024);
7863 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
7870 fprintf(fff, _("現在の属性 : %s\n\n", "Your alighnment : %s\n\n"), your_alignment());
7874 /* Close the file */
7877 /* Display the file contents */
7878 show_file(TRUE, file_name, _("八つの徳", "Virtues"), 0, 0);
7880 /* Remove the file */
7888 static void do_cmd_knowledge_dungeon(void)
7892 char file_name[1024];
7896 /* Open a new file */
7897 fff = my_fopen_temp(file_name, 1024);
7899 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
7906 for (i = 1; i < max_d_idx; i++)
7910 if (!d_info[i].maxdepth) continue;
7911 if (!max_dlv[i]) continue;
7912 if (d_info[i].final_guardian)
7914 if (!r_info[d_info[i].final_guardian].max_num) seiha = TRUE;
7916 else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
7918 fprintf(fff, _("%c%-12s : %3d 階\n", "%c%-16s : level %3d\n"), seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
7922 /* Close the file */
7925 /* Display the file contents */
7926 show_file(TRUE, file_name, _("今までに入ったダンジョン", "Dungeon"), 0, 0);
7928 /* Remove the file */
7933 * List virtues & status
7936 static void do_cmd_knowledge_stat(void)
7940 char file_name[1024];
7943 /* Open a new file */
7944 fff = my_fopen_temp(file_name, 1024);
7946 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
7953 percent = (int)(((long)p_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
7954 (2 * p_ptr->hitdie +
7955 ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
7958 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "現在の体力ランク : %d/100\n\n", percent);
7959 else fprintf(fff, "現在の体力ランク : ???\n\n");
7960 fprintf(fff, "能力の最大値\n\n");
7962 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "Your current Life Rating is %d/100.\n\n", percent);
7963 else fprintf(fff, "Your current Life Rating is ???.\n\n");
7964 fprintf(fff, "Limits of maximum stats\n\n");
7966 for (v_nr = 0; v_nr < 6; v_nr++)
7968 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);
7969 else fprintf(fff, "%s ???\n", stat_names[v_nr]);
7975 /* Close the file */
7978 /* Display the file contents */
7979 show_file(TRUE, file_name, _("自分に関する情報", "HP-rate & Max stat"), 0, 0);
7981 /* Remove the file */
7987 * Print all active quests
7989 static void do_cmd_knowledge_quests_current(FILE *fff)
7992 char rand_tmp_str[120] = "\0";
7994 monster_race *r_ptr;
7996 int rand_level = 100;
7999 fprintf(fff, _("《遂行中のクエスト》\n", "< Current Quest >\n"));
8001 for (i = 1; i < max_quests; i++)
8003 if ((quest[i].status == QUEST_STATUS_TAKEN) ||
8004 ((quest[i].status == QUEST_STATUS_STAGE_COMPLETED) && (quest[i].type == QUEST_TYPE_TOWER)) ||
8005 (quest[i].status == QUEST_STATUS_COMPLETED))
8007 /* Set the quest number temporary */
8008 int old_quest = p_ptr->inside_quest;
8011 /* Clear the text */
8012 for (j = 0; j < 10; j++) quest_text[j][0] = '\0';
8013 quest_text_line = 0;
8015 p_ptr->inside_quest = i;
8017 /* Get the quest text */
8018 init_flags = INIT_SHOW_TEXT;
8020 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
8022 /* Reset the old quest number */
8023 p_ptr->inside_quest = old_quest;
8025 /* No info from "silent" quests */
8026 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
8030 if (quest[i].type != QUEST_TYPE_RANDOM)
8032 char note[80] = "\0";
8034 if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_STAGE_COMPLETED)
8036 switch (quest[i].type)
8038 case QUEST_TYPE_KILL_LEVEL:
8039 case QUEST_TYPE_KILL_ANY_LEVEL:
8040 r_ptr = &r_info[quest[i].r_idx];
8041 strcpy(name, r_name + r_ptr->name);
8042 if (quest[i].max_num > 1)
8045 sprintf(note," - %d 体の%sを倒す。(あと %d 体)",
8046 quest[i].max_num, name, quest[i].max_num - quest[i].cur_num);
8049 sprintf(note," - kill %d %s, have killed %d.",
8050 quest[i].max_num, name, quest[i].cur_num);
8054 sprintf(note,_(" - %sを倒す。", " - kill %s."),name);
8057 case QUEST_TYPE_FIND_ARTIFACT:
8060 artifact_type *a_ptr = &a_info[quest[i].k_idx];
8062 object_type *q_ptr = &forge;
8063 int k_idx = lookup_kind(a_ptr->tval, a_ptr->sval);
8064 object_prep(q_ptr, k_idx);
8065 q_ptr->name1 = quest[i].k_idx;
8066 q_ptr->ident = IDENT_STORE;
8067 object_desc(name, q_ptr, OD_NAME_ONLY);
8069 sprintf(note,_("\n - %sを見つけ出す。", "\n - Find out %s."), name);
8071 case QUEST_TYPE_FIND_EXIT:
8072 sprintf(note,_(" - 出口に到達する。", " - Reach to Exit."));
8075 case QUEST_TYPE_KILL_NUMBER:
8077 sprintf(note," - %d 体のモンスターを倒す。(あと %d 体)",
8078 quest[i].max_num, quest[i].max_num - quest[i].cur_num);
8080 sprintf(note," - Kill %d monsters, have killed %d.",
8081 quest[i].max_num, quest[i].cur_num);
8085 case QUEST_TYPE_KILL_ALL:
8086 case QUEST_TYPE_TOWER:
8087 sprintf(note,_(" - 全てのモンスターを倒す。", " - Kill all monsters."));
8092 /* Print the quest info */
8094 sprintf(tmp_str, " %s (危険度:%d階相当)%s\n",
8095 quest[i].name, quest[i].level, note);
8097 sprintf(tmp_str, " %s (Danger level: %d)%s\n",
8098 quest[i].name, quest[i].level, note);
8101 fputs(tmp_str, fff);
8103 if (quest[i].status == QUEST_STATUS_COMPLETED)
8105 sprintf(tmp_str, _(" クエスト達成 - まだ報酬を受けとってない。\n", " Quest Completed - Unrewarded\n"));
8106 fputs(tmp_str, fff);
8112 while (quest_text[j][0] && j < 10)
8114 fprintf(fff, " %s\n", quest_text[j]);
8119 else if (quest[i].level < rand_level) /* QUEST_TYPE_RANDOM */
8122 rand_level = quest[i].level;
8124 if (max_dlv[DUNGEON_ANGBAND] >= rand_level)
8126 /* Print the quest info */
8127 r_ptr = &r_info[quest[i].r_idx];
8128 strcpy(name, r_name + r_ptr->name);
8130 if (quest[i].max_num > 1)
8133 sprintf(rand_tmp_str," %s (%d 階) - %d 体の%sを倒す。(あと %d 体)\n",
8134 quest[i].name, quest[i].level,
8135 quest[i].max_num, name, quest[i].max_num - quest[i].cur_num);
8139 sprintf(rand_tmp_str," %s (Dungeon level: %d)\n Kill %d %s, have killed %d.\n",
8140 quest[i].name, quest[i].level,
8141 quest[i].max_num, name, quest[i].cur_num);
8147 sprintf(rand_tmp_str," %s (%d 階) - %sを倒す。\n",
8148 quest[i].name, quest[i].level, name);
8150 sprintf(rand_tmp_str," %s (Dungeon level: %d)\n Kill %s.\n",
8151 quest[i].name, quest[i].level, name);
8159 /* Print the current random quest */
8160 if (rand_tmp_str[0]) fputs(rand_tmp_str, fff);
8162 if (!total) fprintf(fff, _(" なし\n", " Nothing.\n"));
8166 static bool do_cmd_knowledge_quests_aux(FILE *fff, IDX q_idx)
8169 char playtime_str[16];
8170 quest_type* const q_ptr = &quest[q_idx];
8172 if (is_fixed_quest_idx(q_idx))
8174 /* Set the quest number temporary */
8175 int old_quest = p_ptr->inside_quest;
8177 p_ptr->inside_quest = q_idx;
8180 init_flags = INIT_NAME_ONLY;
8182 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
8184 /* Reset the old quest number */
8185 p_ptr->inside_quest = old_quest;
8187 /* No info from "silent" quests */
8188 if (q_ptr->flags & QUEST_FLAG_SILENT) return FALSE;
8191 strnfmt(playtime_str, sizeof(playtime_str), "%02d:%02d:%02d",
8192 q_ptr->comptime/(60*60), (q_ptr->comptime/60)%60, q_ptr->comptime%60);
8194 if (!is_fixed_quest_idx(q_idx) && q_ptr->r_idx)
8196 /* Print the quest info */
8197 if (q_ptr->complev == 0)
8200 _(" %-35s (%3d階) - 不戦勝 - %s\n",
8201 " %-35s (Dungeon level: %3d) - Unearned - %s\n") ,
8202 r_name+r_info[q_ptr->r_idx].name,
8203 q_ptr->level, playtime_str);
8208 _(" %-35s (%3d階) - レベル%2d - %s\n",
8209 " %-35s (Dungeon level: %3d) - level %2d - %s\n") ,
8210 r_name+r_info[q_ptr->r_idx].name,
8218 /* Print the quest info */
8220 _(" %-35s (危険度:%3d階相当) - レベル%2d - %s\n",
8221 " %-35s (Danger level: %3d) - level %2d - %s\n") ,
8222 q_ptr->name, q_ptr->level, q_ptr->complev, playtime_str);
8225 fputs(tmp_str, fff);
8231 * Print all finished quests
8233 void do_cmd_knowledge_quests_completed(FILE *fff, int quest_num[])
8238 fprintf(fff, _("《達成したクエスト》\n", "< Completed Quest >\n"));
8239 for (i = 1; i < max_quests; i++)
8241 int q_idx = quest_num[i];
8242 quest_type* const q_ptr = &quest[q_idx];
8244 if (q_ptr->status == QUEST_STATUS_FINISHED &&
8245 do_cmd_knowledge_quests_aux(fff, q_idx))
8250 if (!total) fprintf(fff, _(" なし\n", " Nothing.\n"));
8255 * Print all failed quests
8257 void do_cmd_knowledge_quests_failed(FILE *fff, int quest_num[])
8262 fprintf(fff, _("《失敗したクエスト》\n", "< Failed Quest >\n"));
8263 for (i = 1; i < max_quests; i++)
8265 int q_idx = quest_num[i];
8266 quest_type* const q_ptr = &quest[q_idx];
8268 if (((q_ptr->status == QUEST_STATUS_FAILED_DONE) || (q_ptr->status == QUEST_STATUS_FAILED)) &&
8269 do_cmd_knowledge_quests_aux(fff, q_idx))
8274 if (!total) fprintf(fff, _(" なし\n", " Nothing.\n"));
8279 * Print all random quests
8281 static void do_cmd_knowledge_quests_wiz_random(FILE *fff)
8287 fprintf(fff, _("《残りのランダムクエスト》\n", "< Remaining Random Quest >\n"));
8288 for (i = 1; i < max_quests; i++)
8290 /* No info from "silent" quests */
8291 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
8293 if ((quest[i].type == QUEST_TYPE_RANDOM) && (quest[i].status == QUEST_STATUS_TAKEN))
8297 /* Print the quest info */
8299 sprintf(tmp_str, " %s (%d階, %s)\n",
8300 quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
8302 sprintf(tmp_str, " %s (%d, %s)\n",
8303 quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
8305 fputs(tmp_str, fff);
8308 if (!total) fprintf(fff, _(" なし\n", " Nothing.\n"));
8312 bool ang_sort_comp_quest_num(vptr u, vptr v, int a, int b)
8314 int *q_num = (int *)u;
8315 quest_type *qa = &quest[q_num[a]];
8316 quest_type *qb = &quest[q_num[b]];
8321 return (qa->comptime <= qb->comptime);
8324 void ang_sort_swap_quest_num(vptr u, vptr v, int a, int b)
8326 int *q_num = (int *)u;
8333 q_num[a] = q_num[b];
8339 * Print quest status of all active quests
8341 static void do_cmd_knowledge_quests(void)
8344 char file_name[1024];
8345 int *quest_num, dummy, i;
8347 /* Open a new file */
8348 fff = my_fopen_temp(file_name, 1024);
8351 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
8356 /* Allocate Memory */
8357 C_MAKE(quest_num, max_quests, int);
8359 /* Sort by compete level */
8360 for (i = 1; i < max_quests; i++) quest_num[i] = i;
8361 ang_sort_comp = ang_sort_comp_quest_num;
8362 ang_sort_swap = ang_sort_swap_quest_num;
8363 ang_sort(quest_num, &dummy, max_quests);
8365 /* Dump Quest Information */
8366 do_cmd_knowledge_quests_current(fff);
8368 do_cmd_knowledge_quests_completed(fff, quest_num);
8370 do_cmd_knowledge_quests_failed(fff, quest_num);
8374 do_cmd_knowledge_quests_wiz_random(fff);
8377 /* Close the file */
8380 /* Display the file contents */
8381 show_file(TRUE, file_name, _("クエスト達成状況", "Quest status"), 0, 0);
8383 /* Remove the file */
8387 C_KILL(quest_num, max_quests, int);
8394 static void do_cmd_knowledge_home(void)
8399 char file_name[1024];
8401 char o_name[MAX_NLEN];
8404 process_dungeon_file("w_info.txt", 0, 0, max_wild_y, max_wild_x);
8406 /* Open a new file */
8407 fff = my_fopen_temp(file_name, 1024);
8409 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
8416 /* Print all homes in the different towns */
8417 st_ptr = &town[1].store[STORE_HOME];
8419 /* Home -- if anything there */
8420 if (st_ptr->stock_num)
8425 /* Header with name of the town */
8426 fprintf(fff, _(" [ 我が家のアイテム ]\n", " [Home Inventory]\n"));
8428 /* Dump all available items */
8429 for (i = 0; i < st_ptr->stock_num; i++)
8432 if ((i % 12) == 0) fprintf(fff, "\n ( %d ページ )\n", x++);
8433 object_desc(o_name, &st_ptr->stock[i], 0);
8434 if (strlen(o_name) <= 80-3)
8436 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
8442 for (n = 0, t = o_name; n < 80-3; n++, t++)
8443 if(iskanji(*t)) {t++; n++;}
8444 if (n == 81-3) n = 79-3; /* 最後が漢字半分 */
8446 fprintf(fff, "%c%s %.*s\n", I2A(i%12), paren, n, o_name);
8447 fprintf(fff, " %.77s\n", o_name+n);
8450 object_desc(o_name, &st_ptr->stock[i], 0);
8451 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
8456 /* Add an empty line */
8457 fprintf(fff, "\n\n");
8461 /* Close the file */
8464 /* Display the file contents */
8465 show_file(TRUE, file_name, _("我が家のアイテム", "Home Inventory"), 0, 0);
8467 /* Remove the file */
8473 * Check the status of "autopick"
8475 static void do_cmd_knowledge_autopick(void)
8479 char file_name[1024];
8481 /* Open a new file */
8482 fff = my_fopen_temp(file_name, 1024);
8486 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
8493 fprintf(fff, _("自動破壊/拾いには何も登録されていません。", "No preference for auto picker/destroyer."));
8497 fprintf(fff, _(" 自動拾い/破壊には現在 %d行登録されています。\n\n",
8498 " There are %d registered lines for auto picker/destroyer.\n\n"), max_autopick);
8501 for (k = 0; k < max_autopick; k++)
8504 byte act = autopick_list[k].action;
8505 if (act & DONT_AUTOPICK)
8507 tmp = _("放置", "Leave");
8509 else if (act & DO_AUTODESTROY)
8511 tmp = _("破壊", "Destroy");
8513 else if (act & DO_AUTOPICK)
8515 tmp = _("拾う", "Pickup");
8517 else /* if (act & DO_QUERY_AUTOPICK) */ /* Obvious */
8519 tmp = _("確認", "Query");
8522 if (act & DO_DISPLAY)
8523 fprintf(fff, "%11s", format("[%s]", tmp));
8525 fprintf(fff, "%11s", format("(%s)", tmp));
8527 tmp = autopick_line_from_entry(&autopick_list[k]);
8528 fprintf(fff, " %s", tmp);
8532 /* Close the file */
8534 /* Display the file contents */
8535 show_file(TRUE, file_name, _("自動拾い/破壊 設定リスト", "Auto-picker/Destroyer"), 0, 0);
8537 /* Remove the file */
8543 * Interact with "knowledge"
8545 void do_cmd_knowledge(void)
8548 bool need_redraw = FALSE;
8550 /* File type is "TEXT" */
8551 FILE_TYPE(FILE_TYPE_TEXT);
8553 /* Save the screen */
8556 /* Interact until done */
8562 /* Ask for a choice */
8564 prt(format("%d/2 ページ", (p+1)), 2, 65);
8565 prt("現在の知識を確認する", 3, 0);
8567 prt(format("page %d/2", (p+1)), 2, 65);
8568 prt("Display current knowledge", 3, 0);
8571 /* Give some choices */
8575 prt("(1) 既知の伝説のアイテム の一覧", 6, 5);
8576 prt("(2) 既知のアイテム の一覧", 7, 5);
8577 prt("(3) 既知の生きているユニーク・モンスター の一覧", 8, 5);
8578 prt("(4) 既知のモンスター の一覧", 9, 5);
8579 prt("(5) 倒した敵の数 の一覧", 10, 5);
8580 if (!vanilla_town) prt("(6) 賞金首 の一覧", 11, 5);
8581 prt("(7) 現在のペット の一覧", 12, 5);
8582 prt("(8) 我が家のアイテム の一覧", 13, 5);
8583 prt("(9) *鑑定*済み装備の耐性 の一覧", 14, 5);
8584 prt("(0) 地形の表示文字/タイル の一覧", 15, 5);
8588 prt("(a) 自分に関する情報 の一覧", 6, 5);
8589 prt("(b) 突然変異 の一覧", 7, 5);
8590 prt("(c) 武器の経験値 の一覧", 8, 5);
8591 prt("(d) 魔法の経験値 の一覧", 9, 5);
8592 prt("(e) 技能の経験値 の一覧", 10, 5);
8593 prt("(f) プレイヤーの徳 の一覧", 11, 5);
8594 prt("(g) 入ったダンジョン の一覧", 12, 5);
8595 prt("(h) 実行中のクエスト の一覧", 13, 5);
8596 prt("(i) 現在の自動拾い/破壊設定 の一覧", 14, 5);
8601 prt("(1) Display known artifacts", 6, 5);
8602 prt("(2) Display known objects", 7, 5);
8603 prt("(3) Display remaining uniques", 8, 5);
8604 prt("(4) Display known monster", 9, 5);
8605 prt("(5) Display kill count", 10, 5);
8606 if (!vanilla_town) prt("(6) Display wanted monsters", 11, 5);
8607 prt("(7) Display current pets", 12, 5);
8608 prt("(8) Display home inventory", 13, 5);
8609 prt("(9) Display *identified* equip.", 14, 5);
8610 prt("(0) Display terrain symbols.", 15, 5);
8614 prt("(a) Display about yourself", 6, 5);
8615 prt("(b) Display mutations", 7, 5);
8616 prt("(c) Display weapon proficiency", 8, 5);
8617 prt("(d) Display spell proficiency", 9, 5);
8618 prt("(e) Display misc. proficiency", 10, 5);
8619 prt("(f) Display virtues", 11, 5);
8620 prt("(g) Display dungeons", 12, 5);
8621 prt("(h) Display current quests", 13, 5);
8622 prt("(i) Display auto pick/destroy", 14, 5);
8628 prt("ESC) 抜ける", 21, 1);
8629 prt("SPACE) 次ページ", 21, 30);
8630 /*prt("-) 前ページ", 21, 60);*/
8631 prt("コマンド:", 20, 0);
8633 prt("-more-", 17, 8);
8634 prt("ESC) Exit menu", 21, 1);
8635 prt("SPACE) Next page", 21, 30);
8636 /*prt("-) Previous page", 21, 60);*/
8637 prt("Command: ", 20, 0);
8644 if (i == ESCAPE) break;
8647 case ' ': /* Page change */
8651 case '1': /* Artifacts */
8652 do_cmd_knowledge_artifacts();
8654 case '2': /* Objects */
8655 do_cmd_knowledge_objects(&need_redraw, FALSE, -1);
8657 case '3': /* Uniques */
8658 do_cmd_knowledge_uniques();
8660 case '4': /* Monsters */
8661 do_cmd_knowledge_monsters(&need_redraw, FALSE, -1);
8663 case '5': /* Kill count */
8664 do_cmd_knowledge_kill_count();
8666 case '6': /* wanted */
8667 if (!vanilla_town) do_cmd_knowledge_kubi();
8669 case '7': /* Pets */
8670 do_cmd_knowledge_pets();
8672 case '8': /* Home */
8673 do_cmd_knowledge_home();
8675 case '9': /* Resist list */
8676 do_cmd_knowledge_inven();
8678 case '0': /* Feature list */
8680 int lighting_level = F_LIT_STANDARD;
8681 do_cmd_knowledge_features(&need_redraw, FALSE, -1, &lighting_level);
8685 case 'a': /* Max stat */
8686 do_cmd_knowledge_stat();
8688 case 'b': /* Mutations */
8689 do_cmd_knowledge_mutations();
8691 case 'c': /* weapon-exp */
8692 do_cmd_knowledge_weapon_exp();
8694 case 'd': /* spell-exp */
8695 do_cmd_knowledge_spell_exp();
8697 case 'e': /* skill-exp */
8698 do_cmd_knowledge_skill_exp();
8700 case 'f': /* Virtues */
8701 do_cmd_knowledge_virtues();
8703 case 'g': /* Dungeon */
8704 do_cmd_knowledge_dungeon();
8706 case 'h': /* Quests */
8707 do_cmd_knowledge_quests();
8709 case 'i': /* Autopick */
8710 do_cmd_knowledge_autopick();
8712 default: /* Unknown option */
8716 /* Flush messages */
8720 /* Restore the screen */
8723 if (need_redraw) do_cmd_redraw();
8728 * Check on the status of an active quest
8730 void do_cmd_checkquest(void)
8732 /* File type is "TEXT" */
8733 FILE_TYPE(FILE_TYPE_TEXT);
8735 /* Save the screen */
8739 do_cmd_knowledge_quests();
8741 /* Restore the screen */
8747 * Display the time and date
8749 void do_cmd_time(void)
8751 int day, hour, min, full, start, end, num;
8759 extract_day_hour_min(&day, &hour, &min);
8761 full = hour * 100 + min;
8768 strcpy(desc, _("変な時刻だ。", "It is a strange time."));
8770 if (day < MAX_DAYS) sprintf(day_buf, "%d", day);
8771 else strcpy(day_buf, "*****");
8775 msg_format("%s日目, 時刻は%d:%02d %sです。",
8776 day_buf, (hour % 12 == 0) ? 12 : (hour % 12),
8777 min, (hour < 12) ? "AM" : "PM");
8779 msg_format("This is day %s. The time is %d:%02d %s.",
8780 day_buf, (hour % 12 == 0) ? 12 : (hour % 12),
8781 min, (hour < 12) ? "AM" : "PM");
8786 if (!randint0(10) || p_ptr->image)
8788 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, _("timefun_j.txt", "timefun.txt"));
8792 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, _("timenorm_j.txt", "timenorm.txt"));
8795 /* Open this file */
8796 fff = my_fopen(buf, "rt");
8801 /* Find this time */
8802 while (!my_fgets(fff, buf, sizeof(buf)))
8804 /* Ignore comments */
8805 if (!buf[0] || (buf[0] == '#')) continue;
8807 /* Ignore invalid lines */
8808 if (buf[1] != ':') continue;
8810 /* Process 'Start' */
8813 /* Extract the starting time */
8814 start = atoi(buf + 2);
8816 /* Assume valid for an hour */
8826 /* Extract the ending time */
8827 end = atoi(buf + 2);
8833 /* Ignore incorrect range */
8834 if ((start > full) || (full > end)) continue;
8836 /* Process 'Description' */
8841 /* Apply the randomizer */
8842 if (!randint0(num)) strcpy(desc, buf + 2);
8852 /* Close the file */