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.
54 #include "cmd-spell.h"
58 #include "player-effects.h"
59 #include "player-status.h"
60 #include "player-skill.h"
61 #include "player-personality.h"
68 #include "object-flavor.h"
69 #include "object-hook.h"
71 #include "monster-status.h"
73 #include "view-mainwindow.h"
74 #include "dungeon-file.h"
76 #include "player-class.h"
77 #include "player-move.h"
79 #include "objectkind.h"
80 #include "floor-town.h"
82 #include "view-mainwindow.h"
87 * Mark strings for auto dump
89 static char auto_dump_header[] = "# vvvvvvv== %s ==vvvvvvv";
90 static char auto_dump_footer[] = "# ^^^^^^^== %s ==^^^^^^^";
93 * Variables for auto dump
95 static FILE *auto_dump_stream;
96 static concptr auto_dump_mark;
97 static int auto_dump_line_num;
103 * @brief prf出力内容を消去する /
104 * Remove old lines automatically generated before.
105 * @param orig_file 消去を行うファイル名
107 static void remove_auto_dump(concptr orig_file)
109 FILE *tmp_fff, *orig_fff;
113 bool between_mark = FALSE;
114 bool changed = FALSE;
116 long header_location = 0;
117 char header_mark_str[80];
118 char footer_mark_str[80];
121 /* Prepare a header/footer mark string */
122 sprintf(header_mark_str, auto_dump_header, auto_dump_mark);
123 sprintf(footer_mark_str, auto_dump_footer, auto_dump_mark);
125 mark_len = strlen(footer_mark_str);
127 /* Open an old dump file in read-only mode */
128 orig_fff = my_fopen(orig_file, "r");
130 /* If original file does not exist, nothing to do */
131 if (!orig_fff) return;
133 /* Open a new (temporary) file */
134 tmp_fff = my_fopen_temp(tmp_file, 1024);
138 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), tmp_file);
143 /* Loop for every line */
147 if (my_fgets(orig_fff, buf, sizeof(buf)))
149 /* Read error: Assume End of File */
152 * Was looking for the footer, but not found.
154 * Since automatic dump might be edited by hand,
155 * it's dangerous to kill these lines.
156 * Seek back to the next line of the (pseudo) header,
161 fseek(orig_fff, header_location, SEEK_SET);
162 between_mark = FALSE;
166 /* Success -- End the loop */
173 /* We are looking for the header mark of automatic dump */
176 /* Is this line a header? */
177 if (!strcmp(buf, header_mark_str))
179 /* Memorise seek point of this line */
180 header_location = ftell(orig_fff);
182 /* Initialize counter for number of lines */
185 /* Look for the footer from now */
188 /* There are some changes */
195 /* Copy orginally lines */
196 fprintf(tmp_fff, "%s\n", buf);
200 /* We are looking for the footer mark of automatic dump */
203 /* Is this line a footer? */
204 if (!strncmp(buf, footer_mark_str, mark_len))
209 * Compare the number of lines
211 * If there is an inconsistency between
212 * actual number of lines and the
213 * number here, the automatic dump
214 * might be edited by hand. So it's
215 * dangerous to kill these lines.
216 * Seek back to the next line of the
217 * (pseudo) header, and read again.
219 if (!sscanf(buf + mark_len, " (%d)", &tmp)
222 fseek(orig_fff, header_location, SEEK_SET);
225 /* Look for another header */
226 between_mark = FALSE;
232 /* Ignore old line, and count number of lines */
242 /* If there are some changes, overwrite the original file with new one */
245 /* Copy contents of temporary file */
247 tmp_fff = my_fopen(tmp_file, "r");
248 orig_fff = my_fopen(orig_file, "w");
250 while (!my_fgets(tmp_fff, buf, sizeof(buf)))
251 fprintf(orig_fff, "%s\n", buf);
257 /* Kill the temporary file */
265 * @brief prfファイルのフォーマットに従った内容を出力する /
266 * Dump a formatted line, using "vstrnfmt()".
269 static void auto_dump_printf(concptr fmt, ...)
276 /* Begin the Varargs Stuff */
279 /* Format the args, save the length */
280 (void)vstrnfmt(buf, sizeof(buf), fmt, vp);
282 /* End the Varargs Stuff */
285 /* Count number of lines */
286 for (p = buf; *p; p++)
288 if (*p == '\n') auto_dump_line_num++;
292 fprintf(auto_dump_stream, "%s", buf);
297 * @brief prfファイルをファイルオープンする /
298 * Open file to append auto dump.
300 * @param mark 出力するヘッダマーク
301 * @return ファイルポインタを取得できたらTRUEを返す
303 static bool open_auto_dump(concptr buf, concptr mark)
306 char header_mark_str[80];
308 /* Save the mark string */
309 auto_dump_mark = mark;
311 /* Prepare a header mark string */
312 sprintf(header_mark_str, auto_dump_header, auto_dump_mark);
314 /* Remove old macro dumps */
315 remove_auto_dump(buf);
317 /* Append to the file */
318 auto_dump_stream = my_fopen(buf, "a");
321 if (!auto_dump_stream) {
322 msg_format(_("%s を開くことができませんでした。", "Failed to open %s."), buf);
330 fprintf(auto_dump_stream, "%s\n", header_mark_str);
332 /* Initialize counter */
333 auto_dump_line_num = 0;
335 auto_dump_printf(_("# *警告!!* 以降の行は自動生成されたものです。\n",
336 "# *Warning!* The lines below are an automatic dump.\n"));
337 auto_dump_printf(_("# *警告!!* 後で自動的に削除されるので編集しないでください。\n",
338 "# Don't edit them; changes will be deleted and replaced automatically.\n"));
344 * @brief prfファイルをファイルクローズする /
345 * Append foot part and close auto dump.
348 static void close_auto_dump(void)
350 char footer_mark_str[80];
352 /* Prepare a footer mark string */
353 sprintf(footer_mark_str, auto_dump_footer, auto_dump_mark);
355 auto_dump_printf(_("# *警告!!* 以降の行は自動生成されたものです。\n",
356 "# *Warning!* The lines below are an automatic dump.\n"));
357 auto_dump_printf(_("# *警告!!* 後で自動的に削除されるので編集しないでください。\n",
358 "# Don't edit them; changes will be deleted and replaced automatically.\n"));
360 fprintf(auto_dump_stream, "%s (%d)\n", footer_mark_str, auto_dump_line_num);
363 my_fclose(auto_dump_stream);
372 * @brief Return suffix of ordinal number
374 * @return pointer of suffix string.
376 concptr get_ordinal_number_suffix(int num)
378 num = ABS(num) % 100;
382 return (num == 11) ? "th" : "st";
384 return (num == 12) ? "th" : "nd";
386 return (num == 13) ? "th" : "rd";
395 * @brief 日記にメッセージを追加する /
396 * Take note to the diary.
397 * @param type 日記内容のID
398 * @param num 日記内容のIDに応じた数値
399 * @param note 日記内容のIDに応じた文字列参照ポインタ
402 errr do_cmd_write_nikki(int type, int num, concptr note)
406 GAME_TEXT file_name[MAX_NLEN];
408 concptr note_level = "";
409 bool do_level = TRUE;
410 char note_level_buf[40];
413 static bool disable_nikki = FALSE;
415 extract_day_hour_min(&day, &hour, &min);
417 if (disable_nikki) return(-1);
419 if (type == NIKKI_FIX_QUEST_C ||
420 type == NIKKI_FIX_QUEST_F ||
421 type == NIKKI_RAND_QUEST_C ||
422 type == NIKKI_RAND_QUEST_F ||
423 type == NIKKI_TO_QUEST)
427 old_quest = p_ptr->inside_quest;
428 p_ptr->inside_quest = (quest[num].type == QUEST_TYPE_RANDOM) ? 0 : num;
430 /* Get the quest text */
431 init_flags = INIT_NAME_ONLY;
433 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
435 /* Reset the old quest number */
436 p_ptr->inside_quest = old_quest;
439 /* different filne name to avoid mixing */
440 sprintf(file_name,_("playrecord-%s.txt", "playrec-%s.txt"),savefile_base);
441 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
443 /* File type is "TEXT" */
444 FILE_TYPE(FILE_TYPE_TEXT);
446 fff = my_fopen(buf, "a");
451 msg_format(_("%s を開くことができませんでした。プレイ記録を一時停止します。", "Failed to open %s. Play-Record is disabled temporally."), buf);
457 q_idx = quest_number(current_floor_ptr->dun_level);
461 if (p_ptr->inside_arena)
462 note_level = _("アリーナ:", "Arane:");
463 else if (!current_floor_ptr->dun_level)
464 note_level = _("地上:", "Surface:");
465 else if (q_idx && (is_fixed_quest_idx(q_idx)
466 && !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
467 note_level = _("クエスト:", "Quest:");
471 sprintf(note_level_buf, "%d階(%s):", (int)current_floor_ptr->dun_level, d_name+d_info[p_ptr->dungeon_idx].name);
473 sprintf(note_level_buf, "%s L%d:", d_name+d_info[p_ptr->dungeon_idx].name, (int)current_floor_ptr->dun_level);
475 note_level = note_level_buf;
483 if (day < MAX_DAYS) fprintf(fff, _("%d日目\n", "Day %d\n"), day);
484 else fputs(_("*****日目\n", "Day *****\n"), fff);
492 fprintf(fff, "%s\n",note);
496 fprintf(fff, " %2d:%02d %20s %s\n",hour, min, note_level, note);
501 fprintf(fff, _(" %2d:%02d %20s %sを発見した。\n", " %2d:%02d %20s discovered %s.\n"), hour, min, note_level, note);
504 case NIKKI_ART_SCROLL:
506 fprintf(fff, _(" %2d:%02d %20s 巻物によって%sを生成した。\n", " %2d:%02d %20s created %s by scroll.\n"), hour, min, note_level, note);
511 fprintf(fff, _(" %2d:%02d %20s %sを倒した。\n", " %2d:%02d %20s defeated %s.\n"), hour, min, note_level, note);
514 case NIKKI_FIX_QUEST_C:
516 if (quest[num].flags & QUEST_FLAG_SILENT) break;
517 fprintf(fff, _(" %2d:%02d %20s クエスト「%s」を達成した。\n",
518 " %2d:%02d %20s completed quest '%s'.\n"), hour, min, note_level, quest[num].name);
521 case NIKKI_FIX_QUEST_F:
523 if (quest[num].flags & QUEST_FLAG_SILENT) break;
524 fprintf(fff, _(" %2d:%02d %20s クエスト「%s」から命からがら逃げ帰った。\n",
525 " %2d:%02d %20s run away from quest '%s'.\n"), hour, min, note_level, quest[num].name);
528 case NIKKI_RAND_QUEST_C:
530 GAME_TEXT name[MAX_NLEN];
531 strcpy(name, r_name+r_info[quest[num].r_idx].name);
532 fprintf(fff, _(" %2d:%02d %20s ランダムクエスト(%s)を達成した。\n",
533 " %2d:%02d %20s completed random quest '%s'\n"), hour, min, note_level, name);
536 case NIKKI_RAND_QUEST_F:
538 GAME_TEXT name[MAX_NLEN];
539 strcpy(name, r_name+r_info[quest[num].r_idx].name);
540 fprintf(fff, _(" %2d:%02d %20s ランダムクエスト(%s)から逃げ出した。\n",
541 " %2d:%02d %20s ran away from quest '%s'.\n"), hour, min, note_level, name);
544 case NIKKI_MAXDEAPTH:
546 fprintf(fff, _(" %2d:%02d %20s %sの最深階%d階に到達した。\n",
547 " %2d:%02d %20s reached level %d of %s for the first time.\n"), hour, min, note_level,
548 _(d_name+d_info[p_ptr->dungeon_idx].name, num),
549 _(num, d_name+d_info[p_ptr->dungeon_idx].name));
554 fprintf(fff, _(" %2d:%02d %20s %s%sの最深階を%d階にセットした。\n",
555 " %2d:%02d %20s reset recall level of %s to %d %s.\n"), hour, min, note_level, note,
556 _(d_name + d_info[num].name, (int)max_dlv[num]),
557 _((int)max_dlv[num], d_name + d_info[num].name));
563 if (q_idx && (is_fixed_quest_idx(q_idx)
564 && !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
566 to = _("地上", "the surface");
570 if (!(current_floor_ptr->dun_level+num)) to = _("地上", "the surface");
571 else to = format(_("%d階", "level %d"), current_floor_ptr->dun_level+num);
573 fprintf(fff, _(" %2d:%02d %20s %sへ%s。\n", " %2d:%02d %20s %s %s.\n"), hour, min, note_level, _(to, note), _(note, to));
579 fprintf(fff, _(" %2d:%02d %20s 帰還を使って%sの%d階へ下りた。\n", " %2d:%02d %20s recalled to dungeon level %d of %s.\n"),
580 hour, min, note_level, _(d_name+d_info[p_ptr->dungeon_idx].name, (int)max_dlv[p_ptr->dungeon_idx]),
581 _((int)max_dlv[p_ptr->dungeon_idx], d_name+d_info[p_ptr->dungeon_idx].name));
583 fprintf(fff, _(" %2d:%02d %20s 帰還を使って地上へと戻った。\n", " %2d:%02d %20s recalled from dungeon to surface.\n"), hour, min, note_level);
588 if (quest[num].flags & QUEST_FLAG_SILENT) break;
589 fprintf(fff, _(" %2d:%02d %20s クエスト「%s」へと突入した。\n", " %2d:%02d %20s entered the quest '%s'.\n"),
590 hour, min, note_level, quest[num].name);
595 fprintf(fff, _(" %2d:%02d %20s レベル・テレポートで脱出した。\n", " %2d:%02d %20s Got out using teleport level.\n"),
596 hour, min, note_level);
601 fprintf(fff, _(" %2d:%02d %20s %sを購入した。\n", " %2d:%02d %20s bought %s.\n"), hour, min, note_level, note);
606 fprintf(fff, _(" %2d:%02d %20s %sを売却した。\n", " %2d:%02d %20s sold %s.\n"), hour, min, note_level, note);
614 fprintf(fff, _(" %2d:%02d %20s 闘技場の%d%s回戦で、%sの前に敗れ去った。\n", " %2d:%02d %20s beaten by %s in the %d%s fight.\n"),
615 hour, min, note_level, _(n, note), _("", n), _(note, get_ordinal_number_suffix(n)));
618 fprintf(fff, _(" %2d:%02d %20s 闘技場の%d%s回戦(%s)に勝利した。\n", " %2d:%02d %20s won the %d%s fight (%s).\n"),
619 hour, min, note_level, num, _("", get_ordinal_number_suffix(num)), note);
621 if (num == MAX_ARENA_MONS)
623 fprintf(fff, _(" 闘技場のすべての敵に勝利し、チャンピオンとなった。\n",
624 " won all fight to become a Chanpion.\n"));
631 fprintf(fff, _(" %2d:%02d %20s %sを識別した。\n", " %2d:%02d %20s identified %s.\n"), hour, min, note_level, note);
637 if (!current_floor_ptr->dun_level)
638 to = _("地上", "the surface");
640 to = format(_("%d階(%s)", "level %d of %s"), current_floor_ptr->dun_level, d_name+d_info[p_ptr->dungeon_idx].name);
642 fprintf(fff, _(" %2d:%02d %20s %sへとウィザード・テレポートで移動した。\n",
643 " %2d:%02d %20s wizard-teleport to %s.\n"), hour, min, note_level, to);
649 if (!current_floor_ptr->dun_level)
650 to = _("地上", "the surface");
652 to = format(_("%d階(%s)", "level %d of %s"), current_floor_ptr->dun_level, d_name+d_info[p_ptr->dungeon_idx].name);
654 fprintf(fff, _(" %2d:%02d %20s %sへとパターンの力で移動した。\n",
655 " %2d:%02d %20s used Pattern to teleport to %s.\n"), hour, min, note_level, to);
660 fprintf(fff, _(" %2d:%02d %20s レベルが%dに上がった。\n", " %2d:%02d %20s reached player level %d.\n"), hour, min, note_level, num);
663 case NIKKI_GAMESTART:
665 time_t ct = time((time_t*)0);
669 fprintf(fff, "%s %s",note, ctime(&ct));
672 fprintf(fff, " %2d:%02d %20s %s %s",hour, min, note_level, note, ctime(&ct));
675 case NIKKI_NAMED_PET:
677 fprintf(fff, " %2d:%02d %20s ", hour, min, note_level);
680 case RECORD_NAMED_PET_NAME:
681 fprintf(fff, _("%sを旅の友にすることに決めた。\n", "decided to travel together with %s.\n"), note);
683 case RECORD_NAMED_PET_UNNAME:
684 fprintf(fff, _("%sの名前を消した。\n", "unnamed %s.\n"), note);
686 case RECORD_NAMED_PET_DISMISS:
687 fprintf(fff, _("%sを解放した。\n", "dismissed %s.\n"), note);
689 case RECORD_NAMED_PET_DEATH:
690 fprintf(fff, _("%sが死んでしまった。\n", "%s died.\n"), note);
692 case RECORD_NAMED_PET_MOVED:
693 fprintf(fff, _("%sをおいて別のマップへ移動した。\n", "moved to another map leaving %s behind.\n"), note);
695 case RECORD_NAMED_PET_LOST_SIGHT:
696 fprintf(fff, _("%sとはぐれてしまった。\n", "lost sight of %s.\n"), note);
698 case RECORD_NAMED_PET_DESTROY:
699 fprintf(fff, _("%sが*破壊*によって消え去った。\n", "%s was made disappeared by *destruction*.\n"), note);
701 case RECORD_NAMED_PET_EARTHQUAKE:
702 fprintf(fff, _("%sが岩石に押し潰された。\n", "%s was crushed by falling rocks.\n"), note);
704 case RECORD_NAMED_PET_GENOCIDE:
705 fprintf(fff, _("%sが抹殺によって消え去った。\n", "%s was made disappeared by genocide.\n"), note);
707 case RECORD_NAMED_PET_WIZ_ZAP:
708 fprintf(fff, _("%sがデバッグコマンドによって消え去った。\n", "%s was removed by debug command.\n"), note);
710 case RECORD_NAMED_PET_TELE_LEVEL:
711 fprintf(fff, _("%sがテレポート・レベルによって消え去った。\n", "%s was made disappeared by teleport level.\n"), note);
713 case RECORD_NAMED_PET_BLAST:
714 fprintf(fff, _("%sを爆破した。\n", "blasted %s.\n"), note);
716 case RECORD_NAMED_PET_HEAL_LEPER:
717 fprintf(fff, _("%sの病気が治り旅から外れた。\n", "%s was healed and left.\n"), note);
719 case RECORD_NAMED_PET_COMPACT:
720 fprintf(fff, _("%sがモンスター情報圧縮によって消え去った。\n", "%s was made disappeared by compacting monsters.\n"), note);
722 case RECORD_NAMED_PET_LOSE_PARENT:
723 fprintf(fff, _("%sの召喚者が既にいないため消え去った。\n", "%s disappeared because there does not exist summoner.\n"), note);
734 case NIKKI_WIZARD_LOG:
735 fprintf(fff, "%s\n", note);
744 if (do_level) write_level = FALSE;
750 #define MAX_SUBTITLE (sizeof(subtitle)/sizeof(subtitle[0]))
753 * @brief 日記のタイトル表記と内容出力 /
756 * 日記のタイトルは本関数の subtitle ローカル変数で定義されている。
758 static void do_cmd_disp_nikki(void)
760 char nikki_title[256];
761 GAME_TEXT file_name[MAX_NLEN];
766 static const char subtitle[][30] = {"最強の肉体を求めて",
797 static const char subtitle[][51] ={"Quest of The World's Toughest Body",
798 "Attack is the best form of defence.",
800 "An unexpected windfall",
801 "A drowning man will catch at a straw",
802 "Don't count your chickens before they are hatched.",
803 "It is no use crying over spilt milk.",
804 "Seeing is believing.",
805 "Strike the iron while it is hot.",
806 "I don't care what follows.",
807 "To dig a well to put out a house on fire.",
808 "Tomorrow is another day.",
809 "Easy come, easy go.",
810 "The more haste, the less speed.",
811 "Where there is life, there is hope.",
812 "There is no royal road to *WINNER*.",
813 "Danger past, God forgotten.",
814 "The best thing to do now is to run away.",
815 "Life is but an empty dream.",
816 "Dead men tell no tales.",
817 "A book that remains shut is but a block.",
818 "Misfortunes never come singly.",
819 "A little knowledge is a dangerous thing.",
820 "History repeats itself.",
821 "*WINNER* was not built in a day.",
822 "Ignorance is bliss.",
823 "To lose is to win?",
824 "No medicine can cure folly.",
825 "All good things come to an end.",
826 "M$ Empire strikes back.",
827 "To see is to believe",
829 "Quest of The World's Greatest Brain"};
831 sprintf(file_name,_("playrecord-%s.txt", "playrec-%s.txt"),savefile_base);
832 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
834 if (p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_MONK || p_ptr->pclass == CLASS_SAMURAI || p_ptr->pclass == CLASS_BERSERKER)
835 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)]);
836 else if (IS_WIZARD_CLASS(p_ptr))
837 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)+1]);
838 else strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-2)+1]);
841 sprintf(nikki_title, "「%s%s%sの伝説 -%s-」", ap_ptr->title, ap_ptr->no ? "の" : "", p_ptr->name, tmp);
843 sprintf(nikki_title, "Legend of %s %s '%s'", ap_ptr->title, p_ptr->name, tmp);
846 /* Display the file contents */
847 show_file(FALSE, buf, nikki_title, -1, 0);
851 * @brief 日記に任意の内容を表記するコマンドのメインルーチン /
854 static void do_cmd_bunshou(void)
857 char bunshou[80] = "\0";
859 if (get_string(_("内容: ", "diary note: "), tmp, 79))
861 strcpy(bunshou, tmp);
863 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, bunshou);
868 * @brief 最後に取得したアイテムの情報を日記に追加するメインルーチン /
871 static void do_cmd_last_get(void)
876 if (record_o_name[0] == '\0') return;
878 sprintf(buf,_("%sの入手を記録します。", "Do you really want to record getting %s? "),record_o_name);
879 if (!get_check(buf)) return;
881 turn_tmp = current_world_ptr->game_turn;
882 current_world_ptr->game_turn = record_turn;
883 sprintf(buf,_("%sを手に入れた。", "descover %s."), record_o_name);
884 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, buf);
885 current_world_ptr->game_turn = turn_tmp;
889 * @brief ファイル中の全日記記録を消去する /
892 static void do_cmd_erase_nikki(void)
894 GAME_TEXT file_name[MAX_NLEN];
898 if (!get_check(_("本当に記録を消去しますか?", "Do you really want to delete all your record? "))) return;
899 sprintf(file_name,_("playrecord-%s.txt", "playrec-%s.txt"),savefile_base);
900 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
903 fff = my_fopen(buf, "w");
906 msg_format(_("記録を消去しました。", "deleted record."));
908 msg_format(_("%s の消去に失敗しました。", "failed to delete %s."), buf);
917 void do_cmd_nikki(void)
921 /* File type is "TEXT" */
922 FILE_TYPE(FILE_TYPE_TEXT);
925 /* Interact until done */
930 /* Ask for a choice */
931 prt(_("[ 記録の設定 ]", "[ Play Record ]"), 2, 0);
933 /* Give some choices */
934 prt(_("(1) 記録を見る", "(1) Display your record"), 4, 5);
935 prt(_("(2) 文章を記録する", "(2) Add record"), 5, 5);
936 prt(_("(3) 直前に入手又は鑑定したものを記録する", "(3) Record item you last get/identify"), 6, 5);
937 prt(_("(4) 記録を消去する", "(4) Delete your record"), 7, 5);
939 prt(_("(R) プレイ動画を記録する/中止する", "(R) Record playing movie / or stop it"), 9, 5);
942 prt(_("コマンド:", "Command: "), 18, 0);
947 if (i == ESCAPE) break;
961 do_cmd_erase_nikki();
965 prepare_movie_hooks();
967 default: /* Unknown option */
977 * @brief 画面を再描画するコマンドのメインルーチン
978 * Hack -- redraw the screen
982 * This command performs various low level updates, clears all the "extra"
983 * windows, does a total redraw of the main window, and requests all of the
984 * interesting updates and redraws that I can think of.
986 * This command is also used to "instantiate" the results of the user
987 * selecting various things, such as graphics mode, so it must call
988 * the "TERM_XTRA_REACT" hook before redrawing the windows.
991 void do_cmd_redraw(void)
997 /* Hack -- react to changes */
998 Term_xtra(TERM_XTRA_REACT, 0);
1000 /* Combine and Reorder the pack (later) */
1001 p_ptr->update |= (PU_COMBINE | PU_REORDER);
1002 p_ptr->update |= (PU_TORCH);
1003 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
1004 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
1005 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
1006 p_ptr->update |= (PU_MONSTERS);
1008 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1010 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
1011 p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
1017 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
1020 /* Redraw every window */
1021 for (j = 0; j < 8; j++)
1024 if (!angband_term[j]) continue;
1027 Term_activate(angband_term[j]);
1036 * @brief プレイヤーのステータス表示
1039 void do_cmd_player_status(void)
1050 display_player(mode);
1055 display_player(mode);
1059 Term_putstr(2, 23, -1, TERM_WHITE,
1060 _("['c'で名前変更, 'f'でファイルへ書出, 'h'でモード変更, ESCで終了]", "['c' to change name, 'f' to file, 'h' to change mode, or ESC]"));
1064 if (c == ESCAPE) break;
1071 /* Process the player name */
1072 process_player_name(FALSE);
1078 sprintf(tmp, "%s.txt", p_ptr->base_name);
1079 if (get_string(_("ファイル名: ", "File name: "), tmp, 80))
1081 if (tmp[0] && (tmp[0] != ' '))
1083 file_character(tmp);
1101 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1108 * @brief 最近表示されたメッセージを再表示するコマンドのメインルーチン
1109 * Recall the most recent message
1112 void do_cmd_message_one(void)
1114 /* Recall one message */
1115 prt(format("> %s", message_str(0)), 0, 0);
1120 * @brief メッセージのログを表示するコマンドのメインルーチン
1121 * Recall the most recent message
1125 * Show previous messages to the user -BEN-
1127 * The screen format uses line 0 and 23 for headers and prompts,
1128 * skips line 1 and 22, and uses line 2 thru 21 for old messages.
1130 * This command shows you which commands you are viewing, and allows
1131 * you to "search" for strings in the recall.
1133 * Note that messages may be longer than 80 characters, but they are
1134 * displayed using "infinite" length, with a special sub-command to
1135 * "slide" the virtual display to the left or right.
1137 * Attempt to only hilite the matching portions of the string.
1140 void do_cmd_messages(int num_now)
1144 char shower_str[81];
1145 char finder_str[81];
1147 concptr shower = NULL;
1151 Term_get_size(&wid, &hgt);
1153 /* Number of message lines in a screen */
1154 num_lines = hgt - 4;
1157 strcpy(finder_str, "");
1160 strcpy(shower_str, "");
1162 /* Total messages */
1165 /* Start on first message */
1170 /* Process requests until done */
1176 /* Dump up to 20 lines of messages */
1177 for (j = 0; (j < num_lines) && (i + j < n); j++)
1179 concptr msg = message_str(i+j);
1181 /* Dump the messages, bottom to top */
1182 c_prt((i + j < num_now ? TERM_WHITE : TERM_SLATE), msg, num_lines + 1 - j, 0);
1184 /* Hilite "shower" */
1185 if (shower && shower[0])
1189 /* Display matches */
1190 while ((str = my_strstr(str, shower)) != NULL)
1192 int len = strlen(shower);
1194 /* Display the match */
1195 Term_putstr(str-msg, num_lines + 1 - j, len, TERM_YELLOW, shower);
1203 /* Erase remaining lines */
1204 for (; j < num_lines; j++)
1206 Term_erase(0, num_lines + 1 - j, 255);
1209 /* Display header */
1211 prt(format(_("以前のメッセージ %d-%d 全部で(%d)", "Message Recall (%d-%d of %d)"),
1212 i, i + j - 1, n), 0, 0);
1214 /* Display prompt (not very informative) */
1215 prt(_("[ 'p' で更に古いもの, 'n' で更に新しいもの, '/' で検索, ESC で中断 ]",
1216 "[Press 'p' for older, 'n' for newer, ..., or ESCAPE]"), hgt - 1, 0);
1218 skey = inkey_special(TRUE);
1220 /* Exit on Escape */
1221 if (skey == ESCAPE) break;
1223 /* Hack -- Save the old index */
1228 /* Hack -- handle show */
1231 prt(_("強調: ", "Show: "), hgt - 1, 0);
1233 /* Get a "shower" string, or continue */
1234 strcpy(back_str, shower_str);
1235 if (askfor(shower_str, 80))
1238 shower = shower_str[0] ? shower_str : NULL;
1240 else strcpy(shower_str, back_str);
1244 /* Hack -- handle find */
1251 prt(_("検索: ", "Find: "), hgt - 1, 0);
1253 /* Get a "finder" string, or continue */
1254 strcpy(back_str, finder_str);
1255 if (!askfor(finder_str, 80))
1257 strcpy(finder_str, back_str);
1260 else if (!finder_str[0])
1262 shower = NULL; /* Stop showing */
1267 shower = finder_str;
1270 for (z = i + 1; z < n; z++)
1272 concptr msg = message_str(z);
1275 if (my_strstr(msg, finder_str))
1286 /* Recall 1 older message */
1288 /* Go to the oldest line */
1292 /* Recall 1 newer message */
1294 /* Go to the newest line */
1298 /* Recall 1 older message */
1303 /* Go older if legal */
1304 i = MIN(i + 1, n - num_lines);
1307 /* Recall 10 older messages */
1309 /* Go older if legal */
1310 i = MIN(i + 10, n - num_lines);
1313 /* Recall 20 older messages */
1318 /* Go older if legal */
1319 i = MIN(i + num_lines, n - num_lines);
1322 /* Recall 20 newer messages */
1326 /* Go newer (if able) */
1327 i = MAX(0, i - num_lines);
1330 /* Recall 10 newer messages */
1332 /* Go newer (if able) */
1336 /* Recall 1 newer messages */
1339 /* Go newer (if able) */
1344 /* Hack -- Error of some kind */
1352 * @brief prefファイルを選択して処理する /
1353 * Ask for a "user pref line" and process it
1356 * Allow absolute file names?
1358 void do_cmd_pref(void)
1365 /* Ask for a "user pref command" */
1366 if (!get_string(_("設定変更コマンド: ", "Pref: "), buf, 80)) return;
1368 /* Process that pref command */
1369 (void)process_pref_file_command(buf);
1373 * @brief 自動拾い設定ファイルをロードするコマンドのメインルーチン /
1376 void do_cmd_reload_autopick(void)
1378 if (!get_check(_("自動拾い設定ファイルをロードしますか? ", "Reload auto-pick preference file? "))) return;
1379 /* Load the file with messages */
1380 autopick_load_pref(TRUE);
1386 * @brief マクロ情報をprefファイルに保存する /
1387 * @param fname ファイル名
1390 static errr macro_dump(concptr fname)
1392 static concptr mark = "Macro Dump";
1397 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
1399 /* File type is "TEXT" */
1400 FILE_TYPE(FILE_TYPE_TEXT);
1402 /* Append to the file */
1403 if (!open_auto_dump(buf, mark)) return (-1);
1406 auto_dump_printf(_("\n# 自動マクロセーブ\n\n", "\n# Automatic macro dump\n\n"));
1409 for (i = 0; i < macro__num; i++)
1411 /* Extract the action */
1412 ascii_to_text(buf, macro__act[i]);
1414 /* Dump the macro */
1415 auto_dump_printf("A:%s\n", buf);
1417 /* Extract the action */
1418 ascii_to_text(buf, macro__pat[i]);
1420 /* Dump normal macros */
1421 auto_dump_printf("P:%s\n", buf);
1424 auto_dump_printf("\n");
1436 * @brief マクロのトリガーキーを取得する /
1437 * Hack -- ask for a "trigger" (see below)
1438 * @param buf キー表記を保管するバッファ
1442 * Note the complex use of the "inkey()" function from "util.c".
1444 * Note that both "flush()" calls are extremely important.
1447 static void do_cmd_macro_aux(char *buf)
1455 /* Do not process macros */
1461 /* Read the pattern */
1467 /* Do not process macros */
1470 /* Do not wait for keys */
1473 /* Attempt to read a key */
1482 /* Convert the trigger */
1483 ascii_to_text(tmp, buf);
1485 /* Hack -- display the trigger */
1486 Term_addstr(-1, TERM_WHITE, tmp);
1492 * @brief マクロのキー表記からアスキーコードを得てターミナルに表示する /
1493 * Hack -- ask for a keymap "trigger" (see below)
1494 * @param buf キー表記を取得するバッファ
1498 * Note that both "flush()" calls are extremely important. This may
1499 * no longer be true, since "util.c" is much simpler now.
1502 static void do_cmd_macro_aux_keymap(char *buf)
1512 /* Convert to ascii */
1513 ascii_to_text(tmp, buf);
1515 /* Hack -- display the trigger */
1516 Term_addstr(-1, TERM_WHITE, tmp);
1523 * @brief キーマップをprefファイルにダンプする /
1524 * Hack -- append all keymaps to the given file
1525 * @param fname ファイルネーム
1529 static errr keymap_dump(concptr fname)
1531 static concptr mark = "Keymap Dump";
1540 if (rogue_like_commands)
1542 mode = KEYMAP_MODE_ROGUE;
1548 mode = KEYMAP_MODE_ORIG;
1551 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
1553 /* File type is "TEXT" */
1554 FILE_TYPE(FILE_TYPE_TEXT);
1556 /* Append to the file */
1557 if (!open_auto_dump(buf, mark)) return -1;
1560 auto_dump_printf(_("\n# 自動キー配置セーブ\n\n", "\n# Automatic keymap dump\n\n"));
1563 for (i = 0; i < 256; i++)
1567 /* Loop up the keymap */
1568 act = keymap_act[mode][i];
1570 /* Skip empty keymaps */
1573 /* Encode the key */
1576 ascii_to_text(key, buf);
1578 /* Encode the action */
1579 ascii_to_text(buf, act);
1581 /* Dump the macro */
1582 auto_dump_printf("A:%s\n", buf);
1583 auto_dump_printf("C:%d:%s\n", mode, key);
1595 * @brief マクロを設定するコマンドのメインルーチン /
1596 * Interact with "macros"
1600 * Note that the macro "action" must be defined before the trigger.
1602 * Could use some helpful instructions on this page.
1605 void do_cmd_macros(void)
1617 if (rogue_like_commands)
1619 mode = KEYMAP_MODE_ROGUE;
1625 mode = KEYMAP_MODE_ORIG;
1628 /* File type is "TEXT" */
1629 FILE_TYPE(FILE_TYPE_TEXT);
1634 /* Process requests until done */
1638 prt(_("[ マクロの設定 ]", "Interact with Macros"), 2, 0);
1640 /* Describe that action */
1641 prt(_("マクロ行動が(もしあれば)下に表示されます:", "Current action (if any) shown below:"), 20, 0);
1643 /* Analyze the current action */
1644 ascii_to_text(buf, macro__buf);
1646 /* Display the current action */
1651 prt(_("(1) ユーザー設定ファイルのロード", "(1) Load a user pref file"), 4, 5);
1653 prt(_("(2) ファイルにマクロを追加", "(2) Append macros to a file"), 5, 5);
1654 prt(_("(3) マクロの確認", "(3) Query a macro"), 6, 5);
1655 prt(_("(4) マクロの作成", "(4) Create a macro"), 7, 5);
1656 prt(_("(5) マクロの削除", "(5) Remove a macro"), 8, 5);
1657 prt(_("(6) ファイルにキー配置を追加", "(6) Append keymaps to a file"), 9, 5);
1658 prt(_("(7) キー配置の確認", "(7) Query a keymap"), 10, 5);
1659 prt(_("(8) キー配置の作成", "(8) Create a keymap"), 11, 5);
1660 prt(_("(9) キー配置の削除", "(9) Remove a keymap"), 12, 5);
1661 prt(_("(0) マクロ行動の入力", "(0) Enter a new action"), 13, 5);
1662 #endif /* ALLOW_MACROS */
1665 prt(_("コマンド: ", "Command: "), 16, 0);
1670 if (i == ESCAPE) break;
1672 /* Load a 'macro' file */
1678 prt(_("コマンド: ユーザー設定ファイルのロード", "Command: Load a user pref file"), 16, 0);
1681 prt(_("ファイル: ", "File: "), 18, 0);
1683 /* Default filename */
1684 sprintf(tmp, "%s.prf", p_ptr->base_name);
1686 /* Ask for a file */
1687 if (!askfor(tmp, 80)) continue;
1689 /* Process the given filename */
1690 err = process_pref_file(tmp);
1693 msg_format(_("標準の設定ファイル'%s'を読み込みました。", "Loaded default '%s'."), tmp);
1698 msg_format(_("'%s'の読み込みに失敗しました!", "Failed to load '%s'!"), tmp);
1702 msg_format(_("'%s'を読み込みました。", "Loaded '%s'."), tmp);
1712 prt(_("コマンド: マクロをファイルに追加する", "Command: Append macros to a file"), 16, 0);
1715 prt(_("ファイル: ", "File: "), 18, 0);
1717 /* Default filename */
1718 sprintf(tmp, "%s.prf", p_ptr->base_name);
1720 /* Ask for a file */
1721 if (!askfor(tmp, 80)) continue;
1723 /* Dump the macros */
1724 (void)macro_dump(tmp);
1727 msg_print(_("マクロを追加しました。", "Appended macros."));
1736 prt(_("コマンド: マクロの確認", "Command: Query a macro"), 16, 0);
1740 prt(_("トリガーキー: ", "Trigger: "), 18, 0);
1742 /* Get a macro trigger */
1743 do_cmd_macro_aux(buf);
1745 /* Acquire action */
1746 k = macro_find_exact(buf);
1752 msg_print(_("そのキーにはマクロは定義されていません。", "Found no macro."));
1758 /* Obtain the action */
1759 strcpy(macro__buf, macro__act[k]);
1761 /* Analyze the current action */
1762 ascii_to_text(buf, macro__buf);
1764 /* Display the current action */
1768 msg_print(_("マクロを確認しました。", "Found a macro."));
1772 /* Create a macro */
1776 prt(_("コマンド: マクロの作成", "Command: Create a macro"), 16, 0);
1779 prt(_("トリガーキー: ", "Trigger: "), 18, 0);
1781 /* Get a macro trigger */
1782 do_cmd_macro_aux(buf);
1788 c_prt(TERM_L_RED, _("カーソルキーの左右でカーソル位置を移動。BackspaceかDeleteで一文字削除。",
1789 "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0);
1792 prt(_("マクロ行動: ", "Action: "), 20, 0);
1794 /* Convert to text */
1795 ascii_to_text(tmp, macro__buf);
1797 /* Get an encoded action */
1798 if (askfor(tmp, 80))
1800 /* Convert to ascii */
1801 text_to_ascii(macro__buf, tmp);
1803 /* Link the macro */
1804 macro_add(buf, macro__buf);
1807 msg_print(_("マクロを追加しました。", "Added a macro."));
1811 /* Remove a macro */
1815 prt(_("コマンド: マクロの削除", "Command: Remove a macro"), 16, 0);
1818 prt(_("トリガーキー: ", "Trigger: "), 18, 0);
1820 /* Get a macro trigger */
1821 do_cmd_macro_aux(buf);
1823 /* Link the macro */
1824 macro_add(buf, buf);
1827 msg_print(_("マクロを削除しました。", "Removed a macro."));
1834 prt(_("コマンド: キー配置をファイルに追加する", "Command: Append keymaps to a file"), 16, 0);
1837 prt(_("ファイル: ", "File: "), 18, 0);
1839 /* Default filename */
1840 sprintf(tmp, "%s.prf", p_ptr->base_name);
1842 /* Ask for a file */
1843 if (!askfor(tmp, 80)) continue;
1845 /* Dump the macros */
1846 (void)keymap_dump(tmp);
1849 msg_print(_("キー配置を追加しました。", "Appended keymaps."));
1852 /* Query a keymap */
1858 prt(_("コマンド: キー配置の確認", "Command: Query a keymap"), 16, 0);
1861 prt(_("押すキー: ", "Keypress: "), 18, 0);
1863 /* Get a keymap trigger */
1864 do_cmd_macro_aux_keymap(buf);
1866 /* Look up the keymap */
1867 act = keymap_act[mode][(byte)(buf[0])];
1873 msg_print(_("キー配置は定義されていません。", "Found no keymap."));
1879 /* Obtain the action */
1880 strcpy(macro__buf, act);
1882 /* Analyze the current action */
1883 ascii_to_text(buf, macro__buf);
1885 /* Display the current action */
1889 msg_print(_("キー配置を確認しました。", "Found a keymap."));
1893 /* Create a keymap */
1897 prt(_("コマンド: キー配置の作成", "Command: Create a keymap"), 16, 0);
1900 prt(_("押すキー: ", "Keypress: "), 18, 0);
1902 /* Get a keymap trigger */
1903 do_cmd_macro_aux_keymap(buf);
1909 c_prt(TERM_L_RED, _("カーソルキーの左右でカーソル位置を移動。BackspaceかDeleteで一文字削除。",
1910 "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0);
1913 prt(_("行動: ", "Action: "), 20, 0);
1915 /* Convert to text */
1916 ascii_to_text(tmp, macro__buf);
1918 /* Get an encoded action */
1919 if (askfor(tmp, 80))
1921 /* Convert to ascii */
1922 text_to_ascii(macro__buf, tmp);
1924 /* Free old keymap */
1925 string_free(keymap_act[mode][(byte)(buf[0])]);
1927 /* Make new keymap */
1928 keymap_act[mode][(byte)(buf[0])] = string_make(macro__buf);
1931 msg_print(_("キー配置を追加しました。", "Added a keymap."));
1935 /* Remove a keymap */
1939 prt(_("コマンド: キー配置の削除", "Command: Remove a keymap"), 16, 0);
1942 prt(_("押すキー: ", "Keypress: "), 18, 0);
1944 /* Get a keymap trigger */
1945 do_cmd_macro_aux_keymap(buf);
1947 /* Free old keymap */
1948 string_free(keymap_act[mode][(byte)(buf[0])]);
1950 /* Make new keymap */
1951 keymap_act[mode][(byte)(buf[0])] = NULL;
1954 msg_print(_("キー配置を削除しました。", "Removed a keymap."));
1957 /* Enter a new action */
1961 prt(_("コマンド: マクロ行動の入力", "Command: Enter a new action"), 16, 0);
1967 c_prt(TERM_L_RED, _("カーソルキーの左右でカーソル位置を移動。BackspaceかDeleteで一文字削除。",
1968 "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0);
1971 prt(_("マクロ行動: ", "Action: "), 20, 0);
1973 /* Hack -- limit the value */
1976 /* Get an encoded action */
1977 if (!askfor(buf, 80)) continue;
1979 /* Extract an action */
1980 text_to_ascii(macro__buf, buf);
1983 #endif /* ALLOW_MACROS */
1996 * @brief キャラクタ色の明暗表現
1998 static concptr lighting_level_str[F_LIT_MAX] =
2013 * @brief キャラクタのビジュアルIDを変更する際の対象指定関数
2014 * @param i 指定対象となるキャラクタコード
2015 * @param num 指定されたビジュアルIDを返す参照ポインタ
2016 * @param max ビジュアルIDの最大数
2017 * @return 指定が実際に行われた場合TRUE、キャンセルされた場合FALSE
2019 static bool cmd_visuals_aux(int i, IDX *num, IDX max)
2026 sprintf(str, "%d", *num);
2028 if (!get_string(format("Input new number(0-%d): ", max-1), str, 4))
2031 tmp = (IDX)strtol(str, NULL, 0);
2032 if (tmp >= 0 && tmp < max)
2035 else if (isupper(i))
2036 *num = (*num + max - 1) % max;
2038 *num = (*num + 1) % max;
2044 * @brief キャラクタの変更メニュー表示
2045 * @param choice_msg 選択メッセージ
2048 static void print_visuals_menu(concptr choice_msg)
2050 prt(_("[ 画面表示の設定 ]", "Interact with Visuals"), 1, 0);
2052 /* Give some choices */
2053 prt(_("(0) ユーザー設定ファイルのロード", "(0) Load a user pref file"), 3, 5);
2055 #ifdef ALLOW_VISUALS
2056 prt(_("(1) モンスターの 色/文字 をファイルに書き出す", "(1) Dump monster attr/chars"), 4, 5);
2057 prt(_("(2) アイテムの 色/文字 をファイルに書き出す", "(2) Dump object attr/chars"), 5, 5);
2058 prt(_("(3) 地形の 色/文字 をファイルに書き出す", "(3) Dump feature attr/chars"), 6, 5);
2059 prt(_("(4) モンスターの 色/文字 を変更する (数値操作)", "(4) Change monster attr/chars (numeric operation)"), 7, 5);
2060 prt(_("(5) アイテムの 色/文字 を変更する (数値操作)", "(5) Change object attr/chars (numeric operation)"), 8, 5);
2061 prt(_("(6) 地形の 色/文字 を変更する (数値操作)", "(6) Change feature attr/chars (numeric operation)"), 9, 5);
2062 prt(_("(7) モンスターの 色/文字 を変更する (シンボルエディタ)", "(7) Change monster attr/chars (visual mode)"), 10, 5);
2063 prt(_("(8) アイテムの 色/文字 を変更する (シンボルエディタ)", "(8) Change object attr/chars (visual mode)"), 11, 5);
2064 prt(_("(9) 地形の 色/文字 を変更する (シンボルエディタ)", "(9) Change feature attr/chars (visual mode)"), 12, 5);
2065 #endif /* ALLOW_VISUALS */
2067 prt(_("(R) 画面表示方法の初期化", "(R) Reset visuals"), 13, 5);
2070 prt(format("コマンド: %s", choice_msg ? choice_msg : _("", "")), 15, 0);
2073 static void do_cmd_knowledge_monsters(bool *need_redraw, bool visual_only, IDX direct_r_idx);
2074 static void do_cmd_knowledge_objects(bool *need_redraw, bool visual_only, IDX direct_k_idx);
2075 static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX direct_f_idx, IDX *lighting_level);
2078 * Interact with "visuals"
2080 void do_cmd_visuals(void)
2085 bool need_redraw = FALSE;
2086 concptr empty_symbol = "<< ? >>";
2088 if (use_bigtile) empty_symbol = "<< ?? >>";
2090 /* File type is "TEXT" */
2091 FILE_TYPE(FILE_TYPE_TEXT);
2094 /* Interact until done */
2099 /* Ask for a choice */
2100 print_visuals_menu(NULL);
2105 if (i == ESCAPE) break;
2109 /* Load a 'pref' file */
2112 prt(_("コマンド: ユーザー設定ファイルのロード", "Command: Load a user pref file"), 15, 0);
2115 prt(_("ファイル: ", "File: "), 17, 0);
2117 /* Default filename */
2118 sprintf(tmp, "%s.prf", p_ptr->base_name);
2121 if (!askfor(tmp, 70)) continue;
2123 /* Process the given filename */
2124 (void)process_pref_file(tmp);
2129 #ifdef ALLOW_VISUALS
2131 /* Dump monster attr/chars */
2134 static concptr mark = "Monster attr/chars";
2137 prt(_("コマンド: モンスターの[色/文字]をファイルに書き出します", "Command: Dump monster attr/chars"), 15, 0);
2140 prt(_("ファイル: ", "File: "), 17, 0);
2142 /* Default filename */
2143 sprintf(tmp, "%s.prf", p_ptr->base_name);
2145 /* Get a filename */
2146 if (!askfor(tmp, 70)) continue;
2147 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
2149 /* Append to the file */
2150 if (!open_auto_dump(buf, mark)) continue;
2153 auto_dump_printf(_("\n# モンスターの[色/文字]の設定\n\n", "\n# Monster attr/char definitions\n\n"));
2156 for (i = 0; i < max_r_idx; i++)
2158 monster_race *r_ptr = &r_info[i];
2160 /* Skip non-entries */
2161 if (!r_ptr->name) continue;
2163 /* Dump a comment */
2164 auto_dump_printf("# %s\n", (r_name + r_ptr->name));
2166 /* Dump the monster attr/char info */
2167 auto_dump_printf("R:%d:0x%02X/0x%02X\n\n", i,
2168 (byte)(r_ptr->x_attr), (byte)(r_ptr->x_char));
2174 msg_print(_("モンスターの[色/文字]をファイルに書き出しました。", "Dumped monster attr/chars."));
2179 /* Dump object attr/chars */
2182 static concptr mark = "Object attr/chars";
2183 KIND_OBJECT_IDX k_idx;
2186 prt(_("コマンド: アイテムの[色/文字]をファイルに書き出します", "Command: Dump object attr/chars"), 15, 0);
2189 prt(_("ファイル: ", "File: "), 17, 0);
2191 /* Default filename */
2192 sprintf(tmp, "%s.prf", p_ptr->base_name);
2194 /* Get a filename */
2195 if (!askfor(tmp, 70)) continue;
2196 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
2198 /* Append to the file */
2199 if (!open_auto_dump(buf, mark)) continue;
2202 auto_dump_printf(_("\n# アイテムの[色/文字]の設定\n\n", "\n# Object attr/char definitions\n\n"));
2205 for (k_idx = 0; k_idx < max_k_idx; k_idx++)
2207 GAME_TEXT o_name[MAX_NLEN];
2208 object_kind *k_ptr = &k_info[k_idx];
2210 /* Skip non-entries */
2211 if (!k_ptr->name) continue;
2216 strip_name(o_name, k_idx);
2222 /* Prepare dummy object */
2223 object_prep(&forge, k_idx);
2225 /* Get un-shuffled flavor name */
2226 object_desc(o_name, &forge, OD_FORCE_FLAVOR);
2229 /* Dump a comment */
2230 auto_dump_printf("# %s\n", o_name);
2232 /* Dump the object attr/char info */
2233 auto_dump_printf("K:%d:0x%02X/0x%02X\n\n", (int)k_idx,
2234 (byte)(k_ptr->x_attr), (byte)(k_ptr->x_char));
2240 msg_print(_("アイテムの[色/文字]をファイルに書き出しました。", "Dumped object attr/chars."));
2245 /* Dump feature attr/chars */
2248 static concptr mark = "Feature attr/chars";
2251 prt(_("コマンド: 地形の[色/文字]をファイルに書き出します", "Command: Dump feature attr/chars"), 15, 0);
2254 prt(_("ファイル: ", "File: "), 17, 0);
2256 /* Default filename */
2257 sprintf(tmp, "%s.prf", p_ptr->base_name);
2259 /* Get a filename */
2260 if (!askfor(tmp, 70)) continue;
2261 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
2263 /* Append to the file */
2264 if (!open_auto_dump(buf, mark)) continue;
2267 auto_dump_printf(_("\n# 地形の[色/文字]の設定\n\n", "\n# Feature attr/char definitions\n\n"));
2270 for (i = 0; i < max_f_idx; i++)
2272 feature_type *f_ptr = &f_info[i];
2274 /* Skip non-entries */
2275 if (!f_ptr->name) continue;
2277 /* Skip mimiccing features */
2278 if (f_ptr->mimic != i) continue;
2280 /* Dump a comment */
2281 auto_dump_printf("# %s\n", (f_name + f_ptr->name));
2283 /* Dump the feature attr/char info */
2284 auto_dump_printf("F:%d:0x%02X/0x%02X:0x%02X/0x%02X:0x%02X/0x%02X\n\n", i,
2285 (byte)(f_ptr->x_attr[F_LIT_STANDARD]), (byte)(f_ptr->x_char[F_LIT_STANDARD]),
2286 (byte)(f_ptr->x_attr[F_LIT_LITE]), (byte)(f_ptr->x_char[F_LIT_LITE]),
2287 (byte)(f_ptr->x_attr[F_LIT_DARK]), (byte)(f_ptr->x_char[F_LIT_DARK]));
2293 msg_print(_("地形の[色/文字]をファイルに書き出しました。", "Dumped feature attr/chars."));
2298 /* Modify monster attr/chars (numeric operation) */
2301 static concptr choice_msg = _("モンスターの[色/文字]を変更します", "Change monster attr/chars");
2302 static MONRACE_IDX r = 0;
2304 prt(format(_("コマンド: %s", "Command: %s"), choice_msg), 15, 0);
2306 /* Hack -- query until done */
2309 monster_race *r_ptr = &r_info[r];
2313 TERM_COLOR da = r_ptr->d_attr;
2314 byte dc = r_ptr->d_char;
2315 TERM_COLOR ca = r_ptr->x_attr;
2316 byte cc = r_ptr->x_char;
2318 /* Label the object */
2319 Term_putstr(5, 17, -1, TERM_WHITE,
2320 format(_("モンスター = %d, 名前 = %-40.40s", "Monster = %d, Name = %-40.40s"), r, (r_name + r_ptr->name)));
2322 /* Label the Default values */
2323 Term_putstr(10, 19, -1, TERM_WHITE,
2324 format(_("初期値 色 / 文字 = %3u / %3u", "Default attr/char = %3u / %3u"), da, dc));
2326 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
2327 Term_queue_bigchar(43, 19, da, dc, 0, 0);
2329 /* Label the Current values */
2330 Term_putstr(10, 20, -1, TERM_WHITE,
2331 format(_("現在値 色 / 文字 = %3u / %3u", "Current attr/char = %3u / %3u"), ca, cc));
2333 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
2334 Term_queue_bigchar(43, 20, ca, cc, 0, 0);
2337 Term_putstr(0, 22, -1, TERM_WHITE,
2338 _("コマンド (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): "));
2343 if (i == ESCAPE) break;
2345 if (iscntrl(i)) c = 'a' + i - KTRL('A');
2346 else if (isupper(i)) c = 'a' + i - 'A';
2356 if (!cmd_visuals_aux(i, &r, max_r_idx))
2362 while (!r_info[r].name);
2366 t = (int)r_ptr->x_attr;
2367 (void)cmd_visuals_aux(i, &t, 256);
2368 r_ptr->x_attr = (byte)t;
2372 t = (int)r_ptr->x_char;
2373 (void)cmd_visuals_aux(i, &t, 256);
2374 r_ptr->x_char = (byte)t;
2378 do_cmd_knowledge_monsters(&need_redraw, TRUE, r);
2380 print_visuals_menu(choice_msg);
2388 /* Modify object attr/chars (numeric operation) */
2391 static concptr choice_msg = _("アイテムの[色/文字]を変更します", "Change object attr/chars");
2393 prt(format(_("コマンド: %s", "Command: %s"), choice_msg), 15, 0);
2395 /* Hack -- query until done */
2398 object_kind *k_ptr = &k_info[k];
2402 TERM_COLOR da = k_ptr->d_attr;
2403 SYMBOL_CODE dc = k_ptr->d_char;
2404 TERM_COLOR ca = k_ptr->x_attr;
2405 SYMBOL_CODE cc = k_ptr->x_char;
2407 /* Label the object */
2408 Term_putstr(5, 17, -1, TERM_WHITE,
2409 format(_("アイテム = %d, 名前 = %-40.40s", "Object = %d, Name = %-40.40s"),
2410 k, k_name + (!k_ptr->flavor ? k_ptr->name : k_ptr->flavor_name)));
2412 /* Label the Default values */
2413 Term_putstr(10, 19, -1, TERM_WHITE,
2414 format(_("初期値 色 / 文字 = %3d / %3d", "Default attr/char = %3d / %3d"), da, dc));
2416 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
2417 Term_queue_bigchar(43, 19, da, dc, 0, 0);
2419 /* Label the Current values */
2420 Term_putstr(10, 20, -1, TERM_WHITE,
2421 format(_("現在値 色 / 文字 = %3d / %3d", "Current attr/char = %3d / %3d"), ca, cc));
2423 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
2424 Term_queue_bigchar(43, 20, ca, cc, 0, 0);
2427 Term_putstr(0, 22, -1, TERM_WHITE,
2428 _("コマンド (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): "));
2433 if (i == ESCAPE) break;
2435 if (iscntrl(i)) c = 'a' + i - KTRL('A');
2436 else if (isupper(i)) c = 'a' + i - 'A';
2446 if (!cmd_visuals_aux(i, &k, max_k_idx))
2452 while (!k_info[k].name);
2456 t = (int)k_ptr->x_attr;
2457 (void)cmd_visuals_aux(i, &t, 256);
2458 k_ptr->x_attr = (byte)t;
2462 t = (int)k_ptr->x_char;
2463 (void)cmd_visuals_aux(i, &t, 256);
2464 k_ptr->x_char = (byte)t;
2468 do_cmd_knowledge_objects(&need_redraw, TRUE, k);
2470 print_visuals_menu(choice_msg);
2478 /* Modify feature attr/chars (numeric operation) */
2481 static concptr choice_msg = _("地形の[色/文字]を変更します", "Change feature attr/chars");
2483 static IDX lighting_level = F_LIT_STANDARD;
2484 prt(format(_("コマンド: %s", "Command: %s"), choice_msg), 15, 0);
2486 /* Hack -- query until done */
2489 feature_type *f_ptr = &f_info[f];
2493 TERM_COLOR da = f_ptr->d_attr[lighting_level];
2494 byte dc = f_ptr->d_char[lighting_level];
2495 TERM_COLOR ca = f_ptr->x_attr[lighting_level];
2496 byte cc = f_ptr->x_char[lighting_level];
2498 /* Label the object */
2500 Term_putstr(5, 17, -1, TERM_WHITE,
2501 format(_("地形 = %d, 名前 = %s, 明度 = %s", "Terrain = %d, Name = %s, Lighting = %s"),
2502 f, (f_name + f_ptr->name), lighting_level_str[lighting_level]));
2504 /* Label the Default values */
2505 Term_putstr(10, 19, -1, TERM_WHITE,
2506 format(_("初期値 色 / 文字 = %3d / %3d", "Default attr/char = %3d / %3d"), da, dc));
2508 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
2509 Term_queue_bigchar(43, 19, da, dc, 0, 0);
2511 /* Label the Current values */
2513 Term_putstr(10, 20, -1, TERM_WHITE,
2514 format("現在値 色 / 文字 = %3d / %3d", ca, cc));
2516 Term_putstr(10, 20, -1, TERM_WHITE,
2517 format("Current attr/char = %3d / %3d", ca, cc));
2520 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
2521 Term_queue_bigchar(43, 20, ca, cc, 0, 0);
2525 Term_putstr(0, 22, -1, TERM_WHITE,
2526 "コマンド (n/N/^N/a/A/^A/c/C/^C/l/L/^L/d/D/^D/v/V/^V): ");
2528 Term_putstr(0, 22, -1, TERM_WHITE,
2529 "Command (n/N/^N/a/A/^A/c/C/^C/l/L/^L/d/D/^D/v/V/^V): ");
2535 if (i == ESCAPE) break;
2537 if (iscntrl(i)) c = 'a' + i - KTRL('A');
2538 else if (isupper(i)) c = 'a' + i - 'A';
2548 if (!cmd_visuals_aux(i, &f, max_f_idx))
2554 while (!f_info[f].name || (f_info[f].mimic != f));
2558 t = (int)f_ptr->x_attr[lighting_level];
2559 (void)cmd_visuals_aux(i, &t, 256);
2560 f_ptr->x_attr[lighting_level] = (byte)t;
2564 t = (int)f_ptr->x_char[lighting_level];
2565 (void)cmd_visuals_aux(i, &t, 256);
2566 f_ptr->x_char[lighting_level] = (byte)t;
2570 (void)cmd_visuals_aux(i, &lighting_level, F_LIT_MAX);
2573 apply_default_feat_lighting(f_ptr->x_attr, f_ptr->x_char);
2577 do_cmd_knowledge_features(&need_redraw, TRUE, f, &lighting_level);
2579 print_visuals_menu(choice_msg);
2587 /* Modify monster attr/chars (visual mode) */
2589 do_cmd_knowledge_monsters(&need_redraw, TRUE, -1);
2592 /* Modify object attr/chars (visual mode) */
2594 do_cmd_knowledge_objects(&need_redraw, TRUE, -1);
2597 /* Modify feature attr/chars (visual mode) */
2600 IDX lighting_level = F_LIT_STANDARD;
2601 do_cmd_knowledge_features(&need_redraw, TRUE, -1, &lighting_level);
2605 #endif /* ALLOW_VISUALS */
2613 msg_print(_("画面上の[色/文字]を初期値にリセットしました。", "Visual attr/char tables reset."));
2617 /* Unknown option */
2627 if (need_redraw) do_cmd_redraw();
2632 * Interact with "colors"
2634 void do_cmd_colors(void)
2643 /* File type is "TEXT" */
2644 FILE_TYPE(FILE_TYPE_TEXT);
2649 /* Interact until done */
2654 /* Ask for a choice */
2655 prt(_("[ カラーの設定 ]", "Interact with Colors"), 2, 0);
2657 /* Give some choices */
2658 prt(_("(1) ユーザー設定ファイルのロード", "(1) Load a user pref file"), 4, 5);
2661 prt(_("(2) カラーの設定をファイルに書き出す", "(2) Dump colors"), 5, 5);
2662 prt(_("(3) カラーの設定を変更する", "(3) Modify colors"), 6, 5);
2666 prt(_("コマンド: ", "Command: "), 8, 0);
2670 if (i == ESCAPE) break;
2672 /* Load a 'pref' file */
2676 prt(_("コマンド: ユーザー設定ファイルをロードします", "Command: Load a user pref file"), 8, 0);
2679 prt(_("ファイル: ", "File: "), 10, 0);
2682 sprintf(tmp, "%s.prf", p_ptr->base_name);
2685 if (!askfor(tmp, 70)) continue;
2687 /* Process the given filename */
2688 (void)process_pref_file(tmp);
2690 /* Mega-Hack -- react to changes */
2691 Term_xtra(TERM_XTRA_REACT, 0);
2693 /* Mega-Hack -- redraw */
2702 static concptr mark = "Colors";
2705 prt(_("コマンド: カラーの設定をファイルに書き出します", "Command: Dump colors"), 8, 0);
2708 prt(_("ファイル: ", "File: "), 10, 0);
2710 /* Default filename */
2711 sprintf(tmp, "%s.prf", p_ptr->base_name);
2713 /* Get a filename */
2714 if (!askfor(tmp, 70)) continue;
2715 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
2717 /* Append to the file */
2718 if (!open_auto_dump(buf, mark)) continue;
2721 auto_dump_printf(_("\n# カラーの設定\n\n", "\n# Color redefinitions\n\n"));
2724 for (i = 0; i < 256; i++)
2726 int kv = angband_color_table[i][0];
2727 int rv = angband_color_table[i][1];
2728 int gv = angband_color_table[i][2];
2729 int bv = angband_color_table[i][3];
2731 concptr name = _("未知", "unknown");
2733 /* Skip non-entries */
2734 if (!kv && !rv && !gv && !bv) continue;
2736 /* Extract the color name */
2737 if (i < 16) name = color_names[i];
2739 /* Dump a comment */
2740 auto_dump_printf(_("# カラー '%s'\n", "# Color '%s'\n"), name);
2742 /* Dump the monster attr/char info */
2743 auto_dump_printf("V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n",
2750 msg_print(_("カラーの設定をファイルに書き出しました。", "Dumped color redefinitions."));
2759 prt(_("コマンド: カラーの設定を変更します", "Command: Modify colors"), 8, 0);
2761 /* Hack -- query until done */
2770 /* Exhibit the normal colors */
2771 for (j = 0; j < 16; j++)
2773 /* Exhibit this color */
2774 Term_putstr(j*4, 20, -1, a, "###");
2776 /* Exhibit all colors */
2777 Term_putstr(j*4, 22, -1, j, format("%3d", j));
2780 /* Describe the color */
2781 name = ((a < 16) ? color_names[a] : _("未定義", "undefined"));
2783 /* Describe the color */
2784 Term_putstr(5, 10, -1, TERM_WHITE,
2785 format(_("カラー = %d, 名前 = %s", "Color = %d, Name = %s"), a, name));
2787 /* Label the Current values */
2788 Term_putstr(5, 12, -1, TERM_WHITE,
2789 format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x",
2790 angband_color_table[a][0],
2791 angband_color_table[a][1],
2792 angband_color_table[a][2],
2793 angband_color_table[a][3]));
2796 Term_putstr(0, 14, -1, TERM_WHITE,
2797 _("コマンド (n/N/k/K/r/R/g/G/b/B): ", "Command (n/N/k/K/r/R/g/G/b/B): "));
2802 if (i == ESCAPE) break;
2805 if (i == 'n') a = (byte)(a + 1);
2806 if (i == 'N') a = (byte)(a - 1);
2807 if (i == 'k') angband_color_table[a][0] = (byte)(angband_color_table[a][0] + 1);
2808 if (i == 'K') angband_color_table[a][0] = (byte)(angband_color_table[a][0] - 1);
2809 if (i == 'r') angband_color_table[a][1] = (byte)(angband_color_table[a][1] + 1);
2810 if (i == 'R') angband_color_table[a][1] = (byte)(angband_color_table[a][1] - 1);
2811 if (i == 'g') angband_color_table[a][2] = (byte)(angband_color_table[a][2] + 1);
2812 if (i == 'G') angband_color_table[a][2] = (byte)(angband_color_table[a][2] - 1);
2813 if (i == 'b') angband_color_table[a][3] = (byte)(angband_color_table[a][3] + 1);
2814 if (i == 'B') angband_color_table[a][3] = (byte)(angband_color_table[a][3] - 1);
2816 /* Hack -- react to changes */
2817 Term_xtra(TERM_XTRA_REACT, 0);
2819 /* Hack -- redraw */
2826 /* Unknown option */
2840 * Note something in the message recall
2842 void do_cmd_note(void)
2850 if (!get_string(_("メモ: ", "Note: "), buf, 60)) return;
2852 /* Ignore empty notes */
2853 if (!buf[0] || (buf[0] == ' ')) return;
2855 /* Add the note to the message recall */
2856 msg_format(_("メモ: %s", "Note: %s"), buf);
2861 * Mention the current version
2863 void do_cmd_version(void)
2865 #if FAKE_VER_EXTRA > 0
2866 msg_format(_("変愚蛮怒(Hengband) %d.%d.%d.%d", "You are playing Hengband %d.%d.%d.%d."),
2867 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH, FAKE_VER_EXTRA);
2869 msg_format(_("変愚蛮怒(Hengband) %d.%d.%d", "You are playing Hengband %d.%d.%d."),
2870 FAKE_VER_MAJOR - 10, FAKE_VER_MINOR, FAKE_VER_PATCH);
2877 * Array of feeling strings
2879 static concptr do_cmd_feeling_text[11] =
2881 _("この階の雰囲気を感じとれなかった...", "Looks like any other level."),
2882 _("この階には何か特別なものがあるような気がする。", "You feel there is something special about this level."),
2883 _("恐ろしい死の幻が目に浮かび、気絶しそうになった!", "You nearly faint as horrible visions of death fill your mind!"),
2884 _("この階はとても危険なようだ。", "This level looks very dangerous."),
2885 _("とても悪い予感がする...", "You have a very bad feeling..."),
2886 _("悪い予感がする...", "You have a bad feeling..."),
2887 _("何か緊張する。", "You feel nervous."),
2888 _("少し不運な気がする...", "You feel your luck is turning..."),
2889 _("この場所は好きになれない。", "You don't like the look of this place."),
2890 _("この階はそれなりに安全なようだ。", "This level looks reasonably safe."),
2891 _("なんて退屈なところだ...", "What a boring place...")
2894 static concptr do_cmd_feeling_text_combat[11] =
2896 _("この階の雰囲気を感じとれなかった...", "Looks like any other level."),
2897 _("この階には何か特別なものがあるような気がする。", "You feel there is something special about this level."),
2898 _("今夜もまた、誰かが命を落とす...", "You nearly faint as horrible visions of death fill your mind!"),
2899 _("この階はとても危険なようだ。", "This level looks very dangerous."),
2900 _("とても悪い予感がする...", "You have a very bad feeling..."),
2901 _("悪い予感がする...", "You have a bad feeling..."),
2902 _("何か緊張する。", "You feel nervous."),
2903 _("少し不運な気がする...", "You feel your luck is turning..."),
2904 _("この場所は好きになれない。", "You don't like the look of this place."),
2905 _("この階はそれなりに安全なようだ。", "This level looks reasonably safe."),
2906 _("なんて退屈なところだ...", "What a boring place...")
2909 static concptr do_cmd_feeling_text_lucky[11] =
2911 _("この階の雰囲気を感じとれなかった...", "Looks like any other level."),
2912 _("この階には何か特別なものがあるような気がする。", "You feel there is something special about this level."),
2913 _("この階はこの上なく素晴らしい感じがする。", "You have a superb feeling about this level."),
2914 _("素晴らしい感じがする...", "You have an excellent feeling..."),
2915 _("とても良い感じがする...", "You have a very good feeling..."),
2916 _("良い感じがする...", "You have a good feeling..."),
2917 _("ちょっと幸運な感じがする...", "You feel strangely lucky..."),
2918 _("多少は運が向いてきたか...", "You feel your luck is turning..."),
2919 _("見た感じ悪くはない...", "You like the look of this place..."),
2920 _("全然駄目ということはないが...", "This level can't be all bad..."),
2921 _("なんて退屈なところだ...", "What a boring place...")
2926 * Note that "feeling" is set to zero unless some time has passed.
2927 * Note that this is done when the level is GENERATED, not entered.
2929 void do_cmd_feeling(void)
2931 if (p_ptr->wild_mode) return;
2933 /* No useful feeling in quests */
2934 if (p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level))
2936 msg_print(_("典型的なクエストのダンジョンのようだ。", "Looks like a typical quest level."));
2940 /* No useful feeling in town */
2941 else if (p_ptr->town_num && !current_floor_ptr->dun_level)
2943 if (!strcmp(town_info[p_ptr->town_num].name, _("荒野", "wilderness")))
2945 msg_print(_("何かありそうな荒野のようだ。", "Looks like a strange wilderness."));
2950 msg_print(_("典型的な町のようだ。", "Looks like a typical town."));
2955 /* No useful feeling in the wilderness */
2956 else if (!current_floor_ptr->dun_level)
2958 msg_print(_("典型的な荒野のようだ。", "Looks like a typical wilderness."));
2962 /* Display the feeling */
2963 if (p_ptr->muta3 & MUT3_GOOD_LUCK)
2964 msg_print(do_cmd_feeling_text_lucky[p_ptr->feeling]);
2965 else if (p_ptr->pseikaku == SEIKAKU_COMBAT ||
2966 p_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON)
2967 msg_print(do_cmd_feeling_text_combat[p_ptr->feeling]);
2969 msg_print(do_cmd_feeling_text[p_ptr->feeling]);
2975 * Description of each monster group.
2977 static concptr monster_group_text[] =
2980 "ユニーク", /* "Uniques" */
2981 "乗馬可能なモンスター", /* "Riding" */
2982 "賞金首", /* "Wanted */
2983 "アンバーの王族", /* "Ambertite" */
3012 /* "古代ドラゴン/ワイアーム", */
3073 /* "Ancient Dragon/Wyrm", */
3082 "Multi-Headed Reptile",
3087 "Reptile/Amphibian",
3088 "Spider/Scorpion/Tick",
3090 /* "Major Demon", */
3107 * Symbols of monsters in each group. Note the "Uniques" group
3108 * is handled differently.
3110 static concptr monster_group_char[] =
3167 "!$&()+./=>?[\\]`{|~",
3177 * Build a list of monster indexes in the given group. Return the number
3178 * of monsters in the group.
3180 * mode & 0x01 : check for non-empty group
3181 * mode & 0x02 : visual operation only
3183 static IDX collect_monsters(IDX grp_cur, IDX mon_idx[], BIT_FLAGS8 mode)
3189 /* Get a list of x_char in this group */
3190 concptr group_char = monster_group_char[grp_cur];
3192 /* XXX Hack -- Check if this is the "Uniques" group */
3193 bool grp_unique = (monster_group_char[grp_cur] == (char *) -1L);
3195 /* XXX Hack -- Check if this is the "Riding" group */
3196 bool grp_riding = (monster_group_char[grp_cur] == (char *) -2L);
3198 /* XXX Hack -- Check if this is the "Wanted" group */
3199 bool grp_wanted = (monster_group_char[grp_cur] == (char *) -3L);
3201 /* XXX Hack -- Check if this is the "Amberite" group */
3202 bool grp_amberite = (monster_group_char[grp_cur] == (char *) -4L);
3205 /* Check every race */
3206 for (i = 0; i < max_r_idx; i++)
3208 /* Access the race */
3209 monster_race *r_ptr = &r_info[i];
3211 /* Skip empty race */
3212 if (!r_ptr->name) continue ;
3214 /* Require known monsters */
3215 if (!(mode & 0x02) && !cheat_know && !r_ptr->r_sights) continue;
3219 if (!(r_ptr->flags1 & RF1_UNIQUE)) continue;
3222 else if (grp_riding)
3224 if (!(r_ptr->flags7 & RF7_RIDING)) continue;
3227 else if (grp_wanted)
3229 bool wanted = FALSE;
3231 for (j = 0; j < MAX_KUBI; j++)
3233 if (current_world_ptr->bounty_r_idx[j] == i || current_world_ptr->bounty_r_idx[j] - 10000 == i ||
3234 (p_ptr->today_mon && p_ptr->today_mon == i))
3240 if (!wanted) continue;
3243 else if (grp_amberite)
3245 if (!(r_ptr->flags3 & RF3_AMBERITE)) continue;
3250 /* Check for race in the group */
3251 if (!my_strchr(group_char, r_ptr->d_char)) continue;
3255 mon_idx[mon_cnt++] = i;
3257 /* XXX Hack -- Just checking for non-empty group */
3258 if (mode & 0x01) break;
3261 /* Terminate the list */
3262 mon_idx[mon_cnt] = -1;
3264 ang_sort(mon_idx, &dummy_why, mon_cnt, ang_sort_comp_monster_level, ang_sort_swap_hook);
3266 /* Return the number of races */
3272 * Description of each monster group.
3274 static concptr object_group_text[] =
3277 "キノコ", /* "Mushrooms" */
3278 "薬", /* "Potions" */
3279 "油つぼ", /* "Flasks" */
3280 "巻物", /* "Scrolls" */
3282 "アミュレット", /* "Amulets" */
3283 "笛", /* "Whistle" */
3284 "光源", /* "Lanterns" */
3285 "魔法棒", /* "Wands" */
3288 "カード", /* "Cards" */
3299 "刀剣類", /* "Swords" */
3300 "鈍器", /* "Blunt Weapons" */
3301 "長柄武器", /* "Polearms" */
3302 "採掘道具", /* "Diggers" */
3303 "飛び道具", /* "Bows" */
3307 "軽装鎧", /* "Soft Armor" */
3308 "重装鎧", /* "Hard Armor" */
3309 "ドラゴン鎧", /* "Dragon Armor" */
3310 "盾", /* "Shields" */
3311 "クローク", /* "Cloaks" */
3312 "籠手", /* "Gloves" */
3313 "ヘルメット", /* "Helms" */
3315 "ブーツ", /* "Boots" */
3368 * TVALs of items in each group
3370 static byte object_group_tval[] =
3411 TV_LIFE_BOOK, /* Hack -- all spellbooks */
3419 * Build a list of object indexes in the given group. Return the number
3420 * of objects in the group.
3422 * mode & 0x01 : check for non-empty group
3423 * mode & 0x02 : visual operation only
3425 static KIND_OBJECT_IDX collect_objects(int grp_cur, KIND_OBJECT_IDX object_idx[], BIT_FLAGS8 mode)
3427 KIND_OBJECT_IDX i, object_cnt = 0;
3430 /* Get a list of x_char in this group */
3431 byte group_tval = object_group_tval[grp_cur];
3433 /* Check every object */
3434 for (i = 0; i < max_k_idx; i++)
3436 /* Access the object */
3437 object_kind *k_ptr = &k_info[i];
3439 /* Skip empty objects */
3440 if (!k_ptr->name) continue;
3444 /* Any objects will be displayed */
3450 /* Skip non-flavoured objects */
3451 if (!k_ptr->flavor) continue;
3453 /* Require objects ever seen */
3454 if (!k_ptr->aware) continue;
3457 /* Skip items with no distribution (special artifacts) */
3458 for (j = 0, k = 0; j < 4; j++) k += k_ptr->chance[j];
3462 /* Check for objects in the group */
3463 if (TV_LIFE_BOOK == group_tval)
3465 /* Hack -- All spell books */
3466 if (TV_LIFE_BOOK <= k_ptr->tval && k_ptr->tval <= TV_HEX_BOOK)
3468 /* Add the object */
3469 object_idx[object_cnt++] = i;
3473 else if (k_ptr->tval == group_tval)
3475 /* Add the object */
3476 object_idx[object_cnt++] = i;
3480 /* XXX Hack -- Just checking for non-empty group */
3481 if (mode & 0x01) break;
3484 /* Terminate the list */
3485 object_idx[object_cnt] = -1;
3487 /* Return the number of objects */
3493 * Description of each feature group.
3495 static concptr feature_group_text[] =
3503 * Build a list of feature indexes in the given group. Return the number
3504 * of features in the group.
3506 * mode & 0x01 : check for non-empty group
3508 static FEAT_IDX collect_features(int grp_cur, FEAT_IDX *feat_idx, BIT_FLAGS8 mode)
3511 FEAT_IDX feat_cnt = 0;
3513 /* Unused; There is a single group. */
3516 /* Check every feature */
3517 for (i = 0; i < max_f_idx; i++)
3519 feature_type *f_ptr = &f_info[i];
3521 /* Skip empty index */
3522 if (!f_ptr->name) continue;
3524 /* Skip mimiccing features */
3525 if (f_ptr->mimic != i) continue;
3528 feat_idx[feat_cnt++] = i;
3530 /* XXX Hack -- Just checking for non-empty group */
3531 if (mode & 0x01) break;
3534 /* Terminate the list */
3535 feat_idx[feat_cnt] = -1;
3537 /* Return the number of races */
3544 * Build a list of monster indexes in the given group. Return the number
3545 * of monsters in the group.
3547 static int collect_artifacts(int grp_cur, int object_idx[])
3549 int i, object_cnt = 0;
3551 /* Get a list of x_char in this group */
3552 byte group_tval = object_group_tval[grp_cur];
3554 /* Check every object */
3555 for (i = 0; i < max_a_idx; i++)
3557 /* Access the artifact */
3558 artifact_type *a_ptr = &a_info[i];
3560 /* Skip empty artifacts */
3561 if (!a_ptr->name) continue;
3563 /* Skip "uncreated" artifacts */
3564 if (!a_ptr->cur_num) continue;
3566 /* Check for race in the group */
3567 if (a_ptr->tval == group_tval)
3570 object_idx[object_cnt++] = i;
3574 /* Terminate the list */
3575 object_idx[object_cnt] = 0;
3577 /* Return the number of races */
3584 * Encode the screen colors
3586 static char hack[17] = "dwsorgbuDWvyRGBU";
3590 * Hack -- load a screen dump from a file
3592 void do_cmd_load_screen(void)
3597 SYMBOL_CODE c = ' ';
3603 Term_get_size(&wid, &hgt);
3604 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
3606 /* Append to the file */
3607 fff = my_fopen(buf, "r");
3610 msg_format(_("%s を開くことができませんでした。", "Failed to open %s."), buf);
3618 /* Load the screen */
3619 for (y = 0; okay; y++)
3621 /* Get a line of data including control code */
3622 if (!fgets(buf, 1024, fff)) okay = FALSE;
3624 /* Get the blank line */
3625 if (buf[0] == '\n' || buf[0] == '\0') break;
3627 /* Ignore too large screen image */
3628 if (y >= hgt) continue;
3631 for (x = 0; x < wid - 1; x++)
3634 if (buf[x] == '\n' || buf[x] == '\0') break;
3636 /* Put the attr/char */
3637 Term_draw(x, y, TERM_WHITE, buf[x]);
3641 /* Dump the screen */
3642 for (y = 0; okay; y++)
3644 /* Get a line of data including control code */
3645 if (!fgets(buf, 1024, fff)) okay = FALSE;
3647 /* Get the blank line */
3648 if (buf[0] == '\n' || buf[0] == '\0') break;
3650 /* Ignore too large screen image */
3651 if (y >= hgt) continue;
3654 for (x = 0; x < wid - 1; x++)
3657 if (buf[x] == '\n' || buf[x] == '\0') break;
3659 /* Get the attr/char */
3660 (void)(Term_what(x, y, &a, &c));
3662 /* Look up the attr */
3663 for (i = 0; i < 16; i++)
3665 /* Use attr matches */
3666 if (hack[i] == buf[x]) a = (byte_hack)i;
3669 /* Put the attr/char */
3670 Term_draw(x, y, a, c);
3675 prt(_("ファイルに書き出された画面(記念撮影)をロードしました。", "Screen dump loaded."), 0, 0);
3686 concptr inven_res_label = _(" 酸電火冷毒光闇破轟獄因沌劣 盲怖乱痺透命感消復浮",
3687 " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv");
3690 #define IM_FLAG_STR _("*", "* ")
3691 #define HAS_FLAG_STR _("+", "+ ")
3692 #define NO_FLAG_STR _("・", ". ")
3694 #define print_im_or_res_flag(IM, RES) \
3696 fputs(have_flag(flgs, (IM)) ? IM_FLAG_STR : \
3697 (have_flag(flgs, (RES)) ? HAS_FLAG_STR : NO_FLAG_STR), fff); \
3700 #define print_flag(TR) \
3702 fputs(have_flag(flgs, (TR)) ? HAS_FLAG_STR : NO_FLAG_STR, fff); \
3706 /* XTRA HACK RESLIST */
3707 static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr, int *j, OBJECT_TYPE_VALUE tval, char *where)
3709 GAME_TEXT o_name[MAX_NLEN];
3710 BIT_FLAGS flgs[TR_FLAG_SIZE];
3712 if (!o_ptr->k_idx) return;
3713 if (o_ptr->tval != tval) return;
3715 /* Identified items only */
3716 if (!object_is_known(o_ptr)) return;
3719 * HACK:Ring of Lordly protection and Dragon equipment
3720 * have random resistances.
3722 if ((object_is_wearable(o_ptr) && object_is_ego(o_ptr))
3723 || ((tval == TV_AMULET) && (o_ptr->sval == SV_AMULET_RESISTANCE))
3724 || ((tval == TV_RING) && (o_ptr->sval == SV_RING_LORDLY))
3725 || ((tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD))
3726 || ((tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM))
3727 || ((tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES))
3728 || ((tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE))
3729 || object_is_artifact(o_ptr))
3732 object_desc(o_name, o_ptr, OD_NAME_ONLY);
3734 while (o_name[i] && (i < 26))
3737 if (iskanji(o_name[i])) i++;
3746 o_name[i] = ' '; i++;
3751 fprintf(fff, "%s %s", where, o_name);
3753 if (!(o_ptr->ident & (IDENT_MENTAL)))
3755 fputs(_("-------不明--------------- -------不明---------\n",
3756 "-------unknown------------ -------unknown------\n"), fff);
3760 object_flags_known(o_ptr, flgs);
3762 print_im_or_res_flag(TR_IM_ACID, TR_RES_ACID);
3763 print_im_or_res_flag(TR_IM_ELEC, TR_RES_ELEC);
3764 print_im_or_res_flag(TR_IM_FIRE, TR_RES_FIRE);
3765 print_im_or_res_flag(TR_IM_COLD, TR_RES_COLD);
3766 print_flag(TR_RES_POIS);
3767 print_flag(TR_RES_LITE);
3768 print_flag(TR_RES_DARK);
3769 print_flag(TR_RES_SHARDS);
3770 print_flag(TR_RES_SOUND);
3771 print_flag(TR_RES_NETHER);
3772 print_flag(TR_RES_NEXUS);
3773 print_flag(TR_RES_CHAOS);
3774 print_flag(TR_RES_DISEN);
3778 print_flag(TR_RES_BLIND);
3779 print_flag(TR_RES_FEAR);
3780 print_flag(TR_RES_CONF);
3781 print_flag(TR_FREE_ACT);
3782 print_flag(TR_SEE_INVIS);
3783 print_flag(TR_HOLD_EXP);
3784 print_flag(TR_TELEPATHY);
3785 print_flag(TR_SLOW_DIGEST);
3786 print_flag(TR_REGEN);
3787 print_flag(TR_LEVITATION);
3795 fprintf(fff, "%s\n", inven_res_label);
3801 * Display *ID* ed weapons/armors's resistances
3803 static void do_cmd_knowledge_inven(void)
3806 GAME_TEXT file_name[1024];
3808 OBJECT_TYPE_VALUE tval;
3814 /* Open a new file */
3815 fff = my_fopen_temp(file_name, 1024);
3818 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
3822 fprintf(fff, "%s\n", inven_res_label);
3824 for (tval = TV_WEARABLE_BEGIN; tval <= TV_WEARABLE_END; tval++)
3828 for (; j < 9; j++) fputc('\n', fff);
3830 fprintf(fff, "%s\n", inven_res_label);
3832 strcpy(where, _("装", "E "));
3833 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
3835 do_cmd_knowledge_inven_aux(fff, &p_ptr->inventory_list[i], &j, tval, where);
3837 strcpy(where, _("持", "I "));
3838 for (i = 0; i < INVEN_PACK; i++)
3840 do_cmd_knowledge_inven_aux(fff, &p_ptr->inventory_list[i], &j, tval, where);
3843 st_ptr = &town_info[1].store[STORE_HOME];
3844 strcpy(where, _("家", "H "));
3845 for (i = 0; i < st_ptr->stock_num; i++)
3847 do_cmd_knowledge_inven_aux(fff, &st_ptr->stock[i], &j, tval, where);
3852 /* Display the file contents */
3853 show_file(TRUE, file_name, _("*鑑定*済み武器/防具の耐性リスト", "Resistances of *identified* equipment"), 0, 0);
3858 void do_cmd_save_screen_html_aux(char *filename, int message)
3863 TERM_COLOR a = 0, old_a = 0;
3877 concptr html_head[] = {
3878 "<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
3882 concptr html_foot[] = {
3884 "</body>\n</html>\n",
3890 Term_get_size(&wid, &hgt);
3892 /* File type is "TEXT" */
3893 FILE_TYPE(FILE_TYPE_TEXT);
3895 /* Append to the file */
3896 fff = my_fopen(filename, "w");
3900 msg_format(_("ファイル %s を開けませんでした。", "Failed to open file %s."), filename);
3906 if (message) screen_save();
3907 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "htmldump.prf");
3908 tmpfff = my_fopen(buf, "r");
3910 for (i = 0; html_head[i]; i++)
3911 fputs(html_head[i], fff);
3915 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
3917 if (strncmp(buf, tags[0], strlen(tags[0])) == 0)
3921 if (strncmp(buf, tags[1], strlen(tags[1])) == 0)
3923 fprintf(fff, "%s\n", buf);
3928 /* Dump the screen */
3929 for (y = 0; y < hgt; y++)
3936 for (x = 0; x < wid - 1; x++)
3940 /* Get the attr/char */
3941 (void)(Term_what(x, y, &a, &c));
3945 case '&': cc = "&"; break;
3946 case '<': cc = "<"; break;
3947 case '>': cc = ">"; break;
3949 case 0x1f: c = '.'; break;
3950 case 0x7f: c = (a == 0x09) ? '%' : '#'; break;
3955 if ((y == 0 && x == 0) || a != old_a) {
3956 rv = angband_color_table[a][1];
3957 gv = angband_color_table[a][2];
3958 bv = angband_color_table[a][3];
3959 fprintf(fff, "%s<font color=\"#%02x%02x%02x\">",
3960 ((y == 0 && x == 0) ? "" : "</font>"), rv, gv, bv);
3964 fprintf(fff, "%s", cc);
3966 fprintf(fff, "%c", c);
3969 fprintf(fff, "</font>");
3972 for (i = 0; html_foot[i]; i++)
3973 fputs(html_foot[i], fff);
3978 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
3980 if (strncmp(buf, tags[2], strlen(tags[2])) == 0)
3984 if (strncmp(buf, tags[3], strlen(tags[3])) == 0)
3986 fprintf(fff, "%s\n", buf);
3997 msg_print(_("画面(記念撮影)をファイルに書き出しました。", "Screen dump saved."));
4005 * Hack -- save a screen dump to a file
4007 static void do_cmd_save_screen_html(void)
4009 char buf[1024], tmp[256] = "screen.html";
4011 if (!get_string(_("ファイル名: ", "File name: "), tmp, 80))
4013 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
4017 do_cmd_save_screen_html_aux(buf, 1);
4022 * Redefinable "save_screen" action
4024 void (*screendump_aux)(void) = NULL;
4028 * Hack -- save a screen dump to a file
4030 void do_cmd_save_screen(void)
4032 bool old_use_graphics = use_graphics;
4033 bool html_dump = FALSE;
4037 prt(_("記念撮影しますか? [(y)es/(h)tml/(n)o] ", "Save screen dump? [(y)es/(h)tml/(n)o] "), 0, 0);
4041 if (c == 'Y' || c == 'y')
4043 else if (c == 'H' || c == 'h')
4055 Term_get_size(&wid, &hgt);
4057 if (old_use_graphics)
4059 use_graphics = FALSE;
4061 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
4067 do_cmd_save_screen_html();
4071 /* Do we use a special screendump function ? */
4072 else if (screendump_aux)
4074 /* Dump the screen to a graphics file */
4075 (*screendump_aux)();
4077 else /* Dump the screen as text */
4081 SYMBOL_CODE c = ' ';
4084 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
4086 /* File type is "TEXT" */
4087 FILE_TYPE(FILE_TYPE_TEXT);
4089 /* Append to the file */
4090 fff = my_fopen(buf, "w");
4094 msg_format(_("ファイル %s を開けませんでした。", "Failed to open file %s."), buf);
4102 /* Dump the screen */
4103 for (y = 0; y < hgt; y++)
4106 for (x = 0; x < wid - 1; x++)
4108 /* Get the attr/char */
4109 (void)(Term_what(x, y, &a, &c));
4119 fprintf(fff, "%s\n", buf);
4126 /* Dump the screen */
4127 for (y = 0; y < hgt; y++)
4130 for (x = 0; x < wid - 1; x++)
4132 /* Get the attr/char */
4133 (void)(Term_what(x, y, &a, &c));
4136 buf[x] = hack[a&0x0F];
4143 fprintf(fff, "%s\n", buf);
4150 msg_print(_("画面(記念撮影)をファイルに書き出しました。", "Screen dump saved."));
4155 if (old_use_graphics)
4157 use_graphics = TRUE;
4159 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
4165 * Check the status of "artifacts"
4167 static void do_cmd_knowledge_artifacts(void)
4177 GAME_TEXT file_name[1024];
4178 GAME_TEXT base_name[MAX_NLEN];
4182 /* Open a new file */
4183 fff = my_fopen_temp(file_name, 1024);
4186 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
4191 /* Allocate the "who" array */
4192 C_MAKE(who, max_a_idx, ARTIFACT_IDX);
4194 /* Allocate the "okay" array */
4195 C_MAKE(okay, max_a_idx, bool);
4197 /* Scan the artifacts */
4198 for (k = 0; k < max_a_idx; k++)
4200 artifact_type *a_ptr = &a_info[k];
4205 /* Skip "empty" artifacts */
4206 if (!a_ptr->name) continue;
4208 /* Skip "uncreated" artifacts */
4209 if (!a_ptr->cur_num) continue;
4215 /* Check the dungeon */
4216 for (y = 0; y < current_floor_ptr->height; y++)
4218 for (x = 0; x < current_floor_ptr->width; x++)
4220 grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
4222 OBJECT_IDX this_o_idx, next_o_idx = 0;
4224 /* Scan all objects in the grid */
4225 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
4228 o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
4229 next_o_idx = o_ptr->next_o_idx;
4231 /* Ignore non-artifacts */
4232 if (!object_is_fixed_artifact(o_ptr)) continue;
4234 /* Ignore known items */
4235 if (object_is_known(o_ptr)) continue;
4237 /* Note the artifact */
4238 okay[o_ptr->name1] = FALSE;
4243 /* Check the p_ptr->inventory_list and equipment */
4244 for (i = 0; i < INVEN_TOTAL; i++)
4246 object_type *o_ptr = &p_ptr->inventory_list[i];
4248 /* Ignore non-objects */
4249 if (!o_ptr->k_idx) continue;
4251 /* Ignore non-artifacts */
4252 if (!object_is_fixed_artifact(o_ptr)) continue;
4254 /* Ignore known items */
4255 if (object_is_known(o_ptr)) continue;
4257 /* Note the artifact */
4258 okay[o_ptr->name1] = FALSE;
4261 for (k = 0; k < max_a_idx; k++)
4263 if (okay[k]) who[n++] = k;
4266 ang_sort(who, &why, n, ang_sort_art_comp, ang_sort_art_swap);
4268 /* Scan the artifacts */
4269 for (k = 0; k < n; k++)
4271 artifact_type *a_ptr = &a_info[who[k]];
4272 strcpy(base_name, _("未知の伝説のアイテム", "Unknown Artifact"));
4274 /* Obtain the base object type */
4275 z = lookup_kind(a_ptr->tval, a_ptr->sval);
4284 /* Create fake object */
4285 object_prep(q_ptr, z);
4287 /* Make it an artifact */
4288 q_ptr->name1 = (byte)who[k];
4290 /* Display as if known */
4291 q_ptr->ident |= IDENT_STORE;
4293 /* Describe the artifact */
4294 object_desc(base_name, q_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
4297 /* Hack -- Build the artifact name */
4298 fprintf(fff, _(" %s\n", " The %s\n"), base_name);
4301 /* Free the "who" array */
4302 C_KILL(who, max_a_idx, ARTIFACT_IDX);
4304 /* Free the "okay" array */
4305 C_KILL(okay, max_a_idx, bool);
4308 /* Display the file contents */
4309 show_file(TRUE, file_name, _("既知の伝説のアイテム", "Artifacts Seen"), 0, 0);
4315 * Display known uniques
4316 * With "XTRA HACK UNIQHIST" (Originally from XAngband)
4318 static void do_cmd_knowledge_uniques(void)
4327 GAME_TEXT file_name[1024];
4330 int n_alive_surface = 0;
4331 int n_alive_over100 = 0;
4332 int n_alive_total = 0;
4335 for (i = 0; i < 10; i++) n_alive[i] = 0;
4337 /* Open a new file */
4338 fff = my_fopen_temp(file_name, 1024);
4342 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
4347 /* Allocate the "who" array */
4348 C_MAKE(who, max_r_idx, MONRACE_IDX);
4350 /* Scan the monsters */
4351 for (i = 1; i < max_r_idx; i++)
4353 monster_race *r_ptr = &r_info[i];
4356 if (!r_ptr->name) continue;
4358 /* Require unique monsters */
4359 if (!(r_ptr->flags1 & RF1_UNIQUE)) continue;
4361 /* Only display "known" uniques */
4362 if (!cheat_know && !r_ptr->r_sights) continue;
4364 /* Only print rarity <= 100 uniques */
4365 if (!r_ptr->rarity || ((r_ptr->rarity > 100) && !(r_ptr->flags1 & RF1_QUESTOR))) continue;
4367 /* Only "alive" uniques */
4368 if (r_ptr->max_num == 0) continue;
4372 lev = (r_ptr->level - 1) / 10;
4376 if (max_lev < lev) max_lev = lev;
4378 else n_alive_over100++;
4380 else n_alive_surface++;
4382 /* Collect "appropriate" monsters */
4386 /* Sort the array by dungeon depth of monsters */
4387 ang_sort(who, &why, n, ang_sort_comp_hook, ang_sort_swap_hook);
4389 if (n_alive_surface)
4391 fprintf(fff, _(" 地上 生存: %3d体\n", " Surface alive: %3d\n"), n_alive_surface);
4392 n_alive_total += n_alive_surface;
4394 for (i = 0; i <= max_lev; i++)
4396 fprintf(fff, _("%3d-%3d階 生存: %3d体\n", "Level %3d-%3d alive: %3d\n"), 1 + i * 10, 10 + i * 10, n_alive[i]);
4397 n_alive_total += n_alive[i];
4399 if (n_alive_over100)
4401 fprintf(fff, _("101- 階 生存: %3d体\n", "Level 101- alive: %3d\n"), n_alive_over100);
4402 n_alive_total += n_alive_over100;
4407 fputs(_("--------- -----------\n", "------------- ----------\n"), fff);
4408 fprintf(fff, _(" 合計 生存: %3d体\n\n", " Total alive: %3d\n\n"), n_alive_total);
4412 fputs(_("現在は既知の生存ユニークはいません。\n", "No known uniques alive.\n"), fff);
4415 /* Scan the monster races */
4416 for (k = 0; k < n; k++)
4418 monster_race *r_ptr = &r_info[who[k]];
4420 fprintf(fff, _(" %s (レベル%d)\n", " %s (level %d)\n"), r_name + r_ptr->name, (int)r_ptr->level);
4423 /* Free the "who" array */
4424 C_KILL(who, max_r_idx, s16b);
4427 /* Display the file contents */
4428 show_file(TRUE, file_name, _("まだ生きているユニーク・モンスター", "Alive Uniques"), 0, 0);
4434 * Display weapon-exp
4436 static void do_cmd_knowledge_weapon_exp(void)
4444 GAME_TEXT file_name[1024];
4447 /* Open a new file */
4448 fff = my_fopen_temp(file_name, 1024);
4450 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
4455 for (i = 0; i < 5; i++)
4457 for (num = 0; num < 64; num++)
4459 for (j = 0; j < max_k_idx; j++)
4461 object_kind *k_ptr = &k_info[j];
4463 if ((k_ptr->tval == TV_SWORD - i) && (k_ptr->sval == num))
4465 if ((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON || k_ptr->sval == SV_HARP)) continue;
4467 weapon_exp = p_ptr->weapon_exp[4 - i][num];
4469 fprintf(fff, "%-25s ", tmp);
4470 if (weapon_exp >= s_info[p_ptr->pclass].w_max[4 - i][num]) fprintf(fff, "!");
4471 else fprintf(fff, " ");
4472 fprintf(fff, "%s", exp_level_str[weapon_exp_level(weapon_exp)]);
4473 if (cheat_xtra) fprintf(fff, " %d", weapon_exp);
4482 /* Display the file contents */
4483 show_file(TRUE, file_name, _("武器の経験値", "Weapon Proficiency"), 0, 0);
4489 * @brief 魔法の経験値を表示するコマンドのメインルーチン
4493 static void do_cmd_knowledge_spell_exp(void)
4500 const magic_type *s_ptr;
4502 GAME_TEXT file_name[1024];
4504 /* Open a new file */
4505 fff = my_fopen_temp(file_name, 1024);
4507 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
4512 if (p_ptr->realm1 != REALM_NONE)
4514 fprintf(fff, _("%sの魔法書\n", "%s Spellbook\n"), realm_names[p_ptr->realm1]);
4515 for (i = 0; i < 32; i++)
4517 if (!is_magic(p_ptr->realm1))
4519 s_ptr = &technic_info[p_ptr->realm1 - MIN_TECHNIC][i];
4523 s_ptr = &mp_ptr->info[p_ptr->realm1 - 1][i];
4525 if (s_ptr->slevel >= 99) continue;
4526 spell_exp = p_ptr->spell_exp[i];
4527 exp_level = spell_exp_level(spell_exp);
4528 fprintf(fff, "%-25s ", do_spell(p_ptr->realm1, i, SPELL_NAME));
4529 if (p_ptr->realm1 == REALM_HISSATSU)
4530 fprintf(fff, "[--]");
4533 if (exp_level >= EXP_LEVEL_MASTER) fprintf(fff, "!");
4534 else fprintf(fff, " ");
4535 fprintf(fff, "%s", exp_level_str[exp_level]);
4537 if (cheat_xtra) fprintf(fff, " %d", spell_exp);
4542 if (p_ptr->realm2 != REALM_NONE)
4544 fprintf(fff, _("%sの魔法書\n", "\n%s Spellbook\n"), realm_names[p_ptr->realm2]);
4545 for (i = 0; i < 32; i++)
4547 if (!is_magic(p_ptr->realm1))
4549 s_ptr = &technic_info[p_ptr->realm2 - MIN_TECHNIC][i];
4553 s_ptr = &mp_ptr->info[p_ptr->realm2 - 1][i];
4555 if (s_ptr->slevel >= 99) continue;
4557 spell_exp = p_ptr->spell_exp[i + 32];
4558 exp_level = spell_exp_level(spell_exp);
4559 fprintf(fff, "%-25s ", do_spell(p_ptr->realm2, i, SPELL_NAME));
4560 if (exp_level >= EXP_LEVEL_EXPERT) fprintf(fff, "!");
4561 else fprintf(fff, " ");
4562 fprintf(fff, "%s", exp_level_str[exp_level]);
4563 if (cheat_xtra) fprintf(fff, " %d", spell_exp);
4569 /* Display the file contents */
4570 show_file(TRUE, file_name, _("魔法の経験値", "Spell Proficiency"), 0, 0);
4576 * @brief スキル情報を表示するコマンドのメインルーチン /
4580 static void do_cmd_knowledge_skill_exp(void)
4582 int i = 0, skill_exp;
4586 char file_name[1024];
4587 char skill_name[GINOU_TEMPMAX][20] =
4589 _("マーシャルアーツ", "Martial Arts "),
4590 _("二刀流 ", "Dual Wielding "),
4591 _("乗馬 ", "Riding "),
4595 /* Open a new file */
4596 fff = my_fopen_temp(file_name, 1024);
4598 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
4603 for (i = 0; i < GINOU_TEMPMAX; i++)
4605 skill_exp = p_ptr->skill_exp[i];
4606 fprintf(fff, "%-20s ", skill_name[i]);
4607 if (skill_exp >= s_info[p_ptr->pclass].s_max[i]) fprintf(fff, "!");
4608 else fprintf(fff, " ");
4609 fprintf(fff, "%s", exp_level_str[(i == GINOU_RIDING) ? riding_exp_level(skill_exp) : weapon_exp_level(skill_exp)]);
4610 if (cheat_xtra) fprintf(fff, " %d", skill_exp);
4615 /* Display the file contents */
4616 show_file(TRUE, file_name, _("技能の経験値", "Miscellaneous Proficiency"), 0, 0);
4622 * @brief 現在のペットを表示するコマンドのメインルーチン /
4623 * Display current pets
4626 static void do_cmd_knowledge_pets(void)
4630 monster_type *m_ptr;
4631 GAME_TEXT pet_name[MAX_NLEN];
4633 int show_upkeep = 0;
4634 GAME_TEXT file_name[1024];
4637 /* Open a new file */
4638 fff = my_fopen_temp(file_name, 1024);
4640 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
4645 /* Process the monsters (backwards) */
4646 for (i = current_floor_ptr->m_max - 1; i >= 1; i--)
4648 /* Access the monster */
4649 m_ptr = ¤t_floor_ptr->m_list[i];
4651 /* Ignore "dead" monsters */
4652 if (!monster_is_valid(m_ptr)) continue;
4654 /* Calculate "upkeep" for pets */
4658 monster_desc(pet_name, m_ptr, MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
4659 fprintf(fff, "%s (%s)\n", pet_name, look_mon_desc(m_ptr, 0x00));
4663 show_upkeep = calculate_upkeep();
4665 fprintf(fff, "----------------------------------------------\n");
4667 fprintf(fff, " 合計: %d 体のペット\n", t_friends);
4669 fprintf(fff, " Total: %d pet%s.\n", t_friends, (t_friends == 1 ? "" : "s"));
4671 fprintf(fff, _(" 維持コスト: %d%% MP\n", " Upkeep: %d%% mana.\n"), show_upkeep);
4676 /* Display the file contents */
4677 show_file(TRUE, file_name, _("現在のペット", "Current Pets"), 0, 0);
4683 * @brief 現在のペットを表示するコマンドのメインルーチン /
4686 * @note the player ghosts are ignored.
4688 static void do_cmd_knowledge_kill_count(void)
4695 GAME_TEXT file_name[1024];
4700 /* Open a new file */
4701 fff = my_fopen_temp(file_name, 1024);
4704 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
4709 /* Allocate the "who" array */
4710 C_MAKE(who, max_r_idx, MONRACE_IDX);
4713 /* Monsters slain */
4716 for (kk = 1; kk < max_r_idx; kk++)
4718 monster_race *r_ptr = &r_info[kk];
4720 if (r_ptr->flags1 & (RF1_UNIQUE))
4722 bool dead = (r_ptr->max_num == 0);
4731 MONSTER_NUMBER This = r_ptr->r_pkills;
4741 fprintf(fff,_("あなたはまだ敵を倒していない。\n\n", "You have defeated no enemies yet.\n\n"));
4744 fprintf(fff,"あなたは%ld体の敵を倒している。\n\n", (long int)Total);
4746 fprintf(fff,"You have defeated %ld %s.\n\n", (long int)Total, (Total == 1) ? "enemy" : "enemies");
4752 /* Scan the monsters */
4753 for (i = 1; i < max_r_idx; i++)
4755 monster_race *r_ptr = &r_info[i];
4757 /* Use that monster */
4758 if (r_ptr->name) who[n++] = i;
4761 /* Sort the array by dungeon depth of monsters */
4762 ang_sort(who, &why, n, ang_sort_comp_hook, ang_sort_swap_hook);
4764 /* Scan the monster races */
4765 for (k = 0; k < n; k++)
4767 monster_race *r_ptr = &r_info[who[k]];
4769 if (r_ptr->flags1 & (RF1_UNIQUE))
4771 bool dead = (r_ptr->max_num == 0);
4775 fprintf(fff, " %s\n", (r_name + r_ptr->name));
4781 MONSTER_NUMBER This = r_ptr->r_pkills;
4786 /* p,tは人と数える by ita */
4787 if (my_strchr("pt", r_ptr->d_char))
4788 fprintf(fff, " %3d 人の %s\n", (int)This, r_name + r_ptr->name);
4790 fprintf(fff, " %3d 体の %s\n", (int)This, r_name + r_ptr->name);
4794 if (my_strstr(r_name + r_ptr->name, "coins"))
4796 fprintf(fff, " 1 pile of %s\n", (r_name + r_ptr->name));
4800 fprintf(fff, " 1 %s\n", (r_name + r_ptr->name));
4806 strcpy(ToPlural, (r_name + r_ptr->name));
4807 plural_aux(ToPlural);
4808 fprintf(fff, " %d %s\n", This, ToPlural);
4818 fprintf(fff,"----------------------------------------------\n");
4820 fprintf(fff," 合計: %lu 体を倒した。\n", (unsigned long int)Total);
4822 fprintf(fff," Total: %lu creature%s killed.\n", (unsigned long int)Total, (Total == 1 ? "" : "s"));
4826 /* Free the "who" array */
4827 C_KILL(who, max_r_idx, s16b);
4830 /* Display the file contents */
4831 show_file(TRUE, file_name, _("倒した敵の数", "Kill Count"), 0, 0);
4837 * @brief モンスター情報リスト中のグループを表示する /
4838 * Display the object groups.
4842 * @param per_page リストの表示行
4843 * @param grp_idx グループのID配列
4844 * @param group_text グループ名の文字列配列
4845 * @param grp_cur 現在の選択ID
4846 * @param grp_top 現在の選択リスト最上部ID
4849 static void display_group_list(int col, int row, int wid, int per_page, IDX grp_idx[], concptr group_text[], int grp_cur, int grp_top)
4853 /* Display lines until done */
4854 for (i = 0; i < per_page && (grp_idx[i] >= 0); i++)
4856 /* Get the group index */
4857 int grp = grp_idx[grp_top + i];
4859 /* Choose a color */
4860 TERM_COLOR attr = (grp_top + i == grp_cur) ? TERM_L_BLUE : TERM_WHITE;
4862 /* Erase the entire line */
4863 Term_erase(col, row + i, wid);
4865 /* Display the group label */
4866 c_put_str(attr, group_text[grp], row + i, col);
4872 * Move the cursor in a browser window
4874 static void browser_cursor(char ch, int *column, IDX *grp_cur, int grp_cnt,
4875 IDX *list_cur, int list_cnt)
4880 IDX list = *list_cur;
4882 /* Extract direction */
4885 /* Hack -- scroll up full screen */
4890 /* Hack -- scroll down full screen */
4895 d = get_keymap_dir(ch);
4900 /* Diagonals - hack */
4901 if ((ddx[d] > 0) && ddy[d])
4906 Term_get_size(&wid, &hgt);
4908 browser_rows = hgt - 8;
4910 /* Browse group list */
4915 /* Move up or down */
4916 grp += ddy[d] * (browser_rows - 1);
4919 if (grp >= grp_cnt) grp = grp_cnt - 1;
4920 if (grp < 0) grp = 0;
4921 if (grp != old_grp) list = 0;
4924 /* Browse sub-list list */
4927 /* Move up or down */
4928 list += ddy[d] * browser_rows;
4931 if (list >= list_cnt) list = list_cnt - 1;
4932 if (list < 0) list = 0;
4944 if (col < 0) col = 0;
4945 if (col > 1) col = 1;
4952 /* Browse group list */
4957 /* Move up or down */
4961 if (grp >= grp_cnt) grp = grp_cnt - 1;
4962 if (grp < 0) grp = 0;
4963 if (grp != old_grp) list = 0;
4966 /* Browse sub-list list */
4969 /* Move up or down */
4970 list += (IDX)ddy[d];
4973 if (list >= list_cnt) list = list_cnt - 1;
4974 if (list < 0) list = 0;
4985 static void display_visual_list(int col, int row, int height, int width, TERM_COLOR attr_top, byte char_left)
4989 /* Clear the display lines */
4990 for (i = 0; i < height; i++)
4992 Term_erase(col, row + i, width);
4995 /* Bigtile mode uses double width */
4996 if (use_bigtile) width /= 2;
4998 /* Display lines until done */
4999 for (i = 0; i < height; i++)
5001 /* Display columns until done */
5002 for (j = 0; j < width; j++)
5006 TERM_LEN x = col + j;
5007 TERM_LEN y = row + i;
5009 /* Bigtile mode uses double width */
5010 if (use_bigtile) x += j;
5015 /* Ignore illegal characters */
5016 if (ia > 0x7f || ic > 0xff || ic < ' ' ||
5017 (!use_graphics && ic > 0x7f))
5023 /* Force correct code for both ASCII character and tile */
5024 if (c & 0x80) a |= 0x80;
5026 /* Display symbol */
5027 Term_queue_bigchar(x, y, a, c, 0, 0);
5034 * Place the cursor at the collect position for visual mode
5036 static void place_visual_list_cursor(TERM_LEN col, TERM_LEN row, TERM_COLOR a, byte c, TERM_COLOR attr_top, byte char_left)
5038 int i = (a & 0x7f) - attr_top;
5039 int j = c - char_left;
5041 TERM_LEN x = col + j;
5042 TERM_LEN y = row + i;
5044 /* Bigtile mode uses double width */
5045 if (use_bigtile) x += j;
5047 /* Place the cursor */
5053 * Clipboard variables for copy&paste in visual mode
5055 static TERM_COLOR attr_idx = 0;
5056 static SYMBOL_CODE char_idx = 0;
5058 /* Hack -- for feature lighting */
5059 static TERM_COLOR attr_idx_feat[F_LIT_MAX];
5060 static SYMBOL_CODE char_idx_feat[F_LIT_MAX];
5063 * Do visual mode command -- Change symbols
5065 static bool visual_mode_command(char ch, bool *visual_list_ptr,
5066 int height, int width,
5067 TERM_COLOR *attr_top_ptr, byte *char_left_ptr,
5068 TERM_COLOR *cur_attr_ptr, SYMBOL_CODE *cur_char_ptr, bool *need_redraw)
5070 static TERM_COLOR attr_old = 0;
5071 static SYMBOL_CODE char_old = 0;
5076 if (*visual_list_ptr)
5079 *cur_attr_ptr = attr_old;
5080 *cur_char_ptr = char_old;
5081 *visual_list_ptr = FALSE;
5089 if (*visual_list_ptr)
5092 *visual_list_ptr = FALSE;
5093 *need_redraw = TRUE;
5101 if (!*visual_list_ptr)
5103 *visual_list_ptr = TRUE;
5105 *attr_top_ptr = MAX(0, (*cur_attr_ptr & 0x7f) - 5);
5106 *char_left_ptr = MAX(0, *cur_char_ptr - 10);
5108 attr_old = *cur_attr_ptr;
5109 char_old = *cur_char_ptr;
5120 /* Set the visual */
5121 attr_idx = *cur_attr_ptr;
5122 char_idx = *cur_char_ptr;
5124 /* Hack -- for feature lighting */
5125 for (i = 0; i < F_LIT_MAX; i++)
5127 attr_idx_feat[i] = 0;
5128 char_idx_feat[i] = 0;
5135 if (attr_idx || (!(char_idx & 0x80) && char_idx)) /* Allow TERM_DARK text */
5138 *cur_attr_ptr = attr_idx;
5139 *attr_top_ptr = MAX(0, (*cur_attr_ptr & 0x7f) - 5);
5140 if (!*visual_list_ptr) *need_redraw = TRUE;
5146 *cur_char_ptr = char_idx;
5147 *char_left_ptr = MAX(0, *cur_char_ptr - 10);
5148 if (!*visual_list_ptr) *need_redraw = TRUE;
5154 if (*visual_list_ptr)
5157 int d = get_keymap_dir(ch);
5158 TERM_COLOR a = (*cur_attr_ptr & 0x7f);
5159 SYMBOL_CODE c = *cur_char_ptr;
5161 if (use_bigtile) eff_width = width / 2;
5162 else eff_width = width;
5164 /* Restrict direction */
5165 if ((a == 0) && (ddy[d] < 0)) d = 0;
5166 if ((c == 0) && (ddx[d] < 0)) d = 0;
5167 if ((a == 0x7f) && (ddy[d] > 0)) d = 0;
5168 if ((c == 0xff) && (ddx[d] > 0)) d = 0;
5170 a += (TERM_COLOR)ddy[d];
5171 c += (SYMBOL_CODE)ddx[d];
5173 /* Force correct code for both ASCII character and tile */
5174 if (c & 0x80) a |= 0x80;
5176 /* Set the visual */
5181 /* Move the frame */
5182 if ((ddx[d] < 0) && *char_left_ptr > MAX(0, (int)c - 10)) (*char_left_ptr)--;
5183 if ((ddx[d] > 0) && *char_left_ptr + eff_width < MIN(0xff, (int)c + 10)) (*char_left_ptr)++;
5184 if ((ddy[d] < 0) && *attr_top_ptr > MAX(0, (int)(a & 0x7f) - 4)) (*attr_top_ptr)--;
5185 if ((ddy[d] > 0) && *attr_top_ptr + height < MIN(0x7f, (a & 0x7f) + 4)) (*attr_top_ptr)++;
5191 /* Visual mode command is not used */
5197 * Display the monsters in a group.
5199 static void display_monster_list(int col, int row, int per_page, s16b mon_idx[],
5200 int mon_cur, int mon_top, bool visual_only)
5204 /* Display lines until done */
5205 for (i = 0; i < per_page && (mon_idx[mon_top + i] >= 0); i++)
5209 /* Get the race index */
5210 MONRACE_IDX r_idx = mon_idx[mon_top + i] ;
5212 /* Access the race */
5213 monster_race *r_ptr = &r_info[r_idx];
5215 /* Choose a color */
5216 attr = ((i + mon_top == mon_cur) ? TERM_L_BLUE : TERM_WHITE);
5218 /* Display the name */
5219 c_prt(attr, (r_name + r_ptr->name), row + i, col);
5221 /* Hack -- visual_list mode */
5224 c_prt(attr, format("%02x/%02x", r_ptr->x_attr, r_ptr->x_char), row + i, (p_ptr->wizard || visual_only) ? 56 : 61);
5226 if (p_ptr->wizard || visual_only)
5228 c_prt(attr, format("%d", r_idx), row + i, 62);
5231 /* Erase chars before overwritten by the race letter */
5232 Term_erase(69, row + i, 255);
5234 /* Display symbol */
5235 Term_queue_bigchar(use_bigtile ? 69 : 70, row + i, r_ptr->x_attr, r_ptr->x_char, 0, 0);
5240 if (!(r_ptr->flags1 & RF1_UNIQUE))
5241 put_str(format("%5d", r_ptr->r_pkills), row + i, 73);
5243 c_put_str((r_ptr->max_num == 0 ? TERM_L_DARK : TERM_WHITE),
5244 (r_ptr->max_num == 0 ? _("死亡", " dead") : _("生存", "alive")), row + i, 74);
5248 /* Clear remaining lines */
5249 for (; i < per_page; i++)
5251 Term_erase(col, row + i, 255);
5257 * Display known monsters.
5259 static void do_cmd_knowledge_monsters(bool *need_redraw, bool visual_only, IDX direct_r_idx)
5263 IDX grp_cur, grp_top, old_grp_cur;
5264 IDX mon_cur, mon_top;
5265 IDX grp_cnt, grp_idx[100];
5273 bool visual_list = FALSE;
5274 TERM_COLOR attr_top = 0;
5282 Term_get_size(&wid, &hgt);
5284 browser_rows = hgt - 8;
5286 /* Allocate the "mon_idx" array */
5287 C_MAKE(mon_idx, max_r_idx, MONRACE_IDX);
5292 if (direct_r_idx < 0)
5294 mode = visual_only ? 0x03 : 0x01;
5296 /* Check every group */
5297 for (i = 0; monster_group_text[i] != NULL; i++)
5299 /* Measure the label */
5300 len = strlen(monster_group_text[i]);
5302 /* Save the maximum length */
5303 if (len > max) max = len;
5305 /* See if any monsters are known */
5306 if ((monster_group_char[i] == ((char *) -1L)) || collect_monsters(i, mon_idx, mode))
5308 /* Build a list of groups with known monsters */
5309 grp_idx[grp_cnt++] = i;
5317 mon_idx[0] = direct_r_idx;
5320 /* Terminate the list */
5323 (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
5324 &attr_top, &char_left, &r_info[direct_r_idx].x_attr, &r_info[direct_r_idx].x_char, need_redraw);
5327 /* Terminate the list */
5328 grp_idx[grp_cnt] = -1;
5331 grp_cur = grp_top = 0;
5332 mon_cur = mon_top = 0;
5337 mode = visual_only ? 0x02 : 0x00;
5342 monster_race *r_ptr;
5347 prt(format(_("%s - モンスター", "%s - monsters"), !visual_only ? _("知識", "Knowledge") : _("表示", "Visuals")), 2, 0);
5348 if (direct_r_idx < 0) prt(_("グループ", "Group"), 4, 0);
5349 prt(_("名前", "Name"), 4, max + 3);
5350 if (p_ptr->wizard || visual_only) prt("Idx", 4, 62);
5351 prt(_("文字", "Sym"), 4, 67);
5352 if (!visual_only) prt(_("殺害数", "Kills"), 4, 72);
5354 for (i = 0; i < 78; i++)
5356 Term_putch(i, 5, TERM_WHITE, '=');
5359 if (direct_r_idx < 0)
5361 for (i = 0; i < browser_rows; i++)
5363 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
5370 if (direct_r_idx < 0)
5372 /* Scroll group list */
5373 if (grp_cur < grp_top) grp_top = grp_cur;
5374 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
5376 /* Display a list of monster groups */
5377 display_group_list(0, 6, max, browser_rows, grp_idx, monster_group_text, grp_cur, grp_top);
5379 if (old_grp_cur != grp_cur)
5381 old_grp_cur = grp_cur;
5383 /* Get a list of monsters in the current group */
5384 mon_cnt = collect_monsters(grp_idx[grp_cur], mon_idx, mode);
5387 /* Scroll monster list */
5388 while (mon_cur < mon_top)
5389 mon_top = MAX(0, mon_top - browser_rows/2);
5390 while (mon_cur >= mon_top + browser_rows)
5391 mon_top = MIN(mon_cnt - browser_rows, mon_top + browser_rows/2);
5396 /* Display a list of monsters in the current group */
5397 display_monster_list(max + 3, 6, browser_rows, mon_idx, mon_cur, mon_top, visual_only);
5403 /* Display a monster name */
5404 display_monster_list(max + 3, 6, 1, mon_idx, mon_cur, mon_top, visual_only);
5406 /* Display visual list below first monster */
5407 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
5411 prt(format(_("<方向>%s%s%s, ESC", "<dir>%s%s%s, ESC"),
5412 (!visual_list && !visual_only) ? _(", 'r'で思い出を見る", ", 'r' to recall") : "",
5413 visual_list ? _(", ENTERで決定", ", ENTER to accept") : _(", 'v'でシンボル変更", ", 'v' for visuals"),
5414 (attr_idx || char_idx) ? _(", 'c', 'p'でペースト", ", 'c', 'p' to paste") : _(", 'c'でコピー", ", 'c' to copy")),
5417 /* Get the current monster */
5418 r_ptr = &r_info[mon_idx[mon_cur]];
5422 /* Mega Hack -- track this monster race */
5423 if (mon_cnt) monster_race_track(mon_idx[mon_cur]);
5429 place_visual_list_cursor(max + 3, 7, r_ptr->x_attr, r_ptr->x_char, attr_top, char_left);
5433 Term_gotoxy(0, 6 + (grp_cur - grp_top));
5437 Term_gotoxy(max + 3, 6 + (mon_cur - mon_top));
5442 /* Do visual mode command if needed */
5443 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))
5445 if (direct_r_idx >= 0)
5470 /* Recall on screen */
5471 if (!visual_list && !visual_only && (mon_idx[mon_cur] > 0))
5473 screen_roff(mon_idx[mon_cur], 0);
5484 /* Move the cursor */
5485 browser_cursor(ch, &column, &grp_cur, grp_cnt, &mon_cur, mon_cnt);
5492 /* Free the "mon_idx" array */
5493 C_KILL(mon_idx, max_r_idx, MONRACE_IDX);
5498 * Display the objects in a group.
5500 static void display_object_list(int col, int row, int per_page, IDX object_idx[],
5501 int object_cur, int object_top, bool visual_only)
5505 /* Display lines until done */
5506 for (i = 0; i < per_page && (object_idx[object_top + i] >= 0); i++)
5508 GAME_TEXT o_name[MAX_NLEN];
5511 object_kind *flavor_k_ptr;
5513 /* Get the object index */
5514 KIND_OBJECT_IDX k_idx = object_idx[object_top + i];
5516 /* Access the object */
5517 object_kind *k_ptr = &k_info[k_idx];
5519 /* Choose a color */
5520 TERM_COLOR attr = ((k_ptr->aware || visual_only) ? TERM_WHITE : TERM_SLATE);
5521 byte cursor = ((k_ptr->aware || visual_only) ? TERM_L_BLUE : TERM_BLUE);
5524 if (!visual_only && k_ptr->flavor)
5526 /* Appearance of this object is shuffled */
5527 flavor_k_ptr = &k_info[k_ptr->flavor];
5531 /* Appearance of this object is very normal */
5532 flavor_k_ptr = k_ptr;
5537 attr = ((i + object_top == object_cur) ? cursor : attr);
5539 if (!k_ptr->flavor || (!visual_only && k_ptr->aware))
5542 strip_name(o_name, k_idx);
5547 strcpy(o_name, k_name + flavor_k_ptr->flavor_name);
5550 /* Display the name */
5551 c_prt(attr, o_name, row + i, col);
5553 /* Hack -- visual_list mode */
5556 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);
5558 if (p_ptr->wizard || visual_only)
5560 c_prt(attr, format("%d", k_idx), row + i, 70);
5563 a = flavor_k_ptr->x_attr;
5564 c = flavor_k_ptr->x_char;
5566 /* Display symbol */
5567 Term_queue_bigchar(use_bigtile ? 76 : 77, row + i, a, c, 0, 0);
5570 /* Clear remaining lines */
5571 for (; i < per_page; i++)
5573 Term_erase(col, row + i, 255);
5578 * Describe fake object
5580 static void desc_obj_fake(KIND_OBJECT_IDX k_idx)
5583 object_type object_type_body;
5584 o_ptr = &object_type_body;
5586 object_prep(o_ptr, k_idx);
5588 /* It's fully know */
5589 o_ptr->ident |= IDENT_KNOWN;
5591 /* Track the object */
5592 /* object_actual_track(o_ptr); */
5594 /* Hack - mark as fake */
5595 /* term_obj_real = FALSE; */
5598 if (!screen_object(o_ptr, SCROBJ_FAKE_OBJECT | SCROBJ_FORCE_DETAIL))
5600 msg_print(_("特に変わったところはないようだ。", "You see nothing special."));
5608 * Display known objects
5610 static void do_cmd_knowledge_objects(bool *need_redraw, bool visual_only, IDX direct_k_idx)
5614 IDX grp_cur, grp_top, old_grp_cur;
5615 IDX object_old, object_cur, object_top;
5619 OBJECT_IDX *object_idx;
5625 bool visual_list = FALSE;
5626 TERM_COLOR attr_top = 0;
5634 Term_get_size(&wid, &hgt);
5636 browser_rows = hgt - 8;
5638 /* Allocate the "object_idx" array */
5639 C_MAKE(object_idx, max_k_idx, KIND_OBJECT_IDX);
5644 if (direct_k_idx < 0)
5646 mode = visual_only ? 0x03 : 0x01;
5648 /* Check every group */
5649 for (i = 0; object_group_text[i] != NULL; i++)
5651 /* Measure the label */
5652 len = strlen(object_group_text[i]);
5654 /* Save the maximum length */
5655 if (len > max) max = len;
5657 /* See if any monsters are known */
5658 if (collect_objects(i, object_idx, mode))
5660 /* Build a list of groups with known monsters */
5661 grp_idx[grp_cnt++] = i;
5670 object_kind *k_ptr = &k_info[direct_k_idx];
5671 object_kind *flavor_k_ptr;
5673 if (!visual_only && k_ptr->flavor)
5675 /* Appearance of this object is shuffled */
5676 flavor_k_ptr = &k_info[k_ptr->flavor];
5680 /* Appearance of this object is very normal */
5681 flavor_k_ptr = k_ptr;
5684 object_idx[0] = direct_k_idx;
5685 object_old = direct_k_idx;
5688 /* Terminate the list */
5691 (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
5692 &attr_top, &char_left, &flavor_k_ptr->x_attr, &flavor_k_ptr->x_char, need_redraw);
5695 /* Terminate the list */
5696 grp_idx[grp_cnt] = -1;
5699 grp_cur = grp_top = 0;
5700 object_cur = object_top = 0;
5705 mode = visual_only ? 0x02 : 0x00;
5710 object_kind *k_ptr, *flavor_k_ptr;
5717 prt(format("%s - アイテム", !visual_only ? "知識" : "表示"), 2, 0);
5718 if (direct_k_idx < 0) prt("グループ", 4, 0);
5719 prt("名前", 4, max + 3);
5720 if (p_ptr->wizard || visual_only) prt("Idx", 4, 70);
5723 prt(format("%s - objects", !visual_only ? "Knowledge" : "Visuals"), 2, 0);
5724 if (direct_k_idx < 0) prt("Group", 4, 0);
5725 prt("Name", 4, max + 3);
5726 if (p_ptr->wizard || visual_only) prt("Idx", 4, 70);
5730 for (i = 0; i < 78; i++)
5732 Term_putch(i, 5, TERM_WHITE, '=');
5735 if (direct_k_idx < 0)
5737 for (i = 0; i < browser_rows; i++)
5739 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
5746 if (direct_k_idx < 0)
5748 /* Scroll group list */
5749 if (grp_cur < grp_top) grp_top = grp_cur;
5750 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
5752 /* Display a list of object groups */
5753 display_group_list(0, 6, max, browser_rows, grp_idx, object_group_text, grp_cur, grp_top);
5755 if (old_grp_cur != grp_cur)
5757 old_grp_cur = grp_cur;
5759 /* Get a list of objects in the current group */
5760 object_cnt = collect_objects(grp_idx[grp_cur], object_idx, mode);
5763 /* Scroll object list */
5764 while (object_cur < object_top)
5765 object_top = MAX(0, object_top - browser_rows/2);
5766 while (object_cur >= object_top + browser_rows)
5767 object_top = MIN(object_cnt - browser_rows, object_top + browser_rows/2);
5772 /* Display a list of objects in the current group */
5773 display_object_list(max + 3, 6, browser_rows, object_idx, object_cur, object_top, visual_only);
5777 object_top = object_cur;
5779 /* Display a list of objects in the current group */
5780 display_object_list(max + 3, 6, 1, object_idx, object_cur, object_top, visual_only);
5782 /* Display visual list below first object */
5783 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
5786 /* Get the current object */
5787 k_ptr = &k_info[object_idx[object_cur]];
5789 if (!visual_only && k_ptr->flavor)
5791 /* Appearance of this object is shuffled */
5792 flavor_k_ptr = &k_info[k_ptr->flavor];
5796 /* Appearance of this object is very normal */
5797 flavor_k_ptr = k_ptr;
5802 prt(format("<方向>%s%s%s, ESC",
5803 (!visual_list && !visual_only) ? ", 'r'で詳細を見る" : "",
5804 visual_list ? ", ENTERで決定" : ", 'v'でシンボル変更",
5805 (attr_idx || char_idx) ? ", 'c', 'p'でペースト" : ", 'c'でコピー"),
5808 prt(format("<dir>%s%s%s, ESC",
5809 (!visual_list && !visual_only) ? ", 'r' to recall" : "",
5810 visual_list ? ", ENTER to accept" : ", 'v' for visuals",
5811 (attr_idx || char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"),
5817 /* Mega Hack -- track this object */
5818 if (object_cnt) object_kind_track(object_idx[object_cur]);
5820 /* The "current" object changed */
5821 if (object_old != object_idx[object_cur])
5825 /* Remember the "current" object */
5826 object_old = object_idx[object_cur];
5832 place_visual_list_cursor(max + 3, 7, flavor_k_ptr->x_attr, flavor_k_ptr->x_char, attr_top, char_left);
5836 Term_gotoxy(0, 6 + (grp_cur - grp_top));
5840 Term_gotoxy(max + 3, 6 + (object_cur - object_top));
5845 /* Do visual mode command if needed */
5846 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))
5848 if (direct_k_idx >= 0)
5873 /* Recall on screen */
5874 if (!visual_list && !visual_only && (grp_cnt > 0))
5876 desc_obj_fake(object_idx[object_cur]);
5884 /* Move the cursor */
5885 browser_cursor(ch, &column, &grp_cur, grp_cnt, &object_cur, object_cnt);
5891 /* Free the "object_idx" array */
5892 C_KILL(object_idx, max_k_idx, KIND_OBJECT_IDX);
5897 * Display the features in a group.
5899 static void display_feature_list(int col, int row, int per_page, FEAT_IDX *feat_idx,
5900 FEAT_IDX feat_cur, FEAT_IDX feat_top, bool visual_only, int lighting_level)
5902 int lit_col[F_LIT_MAX], i, j;
5903 int f_idx_col = use_bigtile ? 62 : 64;
5905 /* Correct columns 1 and 4 */
5906 lit_col[F_LIT_STANDARD] = use_bigtile ? (71 - F_LIT_MAX) : 71;
5907 for (i = F_LIT_NS_BEGIN; i < F_LIT_MAX; i++)
5908 lit_col[i] = lit_col[F_LIT_STANDARD] + 2 + (i - F_LIT_NS_BEGIN) * 2 + (use_bigtile ? i : 0);
5910 /* Display lines until done */
5911 for (i = 0; i < per_page && (feat_idx[feat_top + i] >= 0); i++)
5914 FEAT_IDX f_idx = feat_idx[feat_top + i];
5915 feature_type *f_ptr = &f_info[f_idx];
5916 int row_i = row + i;
5918 /* Choose a color */
5919 attr = ((i + feat_top == feat_cur) ? TERM_L_BLUE : TERM_WHITE);
5921 /* Display the name */
5922 c_prt(attr, f_name + f_ptr->name, row_i, col);
5924 /* Hack -- visual_list mode */
5927 /* Display lighting level */
5928 c_prt(attr, format("(%s)", lighting_level_str[lighting_level]), row_i, col + 1 + strlen(f_name + f_ptr->name));
5930 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));
5932 if (p_ptr->wizard || visual_only)
5934 c_prt(attr, format("%d", f_idx), row_i, f_idx_col);
5937 /* Display symbol */
5938 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);
5940 Term_putch(lit_col[F_LIT_NS_BEGIN], row_i, TERM_SLATE, '(');
5941 for (j = F_LIT_NS_BEGIN + 1; j < F_LIT_MAX; j++)
5943 Term_putch(lit_col[j], row_i, TERM_SLATE, '/');
5945 Term_putch(lit_col[F_LIT_MAX - 1] + (use_bigtile ? 3 : 2), row_i, TERM_SLATE, ')');
5947 /* Mega-hack -- Use non-standard colour */
5948 for (j = F_LIT_NS_BEGIN; j < F_LIT_MAX; j++)
5950 Term_queue_bigchar(lit_col[j] + 1, row_i, f_ptr->x_attr[j], f_ptr->x_char[j], 0, 0);
5954 /* Clear remaining lines */
5955 for (; i < per_page; i++)
5957 Term_erase(col, row + i, 255);
5963 * Interact with feature visuals.
5965 static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX direct_f_idx, IDX *lighting_level)
5969 FEAT_IDX grp_cur, grp_top, old_grp_cur;
5970 FEAT_IDX feat_cur, feat_top;
5972 FEAT_IDX grp_idx[100];
5976 TERM_LEN column = 0;
5980 bool visual_list = FALSE;
5981 TERM_COLOR attr_top = 0;
5984 TERM_LEN browser_rows;
5987 TERM_COLOR attr_old[F_LIT_MAX];
5988 SYMBOL_CODE char_old[F_LIT_MAX];
5989 TERM_COLOR *cur_attr_ptr;
5990 SYMBOL_CODE *cur_char_ptr;
5992 (void)C_WIPE(attr_old, F_LIT_MAX, TERM_COLOR);
5993 (void)C_WIPE(char_old, F_LIT_MAX, SYMBOL_CODE);
5995 Term_get_size(&wid, &hgt);
5997 browser_rows = hgt - 8;
5999 /* Allocate the "feat_idx" array */
6000 C_MAKE(feat_idx, max_f_idx, FEAT_IDX);
6005 if (direct_f_idx < 0)
6007 /* Check every group */
6008 for (i = 0; feature_group_text[i] != NULL; i++)
6010 /* Measure the label */
6011 len = strlen(feature_group_text[i]);
6013 /* Save the maximum length */
6014 if (len > max) max = len;
6016 /* See if any features are known */
6017 if (collect_features(i, feat_idx, 0x01))
6019 /* Build a list of groups with known features */
6020 grp_idx[grp_cnt++] = i;
6028 feature_type *f_ptr = &f_info[direct_f_idx];
6030 feat_idx[0] = direct_f_idx;
6033 /* Terminate the list */
6036 (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
6037 &attr_top, &char_left, &f_ptr->x_attr[*lighting_level], &f_ptr->x_char[*lighting_level], need_redraw);
6039 for (i = 0; i < F_LIT_MAX; i++)
6041 attr_old[i] = f_ptr->x_attr[i];
6042 char_old[i] = f_ptr->x_char[i];
6046 /* Terminate the list */
6047 grp_idx[grp_cnt] = -1;
6050 grp_cur = grp_top = 0;
6051 feat_cur = feat_top = 0;
6059 feature_type *f_ptr;
6065 prt(_("表示 - 地形", "Visuals - features"), 2, 0);
6066 if (direct_f_idx < 0) prt(_("グループ", "Group"), 4, 0);
6067 prt(_("名前", "Name"), 4, max + 3);
6070 if (p_ptr->wizard || visual_only) prt("Idx", 4, 62);
6071 prt(_("文字 ( l/ d)", "Sym ( l/ d)"), 4, 66);
6075 if (p_ptr->wizard || visual_only) prt("Idx", 4, 64);
6076 prt(_("文字 (l/d)", "Sym (l/d)"), 4, 68);
6079 for (i = 0; i < 78; i++)
6081 Term_putch(i, 5, TERM_WHITE, '=');
6084 if (direct_f_idx < 0)
6086 for (i = 0; i < browser_rows; i++)
6088 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
6095 if (direct_f_idx < 0)
6097 /* Scroll group list */
6098 if (grp_cur < grp_top) grp_top = grp_cur;
6099 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
6101 /* Display a list of feature groups */
6102 display_group_list(0, 6, max, browser_rows, grp_idx, feature_group_text, grp_cur, grp_top);
6104 if (old_grp_cur != grp_cur)
6106 old_grp_cur = grp_cur;
6108 /* Get a list of features in the current group */
6109 feat_cnt = collect_features(grp_idx[grp_cur], feat_idx, 0x00);
6112 /* Scroll feature list */
6113 while (feat_cur < feat_top)
6114 feat_top = MAX(0, feat_top - browser_rows/2);
6115 while (feat_cur >= feat_top + browser_rows)
6116 feat_top = MIN(feat_cnt - browser_rows, feat_top + browser_rows/2);
6121 /* Display a list of features in the current group */
6122 display_feature_list(max + 3, 6, browser_rows, feat_idx, feat_cur, feat_top, visual_only, F_LIT_STANDARD);
6126 feat_top = feat_cur;
6128 /* Display a list of features in the current group */
6129 display_feature_list(max + 3, 6, 1, feat_idx, feat_cur, feat_top, visual_only, *lighting_level);
6131 /* Display visual list below first object */
6132 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
6136 prt(format(_("<方向>%s, 'd'で標準光源効果%s, ESC", "<dir>%s, 'd' for default lighting%s, ESC"),
6137 visual_list ? _(", ENTERで決定, 'a'で対象明度変更", ", ENTER to accept, 'a' for lighting level") : _(", 'v'でシンボル変更", ", 'v' for visuals"),
6138 (attr_idx || char_idx) ? _(", 'c', 'p'でペースト", ", 'c', 'p' to paste") : _(", 'c'でコピー", ", 'c' to copy")),
6141 /* Get the current feature */
6142 f_ptr = &f_info[feat_idx[feat_cur]];
6143 cur_attr_ptr = &f_ptr->x_attr[*lighting_level];
6144 cur_char_ptr = &f_ptr->x_char[*lighting_level];
6148 place_visual_list_cursor(max + 3, 7, *cur_attr_ptr, *cur_char_ptr, attr_top, char_left);
6152 Term_gotoxy(0, 6 + (grp_cur - grp_top));
6156 Term_gotoxy(max + 3, 6 + (feat_cur - feat_top));
6161 if (visual_list && ((ch == 'A') || (ch == 'a')))
6163 int prev_lighting_level = *lighting_level;
6167 if (*lighting_level <= 0) *lighting_level = F_LIT_MAX - 1;
6168 else (*lighting_level)--;
6172 if (*lighting_level >= F_LIT_MAX - 1) *lighting_level = 0;
6173 else (*lighting_level)++;
6176 if (f_ptr->x_attr[prev_lighting_level] != f_ptr->x_attr[*lighting_level])
6177 attr_top = MAX(0, (f_ptr->x_attr[*lighting_level] & 0x7f) - 5);
6179 if (f_ptr->x_char[prev_lighting_level] != f_ptr->x_char[*lighting_level])
6180 char_left = MAX(0, f_ptr->x_char[*lighting_level] - 10);
6185 else if ((ch == 'D') || (ch == 'd'))
6187 TERM_COLOR prev_x_attr = f_ptr->x_attr[*lighting_level];
6188 byte prev_x_char = f_ptr->x_char[*lighting_level];
6190 apply_default_feat_lighting(f_ptr->x_attr, f_ptr->x_char);
6194 if (prev_x_attr != f_ptr->x_attr[*lighting_level])
6195 attr_top = MAX(0, (f_ptr->x_attr[*lighting_level] & 0x7f) - 5);
6197 if (prev_x_char != f_ptr->x_char[*lighting_level])
6198 char_left = MAX(0, f_ptr->x_char[*lighting_level] - 10);
6200 else *need_redraw = TRUE;
6205 /* Do visual mode command if needed */
6206 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))
6210 /* Restore previous visual settings */
6212 for (i = 0; i < F_LIT_MAX; i++)
6214 f_ptr->x_attr[i] = attr_old[i];
6215 f_ptr->x_char[i] = char_old[i];
6222 if (direct_f_idx >= 0) flag = TRUE;
6223 else *lighting_level = F_LIT_STANDARD;
6226 /* Preserve current visual settings */
6229 for (i = 0; i < F_LIT_MAX; i++)
6231 attr_old[i] = f_ptr->x_attr[i];
6232 char_old[i] = f_ptr->x_char[i];
6234 *lighting_level = F_LIT_STANDARD;
6241 for (i = 0; i < F_LIT_MAX; i++)
6243 attr_idx_feat[i] = f_ptr->x_attr[i];
6244 char_idx_feat[i] = f_ptr->x_char[i];
6253 /* Allow TERM_DARK text */
6254 for (i = F_LIT_NS_BEGIN; i < F_LIT_MAX; i++)
6256 if (attr_idx_feat[i] || (!(char_idx_feat[i] & 0x80) && char_idx_feat[i])) f_ptr->x_attr[i] = attr_idx_feat[i];
6257 if (char_idx_feat[i]) f_ptr->x_char[i] = char_idx_feat[i];
6275 /* Move the cursor */
6276 browser_cursor(ch, &column, &grp_cur, grp_cnt, &feat_cur, feat_cnt);
6282 /* Free the "feat_idx" array */
6283 C_KILL(feat_idx, max_f_idx, FEAT_IDX);
6288 * List wanted monsters
6290 static void do_cmd_knowledge_kubi(void)
6295 GAME_TEXT file_name[1024];
6298 /* Open a new file */
6299 fff = my_fopen_temp(file_name, 1024);
6301 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
6308 bool listed = FALSE;
6310 fprintf(fff, _("今日のターゲット : %s\n", "Today target : %s\n"),
6311 (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : _("不明", "unknown")));
6313 fprintf(fff, _("賞金首リスト\n", "List of wanted monsters\n"));
6314 fprintf(fff, "----------------------------------------------\n");
6316 for (i = 0; i < MAX_KUBI; i++)
6318 if (current_world_ptr->bounty_r_idx[i] <= 10000)
6320 fprintf(fff,"%s\n", r_name + r_info[current_world_ptr->bounty_r_idx[i]].name);
6328 fprintf(fff,"\n%s\n", _("賞金首はもう残っていません。", "There is no more wanted monster."));
6333 /* Display the file contents */
6334 show_file(TRUE, file_name, _("賞金首の一覧", "Wanted monsters"), 0, 0);
6339 * List virtues & status
6341 static void do_cmd_knowledge_virtues(void)
6344 GAME_TEXT file_name[1024];
6346 /* Open a new file */
6347 fff = my_fopen_temp(file_name, 1024);
6349 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
6356 fprintf(fff, _("現在の属性 : %s\n\n", "Your alighnment : %s\n\n"), your_alignment());
6361 /* Display the file contents */
6362 show_file(TRUE, file_name, _("八つの徳", "Virtues"), 0, 0);
6369 static void do_cmd_knowledge_dungeon(void)
6373 GAME_TEXT file_name[1024];
6376 /* Open a new file */
6377 fff = my_fopen_temp(file_name, 1024);
6379 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
6386 for (i = 1; i < max_d_idx; i++)
6390 if (!d_info[i].maxdepth) continue;
6391 if (!max_dlv[i]) continue;
6392 if (d_info[i].final_guardian)
6394 if (!r_info[d_info[i].final_guardian].max_num) seiha = TRUE;
6396 else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
6398 fprintf(fff, _("%c%-12s : %3d 階\n", "%c%-16s : level %3d\n"), seiha ? '!' : ' ', d_name + d_info[i].name, (int)max_dlv[i]);
6403 /* Display the file contents */
6404 show_file(TRUE, file_name, _("今までに入ったダンジョン", "Dungeon"), 0, 0);
6409 * List virtues & status
6412 static void do_cmd_knowledge_stat(void)
6416 GAME_TEXT file_name[1024];
6419 /* Open a new file */
6420 fff = my_fopen_temp(file_name, 1024);
6422 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
6429 percent = (int)(((long)p_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
6430 (2 * p_ptr->hitdie +
6431 ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
6433 if (p_ptr->knowledge & KNOW_HPRATE)
6434 fprintf(fff, _("現在の体力ランク : %d/100\n\n", "Your current Life Rating is %d/100.\n\n"), percent);
6435 else fprintf(fff, _("現在の体力ランク : ???\n\n", "Your current Life Rating is ???.\n\n"));
6437 fprintf(fff, _("能力の最大値\n\n", "Limits of maximum stats\n\n"));
6438 for (v_nr = 0; v_nr < A_MAX; v_nr++)
6440 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);
6441 else fprintf(fff, "%s ???\n", stat_names[v_nr]);
6448 /* Display the file contents */
6449 show_file(TRUE, file_name, _("自分に関する情報", "HP-rate & Max stat"), 0, 0);
6455 * Print all active quests
6457 static void do_cmd_knowledge_quests_current(FILE *fff)
6460 char rand_tmp_str[120] = "\0";
6461 GAME_TEXT name[MAX_NLEN];
6462 monster_race *r_ptr;
6464 int rand_level = 100;
6467 fprintf(fff, _("《遂行中のクエスト》\n", "< Current Quest >\n"));
6469 for (i = 1; i < max_q_idx; i++)
6471 if ((quest[i].status == QUEST_STATUS_TAKEN) ||
6472 ((quest[i].status == QUEST_STATUS_STAGE_COMPLETED) && (quest[i].type == QUEST_TYPE_TOWER)) ||
6473 (quest[i].status == QUEST_STATUS_COMPLETED))
6475 /* Set the quest number temporary */
6476 QUEST_IDX old_quest = p_ptr->inside_quest;
6479 /* Clear the text */
6480 for (j = 0; j < 10; j++) quest_text[j][0] = '\0';
6481 quest_text_line = 0;
6483 p_ptr->inside_quest = i;
6485 /* Get the quest text */
6486 init_flags = INIT_SHOW_TEXT;
6488 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
6490 /* Reset the old quest number */
6491 p_ptr->inside_quest = old_quest;
6493 /* No info from "silent" quests */
6494 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
6498 if (quest[i].type != QUEST_TYPE_RANDOM)
6500 char note[80] = "\0";
6502 if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_STAGE_COMPLETED)
6504 switch (quest[i].type)
6506 case QUEST_TYPE_KILL_LEVEL:
6507 case QUEST_TYPE_KILL_ANY_LEVEL:
6508 r_ptr = &r_info[quest[i].r_idx];
6509 strcpy(name, r_name + r_ptr->name);
6510 if (quest[i].max_num > 1)
6513 sprintf(note," - %d 体の%sを倒す。(あと %d 体)",
6514 (int)quest[i].max_num, name, (int)(quest[i].max_num - quest[i].cur_num));
6517 sprintf(note," - kill %d %s, have killed %d.",
6518 (int)quest[i].max_num, name, (int)quest[i].cur_num);
6522 sprintf(note,_(" - %sを倒す。", " - kill %s."),name);
6525 case QUEST_TYPE_FIND_ARTIFACT:
6528 artifact_type *a_ptr = &a_info[quest[i].k_idx];
6530 object_type *q_ptr = &forge;
6531 KIND_OBJECT_IDX k_idx = lookup_kind(a_ptr->tval, a_ptr->sval);
6532 object_prep(q_ptr, k_idx);
6533 q_ptr->name1 = quest[i].k_idx;
6534 q_ptr->ident = IDENT_STORE;
6535 object_desc(name, q_ptr, OD_NAME_ONLY);
6537 sprintf(note,_("\n - %sを見つけ出す。", "\n - Find out %s."), name);
6539 case QUEST_TYPE_FIND_EXIT:
6540 sprintf(note,_(" - 出口に到達する。", " - Reach to Exit."));
6543 case QUEST_TYPE_KILL_NUMBER:
6545 sprintf(note," - %d 体のモンスターを倒す。(あと %d 体)",
6546 (int)quest[i].max_num, (int)(quest[i].max_num - quest[i].cur_num));
6548 sprintf(note," - Kill %d monsters, have killed %d.",
6549 (int)quest[i].max_num, (int)quest[i].cur_num);
6553 case QUEST_TYPE_KILL_ALL:
6554 case QUEST_TYPE_TOWER:
6555 sprintf(note,_(" - 全てのモンスターを倒す。", " - Kill all monsters."));
6560 /* Print the quest info */
6561 sprintf(tmp_str, _(" %s (危険度:%d階相当)%s\n", " %s (Danger level: %d)%s\n"),
6562 quest[i].name, (int)quest[i].level, note);
6564 fputs(tmp_str, fff);
6566 if (quest[i].status == QUEST_STATUS_COMPLETED)
6568 sprintf(tmp_str, _(" クエスト達成 - まだ報酬を受けとってない。\n", " Quest Completed - Unrewarded\n"));
6569 fputs(tmp_str, fff);
6575 while (quest_text[j][0] && j < 10)
6577 fprintf(fff, " %s\n", quest_text[j]);
6582 else if (quest[i].level < rand_level) /* QUEST_TYPE_RANDOM */
6585 rand_level = quest[i].level;
6587 if (max_dlv[DUNGEON_ANGBAND] >= rand_level)
6589 /* Print the quest info */
6590 r_ptr = &r_info[quest[i].r_idx];
6591 strcpy(name, r_name + r_ptr->name);
6593 if (quest[i].max_num > 1)
6596 sprintf(rand_tmp_str," %s (%d 階) - %d 体の%sを倒す。(あと %d 体)\n",
6597 quest[i].name, (int)quest[i].level,
6598 (int)quest[i].max_num, name, (int)(quest[i].max_num - quest[i].cur_num));
6602 sprintf(rand_tmp_str," %s (Dungeon level: %d)\n Kill %d %s, have killed %d.\n",
6603 quest[i].name, (int)quest[i].level,
6604 (int)quest[i].max_num, name, (int)quest[i].cur_num);
6609 sprintf(rand_tmp_str,_(" %s (%d 階) - %sを倒す。\n", " %s (Dungeon level: %d)\n Kill %s.\n"),
6610 quest[i].name, (int)quest[i].level, name);
6617 /* Print the current random quest */
6618 if (rand_tmp_str[0]) fputs(rand_tmp_str, fff);
6620 if (!total) fprintf(fff, _(" なし\n", " Nothing.\n"));
6624 static bool do_cmd_knowledge_quests_aux(FILE *fff, IDX q_idx)
6627 char playtime_str[16];
6628 quest_type* const q_ptr = &quest[q_idx];
6630 if (is_fixed_quest_idx(q_idx))
6632 /* Set the quest number temporary */
6633 IDX old_quest = p_ptr->inside_quest;
6635 p_ptr->inside_quest = q_idx;
6638 init_flags = INIT_NAME_ONLY;
6640 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
6642 /* Reset the old quest number */
6643 p_ptr->inside_quest = old_quest;
6645 /* No info from "silent" quests */
6646 if (q_ptr->flags & QUEST_FLAG_SILENT) return FALSE;
6649 strnfmt(playtime_str, sizeof(playtime_str), "%02d:%02d:%02d",
6650 q_ptr->comptime/(60*60), (q_ptr->comptime/60)%60, q_ptr->comptime%60);
6652 if (!is_fixed_quest_idx(q_idx) && q_ptr->r_idx)
6654 /* Print the quest info */
6655 if (q_ptr->complev == 0)
6658 _(" %-35s (%3d階) - 不戦勝 - %s\n",
6659 " %-35s (Dungeon level: %3d) - Unearned - %s\n") ,
6660 r_name+r_info[q_ptr->r_idx].name,
6661 (int)q_ptr->level, playtime_str);
6666 _(" %-35s (%3d階) - レベル%2d - %s\n",
6667 " %-35s (Dungeon level: %3d) - level %2d - %s\n") ,
6668 r_name+r_info[q_ptr->r_idx].name,
6676 /* Print the quest info */
6678 _(" %-35s (危険度:%3d階相当) - レベル%2d - %s\n",
6679 " %-35s (Danger level: %3d) - level %2d - %s\n") ,
6680 q_ptr->name, (int)q_ptr->level, q_ptr->complev, playtime_str);
6683 fputs(tmp_str, fff);
6689 * Print all finished quests
6691 void do_cmd_knowledge_quests_completed(FILE *fff, QUEST_IDX quest_num[])
6694 QUEST_IDX total = 0;
6696 fprintf(fff, _("《達成したクエスト》\n", "< Completed Quest >\n"));
6697 for (i = 1; i < max_q_idx; i++)
6699 QUEST_IDX q_idx = quest_num[i];
6700 quest_type* const q_ptr = &quest[q_idx];
6702 if (q_ptr->status == QUEST_STATUS_FINISHED && do_cmd_knowledge_quests_aux(fff, q_idx))
6707 if (!total) fprintf(fff, _(" なし\n", " Nothing.\n"));
6712 * Print all failed quests
6714 void do_cmd_knowledge_quests_failed(FILE *fff, QUEST_IDX quest_num[])
6717 QUEST_IDX total = 0;
6719 fprintf(fff, _("《失敗したクエスト》\n", "< Failed Quest >\n"));
6720 for (i = 1; i < max_q_idx; i++)
6722 QUEST_IDX q_idx = quest_num[i];
6723 quest_type* const q_ptr = &quest[q_idx];
6725 if (((q_ptr->status == QUEST_STATUS_FAILED_DONE) || (q_ptr->status == QUEST_STATUS_FAILED)) &&
6726 do_cmd_knowledge_quests_aux(fff, q_idx))
6731 if (!total) fprintf(fff, _(" なし\n", " Nothing.\n"));
6736 * Print all random quests
6738 static void do_cmd_knowledge_quests_wiz_random(FILE *fff)
6740 GAME_TEXT tmp_str[120];
6742 QUEST_IDX total = 0;
6744 fprintf(fff, _("《残りのランダムクエスト》\n", "< Remaining Random Quest >\n"));
6745 for (i = 1; i < max_q_idx; i++)
6747 /* No info from "silent" quests */
6748 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
6750 if ((quest[i].type == QUEST_TYPE_RANDOM) && (quest[i].status == QUEST_STATUS_TAKEN))
6754 /* Print the quest info */
6755 sprintf(tmp_str, _(" %s (%d階, %s)\n", " %s (%d, %s)\n"),
6756 quest[i].name, (int)quest[i].level, r_name+r_info[quest[i].r_idx].name);
6757 fputs(tmp_str, fff);
6760 if (!total) fprintf(fff, _(" なし\n", " Nothing.\n"));
6764 * Print quest status of all active quests
6766 static void do_cmd_knowledge_quests(void)
6769 GAME_TEXT file_name[1024];
6774 /* Open a new file */
6775 fff = my_fopen_temp(file_name, 1024);
6778 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
6783 /* Allocate Memory */
6784 C_MAKE(quest_num, max_q_idx, QUEST_IDX);
6786 /* Sort by compete level */
6787 for (i = 1; i < max_q_idx; i++) quest_num[i] = i;
6788 ang_sort(quest_num, &dummy, max_q_idx, ang_sort_comp_quest_num, ang_sort_swap_quest_num);
6790 /* Dump Quest Information */
6791 do_cmd_knowledge_quests_current(fff);
6793 do_cmd_knowledge_quests_completed(fff, quest_num);
6795 do_cmd_knowledge_quests_failed(fff, quest_num);
6799 do_cmd_knowledge_quests_wiz_random(fff);
6803 /* Display the file contents */
6804 show_file(TRUE, file_name, _("クエスト達成状況", "Quest status"), 0, 0);
6808 C_KILL(quest_num, max_q_idx, QUEST_IDX);
6815 static void do_cmd_knowledge_home(void)
6820 GAME_TEXT file_name[1024];
6822 GAME_TEXT o_name[MAX_NLEN];
6823 concptr paren = ")";
6825 process_dungeon_file("w_info.txt", 0, 0, current_world_ptr->max_wild_y, current_world_ptr->max_wild_x);
6827 /* Open a new file */
6828 fff = my_fopen_temp(file_name, 1024);
6830 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
6837 /* Print all homes in the different towns */
6838 st_ptr = &town_info[1].store[STORE_HOME];
6840 /* Home -- if anything there */
6841 if (st_ptr->stock_num)
6846 /* Header with name of the town */
6847 fprintf(fff, _(" [ 我が家のアイテム ]\n", " [Home Inventory]\n"));
6849 /* Dump all available items */
6850 for (i = 0; i < st_ptr->stock_num; i++)
6853 if ((i % 12) == 0) fprintf(fff, "\n ( %d ページ )\n", x++);
6854 object_desc(o_name, &st_ptr->stock[i], 0);
6855 if (strlen(o_name) <= 80-3)
6857 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
6863 for (n = 0, t = o_name; n < 80-3; n++, t++)
6864 if(iskanji(*t)) {t++; n++;}
6865 if (n == 81-3) n = 79-3; /* 最後が漢字半分 */
6867 fprintf(fff, "%c%s %.*s\n", I2A(i%12), paren, n, o_name);
6868 fprintf(fff, " %.77s\n", o_name+n);
6871 object_desc(o_name, &st_ptr->stock[i], 0);
6872 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
6877 /* Add an empty line */
6878 fprintf(fff, "\n\n");
6883 /* Display the file contents */
6884 show_file(TRUE, file_name, _("我が家のアイテム", "Home Inventory"), 0, 0);
6890 * Check the status of "autopick"
6892 static void do_cmd_knowledge_autopick(void)
6896 GAME_TEXT file_name[1024];
6898 /* Open a new file */
6899 fff = my_fopen_temp(file_name, 1024);
6903 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
6910 fprintf(fff, _("自動破壊/拾いには何も登録されていません。", "No preference for auto picker/destroyer."));
6914 fprintf(fff, _(" 自動拾い/破壊には現在 %d行登録されています。\n\n",
6915 " There are %d registered lines for auto picker/destroyer.\n\n"), max_autopick);
6918 for (k = 0; k < max_autopick; k++)
6921 byte act = autopick_list[k].action;
6922 if (act & DONT_AUTOPICK)
6924 tmp = _("放置", "Leave");
6926 else if (act & DO_AUTODESTROY)
6928 tmp = _("破壊", "Destroy");
6930 else if (act & DO_AUTOPICK)
6932 tmp = _("拾う", "Pickup");
6936 tmp = _("確認", "Query");
6939 if (act & DO_DISPLAY)
6940 fprintf(fff, "%11s", format("[%s]", tmp));
6942 fprintf(fff, "%11s", format("(%s)", tmp));
6944 tmp = autopick_line_from_entry(&autopick_list[k]);
6945 fprintf(fff, " %s", tmp);
6950 /* Display the file contents */
6951 show_file(TRUE, file_name, _("自動拾い/破壊 設定リスト", "Auto-picker/Destroyer"), 0, 0);
6957 * Interact with "knowledge"
6959 void do_cmd_knowledge(void)
6962 bool need_redraw = FALSE;
6964 /* File type is "TEXT" */
6965 FILE_TYPE(FILE_TYPE_TEXT);
6968 /* Interact until done */
6973 /* Ask for a choice */
6974 prt(format(_("%d/2 ページ", "page %d/2"), (p+1)), 2, 65);
6975 prt(_("現在の知識を確認する", "Display current knowledge"), 3, 0);
6977 /* Give some choices */
6981 prt("(1) 既知の伝説のアイテム の一覧", 6, 5);
6982 prt("(2) 既知のアイテム の一覧", 7, 5);
6983 prt("(3) 既知の生きているユニーク・モンスター の一覧", 8, 5);
6984 prt("(4) 既知のモンスター の一覧", 9, 5);
6985 prt("(5) 倒した敵の数 の一覧", 10, 5);
6986 if (!vanilla_town) prt("(6) 賞金首 の一覧", 11, 5);
6987 prt("(7) 現在のペット の一覧", 12, 5);
6988 prt("(8) 我が家のアイテム の一覧", 13, 5);
6989 prt("(9) *鑑定*済み装備の耐性 の一覧", 14, 5);
6990 prt("(0) 地形の表示文字/タイル の一覧", 15, 5);
6994 prt("(a) 自分に関する情報 の一覧", 6, 5);
6995 prt("(b) 突然変異 の一覧", 7, 5);
6996 prt("(c) 武器の経験値 の一覧", 8, 5);
6997 prt("(d) 魔法の経験値 の一覧", 9, 5);
6998 prt("(e) 技能の経験値 の一覧", 10, 5);
6999 prt("(f) プレイヤーの徳 の一覧", 11, 5);
7000 prt("(g) 入ったダンジョン の一覧", 12, 5);
7001 prt("(h) 実行中のクエスト の一覧", 13, 5);
7002 prt("(i) 現在の自動拾い/破壊設定 の一覧", 14, 5);
7007 prt("(1) Display known artifacts", 6, 5);
7008 prt("(2) Display known objects", 7, 5);
7009 prt("(3) Display remaining uniques", 8, 5);
7010 prt("(4) Display known monster", 9, 5);
7011 prt("(5) Display kill count", 10, 5);
7012 if (!vanilla_town) prt("(6) Display wanted monsters", 11, 5);
7013 prt("(7) Display current pets", 12, 5);
7014 prt("(8) Display home inventory", 13, 5);
7015 prt("(9) Display *identified* equip.", 14, 5);
7016 prt("(0) Display terrain symbols.", 15, 5);
7020 prt("(a) Display about yourself", 6, 5);
7021 prt("(b) Display mutations", 7, 5);
7022 prt("(c) Display weapon proficiency", 8, 5);
7023 prt("(d) Display spell proficiency", 9, 5);
7024 prt("(e) Display misc. proficiency", 10, 5);
7025 prt("(f) Display virtues", 11, 5);
7026 prt("(g) Display dungeons", 12, 5);
7027 prt("(h) Display current quests", 13, 5);
7028 prt("(i) Display auto pick/destroy", 14, 5);
7032 prt(_("-続く-", "-more-"), 17, 8);
7033 prt(_("ESC) 抜ける", "ESC) Exit menu"), 21, 1);
7034 prt(_("SPACE) 次ページ", "SPACE) Next page"), 21, 30);
7035 /*prt("-) 前ページ", 21, 60);*/
7036 prt(_("コマンド:", "Command: "), 20, 0);
7039 if (i == ESCAPE) break;
7042 case ' ': /* Page change */
7046 case '1': /* Artifacts */
7047 do_cmd_knowledge_artifacts();
7049 case '2': /* Objects */
7050 do_cmd_knowledge_objects(&need_redraw, FALSE, -1);
7052 case '3': /* Uniques */
7053 do_cmd_knowledge_uniques();
7055 case '4': /* Monsters */
7056 do_cmd_knowledge_monsters(&need_redraw, FALSE, -1);
7058 case '5': /* Kill count */
7059 do_cmd_knowledge_kill_count();
7061 case '6': /* wanted */
7062 if (!vanilla_town) do_cmd_knowledge_kubi();
7064 case '7': /* Pets */
7065 do_cmd_knowledge_pets();
7067 case '8': /* Home */
7068 do_cmd_knowledge_home();
7070 case '9': /* Resist list */
7071 do_cmd_knowledge_inven();
7073 case '0': /* Feature list */
7075 IDX lighting_level = F_LIT_STANDARD;
7076 do_cmd_knowledge_features(&need_redraw, FALSE, -1, &lighting_level);
7080 case 'a': /* Max stat */
7081 do_cmd_knowledge_stat();
7083 case 'b': /* Mutations */
7084 do_cmd_knowledge_mutations();
7086 case 'c': /* weapon-exp */
7087 do_cmd_knowledge_weapon_exp();
7089 case 'd': /* spell-exp */
7090 do_cmd_knowledge_spell_exp();
7092 case 'e': /* skill-exp */
7093 do_cmd_knowledge_skill_exp();
7095 case 'f': /* Virtues */
7096 do_cmd_knowledge_virtues();
7098 case 'g': /* Dungeon */
7099 do_cmd_knowledge_dungeon();
7101 case 'h': /* Quests */
7102 do_cmd_knowledge_quests();
7104 case 'i': /* Autopick */
7105 do_cmd_knowledge_autopick();
7107 default: /* Unknown option */
7115 if (need_redraw) do_cmd_redraw();
7120 * Check on the status of an active quest
7122 void do_cmd_checkquest(void)
7124 /* File type is "TEXT" */
7125 FILE_TYPE(FILE_TYPE_TEXT);
7129 do_cmd_knowledge_quests();
7135 * Display the time and date
7137 void do_cmd_time(void)
7139 int day, hour, min, full, start, end, num;
7147 extract_day_hour_min(&day, &hour, &min);
7149 full = hour * 100 + min;
7156 strcpy(desc, _("変な時刻だ。", "It is a strange time."));
7158 if (day < MAX_DAYS) sprintf(day_buf, "%d", day);
7159 else strcpy(day_buf, "*****");
7161 msg_format(_("%s日目, 時刻は%d:%02d %sです。", "This is day %s. The time is %d:%02d %s."),
7162 day_buf, (hour % 12 == 0) ? 12 : (hour % 12), min, (hour < 12) ? "AM" : "PM");
7165 if (!randint0(10) || p_ptr->image)
7167 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, _("timefun_j.txt", "timefun.txt"));
7171 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, _("timenorm_j.txt", "timenorm.txt"));
7174 /* Open this file */
7175 fff = my_fopen(buf, "rt");
7179 /* Find this time */
7180 while (!my_fgets(fff, buf, sizeof(buf)))
7182 /* Ignore comments */
7183 if (!buf[0] || (buf[0] == '#')) continue;
7185 /* Ignore invalid lines */
7186 if (buf[1] != ':') continue;
7188 /* Process 'Start' */
7191 /* Extract the starting time */
7192 start = atoi(buf + 2);
7194 /* Assume valid for an hour */
7204 /* Extract the ending time */
7205 end = atoi(buf + 2);
7211 /* Ignore incorrect range */
7212 if ((start > full) || (full > end)) continue;
7214 /* Process 'Description' */
7219 /* Apply the randomizer */
7220 if (!randint0(num)) strcpy(desc, buf + 2);