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 exe_write_diary(player_type *creature_ptr, 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 = creature_ptr->inside_quest;
428 creature_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 creature_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 (creature_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[creature_ptr->dungeon_idx].name);
473 sprintf(note_level_buf, "%s L%d:", d_name+d_info[creature_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[creature_ptr->dungeon_idx].name, num),
549 _(num, d_name+d_info[creature_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[creature_ptr->dungeon_idx].name, (int)max_dlv[creature_ptr->dungeon_idx]),
581 _((int)max_dlv[creature_ptr->dungeon_idx], d_name+d_info[creature_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[creature_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[creature_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 display_diary(player_type *creature_ptr)
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 (creature_ptr->pclass == CLASS_WARRIOR || creature_ptr->pclass == CLASS_MONK || creature_ptr->pclass == CLASS_SAMURAI || creature_ptr->pclass == CLASS_BERSERKER)
835 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)]);
836 else if (IS_WIZARD_CLASS(creature_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 ? "の" : "", creature_ptr->name, tmp);
843 sprintf(nikki_title, "Legend of %s %s '%s'", ap_ptr->title, creature_ptr->name, tmp);
846 /* Display the file contents */
847 show_file(FALSE, buf, nikki_title, -1, 0);
851 * @brief 日記に任意の内容を表記するコマンドのメインルーチン /
854 static void add_diary_note(player_type *creature_ptr)
857 char bunshou[80] = "\0";
859 if (get_string(_("内容: ", "diary note: "), tmp, 79))
861 strcpy(bunshou, tmp);
862 exe_write_diary(creature_ptr, NIKKI_BUNSHOU, 0, bunshou);
867 * @brief 最後に取得したアイテムの情報を日記に追加するメインルーチン /
870 static void do_cmd_last_get(void)
875 if (record_o_name[0] == '\0') return;
877 sprintf(buf,_("%sの入手を記録します。", "Do you really want to record getting %s? "),record_o_name);
878 if (!get_check(buf)) return;
880 turn_tmp = current_world_ptr->game_turn;
881 current_world_ptr->game_turn = record_turn;
882 sprintf(buf,_("%sを手に入れた。", "descover %s."), record_o_name);
883 exe_write_diary(p_ptr, NIKKI_BUNSHOU, 0, buf);
884 current_world_ptr->game_turn = turn_tmp;
888 * @brief ファイル中の全日記記録を消去する /
891 static void do_cmd_erase_nikki(void)
893 GAME_TEXT file_name[MAX_NLEN];
897 if (!get_check(_("本当に記録を消去しますか?", "Do you really want to delete all your record? "))) return;
898 sprintf(file_name,_("playrecord-%s.txt", "playrec-%s.txt"),savefile_base);
899 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
902 fff = my_fopen(buf, "w");
905 msg_format(_("記録を消去しました。", "deleted record."));
907 msg_format(_("%s の消去に失敗しました。", "failed to delete %s."), buf);
916 void do_cmd_nikki(void)
920 /* File type is "TEXT" */
921 FILE_TYPE(FILE_TYPE_TEXT);
924 /* Interact until done */
929 /* Ask for a choice */
930 prt(_("[ 記録の設定 ]", "[ Play Record ]"), 2, 0);
932 /* Give some choices */
933 prt(_("(1) 記録を見る", "(1) Display your record"), 4, 5);
934 prt(_("(2) 文章を記録する", "(2) Add record"), 5, 5);
935 prt(_("(3) 直前に入手又は鑑定したものを記録する", "(3) Record item you last get/identify"), 6, 5);
936 prt(_("(4) 記録を消去する", "(4) Delete your record"), 7, 5);
938 prt(_("(R) プレイ動画を記録する/中止する", "(R) Record playing movie / or stop it"), 9, 5);
941 prt(_("コマンド:", "Command: "), 18, 0);
946 if (i == ESCAPE) break;
951 display_diary(p_ptr);
954 add_diary_note(p_ptr);
960 do_cmd_erase_nikki();
964 prepare_movie_hooks();
966 default: /* Unknown option */
976 * @brief 画面を再描画するコマンドのメインルーチン
977 * Hack -- redraw the screen
981 * This command performs various low level updates, clears all the "extra"
982 * windows, does a total redraw of the main window, and requests all of the
983 * interesting updates and redraws that I can think of.
985 * This command is also used to "instantiate" the results of the user
986 * selecting various things, such as graphics mode, so it must call
987 * the "TERM_XTRA_REACT" hook before redrawing the windows.
990 void do_cmd_redraw(player_type *creature_ptr)
996 /* Hack -- react to changes */
997 Term_xtra(TERM_XTRA_REACT, 0);
999 /* Combine and Reorder the pack (later) */
1000 creature_ptr->update |= (PU_COMBINE | PU_REORDER);
1001 creature_ptr->update |= (PU_TORCH);
1002 creature_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
1003 creature_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
1004 creature_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
1005 creature_ptr->update |= (PU_MONSTERS);
1007 creature_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1009 creature_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
1010 creature_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
1016 if (creature_ptr->prace == RACE_ANDROID) calc_android_exp(creature_ptr);
1019 /* Redraw every window */
1020 for (j = 0; j < 8; j++)
1023 if (!angband_term[j]) continue;
1026 Term_activate(angband_term[j]);
1035 * @brief プレイヤーのステータス表示
1038 void do_cmd_player_status(player_type *creature_ptr)
1049 display_player(p_ptr, mode);
1054 display_player(p_ptr, mode);
1058 Term_putstr(2, 23, -1, TERM_WHITE,
1059 _("['c'で名前変更, 'f'でファイルへ書出, 'h'でモード変更, ESCで終了]", "['c' to change name, 'f' to file, 'h' to change mode, or ESC]"));
1063 if (c == ESCAPE) break;
1070 /* Process the player name */
1071 process_player_name(FALSE);
1077 sprintf(tmp, "%s.txt", creature_ptr->base_name);
1078 if (get_string(_("ファイル名: ", "File name: "), tmp, 80))
1080 if (tmp[0] && (tmp[0] != ' '))
1082 file_character(tmp);
1099 creature_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1106 * @brief 最近表示されたメッセージを再表示するコマンドのメインルーチン
1107 * Recall the most recent message
1110 void do_cmd_message_one(void)
1112 /* Recall one message */
1113 prt(format("> %s", message_str(0)), 0, 0);
1118 * @brief メッセージのログを表示するコマンドのメインルーチン
1119 * Recall the most recent message
1123 * Show previous messages to the user -BEN-
1125 * The screen format uses line 0 and 23 for headers and prompts,
1126 * skips line 1 and 22, and uses line 2 thru 21 for old messages.
1128 * This command shows you which commands you are viewing, and allows
1129 * you to "search" for strings in the recall.
1131 * Note that messages may be longer than 80 characters, but they are
1132 * displayed using "infinite" length, with a special sub-command to
1133 * "slide" the virtual display to the left or right.
1135 * Attempt to only hilite the matching portions of the string.
1138 void do_cmd_messages(int num_now)
1142 char shower_str[81];
1143 char finder_str[81];
1145 concptr shower = NULL;
1149 Term_get_size(&wid, &hgt);
1151 /* Number of message lines in a screen */
1152 num_lines = hgt - 4;
1155 strcpy(finder_str, "");
1158 strcpy(shower_str, "");
1160 /* Total messages */
1163 /* Start on first message */
1168 /* Process requests until done */
1174 /* Dump up to 20 lines of messages */
1175 for (j = 0; (j < num_lines) && (i + j < n); j++)
1177 concptr msg = message_str(i+j);
1179 /* Dump the messages, bottom to top */
1180 c_prt((i + j < num_now ? TERM_WHITE : TERM_SLATE), msg, num_lines + 1 - j, 0);
1182 /* Hilite "shower" */
1183 if (shower && shower[0])
1187 /* Display matches */
1188 while ((str = my_strstr(str, shower)) != NULL)
1190 int len = strlen(shower);
1192 /* Display the match */
1193 Term_putstr(str-msg, num_lines + 1 - j, len, TERM_YELLOW, shower);
1201 /* Erase remaining lines */
1202 for (; j < num_lines; j++)
1204 Term_erase(0, num_lines + 1 - j, 255);
1207 /* Display header */
1209 prt(format(_("以前のメッセージ %d-%d 全部で(%d)", "Message Recall (%d-%d of %d)"),
1210 i, i + j - 1, n), 0, 0);
1212 /* Display prompt (not very informative) */
1213 prt(_("[ 'p' で更に古いもの, 'n' で更に新しいもの, '/' で検索, ESC で中断 ]",
1214 "[Press 'p' for older, 'n' for newer, ..., or ESCAPE]"), hgt - 1, 0);
1216 skey = inkey_special(TRUE);
1218 /* Exit on Escape */
1219 if (skey == ESCAPE) break;
1221 /* Hack -- Save the old index */
1226 /* Hack -- handle show */
1229 prt(_("強調: ", "Show: "), hgt - 1, 0);
1231 /* Get a "shower" string, or continue */
1232 strcpy(back_str, shower_str);
1233 if (askfor(shower_str, 80))
1236 shower = shower_str[0] ? shower_str : NULL;
1238 else strcpy(shower_str, back_str);
1242 /* Hack -- handle find */
1249 prt(_("検索: ", "Find: "), hgt - 1, 0);
1251 /* Get a "finder" string, or continue */
1252 strcpy(back_str, finder_str);
1253 if (!askfor(finder_str, 80))
1255 strcpy(finder_str, back_str);
1258 else if (!finder_str[0])
1260 shower = NULL; /* Stop showing */
1265 shower = finder_str;
1268 for (z = i + 1; z < n; z++)
1270 concptr msg = message_str(z);
1273 if (my_strstr(msg, finder_str))
1284 /* Recall 1 older message */
1286 /* Go to the oldest line */
1290 /* Recall 1 newer message */
1292 /* Go to the newest line */
1296 /* Recall 1 older message */
1301 /* Go older if legal */
1302 i = MIN(i + 1, n - num_lines);
1305 /* Recall 10 older messages */
1307 /* Go older if legal */
1308 i = MIN(i + 10, n - num_lines);
1311 /* Recall 20 older messages */
1316 /* Go older if legal */
1317 i = MIN(i + num_lines, n - num_lines);
1320 /* Recall 20 newer messages */
1324 /* Go newer (if able) */
1325 i = MAX(0, i - num_lines);
1328 /* Recall 10 newer messages */
1330 /* Go newer (if able) */
1334 /* Recall 1 newer messages */
1337 /* Go newer (if able) */
1342 /* Hack -- Error of some kind */
1350 * @brief prefファイルを選択して処理する /
1351 * Ask for a "user pref line" and process it
1354 * Allow absolute file names?
1356 void do_cmd_pref(void)
1363 /* Ask for a "user pref command" */
1364 if (!get_string(_("設定変更コマンド: ", "Pref: "), buf, 80)) return;
1366 /* Process that pref command */
1367 (void)process_pref_file_command(buf);
1371 * @brief 自動拾い設定ファイルをロードするコマンドのメインルーチン /
1374 void do_cmd_reload_autopick(void)
1376 if (!get_check(_("自動拾い設定ファイルをロードしますか? ", "Reload auto-pick preference file? "))) return;
1377 /* Load the file with messages */
1378 autopick_load_pref(TRUE);
1384 * @brief マクロ情報をprefファイルに保存する /
1385 * @param fname ファイル名
1388 static errr macro_dump(concptr fname)
1390 static concptr mark = "Macro Dump";
1395 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
1397 /* File type is "TEXT" */
1398 FILE_TYPE(FILE_TYPE_TEXT);
1400 /* Append to the file */
1401 if (!open_auto_dump(buf, mark)) return (-1);
1404 auto_dump_printf(_("\n# 自動マクロセーブ\n\n", "\n# Automatic macro dump\n\n"));
1407 for (i = 0; i < macro__num; i++)
1409 /* Extract the action */
1410 ascii_to_text(buf, macro__act[i]);
1412 /* Dump the macro */
1413 auto_dump_printf("A:%s\n", buf);
1415 /* Extract the action */
1416 ascii_to_text(buf, macro__pat[i]);
1418 /* Dump normal macros */
1419 auto_dump_printf("P:%s\n", buf);
1422 auto_dump_printf("\n");
1434 * @brief マクロのトリガーキーを取得する /
1435 * Hack -- ask for a "trigger" (see below)
1436 * @param buf キー表記を保管するバッファ
1440 * Note the complex use of the "inkey()" function from "util.c".
1442 * Note that both "flush()" calls are extremely important.
1445 static void do_cmd_macro_aux(char *buf)
1453 /* Do not process macros */
1459 /* Read the pattern */
1465 /* Do not process macros */
1468 /* Do not wait for keys */
1471 /* Attempt to read a key */
1480 /* Convert the trigger */
1481 ascii_to_text(tmp, buf);
1483 /* Hack -- display the trigger */
1484 Term_addstr(-1, TERM_WHITE, tmp);
1490 * @brief マクロのキー表記からアスキーコードを得てターミナルに表示する /
1491 * Hack -- ask for a keymap "trigger" (see below)
1492 * @param buf キー表記を取得するバッファ
1496 * Note that both "flush()" calls are extremely important. This may
1497 * no longer be true, since "util.c" is much simpler now.
1500 static void do_cmd_macro_aux_keymap(char *buf)
1510 /* Convert to ascii */
1511 ascii_to_text(tmp, buf);
1513 /* Hack -- display the trigger */
1514 Term_addstr(-1, TERM_WHITE, tmp);
1521 * @brief キーマップをprefファイルにダンプする /
1522 * Hack -- append all keymaps to the given file
1523 * @param fname ファイルネーム
1527 static errr keymap_dump(concptr fname)
1529 static concptr mark = "Keymap Dump";
1538 if (rogue_like_commands)
1540 mode = KEYMAP_MODE_ROGUE;
1546 mode = KEYMAP_MODE_ORIG;
1549 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
1551 /* File type is "TEXT" */
1552 FILE_TYPE(FILE_TYPE_TEXT);
1554 /* Append to the file */
1555 if (!open_auto_dump(buf, mark)) return -1;
1558 auto_dump_printf(_("\n# 自動キー配置セーブ\n\n", "\n# Automatic keymap dump\n\n"));
1561 for (i = 0; i < 256; i++)
1565 /* Loop up the keymap */
1566 act = keymap_act[mode][i];
1568 /* Skip empty keymaps */
1571 /* Encode the key */
1574 ascii_to_text(key, buf);
1576 /* Encode the action */
1577 ascii_to_text(buf, act);
1579 /* Dump the macro */
1580 auto_dump_printf("A:%s\n", buf);
1581 auto_dump_printf("C:%d:%s\n", mode, key);
1593 * @brief マクロを設定するコマンドのメインルーチン /
1594 * Interact with "macros"
1598 * Note that the macro "action" must be defined before the trigger.
1600 * Could use some helpful instructions on this page.
1603 void do_cmd_macros(void)
1615 if (rogue_like_commands)
1617 mode = KEYMAP_MODE_ROGUE;
1623 mode = KEYMAP_MODE_ORIG;
1626 /* File type is "TEXT" */
1627 FILE_TYPE(FILE_TYPE_TEXT);
1632 /* Process requests until done */
1636 prt(_("[ マクロの設定 ]", "Interact with Macros"), 2, 0);
1638 /* Describe that action */
1639 prt(_("マクロ行動が(もしあれば)下に表示されます:", "Current action (if any) shown below:"), 20, 0);
1641 /* Analyze the current action */
1642 ascii_to_text(buf, macro__buf);
1644 /* Display the current action */
1649 prt(_("(1) ユーザー設定ファイルのロード", "(1) Load a user pref file"), 4, 5);
1651 prt(_("(2) ファイルにマクロを追加", "(2) Append macros to a file"), 5, 5);
1652 prt(_("(3) マクロの確認", "(3) Query a macro"), 6, 5);
1653 prt(_("(4) マクロの作成", "(4) Create a macro"), 7, 5);
1654 prt(_("(5) マクロの削除", "(5) Remove a macro"), 8, 5);
1655 prt(_("(6) ファイルにキー配置を追加", "(6) Append keymaps to a file"), 9, 5);
1656 prt(_("(7) キー配置の確認", "(7) Query a keymap"), 10, 5);
1657 prt(_("(8) キー配置の作成", "(8) Create a keymap"), 11, 5);
1658 prt(_("(9) キー配置の削除", "(9) Remove a keymap"), 12, 5);
1659 prt(_("(0) マクロ行動の入力", "(0) Enter a new action"), 13, 5);
1660 #endif /* ALLOW_MACROS */
1663 prt(_("コマンド: ", "Command: "), 16, 0);
1668 if (i == ESCAPE) break;
1670 /* Load a 'macro' file */
1676 prt(_("コマンド: ユーザー設定ファイルのロード", "Command: Load a user pref file"), 16, 0);
1679 prt(_("ファイル: ", "File: "), 18, 0);
1681 /* Default filename */
1682 sprintf(tmp, "%s.prf", p_ptr->base_name);
1684 /* Ask for a file */
1685 if (!askfor(tmp, 80)) continue;
1687 /* Process the given filename */
1688 err = process_pref_file(tmp);
1691 msg_format(_("標準の設定ファイル'%s'を読み込みました。", "Loaded default '%s'."), tmp);
1696 msg_format(_("'%s'の読み込みに失敗しました!", "Failed to load '%s'!"), tmp);
1700 msg_format(_("'%s'を読み込みました。", "Loaded '%s'."), tmp);
1710 prt(_("コマンド: マクロをファイルに追加する", "Command: Append macros to a file"), 16, 0);
1713 prt(_("ファイル: ", "File: "), 18, 0);
1715 /* Default filename */
1716 sprintf(tmp, "%s.prf", p_ptr->base_name);
1718 /* Ask for a file */
1719 if (!askfor(tmp, 80)) continue;
1721 /* Dump the macros */
1722 (void)macro_dump(tmp);
1725 msg_print(_("マクロを追加しました。", "Appended macros."));
1734 prt(_("コマンド: マクロの確認", "Command: Query a macro"), 16, 0);
1738 prt(_("トリガーキー: ", "Trigger: "), 18, 0);
1740 /* Get a macro trigger */
1741 do_cmd_macro_aux(buf);
1743 /* Acquire action */
1744 k = macro_find_exact(buf);
1750 msg_print(_("そのキーにはマクロは定義されていません。", "Found no macro."));
1756 /* Obtain the action */
1757 strcpy(macro__buf, macro__act[k]);
1759 /* Analyze the current action */
1760 ascii_to_text(buf, macro__buf);
1762 /* Display the current action */
1766 msg_print(_("マクロを確認しました。", "Found a macro."));
1770 /* Create a macro */
1774 prt(_("コマンド: マクロの作成", "Command: Create a macro"), 16, 0);
1777 prt(_("トリガーキー: ", "Trigger: "), 18, 0);
1779 /* Get a macro trigger */
1780 do_cmd_macro_aux(buf);
1784 c_prt(TERM_L_RED, _("カーソルキーの左右でカーソル位置を移動。BackspaceかDeleteで一文字削除。",
1785 "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0);
1788 prt(_("マクロ行動: ", "Action: "), 20, 0);
1790 /* Convert to text */
1791 ascii_to_text(tmp, macro__buf);
1793 /* Get an encoded action */
1794 if (askfor(tmp, 80))
1796 /* Convert to ascii */
1797 text_to_ascii(macro__buf, tmp);
1799 /* Link the macro */
1800 macro_add(buf, macro__buf);
1803 msg_print(_("マクロを追加しました。", "Added a macro."));
1807 /* Remove a macro */
1811 prt(_("コマンド: マクロの削除", "Command: Remove a macro"), 16, 0);
1814 prt(_("トリガーキー: ", "Trigger: "), 18, 0);
1816 /* Get a macro trigger */
1817 do_cmd_macro_aux(buf);
1819 /* Link the macro */
1820 macro_add(buf, buf);
1823 msg_print(_("マクロを削除しました。", "Removed a macro."));
1830 prt(_("コマンド: キー配置をファイルに追加する", "Command: Append keymaps to a file"), 16, 0);
1833 prt(_("ファイル: ", "File: "), 18, 0);
1835 /* Default filename */
1836 sprintf(tmp, "%s.prf", p_ptr->base_name);
1838 /* Ask for a file */
1839 if (!askfor(tmp, 80)) continue;
1841 /* Dump the macros */
1842 (void)keymap_dump(tmp);
1845 msg_print(_("キー配置を追加しました。", "Appended keymaps."));
1848 /* Query a keymap */
1854 prt(_("コマンド: キー配置の確認", "Command: Query a keymap"), 16, 0);
1857 prt(_("押すキー: ", "Keypress: "), 18, 0);
1859 /* Get a keymap trigger */
1860 do_cmd_macro_aux_keymap(buf);
1862 /* Look up the keymap */
1863 act = keymap_act[mode][(byte)(buf[0])];
1869 msg_print(_("キー配置は定義されていません。", "Found no keymap."));
1875 /* Obtain the action */
1876 strcpy(macro__buf, act);
1878 /* Analyze the current action */
1879 ascii_to_text(buf, macro__buf);
1881 /* Display the current action */
1885 msg_print(_("キー配置を確認しました。", "Found a keymap."));
1889 /* Create a keymap */
1893 prt(_("コマンド: キー配置の作成", "Command: Create a keymap"), 16, 0);
1896 prt(_("押すキー: ", "Keypress: "), 18, 0);
1898 /* Get a keymap trigger */
1899 do_cmd_macro_aux_keymap(buf);
1903 c_prt(TERM_L_RED, _("カーソルキーの左右でカーソル位置を移動。BackspaceかDeleteで一文字削除。",
1904 "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0);
1907 prt(_("行動: ", "Action: "), 20, 0);
1909 /* Convert to text */
1910 ascii_to_text(tmp, macro__buf);
1912 /* Get an encoded action */
1913 if (askfor(tmp, 80))
1915 /* Convert to ascii */
1916 text_to_ascii(macro__buf, tmp);
1918 /* Free old keymap */
1919 string_free(keymap_act[mode][(byte)(buf[0])]);
1921 /* Make new keymap */
1922 keymap_act[mode][(byte)(buf[0])] = string_make(macro__buf);
1925 msg_print(_("キー配置を追加しました。", "Added a keymap."));
1929 /* Remove a keymap */
1933 prt(_("コマンド: キー配置の削除", "Command: Remove a keymap"), 16, 0);
1936 prt(_("押すキー: ", "Keypress: "), 18, 0);
1938 /* Get a keymap trigger */
1939 do_cmd_macro_aux_keymap(buf);
1941 /* Free old keymap */
1942 string_free(keymap_act[mode][(byte)(buf[0])]);
1944 /* Make new keymap */
1945 keymap_act[mode][(byte)(buf[0])] = NULL;
1948 msg_print(_("キー配置を削除しました。", "Removed a keymap."));
1951 /* Enter a new action */
1955 prt(_("コマンド: マクロ行動の入力", "Command: Enter a new action"), 16, 0);
1959 c_prt(TERM_L_RED, _("カーソルキーの左右でカーソル位置を移動。BackspaceかDeleteで一文字削除。",
1960 "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0);
1963 prt(_("マクロ行動: ", "Action: "), 20, 0);
1965 /* Hack -- limit the value */
1968 /* Get an encoded action */
1969 if (!askfor(buf, 80)) continue;
1971 /* Extract an action */
1972 text_to_ascii(macro__buf, buf);
1975 #endif /* ALLOW_MACROS */
1988 * @brief キャラクタ色の明暗表現
1990 static concptr lighting_level_str[F_LIT_MAX] =
2005 * @brief キャラクタのビジュアルIDを変更する際の対象指定関数
2006 * @param i 指定対象となるキャラクタコード
2007 * @param num 指定されたビジュアルIDを返す参照ポインタ
2008 * @param max ビジュアルIDの最大数
2009 * @return 指定が実際に行われた場合TRUE、キャンセルされた場合FALSE
2011 static bool cmd_visuals_aux(int i, IDX *num, IDX max)
2018 sprintf(str, "%d", *num);
2020 if (!get_string(format("Input new number(0-%d): ", max-1), str, 4))
2023 tmp = (IDX)strtol(str, NULL, 0);
2024 if (tmp >= 0 && tmp < max)
2027 else if (isupper(i))
2028 *num = (*num + max - 1) % max;
2030 *num = (*num + 1) % max;
2036 * @brief キャラクタの変更メニュー表示
2037 * @param choice_msg 選択メッセージ
2040 static void print_visuals_menu(concptr choice_msg)
2042 prt(_("[ 画面表示の設定 ]", "Interact with Visuals"), 1, 0);
2044 /* Give some choices */
2045 prt(_("(0) ユーザー設定ファイルのロード", "(0) Load a user pref file"), 3, 5);
2047 #ifdef ALLOW_VISUALS
2048 prt(_("(1) モンスターの 色/文字 をファイルに書き出す", "(1) Dump monster attr/chars"), 4, 5);
2049 prt(_("(2) アイテムの 色/文字 をファイルに書き出す", "(2) Dump object attr/chars"), 5, 5);
2050 prt(_("(3) 地形の 色/文字 をファイルに書き出す", "(3) Dump feature attr/chars"), 6, 5);
2051 prt(_("(4) モンスターの 色/文字 を変更する (数値操作)", "(4) Change monster attr/chars (numeric operation)"), 7, 5);
2052 prt(_("(5) アイテムの 色/文字 を変更する (数値操作)", "(5) Change object attr/chars (numeric operation)"), 8, 5);
2053 prt(_("(6) 地形の 色/文字 を変更する (数値操作)", "(6) Change feature attr/chars (numeric operation)"), 9, 5);
2054 prt(_("(7) モンスターの 色/文字 を変更する (シンボルエディタ)", "(7) Change monster attr/chars (visual mode)"), 10, 5);
2055 prt(_("(8) アイテムの 色/文字 を変更する (シンボルエディタ)", "(8) Change object attr/chars (visual mode)"), 11, 5);
2056 prt(_("(9) 地形の 色/文字 を変更する (シンボルエディタ)", "(9) Change feature attr/chars (visual mode)"), 12, 5);
2057 #endif /* ALLOW_VISUALS */
2059 prt(_("(R) 画面表示方法の初期化", "(R) Reset visuals"), 13, 5);
2062 prt(format("コマンド: %s", choice_msg ? choice_msg : _("", "")), 15, 0);
2065 static void do_cmd_knowledge_monsters(bool *need_redraw, bool visual_only, IDX direct_r_idx);
2066 static void do_cmd_knowledge_objects(bool *need_redraw, bool visual_only, IDX direct_k_idx);
2067 static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX direct_f_idx, IDX *lighting_level);
2070 * Interact with "visuals"
2072 void do_cmd_visuals(void)
2077 bool need_redraw = FALSE;
2078 concptr empty_symbol = "<< ? >>";
2080 if (use_bigtile) empty_symbol = "<< ?? >>";
2082 /* File type is "TEXT" */
2083 FILE_TYPE(FILE_TYPE_TEXT);
2086 /* Interact until done */
2091 /* Ask for a choice */
2092 print_visuals_menu(NULL);
2097 if (i == ESCAPE) break;
2101 /* Load a 'pref' file */
2104 prt(_("コマンド: ユーザー設定ファイルのロード", "Command: Load a user pref file"), 15, 0);
2107 prt(_("ファイル: ", "File: "), 17, 0);
2109 /* Default filename */
2110 sprintf(tmp, "%s.prf", p_ptr->base_name);
2113 if (!askfor(tmp, 70)) continue;
2115 /* Process the given filename */
2116 (void)process_pref_file(tmp);
2121 #ifdef ALLOW_VISUALS
2123 /* Dump monster attr/chars */
2126 static concptr mark = "Monster attr/chars";
2129 prt(_("コマンド: モンスターの[色/文字]をファイルに書き出します", "Command: Dump monster attr/chars"), 15, 0);
2132 prt(_("ファイル: ", "File: "), 17, 0);
2134 /* Default filename */
2135 sprintf(tmp, "%s.prf", p_ptr->base_name);
2137 /* Get a filename */
2138 if (!askfor(tmp, 70)) continue;
2139 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
2141 /* Append to the file */
2142 if (!open_auto_dump(buf, mark)) continue;
2145 auto_dump_printf(_("\n# モンスターの[色/文字]の設定\n\n", "\n# Monster attr/char definitions\n\n"));
2148 for (i = 0; i < max_r_idx; i++)
2150 monster_race *r_ptr = &r_info[i];
2152 /* Skip non-entries */
2153 if (!r_ptr->name) continue;
2155 /* Dump a comment */
2156 auto_dump_printf("# %s\n", (r_name + r_ptr->name));
2158 /* Dump the monster attr/char info */
2159 auto_dump_printf("R:%d:0x%02X/0x%02X\n\n", i,
2160 (byte)(r_ptr->x_attr), (byte)(r_ptr->x_char));
2166 msg_print(_("モンスターの[色/文字]をファイルに書き出しました。", "Dumped monster attr/chars."));
2171 /* Dump object attr/chars */
2174 static concptr mark = "Object attr/chars";
2175 KIND_OBJECT_IDX k_idx;
2178 prt(_("コマンド: アイテムの[色/文字]をファイルに書き出します", "Command: Dump object attr/chars"), 15, 0);
2181 prt(_("ファイル: ", "File: "), 17, 0);
2183 /* Default filename */
2184 sprintf(tmp, "%s.prf", p_ptr->base_name);
2186 /* Get a filename */
2187 if (!askfor(tmp, 70)) continue;
2188 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
2190 /* Append to the file */
2191 if (!open_auto_dump(buf, mark)) continue;
2194 auto_dump_printf(_("\n# アイテムの[色/文字]の設定\n\n", "\n# Object attr/char definitions\n\n"));
2197 for (k_idx = 0; k_idx < max_k_idx; k_idx++)
2199 GAME_TEXT o_name[MAX_NLEN];
2200 object_kind *k_ptr = &k_info[k_idx];
2202 /* Skip non-entries */
2203 if (!k_ptr->name) continue;
2208 strip_name(o_name, k_idx);
2214 /* Prepare dummy object */
2215 object_prep(&forge, k_idx);
2217 /* Get un-shuffled flavor name */
2218 object_desc(o_name, &forge, OD_FORCE_FLAVOR);
2221 /* Dump a comment */
2222 auto_dump_printf("# %s\n", o_name);
2224 /* Dump the object attr/char info */
2225 auto_dump_printf("K:%d:0x%02X/0x%02X\n\n", (int)k_idx,
2226 (byte)(k_ptr->x_attr), (byte)(k_ptr->x_char));
2232 msg_print(_("アイテムの[色/文字]をファイルに書き出しました。", "Dumped object attr/chars."));
2237 /* Dump feature attr/chars */
2240 static concptr mark = "Feature attr/chars";
2243 prt(_("コマンド: 地形の[色/文字]をファイルに書き出します", "Command: Dump feature attr/chars"), 15, 0);
2246 prt(_("ファイル: ", "File: "), 17, 0);
2248 /* Default filename */
2249 sprintf(tmp, "%s.prf", p_ptr->base_name);
2251 /* Get a filename */
2252 if (!askfor(tmp, 70)) continue;
2253 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
2255 /* Append to the file */
2256 if (!open_auto_dump(buf, mark)) continue;
2259 auto_dump_printf(_("\n# 地形の[色/文字]の設定\n\n", "\n# Feature attr/char definitions\n\n"));
2262 for (i = 0; i < max_f_idx; i++)
2264 feature_type *f_ptr = &f_info[i];
2266 /* Skip non-entries */
2267 if (!f_ptr->name) continue;
2269 /* Skip mimiccing features */
2270 if (f_ptr->mimic != i) continue;
2272 /* Dump a comment */
2273 auto_dump_printf("# %s\n", (f_name + f_ptr->name));
2275 /* Dump the feature attr/char info */
2276 auto_dump_printf("F:%d:0x%02X/0x%02X:0x%02X/0x%02X:0x%02X/0x%02X\n\n", i,
2277 (byte)(f_ptr->x_attr[F_LIT_STANDARD]), (byte)(f_ptr->x_char[F_LIT_STANDARD]),
2278 (byte)(f_ptr->x_attr[F_LIT_LITE]), (byte)(f_ptr->x_char[F_LIT_LITE]),
2279 (byte)(f_ptr->x_attr[F_LIT_DARK]), (byte)(f_ptr->x_char[F_LIT_DARK]));
2285 msg_print(_("地形の[色/文字]をファイルに書き出しました。", "Dumped feature attr/chars."));
2290 /* Modify monster attr/chars (numeric operation) */
2293 static concptr choice_msg = _("モンスターの[色/文字]を変更します", "Change monster attr/chars");
2294 static MONRACE_IDX r = 0;
2296 prt(format(_("コマンド: %s", "Command: %s"), choice_msg), 15, 0);
2298 /* Hack -- query until done */
2301 monster_race *r_ptr = &r_info[r];
2305 TERM_COLOR da = r_ptr->d_attr;
2306 byte dc = r_ptr->d_char;
2307 TERM_COLOR ca = r_ptr->x_attr;
2308 byte cc = r_ptr->x_char;
2310 /* Label the object */
2311 Term_putstr(5, 17, -1, TERM_WHITE,
2312 format(_("モンスター = %d, 名前 = %-40.40s", "Monster = %d, Name = %-40.40s"), r, (r_name + r_ptr->name)));
2314 /* Label the Default values */
2315 Term_putstr(10, 19, -1, TERM_WHITE,
2316 format(_("初期値 色 / 文字 = %3u / %3u", "Default attr/char = %3u / %3u"), da, dc));
2318 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
2319 Term_queue_bigchar(43, 19, da, dc, 0, 0);
2321 /* Label the Current values */
2322 Term_putstr(10, 20, -1, TERM_WHITE,
2323 format(_("現在値 色 / 文字 = %3u / %3u", "Current attr/char = %3u / %3u"), ca, cc));
2325 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
2326 Term_queue_bigchar(43, 20, ca, cc, 0, 0);
2329 Term_putstr(0, 22, -1, TERM_WHITE,
2330 _("コマンド (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): "));
2335 if (i == ESCAPE) break;
2337 if (iscntrl(i)) c = 'a' + i - KTRL('A');
2338 else if (isupper(i)) c = 'a' + i - 'A';
2348 if (!cmd_visuals_aux(i, &r, max_r_idx))
2354 while (!r_info[r].name);
2358 t = (int)r_ptr->x_attr;
2359 (void)cmd_visuals_aux(i, &t, 256);
2360 r_ptr->x_attr = (byte)t;
2364 t = (int)r_ptr->x_char;
2365 (void)cmd_visuals_aux(i, &t, 256);
2366 r_ptr->x_char = (byte)t;
2370 do_cmd_knowledge_monsters(&need_redraw, TRUE, r);
2372 print_visuals_menu(choice_msg);
2380 /* Modify object attr/chars (numeric operation) */
2383 static concptr choice_msg = _("アイテムの[色/文字]を変更します", "Change object attr/chars");
2385 prt(format(_("コマンド: %s", "Command: %s"), choice_msg), 15, 0);
2387 /* Hack -- query until done */
2390 object_kind *k_ptr = &k_info[k];
2394 TERM_COLOR da = k_ptr->d_attr;
2395 SYMBOL_CODE dc = k_ptr->d_char;
2396 TERM_COLOR ca = k_ptr->x_attr;
2397 SYMBOL_CODE cc = k_ptr->x_char;
2399 /* Label the object */
2400 Term_putstr(5, 17, -1, TERM_WHITE,
2401 format(_("アイテム = %d, 名前 = %-40.40s", "Object = %d, Name = %-40.40s"),
2402 k, k_name + (!k_ptr->flavor ? k_ptr->name : k_ptr->flavor_name)));
2404 /* Label the Default values */
2405 Term_putstr(10, 19, -1, TERM_WHITE,
2406 format(_("初期値 色 / 文字 = %3d / %3d", "Default attr/char = %3d / %3d"), da, dc));
2408 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
2409 Term_queue_bigchar(43, 19, da, dc, 0, 0);
2411 /* Label the Current values */
2412 Term_putstr(10, 20, -1, TERM_WHITE,
2413 format(_("現在値 色 / 文字 = %3d / %3d", "Current attr/char = %3d / %3d"), ca, cc));
2415 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
2416 Term_queue_bigchar(43, 20, ca, cc, 0, 0);
2419 Term_putstr(0, 22, -1, TERM_WHITE,
2420 _("コマンド (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): "));
2425 if (i == ESCAPE) break;
2427 if (iscntrl(i)) c = 'a' + i - KTRL('A');
2428 else if (isupper(i)) c = 'a' + i - 'A';
2438 if (!cmd_visuals_aux(i, &k, max_k_idx))
2444 while (!k_info[k].name);
2448 t = (int)k_ptr->x_attr;
2449 (void)cmd_visuals_aux(i, &t, 256);
2450 k_ptr->x_attr = (byte)t;
2454 t = (int)k_ptr->x_char;
2455 (void)cmd_visuals_aux(i, &t, 256);
2456 k_ptr->x_char = (byte)t;
2460 do_cmd_knowledge_objects(&need_redraw, TRUE, k);
2462 print_visuals_menu(choice_msg);
2470 /* Modify feature attr/chars (numeric operation) */
2473 static concptr choice_msg = _("地形の[色/文字]を変更します", "Change feature attr/chars");
2475 static IDX lighting_level = F_LIT_STANDARD;
2476 prt(format(_("コマンド: %s", "Command: %s"), choice_msg), 15, 0);
2478 /* Hack -- query until done */
2481 feature_type *f_ptr = &f_info[f];
2485 TERM_COLOR da = f_ptr->d_attr[lighting_level];
2486 byte dc = f_ptr->d_char[lighting_level];
2487 TERM_COLOR ca = f_ptr->x_attr[lighting_level];
2488 byte cc = f_ptr->x_char[lighting_level];
2490 /* Label the object */
2492 Term_putstr(5, 17, -1, TERM_WHITE,
2493 format(_("地形 = %d, 名前 = %s, 明度 = %s", "Terrain = %d, Name = %s, Lighting = %s"),
2494 f, (f_name + f_ptr->name), lighting_level_str[lighting_level]));
2496 /* Label the Default values */
2497 Term_putstr(10, 19, -1, TERM_WHITE,
2498 format(_("初期値 色 / 文字 = %3d / %3d", "Default attr/char = %3d / %3d"), da, dc));
2500 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
2501 Term_queue_bigchar(43, 19, da, dc, 0, 0);
2503 /* Label the Current values */
2505 Term_putstr(10, 20, -1, TERM_WHITE,
2506 format("現在値 色 / 文字 = %3d / %3d", ca, cc));
2508 Term_putstr(10, 20, -1, TERM_WHITE,
2509 format("Current attr/char = %3d / %3d", ca, cc));
2512 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
2513 Term_queue_bigchar(43, 20, ca, cc, 0, 0);
2517 Term_putstr(0, 22, -1, TERM_WHITE,
2518 "コマンド (n/N/^N/a/A/^A/c/C/^C/l/L/^L/d/D/^D/v/V/^V): ");
2520 Term_putstr(0, 22, -1, TERM_WHITE,
2521 "Command (n/N/^N/a/A/^A/c/C/^C/l/L/^L/d/D/^D/v/V/^V): ");
2527 if (i == ESCAPE) break;
2529 if (iscntrl(i)) c = 'a' + i - KTRL('A');
2530 else if (isupper(i)) c = 'a' + i - 'A';
2540 if (!cmd_visuals_aux(i, &f, max_f_idx))
2546 while (!f_info[f].name || (f_info[f].mimic != f));
2550 t = (int)f_ptr->x_attr[lighting_level];
2551 (void)cmd_visuals_aux(i, &t, 256);
2552 f_ptr->x_attr[lighting_level] = (byte)t;
2556 t = (int)f_ptr->x_char[lighting_level];
2557 (void)cmd_visuals_aux(i, &t, 256);
2558 f_ptr->x_char[lighting_level] = (byte)t;
2562 (void)cmd_visuals_aux(i, &lighting_level, F_LIT_MAX);
2565 apply_default_feat_lighting(f_ptr->x_attr, f_ptr->x_char);
2569 do_cmd_knowledge_features(&need_redraw, TRUE, f, &lighting_level);
2571 print_visuals_menu(choice_msg);
2579 /* Modify monster attr/chars (visual mode) */
2581 do_cmd_knowledge_monsters(&need_redraw, TRUE, -1);
2584 /* Modify object attr/chars (visual mode) */
2586 do_cmd_knowledge_objects(&need_redraw, TRUE, -1);
2589 /* Modify feature attr/chars (visual mode) */
2592 IDX lighting_level = F_LIT_STANDARD;
2593 do_cmd_knowledge_features(&need_redraw, TRUE, -1, &lighting_level);
2597 #endif /* ALLOW_VISUALS */
2605 msg_print(_("画面上の[色/文字]を初期値にリセットしました。", "Visual attr/char tables reset."));
2609 /* Unknown option */
2619 if (need_redraw) do_cmd_redraw(p_ptr);
2624 * Interact with "colors"
2626 void do_cmd_colors(void)
2635 /* File type is "TEXT" */
2636 FILE_TYPE(FILE_TYPE_TEXT);
2641 /* Interact until done */
2646 /* Ask for a choice */
2647 prt(_("[ カラーの設定 ]", "Interact with Colors"), 2, 0);
2649 /* Give some choices */
2650 prt(_("(1) ユーザー設定ファイルのロード", "(1) Load a user pref file"), 4, 5);
2653 prt(_("(2) カラーの設定をファイルに書き出す", "(2) Dump colors"), 5, 5);
2654 prt(_("(3) カラーの設定を変更する", "(3) Modify colors"), 6, 5);
2658 prt(_("コマンド: ", "Command: "), 8, 0);
2662 if (i == ESCAPE) break;
2664 /* Load a 'pref' file */
2668 prt(_("コマンド: ユーザー設定ファイルをロードします", "Command: Load a user pref file"), 8, 0);
2671 prt(_("ファイル: ", "File: "), 10, 0);
2674 sprintf(tmp, "%s.prf", p_ptr->base_name);
2677 if (!askfor(tmp, 70)) continue;
2679 /* Process the given filename */
2680 (void)process_pref_file(tmp);
2682 /* Mega-Hack -- react to changes */
2683 Term_xtra(TERM_XTRA_REACT, 0);
2685 /* Mega-Hack -- redraw */
2694 static concptr mark = "Colors";
2697 prt(_("コマンド: カラーの設定をファイルに書き出します", "Command: Dump colors"), 8, 0);
2700 prt(_("ファイル: ", "File: "), 10, 0);
2702 /* Default filename */
2703 sprintf(tmp, "%s.prf", p_ptr->base_name);
2705 /* Get a filename */
2706 if (!askfor(tmp, 70)) continue;
2707 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
2709 /* Append to the file */
2710 if (!open_auto_dump(buf, mark)) continue;
2713 auto_dump_printf(_("\n# カラーの設定\n\n", "\n# Color redefinitions\n\n"));
2716 for (i = 0; i < 256; i++)
2718 int kv = angband_color_table[i][0];
2719 int rv = angband_color_table[i][1];
2720 int gv = angband_color_table[i][2];
2721 int bv = angband_color_table[i][3];
2723 concptr name = _("未知", "unknown");
2725 /* Skip non-entries */
2726 if (!kv && !rv && !gv && !bv) continue;
2728 /* Extract the color name */
2729 if (i < 16) name = color_names[i];
2731 /* Dump a comment */
2732 auto_dump_printf(_("# カラー '%s'\n", "# Color '%s'\n"), name);
2734 /* Dump the monster attr/char info */
2735 auto_dump_printf("V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n",
2742 msg_print(_("カラーの設定をファイルに書き出しました。", "Dumped color redefinitions."));
2751 prt(_("コマンド: カラーの設定を変更します", "Command: Modify colors"), 8, 0);
2753 /* Hack -- query until done */
2760 /* Exhibit the normal colors */
2761 for (j = 0; j < 16; j++)
2763 /* Exhibit this color */
2764 Term_putstr(j*4, 20, -1, a, "###");
2766 /* Exhibit all colors */
2767 Term_putstr(j*4, 22, -1, j, format("%3d", j));
2770 /* Describe the color */
2771 name = ((a < 16) ? color_names[a] : _("未定義", "undefined"));
2773 /* Describe the color */
2774 Term_putstr(5, 10, -1, TERM_WHITE,
2775 format(_("カラー = %d, 名前 = %s", "Color = %d, Name = %s"), a, name));
2777 /* Label the Current values */
2778 Term_putstr(5, 12, -1, TERM_WHITE,
2779 format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x",
2780 angband_color_table[a][0],
2781 angband_color_table[a][1],
2782 angband_color_table[a][2],
2783 angband_color_table[a][3]));
2786 Term_putstr(0, 14, -1, TERM_WHITE,
2787 _("コマンド (n/N/k/K/r/R/g/G/b/B): ", "Command (n/N/k/K/r/R/g/G/b/B): "));
2792 if (i == ESCAPE) break;
2795 if (i == 'n') a = (byte)(a + 1);
2796 if (i == 'N') a = (byte)(a - 1);
2797 if (i == 'k') angband_color_table[a][0] = (byte)(angband_color_table[a][0] + 1);
2798 if (i == 'K') angband_color_table[a][0] = (byte)(angband_color_table[a][0] - 1);
2799 if (i == 'r') angband_color_table[a][1] = (byte)(angband_color_table[a][1] + 1);
2800 if (i == 'R') angband_color_table[a][1] = (byte)(angband_color_table[a][1] - 1);
2801 if (i == 'g') angband_color_table[a][2] = (byte)(angband_color_table[a][2] + 1);
2802 if (i == 'G') angband_color_table[a][2] = (byte)(angband_color_table[a][2] - 1);
2803 if (i == 'b') angband_color_table[a][3] = (byte)(angband_color_table[a][3] + 1);
2804 if (i == 'B') angband_color_table[a][3] = (byte)(angband_color_table[a][3] - 1);
2806 /* Hack -- react to changes */
2807 Term_xtra(TERM_XTRA_REACT, 0);
2809 /* Hack -- redraw */
2816 /* Unknown option */
2830 * Note something in the message recall
2832 void do_cmd_note(void)
2840 if (!get_string(_("メモ: ", "Note: "), buf, 60)) return;
2842 /* Ignore empty notes */
2843 if (!buf[0] || (buf[0] == ' ')) return;
2845 /* Add the note to the message recall */
2846 msg_format(_("メモ: %s", "Note: %s"), buf);
2851 * Mention the current version
2853 void do_cmd_version(void)
2855 #if FAKE_VER_EXTRA > 0
2856 msg_format(_("変愚蛮怒(Hengband) %d.%d.%d.%d", "You are playing Hengband %d.%d.%d.%d."),
2857 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH, FAKE_VER_EXTRA);
2859 msg_format(_("変愚蛮怒(Hengband) %d.%d.%d", "You are playing Hengband %d.%d.%d."),
2860 FAKE_VER_MAJOR - 10, FAKE_VER_MINOR, FAKE_VER_PATCH);
2867 * Array of feeling strings
2869 static concptr do_cmd_feeling_text[11] =
2871 _("この階の雰囲気を感じとれなかった...", "Looks like any other level."),
2872 _("この階には何か特別なものがあるような気がする。", "You feel there is something special about this level."),
2873 _("恐ろしい死の幻が目に浮かび、気絶しそうになった!", "You nearly faint as horrible visions of death fill your mind!"),
2874 _("この階はとても危険なようだ。", "This level looks very dangerous."),
2875 _("とても悪い予感がする...", "You have a very bad feeling..."),
2876 _("悪い予感がする...", "You have a bad feeling..."),
2877 _("何か緊張する。", "You feel nervous."),
2878 _("少し不運な気がする...", "You feel your luck is turning..."),
2879 _("この場所は好きになれない。", "You don't like the look of this place."),
2880 _("この階はそれなりに安全なようだ。", "This level looks reasonably safe."),
2881 _("なんて退屈なところだ...", "What a boring place...")
2884 static concptr do_cmd_feeling_text_combat[11] =
2886 _("この階の雰囲気を感じとれなかった...", "Looks like any other level."),
2887 _("この階には何か特別なものがあるような気がする。", "You feel there is something special about this level."),
2888 _("今夜もまた、誰かが命を落とす...", "You nearly faint as horrible visions of death fill your mind!"),
2889 _("この階はとても危険なようだ。", "This level looks very dangerous."),
2890 _("とても悪い予感がする...", "You have a very bad feeling..."),
2891 _("悪い予感がする...", "You have a bad feeling..."),
2892 _("何か緊張する。", "You feel nervous."),
2893 _("少し不運な気がする...", "You feel your luck is turning..."),
2894 _("この場所は好きになれない。", "You don't like the look of this place."),
2895 _("この階はそれなりに安全なようだ。", "This level looks reasonably safe."),
2896 _("なんて退屈なところだ...", "What a boring place...")
2899 static concptr do_cmd_feeling_text_lucky[11] =
2901 _("この階の雰囲気を感じとれなかった...", "Looks like any other level."),
2902 _("この階には何か特別なものがあるような気がする。", "You feel there is something special about this level."),
2903 _("この階はこの上なく素晴らしい感じがする。", "You have a superb feeling about this level."),
2904 _("素晴らしい感じがする...", "You have an excellent feeling..."),
2905 _("とても良い感じがする...", "You have a very good feeling..."),
2906 _("良い感じがする...", "You have a good feeling..."),
2907 _("ちょっと幸運な感じがする...", "You feel strangely lucky..."),
2908 _("多少は運が向いてきたか...", "You feel your luck is turning..."),
2909 _("見た感じ悪くはない...", "You like the look of this place..."),
2910 _("全然駄目ということはないが...", "This level can't be all bad..."),
2911 _("なんて退屈なところだ...", "What a boring place...")
2916 * Note that "feeling" is set to zero unless some time has passed.
2917 * Note that this is done when the level is GENERATED, not entered.
2919 void do_cmd_feeling(void)
2921 if (p_ptr->wild_mode) return;
2923 /* No useful feeling in quests */
2924 if (p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level))
2926 msg_print(_("典型的なクエストのダンジョンのようだ。", "Looks like a typical quest level."));
2930 /* No useful feeling in town */
2931 else if (p_ptr->town_num && !current_floor_ptr->dun_level)
2933 if (!strcmp(town_info[p_ptr->town_num].name, _("荒野", "wilderness")))
2935 msg_print(_("何かありそうな荒野のようだ。", "Looks like a strange wilderness."));
2940 msg_print(_("典型的な町のようだ。", "Looks like a typical town."));
2945 /* No useful feeling in the wilderness */
2946 else if (!current_floor_ptr->dun_level)
2948 msg_print(_("典型的な荒野のようだ。", "Looks like a typical wilderness."));
2952 /* Display the feeling */
2953 if (p_ptr->muta3 & MUT3_GOOD_LUCK)
2954 msg_print(do_cmd_feeling_text_lucky[p_ptr->feeling]);
2955 else if (p_ptr->pseikaku == SEIKAKU_COMBAT ||
2956 p_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON)
2957 msg_print(do_cmd_feeling_text_combat[p_ptr->feeling]);
2959 msg_print(do_cmd_feeling_text[p_ptr->feeling]);
2965 * Description of each monster group.
2967 static concptr monster_group_text[] =
2970 "ユニーク", /* "Uniques" */
2971 "乗馬可能なモンスター", /* "Riding" */
2972 "賞金首", /* "Wanted */
2973 "アンバーの王族", /* "Ambertite" */
3002 /* "古代ドラゴン/ワイアーム", */
3063 /* "Ancient Dragon/Wyrm", */
3072 "Multi-Headed Reptile",
3077 "Reptile/Amphibian",
3078 "Spider/Scorpion/Tick",
3080 /* "Major Demon", */
3097 * Symbols of monsters in each group. Note the "Uniques" group
3098 * is handled differently.
3100 static concptr monster_group_char[] =
3157 "!$&()+./=>?[\\]`{|~",
3167 * Build a list of monster indexes in the given group. Return the number
3168 * of monsters in the group.
3170 * mode & 0x01 : check for non-empty group
3171 * mode & 0x02 : visual operation only
3173 static IDX collect_monsters(IDX grp_cur, IDX mon_idx[], BIT_FLAGS8 mode)
3179 /* Get a list of x_char in this group */
3180 concptr group_char = monster_group_char[grp_cur];
3182 /* XXX Hack -- Check if this is the "Uniques" group */
3183 bool grp_unique = (monster_group_char[grp_cur] == (char *) -1L);
3185 /* XXX Hack -- Check if this is the "Riding" group */
3186 bool grp_riding = (monster_group_char[grp_cur] == (char *) -2L);
3188 /* XXX Hack -- Check if this is the "Wanted" group */
3189 bool grp_wanted = (monster_group_char[grp_cur] == (char *) -3L);
3191 /* XXX Hack -- Check if this is the "Amberite" group */
3192 bool grp_amberite = (monster_group_char[grp_cur] == (char *) -4L);
3195 /* Check every race */
3196 for (i = 0; i < max_r_idx; i++)
3198 /* Access the race */
3199 monster_race *r_ptr = &r_info[i];
3201 /* Skip empty race */
3202 if (!r_ptr->name) continue ;
3204 /* Require known monsters */
3205 if (!(mode & 0x02) && !cheat_know && !r_ptr->r_sights) continue;
3209 if (!(r_ptr->flags1 & RF1_UNIQUE)) continue;
3212 else if (grp_riding)
3214 if (!(r_ptr->flags7 & RF7_RIDING)) continue;
3217 else if (grp_wanted)
3219 bool wanted = FALSE;
3221 for (j = 0; j < MAX_KUBI; j++)
3223 if (current_world_ptr->bounty_r_idx[j] == i || current_world_ptr->bounty_r_idx[j] - 10000 == i ||
3224 (p_ptr->today_mon && p_ptr->today_mon == i))
3230 if (!wanted) continue;
3233 else if (grp_amberite)
3235 if (!(r_ptr->flags3 & RF3_AMBERITE)) continue;
3240 /* Check for race in the group */
3241 if (!my_strchr(group_char, r_ptr->d_char)) continue;
3245 mon_idx[mon_cnt++] = i;
3247 /* XXX Hack -- Just checking for non-empty group */
3248 if (mode & 0x01) break;
3251 /* Terminate the list */
3252 mon_idx[mon_cnt] = -1;
3254 ang_sort(mon_idx, &dummy_why, mon_cnt, ang_sort_comp_monster_level, ang_sort_swap_hook);
3256 /* Return the number of races */
3262 * Description of each monster group.
3264 static concptr object_group_text[] =
3267 "キノコ", /* "Mushrooms" */
3268 "薬", /* "Potions" */
3269 "油つぼ", /* "Flasks" */
3270 "巻物", /* "Scrolls" */
3272 "アミュレット", /* "Amulets" */
3273 "笛", /* "Whistle" */
3274 "光源", /* "Lanterns" */
3275 "魔法棒", /* "Wands" */
3278 "カード", /* "Cards" */
3289 "刀剣類", /* "Swords" */
3290 "鈍器", /* "Blunt Weapons" */
3291 "長柄武器", /* "Polearms" */
3292 "採掘道具", /* "Diggers" */
3293 "飛び道具", /* "Bows" */
3297 "軽装鎧", /* "Soft Armor" */
3298 "重装鎧", /* "Hard Armor" */
3299 "ドラゴン鎧", /* "Dragon Armor" */
3300 "盾", /* "Shields" */
3301 "クローク", /* "Cloaks" */
3302 "籠手", /* "Gloves" */
3303 "ヘルメット", /* "Helms" */
3305 "ブーツ", /* "Boots" */
3358 * TVALs of items in each group
3360 static byte object_group_tval[] =
3401 TV_LIFE_BOOK, /* Hack -- all spellbooks */
3409 * Build a list of object indexes in the given group. Return the number
3410 * of objects in the group.
3412 * mode & 0x01 : check for non-empty group
3413 * mode & 0x02 : visual operation only
3415 static KIND_OBJECT_IDX collect_objects(int grp_cur, KIND_OBJECT_IDX object_idx[], BIT_FLAGS8 mode)
3417 KIND_OBJECT_IDX i, object_cnt = 0;
3420 /* Get a list of x_char in this group */
3421 byte group_tval = object_group_tval[grp_cur];
3423 /* Check every object */
3424 for (i = 0; i < max_k_idx; i++)
3426 /* Access the object */
3427 object_kind *k_ptr = &k_info[i];
3429 /* Skip empty objects */
3430 if (!k_ptr->name) continue;
3434 /* Any objects will be displayed */
3440 /* Skip non-flavoured objects */
3441 if (!k_ptr->flavor) continue;
3443 /* Require objects ever seen */
3444 if (!k_ptr->aware) continue;
3447 /* Skip items with no distribution (special artifacts) */
3448 for (j = 0, k = 0; j < 4; j++) k += k_ptr->chance[j];
3452 /* Check for objects in the group */
3453 if (TV_LIFE_BOOK == group_tval)
3455 /* Hack -- All spell books */
3456 if (TV_LIFE_BOOK <= k_ptr->tval && k_ptr->tval <= TV_HEX_BOOK)
3458 /* Add the object */
3459 object_idx[object_cnt++] = i;
3463 else if (k_ptr->tval == group_tval)
3465 /* Add the object */
3466 object_idx[object_cnt++] = i;
3470 /* XXX Hack -- Just checking for non-empty group */
3471 if (mode & 0x01) break;
3474 /* Terminate the list */
3475 object_idx[object_cnt] = -1;
3477 /* Return the number of objects */
3483 * Description of each feature group.
3485 static concptr feature_group_text[] =
3493 * Build a list of feature indexes in the given group. Return the number
3494 * of features in the group.
3496 * mode & 0x01 : check for non-empty group
3498 static FEAT_IDX collect_features(int grp_cur, FEAT_IDX *feat_idx, BIT_FLAGS8 mode)
3501 FEAT_IDX feat_cnt = 0;
3503 /* Unused; There is a single group. */
3506 /* Check every feature */
3507 for (i = 0; i < max_f_idx; i++)
3509 feature_type *f_ptr = &f_info[i];
3511 /* Skip empty index */
3512 if (!f_ptr->name) continue;
3514 /* Skip mimiccing features */
3515 if (f_ptr->mimic != i) continue;
3518 feat_idx[feat_cnt++] = i;
3520 /* XXX Hack -- Just checking for non-empty group */
3521 if (mode & 0x01) break;
3524 /* Terminate the list */
3525 feat_idx[feat_cnt] = -1;
3527 /* Return the number of races */
3534 * Build a list of monster indexes in the given group. Return the number
3535 * of monsters in the group.
3537 static int collect_artifacts(int grp_cur, int object_idx[])
3539 int i, object_cnt = 0;
3541 /* Get a list of x_char in this group */
3542 byte group_tval = object_group_tval[grp_cur];
3544 /* Check every object */
3545 for (i = 0; i < max_a_idx; i++)
3547 /* Access the artifact */
3548 artifact_type *a_ptr = &a_info[i];
3550 /* Skip empty artifacts */
3551 if (!a_ptr->name) continue;
3553 /* Skip "uncreated" artifacts */
3554 if (!a_ptr->cur_num) continue;
3556 /* Check for race in the group */
3557 if (a_ptr->tval == group_tval)
3560 object_idx[object_cnt++] = i;
3564 /* Terminate the list */
3565 object_idx[object_cnt] = 0;
3567 /* Return the number of races */
3574 * Encode the screen colors
3576 static char hack[17] = "dwsorgbuDWvyRGBU";
3580 * Hack -- load a screen dump from a file
3582 void do_cmd_load_screen(void)
3587 SYMBOL_CODE c = ' ';
3593 Term_get_size(&wid, &hgt);
3594 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
3596 /* Append to the file */
3597 fff = my_fopen(buf, "r");
3600 msg_format(_("%s を開くことができませんでした。", "Failed to open %s."), buf);
3608 /* Load the screen */
3609 for (y = 0; okay; y++)
3611 /* Get a line of data including control code */
3612 if (!fgets(buf, 1024, fff)) okay = FALSE;
3614 /* Get the blank line */
3615 if (buf[0] == '\n' || buf[0] == '\0') break;
3617 /* Ignore too large screen image */
3618 if (y >= hgt) continue;
3621 for (x = 0; x < wid - 1; x++)
3624 if (buf[x] == '\n' || buf[x] == '\0') break;
3626 /* Put the attr/char */
3627 Term_draw(x, y, TERM_WHITE, buf[x]);
3631 /* Dump the screen */
3632 for (y = 0; okay; y++)
3634 /* Get a line of data including control code */
3635 if (!fgets(buf, 1024, fff)) okay = FALSE;
3637 /* Get the blank line */
3638 if (buf[0] == '\n' || buf[0] == '\0') break;
3640 /* Ignore too large screen image */
3641 if (y >= hgt) continue;
3644 for (x = 0; x < wid - 1; x++)
3647 if (buf[x] == '\n' || buf[x] == '\0') break;
3649 /* Get the attr/char */
3650 (void)(Term_what(x, y, &a, &c));
3652 /* Look up the attr */
3653 for (i = 0; i < 16; i++)
3655 /* Use attr matches */
3656 if (hack[i] == buf[x]) a = (byte_hack)i;
3659 /* Put the attr/char */
3660 Term_draw(x, y, a, c);
3665 prt(_("ファイルに書き出された画面(記念撮影)をロードしました。", "Screen dump loaded."), 0, 0);
3676 concptr inven_res_label = _(" 酸電火冷毒光闇破轟獄因沌劣 盲怖乱痺透命感消復浮",
3677 " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv");
3680 #define IM_FLAG_STR _("*", "* ")
3681 #define HAS_FLAG_STR _("+", "+ ")
3682 #define NO_FLAG_STR _("・", ". ")
3684 #define print_im_or_res_flag(IM, RES) \
3686 fputs(have_flag(flgs, (IM)) ? IM_FLAG_STR : \
3687 (have_flag(flgs, (RES)) ? HAS_FLAG_STR : NO_FLAG_STR), fff); \
3690 #define print_flag(TR) \
3692 fputs(have_flag(flgs, (TR)) ? HAS_FLAG_STR : NO_FLAG_STR, fff); \
3696 /* XTRA HACK RESLIST */
3697 static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr, int *j, OBJECT_TYPE_VALUE tval, char *where)
3699 GAME_TEXT o_name[MAX_NLEN];
3700 BIT_FLAGS flgs[TR_FLAG_SIZE];
3702 if (!o_ptr->k_idx) return;
3703 if (o_ptr->tval != tval) return;
3705 /* Identified items only */
3706 if (!object_is_known(o_ptr)) return;
3709 * HACK:Ring of Lordly protection and Dragon equipment
3710 * have random resistances.
3712 if ((object_is_wearable(o_ptr) && object_is_ego(o_ptr))
3713 || ((tval == TV_AMULET) && (o_ptr->sval == SV_AMULET_RESISTANCE))
3714 || ((tval == TV_RING) && (o_ptr->sval == SV_RING_LORDLY))
3715 || ((tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD))
3716 || ((tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM))
3717 || ((tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES))
3718 || ((tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE))
3719 || object_is_artifact(o_ptr))
3722 object_desc(o_name, o_ptr, OD_NAME_ONLY);
3724 while (o_name[i] && (i < 26))
3727 if (iskanji(o_name[i])) i++;
3736 o_name[i] = ' '; i++;
3741 fprintf(fff, "%s %s", where, o_name);
3743 if (!(o_ptr->ident & (IDENT_MENTAL)))
3745 fputs(_("-------不明--------------- -------不明---------\n",
3746 "-------unknown------------ -------unknown------\n"), fff);
3750 object_flags_known(o_ptr, flgs);
3752 print_im_or_res_flag(TR_IM_ACID, TR_RES_ACID);
3753 print_im_or_res_flag(TR_IM_ELEC, TR_RES_ELEC);
3754 print_im_or_res_flag(TR_IM_FIRE, TR_RES_FIRE);
3755 print_im_or_res_flag(TR_IM_COLD, TR_RES_COLD);
3756 print_flag(TR_RES_POIS);
3757 print_flag(TR_RES_LITE);
3758 print_flag(TR_RES_DARK);
3759 print_flag(TR_RES_SHARDS);
3760 print_flag(TR_RES_SOUND);
3761 print_flag(TR_RES_NETHER);
3762 print_flag(TR_RES_NEXUS);
3763 print_flag(TR_RES_CHAOS);
3764 print_flag(TR_RES_DISEN);
3768 print_flag(TR_RES_BLIND);
3769 print_flag(TR_RES_FEAR);
3770 print_flag(TR_RES_CONF);
3771 print_flag(TR_FREE_ACT);
3772 print_flag(TR_SEE_INVIS);
3773 print_flag(TR_HOLD_EXP);
3774 print_flag(TR_TELEPATHY);
3775 print_flag(TR_SLOW_DIGEST);
3776 print_flag(TR_REGEN);
3777 print_flag(TR_LEVITATION);
3785 fprintf(fff, "%s\n", inven_res_label);
3791 * Display *ID* ed weapons/armors's resistances
3793 static void do_cmd_knowledge_inven(void)
3796 GAME_TEXT file_name[1024];
3798 OBJECT_TYPE_VALUE tval;
3804 /* Open a new file */
3805 fff = my_fopen_temp(file_name, 1024);
3808 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
3812 fprintf(fff, "%s\n", inven_res_label);
3814 for (tval = TV_WEARABLE_BEGIN; tval <= TV_WEARABLE_END; tval++)
3818 for (; j < 9; j++) fputc('\n', fff);
3820 fprintf(fff, "%s\n", inven_res_label);
3822 strcpy(where, _("装", "E "));
3823 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
3825 do_cmd_knowledge_inven_aux(fff, &p_ptr->inventory_list[i], &j, tval, where);
3827 strcpy(where, _("持", "I "));
3828 for (i = 0; i < INVEN_PACK; i++)
3830 do_cmd_knowledge_inven_aux(fff, &p_ptr->inventory_list[i], &j, tval, where);
3833 st_ptr = &town_info[1].store[STORE_HOME];
3834 strcpy(where, _("家", "H "));
3835 for (i = 0; i < st_ptr->stock_num; i++)
3837 do_cmd_knowledge_inven_aux(fff, &st_ptr->stock[i], &j, tval, where);
3842 /* Display the file contents */
3843 show_file(TRUE, file_name, _("*鑑定*済み武器/防具の耐性リスト", "Resistances of *identified* equipment"), 0, 0);
3848 void do_cmd_save_screen_html_aux(char *filename, int message)
3853 TERM_COLOR a = 0, old_a = 0;
3867 concptr html_head[] = {
3868 "<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
3872 concptr html_foot[] = {
3874 "</body>\n</html>\n",
3880 Term_get_size(&wid, &hgt);
3882 /* File type is "TEXT" */
3883 FILE_TYPE(FILE_TYPE_TEXT);
3885 /* Append to the file */
3886 fff = my_fopen(filename, "w");
3890 msg_format(_("ファイル %s を開けませんでした。", "Failed to open file %s."), filename);
3896 if (message) screen_save();
3897 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "htmldump.prf");
3898 tmpfff = my_fopen(buf, "r");
3900 for (i = 0; html_head[i]; i++)
3901 fputs(html_head[i], fff);
3905 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
3907 if (strncmp(buf, tags[0], strlen(tags[0])) == 0)
3911 if (strncmp(buf, tags[1], strlen(tags[1])) == 0)
3913 fprintf(fff, "%s\n", buf);
3918 /* Dump the screen */
3919 for (y = 0; y < hgt; y++)
3926 for (x = 0; x < wid - 1; x++)
3930 /* Get the attr/char */
3931 (void)(Term_what(x, y, &a, &c));
3935 case '&': cc = "&"; break;
3936 case '<': cc = "<"; break;
3937 case '>': cc = ">"; break;
3939 case 0x1f: c = '.'; break;
3940 case 0x7f: c = (a == 0x09) ? '%' : '#'; break;
3945 if ((y == 0 && x == 0) || a != old_a) {
3946 rv = angband_color_table[a][1];
3947 gv = angband_color_table[a][2];
3948 bv = angband_color_table[a][3];
3949 fprintf(fff, "%s<font color=\"#%02x%02x%02x\">",
3950 ((y == 0 && x == 0) ? "" : "</font>"), rv, gv, bv);
3954 fprintf(fff, "%s", cc);
3956 fprintf(fff, "%c", c);
3959 fprintf(fff, "</font>");
3962 for (i = 0; html_foot[i]; i++)
3963 fputs(html_foot[i], fff);
3968 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
3970 if (strncmp(buf, tags[2], strlen(tags[2])) == 0)
3974 if (strncmp(buf, tags[3], strlen(tags[3])) == 0)
3976 fprintf(fff, "%s\n", buf);
3987 msg_print(_("画面(記念撮影)をファイルに書き出しました。", "Screen dump saved."));
3995 * Hack -- save a screen dump to a file
3997 static void do_cmd_save_screen_html(void)
3999 char buf[1024], tmp[256] = "screen.html";
4001 if (!get_string(_("ファイル名: ", "File name: "), tmp, 80))
4003 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
4007 do_cmd_save_screen_html_aux(buf, 1);
4012 * Redefinable "save_screen" action
4014 void (*screendump_aux)(void) = NULL;
4018 * Hack -- save a screen dump to a file
4020 void do_cmd_save_screen(void)
4022 bool old_use_graphics = use_graphics;
4023 bool html_dump = FALSE;
4027 prt(_("記念撮影しますか? [(y)es/(h)tml/(n)o] ", "Save screen dump? [(y)es/(h)tml/(n)o] "), 0, 0);
4031 if (c == 'Y' || c == 'y')
4033 else if (c == 'H' || c == 'h')
4045 Term_get_size(&wid, &hgt);
4047 if (old_use_graphics)
4049 use_graphics = FALSE;
4051 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
4057 do_cmd_save_screen_html();
4058 do_cmd_redraw(p_ptr);
4061 /* Do we use a special screendump function ? */
4062 else if (screendump_aux)
4064 /* Dump the screen to a graphics file */
4065 (*screendump_aux)();
4067 else /* Dump the screen as text */
4071 SYMBOL_CODE c = ' ';
4074 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
4076 /* File type is "TEXT" */
4077 FILE_TYPE(FILE_TYPE_TEXT);
4079 /* Append to the file */
4080 fff = my_fopen(buf, "w");
4084 msg_format(_("ファイル %s を開けませんでした。", "Failed to open file %s."), buf);
4092 /* Dump the screen */
4093 for (y = 0; y < hgt; y++)
4096 for (x = 0; x < wid - 1; x++)
4098 /* Get the attr/char */
4099 (void)(Term_what(x, y, &a, &c));
4109 fprintf(fff, "%s\n", buf);
4116 /* Dump the screen */
4117 for (y = 0; y < hgt; y++)
4120 for (x = 0; x < wid - 1; x++)
4122 /* Get the attr/char */
4123 (void)(Term_what(x, y, &a, &c));
4126 buf[x] = hack[a&0x0F];
4133 fprintf(fff, "%s\n", buf);
4140 msg_print(_("画面(記念撮影)をファイルに書き出しました。", "Screen dump saved."));
4145 if (old_use_graphics)
4147 use_graphics = TRUE;
4149 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
4155 * Check the status of "artifacts"
4157 static void do_cmd_knowledge_artifacts(void)
4167 GAME_TEXT file_name[1024];
4168 GAME_TEXT base_name[MAX_NLEN];
4172 /* Open a new file */
4173 fff = my_fopen_temp(file_name, 1024);
4176 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
4181 /* Allocate the "who" array */
4182 C_MAKE(who, max_a_idx, ARTIFACT_IDX);
4184 /* Allocate the "okay" array */
4185 C_MAKE(okay, max_a_idx, bool);
4187 /* Scan the artifacts */
4188 for (k = 0; k < max_a_idx; k++)
4190 artifact_type *a_ptr = &a_info[k];
4195 /* Skip "empty" artifacts */
4196 if (!a_ptr->name) continue;
4198 /* Skip "uncreated" artifacts */
4199 if (!a_ptr->cur_num) continue;
4205 /* Check the dungeon */
4206 for (y = 0; y < current_floor_ptr->height; y++)
4208 for (x = 0; x < current_floor_ptr->width; x++)
4210 grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
4212 OBJECT_IDX this_o_idx, next_o_idx = 0;
4214 /* Scan all objects in the grid */
4215 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
4218 o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
4219 next_o_idx = o_ptr->next_o_idx;
4221 /* Ignore non-artifacts */
4222 if (!object_is_fixed_artifact(o_ptr)) continue;
4224 /* Ignore known items */
4225 if (object_is_known(o_ptr)) continue;
4227 /* Note the artifact */
4228 okay[o_ptr->name1] = FALSE;
4233 /* Check the p_ptr->inventory_list and equipment */
4234 for (i = 0; i < INVEN_TOTAL; i++)
4236 object_type *o_ptr = &p_ptr->inventory_list[i];
4238 /* Ignore non-objects */
4239 if (!o_ptr->k_idx) continue;
4241 /* Ignore non-artifacts */
4242 if (!object_is_fixed_artifact(o_ptr)) continue;
4244 /* Ignore known items */
4245 if (object_is_known(o_ptr)) continue;
4247 /* Note the artifact */
4248 okay[o_ptr->name1] = FALSE;
4251 for (k = 0; k < max_a_idx; k++)
4253 if (okay[k]) who[n++] = k;
4256 ang_sort(who, &why, n, ang_sort_art_comp, ang_sort_art_swap);
4258 /* Scan the artifacts */
4259 for (k = 0; k < n; k++)
4261 artifact_type *a_ptr = &a_info[who[k]];
4262 strcpy(base_name, _("未知の伝説のアイテム", "Unknown Artifact"));
4264 /* Obtain the base object type */
4265 z = lookup_kind(a_ptr->tval, a_ptr->sval);
4274 /* Create fake object */
4275 object_prep(q_ptr, z);
4277 /* Make it an artifact */
4278 q_ptr->name1 = (byte)who[k];
4280 /* Display as if known */
4281 q_ptr->ident |= IDENT_STORE;
4283 /* Describe the artifact */
4284 object_desc(base_name, q_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
4287 /* Hack -- Build the artifact name */
4288 fprintf(fff, _(" %s\n", " The %s\n"), base_name);
4291 /* Free the "who" array */
4292 C_KILL(who, max_a_idx, ARTIFACT_IDX);
4294 /* Free the "okay" array */
4295 C_KILL(okay, max_a_idx, bool);
4298 /* Display the file contents */
4299 show_file(TRUE, file_name, _("既知の伝説のアイテム", "Artifacts Seen"), 0, 0);
4305 * Display known uniques
4306 * With "XTRA HACK UNIQHIST" (Originally from XAngband)
4308 static void do_cmd_knowledge_uniques(void)
4317 GAME_TEXT file_name[1024];
4320 int n_alive_surface = 0;
4321 int n_alive_over100 = 0;
4322 int n_alive_total = 0;
4325 for (i = 0; i < 10; i++) n_alive[i] = 0;
4327 /* Open a new file */
4328 fff = my_fopen_temp(file_name, 1024);
4332 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
4337 /* Allocate the "who" array */
4338 C_MAKE(who, max_r_idx, MONRACE_IDX);
4340 /* Scan the monsters */
4341 for (i = 1; i < max_r_idx; i++)
4343 monster_race *r_ptr = &r_info[i];
4346 if (!r_ptr->name) continue;
4348 /* Require unique monsters */
4349 if (!(r_ptr->flags1 & RF1_UNIQUE)) continue;
4351 /* Only display "known" uniques */
4352 if (!cheat_know && !r_ptr->r_sights) continue;
4354 /* Only print rarity <= 100 uniques */
4355 if (!r_ptr->rarity || ((r_ptr->rarity > 100) && !(r_ptr->flags1 & RF1_QUESTOR))) continue;
4357 /* Only "alive" uniques */
4358 if (r_ptr->max_num == 0) continue;
4362 lev = (r_ptr->level - 1) / 10;
4366 if (max_lev < lev) max_lev = lev;
4368 else n_alive_over100++;
4370 else n_alive_surface++;
4372 /* Collect "appropriate" monsters */
4376 /* Sort the array by dungeon depth of monsters */
4377 ang_sort(who, &why, n, ang_sort_comp_hook, ang_sort_swap_hook);
4379 if (n_alive_surface)
4381 fprintf(fff, _(" 地上 生存: %3d体\n", " Surface alive: %3d\n"), n_alive_surface);
4382 n_alive_total += n_alive_surface;
4384 for (i = 0; i <= max_lev; i++)
4386 fprintf(fff, _("%3d-%3d階 生存: %3d体\n", "Level %3d-%3d alive: %3d\n"), 1 + i * 10, 10 + i * 10, n_alive[i]);
4387 n_alive_total += n_alive[i];
4389 if (n_alive_over100)
4391 fprintf(fff, _("101- 階 生存: %3d体\n", "Level 101- alive: %3d\n"), n_alive_over100);
4392 n_alive_total += n_alive_over100;
4397 fputs(_("--------- -----------\n", "------------- ----------\n"), fff);
4398 fprintf(fff, _(" 合計 生存: %3d体\n\n", " Total alive: %3d\n\n"), n_alive_total);
4402 fputs(_("現在は既知の生存ユニークはいません。\n", "No known uniques alive.\n"), fff);
4405 /* Scan the monster races */
4406 for (k = 0; k < n; k++)
4408 monster_race *r_ptr = &r_info[who[k]];
4410 fprintf(fff, _(" %s (レベル%d)\n", " %s (level %d)\n"), r_name + r_ptr->name, (int)r_ptr->level);
4413 /* Free the "who" array */
4414 C_KILL(who, max_r_idx, s16b);
4417 /* Display the file contents */
4418 show_file(TRUE, file_name, _("まだ生きているユニーク・モンスター", "Alive Uniques"), 0, 0);
4424 * Display weapon-exp
4426 static void do_cmd_knowledge_weapon_exp(void)
4434 GAME_TEXT file_name[1024];
4437 /* Open a new file */
4438 fff = my_fopen_temp(file_name, 1024);
4440 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
4445 for (i = 0; i < 5; i++)
4447 for (num = 0; num < 64; num++)
4449 for (j = 0; j < max_k_idx; j++)
4451 object_kind *k_ptr = &k_info[j];
4453 if ((k_ptr->tval == TV_SWORD - i) && (k_ptr->sval == num))
4455 if ((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON || k_ptr->sval == SV_HARP)) continue;
4457 weapon_exp = p_ptr->weapon_exp[4 - i][num];
4459 fprintf(fff, "%-25s ", tmp);
4460 if (weapon_exp >= s_info[p_ptr->pclass].w_max[4 - i][num]) fprintf(fff, "!");
4461 else fprintf(fff, " ");
4462 fprintf(fff, "%s", exp_level_str[weapon_exp_level(weapon_exp)]);
4463 if (cheat_xtra) fprintf(fff, " %d", weapon_exp);
4472 /* Display the file contents */
4473 show_file(TRUE, file_name, _("武器の経験値", "Weapon Proficiency"), 0, 0);
4479 * @brief 魔法の経験値を表示するコマンドのメインルーチン
4483 static void do_cmd_knowledge_spell_exp(void)
4490 const magic_type *s_ptr;
4492 GAME_TEXT file_name[1024];
4494 /* Open a new file */
4495 fff = my_fopen_temp(file_name, 1024);
4497 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
4502 if (p_ptr->realm1 != REALM_NONE)
4504 fprintf(fff, _("%sの魔法書\n", "%s Spellbook\n"), realm_names[p_ptr->realm1]);
4505 for (i = 0; i < 32; i++)
4507 if (!is_magic(p_ptr->realm1))
4509 s_ptr = &technic_info[p_ptr->realm1 - MIN_TECHNIC][i];
4513 s_ptr = &mp_ptr->info[p_ptr->realm1 - 1][i];
4515 if (s_ptr->slevel >= 99) continue;
4516 spell_exp = p_ptr->spell_exp[i];
4517 exp_level = spell_exp_level(spell_exp);
4518 fprintf(fff, "%-25s ", do_spell(p_ptr->realm1, i, SPELL_NAME));
4519 if (p_ptr->realm1 == REALM_HISSATSU)
4520 fprintf(fff, "[--]");
4523 if (exp_level >= EXP_LEVEL_MASTER) fprintf(fff, "!");
4524 else fprintf(fff, " ");
4525 fprintf(fff, "%s", exp_level_str[exp_level]);
4527 if (cheat_xtra) fprintf(fff, " %d", spell_exp);
4532 if (p_ptr->realm2 != REALM_NONE)
4534 fprintf(fff, _("%sの魔法書\n", "\n%s Spellbook\n"), realm_names[p_ptr->realm2]);
4535 for (i = 0; i < 32; i++)
4537 if (!is_magic(p_ptr->realm1))
4539 s_ptr = &technic_info[p_ptr->realm2 - MIN_TECHNIC][i];
4543 s_ptr = &mp_ptr->info[p_ptr->realm2 - 1][i];
4545 if (s_ptr->slevel >= 99) continue;
4547 spell_exp = p_ptr->spell_exp[i + 32];
4548 exp_level = spell_exp_level(spell_exp);
4549 fprintf(fff, "%-25s ", do_spell(p_ptr->realm2, i, SPELL_NAME));
4550 if (exp_level >= EXP_LEVEL_EXPERT) fprintf(fff, "!");
4551 else fprintf(fff, " ");
4552 fprintf(fff, "%s", exp_level_str[exp_level]);
4553 if (cheat_xtra) fprintf(fff, " %d", spell_exp);
4559 /* Display the file contents */
4560 show_file(TRUE, file_name, _("魔法の経験値", "Spell Proficiency"), 0, 0);
4566 * @brief スキル情報を表示するコマンドのメインルーチン /
4570 static void do_cmd_knowledge_skill_exp(void)
4572 int i = 0, skill_exp;
4576 char file_name[1024];
4577 char skill_name[GINOU_TEMPMAX][20] =
4579 _("マーシャルアーツ", "Martial Arts "),
4580 _("二刀流 ", "Dual Wielding "),
4581 _("乗馬 ", "Riding "),
4585 /* Open a new file */
4586 fff = my_fopen_temp(file_name, 1024);
4588 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
4593 for (i = 0; i < GINOU_TEMPMAX; i++)
4595 skill_exp = p_ptr->skill_exp[i];
4596 fprintf(fff, "%-20s ", skill_name[i]);
4597 if (skill_exp >= s_info[p_ptr->pclass].s_max[i]) fprintf(fff, "!");
4598 else fprintf(fff, " ");
4599 fprintf(fff, "%s", exp_level_str[(i == GINOU_RIDING) ? riding_exp_level(skill_exp) : weapon_exp_level(skill_exp)]);
4600 if (cheat_xtra) fprintf(fff, " %d", skill_exp);
4605 /* Display the file contents */
4606 show_file(TRUE, file_name, _("技能の経験値", "Miscellaneous Proficiency"), 0, 0);
4612 * @brief 現在のペットを表示するコマンドのメインルーチン /
4613 * Display current pets
4616 static void do_cmd_knowledge_pets(void)
4620 monster_type *m_ptr;
4621 GAME_TEXT pet_name[MAX_NLEN];
4623 int show_upkeep = 0;
4624 GAME_TEXT file_name[1024];
4627 /* Open a new file */
4628 fff = my_fopen_temp(file_name, 1024);
4630 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
4635 /* Process the monsters (backwards) */
4636 for (i = current_floor_ptr->m_max - 1; i >= 1; i--)
4638 /* Access the monster */
4639 m_ptr = ¤t_floor_ptr->m_list[i];
4641 /* Ignore "dead" monsters */
4642 if (!monster_is_valid(m_ptr)) continue;
4644 /* Calculate "upkeep" for pets */
4648 monster_desc(pet_name, m_ptr, MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
4649 fprintf(fff, "%s (%s)\n", pet_name, look_mon_desc(m_ptr, 0x00));
4653 show_upkeep = calculate_upkeep();
4655 fprintf(fff, "----------------------------------------------\n");
4657 fprintf(fff, " 合計: %d 体のペット\n", t_friends);
4659 fprintf(fff, " Total: %d pet%s.\n", t_friends, (t_friends == 1 ? "" : "s"));
4661 fprintf(fff, _(" 維持コスト: %d%% MP\n", " Upkeep: %d%% mana.\n"), show_upkeep);
4666 /* Display the file contents */
4667 show_file(TRUE, file_name, _("現在のペット", "Current Pets"), 0, 0);
4673 * @brief 現在のペットを表示するコマンドのメインルーチン /
4676 * @note the player ghosts are ignored.
4678 static void do_cmd_knowledge_kill_count(void)
4685 GAME_TEXT file_name[1024];
4690 /* Open a new file */
4691 fff = my_fopen_temp(file_name, 1024);
4694 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
4699 /* Allocate the "who" array */
4700 C_MAKE(who, max_r_idx, MONRACE_IDX);
4703 /* Monsters slain */
4706 for (kk = 1; kk < max_r_idx; kk++)
4708 monster_race *r_ptr = &r_info[kk];
4710 if (r_ptr->flags1 & (RF1_UNIQUE))
4712 bool dead = (r_ptr->max_num == 0);
4721 MONSTER_NUMBER This = r_ptr->r_pkills;
4731 fprintf(fff,_("あなたはまだ敵を倒していない。\n\n", "You have defeated no enemies yet.\n\n"));
4734 fprintf(fff,"あなたは%ld体の敵を倒している。\n\n", (long int)Total);
4736 fprintf(fff,"You have defeated %ld %s.\n\n", (long int)Total, (Total == 1) ? "enemy" : "enemies");
4742 /* Scan the monsters */
4743 for (i = 1; i < max_r_idx; i++)
4745 monster_race *r_ptr = &r_info[i];
4747 /* Use that monster */
4748 if (r_ptr->name) who[n++] = i;
4751 /* Sort the array by dungeon depth of monsters */
4752 ang_sort(who, &why, n, ang_sort_comp_hook, ang_sort_swap_hook);
4754 /* Scan the monster races */
4755 for (k = 0; k < n; k++)
4757 monster_race *r_ptr = &r_info[who[k]];
4759 if (r_ptr->flags1 & (RF1_UNIQUE))
4761 bool dead = (r_ptr->max_num == 0);
4765 fprintf(fff, " %s\n", (r_name + r_ptr->name));
4771 MONSTER_NUMBER This = r_ptr->r_pkills;
4776 /* p,tは人と数える by ita */
4777 if (my_strchr("pt", r_ptr->d_char))
4778 fprintf(fff, " %3d 人の %s\n", (int)This, r_name + r_ptr->name);
4780 fprintf(fff, " %3d 体の %s\n", (int)This, r_name + r_ptr->name);
4784 if (my_strstr(r_name + r_ptr->name, "coins"))
4786 fprintf(fff, " 1 pile of %s\n", (r_name + r_ptr->name));
4790 fprintf(fff, " 1 %s\n", (r_name + r_ptr->name));
4796 strcpy(ToPlural, (r_name + r_ptr->name));
4797 plural_aux(ToPlural);
4798 fprintf(fff, " %d %s\n", This, ToPlural);
4808 fprintf(fff,"----------------------------------------------\n");
4810 fprintf(fff," 合計: %lu 体を倒した。\n", (unsigned long int)Total);
4812 fprintf(fff," Total: %lu creature%s killed.\n", (unsigned long int)Total, (Total == 1 ? "" : "s"));
4816 /* Free the "who" array */
4817 C_KILL(who, max_r_idx, s16b);
4820 /* Display the file contents */
4821 show_file(TRUE, file_name, _("倒した敵の数", "Kill Count"), 0, 0);
4827 * @brief モンスター情報リスト中のグループを表示する /
4828 * Display the object groups.
4832 * @param per_page リストの表示行
4833 * @param grp_idx グループのID配列
4834 * @param group_text グループ名の文字列配列
4835 * @param grp_cur 現在の選択ID
4836 * @param grp_top 現在の選択リスト最上部ID
4839 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)
4843 /* Display lines until done */
4844 for (i = 0; i < per_page && (grp_idx[i] >= 0); i++)
4846 /* Get the group index */
4847 int grp = grp_idx[grp_top + i];
4849 /* Choose a color */
4850 TERM_COLOR attr = (grp_top + i == grp_cur) ? TERM_L_BLUE : TERM_WHITE;
4852 /* Erase the entire line */
4853 Term_erase(col, row + i, wid);
4855 /* Display the group label */
4856 c_put_str(attr, group_text[grp], row + i, col);
4862 * Move the cursor in a browser window
4864 static void browser_cursor(char ch, int *column, IDX *grp_cur, int grp_cnt,
4865 IDX *list_cur, int list_cnt)
4870 IDX list = *list_cur;
4872 /* Extract direction */
4875 /* Hack -- scroll up full screen */
4880 /* Hack -- scroll down full screen */
4885 d = get_keymap_dir(ch);
4890 /* Diagonals - hack */
4891 if ((ddx[d] > 0) && ddy[d])
4896 Term_get_size(&wid, &hgt);
4898 browser_rows = hgt - 8;
4900 /* Browse group list */
4905 /* Move up or down */
4906 grp += ddy[d] * (browser_rows - 1);
4909 if (grp >= grp_cnt) grp = grp_cnt - 1;
4910 if (grp < 0) grp = 0;
4911 if (grp != old_grp) list = 0;
4914 /* Browse sub-list list */
4917 /* Move up or down */
4918 list += ddy[d] * browser_rows;
4921 if (list >= list_cnt) list = list_cnt - 1;
4922 if (list < 0) list = 0;
4934 if (col < 0) col = 0;
4935 if (col > 1) col = 1;
4942 /* Browse group list */
4947 /* Move up or down */
4951 if (grp >= grp_cnt) grp = grp_cnt - 1;
4952 if (grp < 0) grp = 0;
4953 if (grp != old_grp) list = 0;
4956 /* Browse sub-list list */
4959 /* Move up or down */
4960 list += (IDX)ddy[d];
4963 if (list >= list_cnt) list = list_cnt - 1;
4964 if (list < 0) list = 0;
4975 static void display_visual_list(int col, int row, int height, int width, TERM_COLOR attr_top, byte char_left)
4979 /* Clear the display lines */
4980 for (i = 0; i < height; i++)
4982 Term_erase(col, row + i, width);
4985 /* Bigtile mode uses double width */
4986 if (use_bigtile) width /= 2;
4988 /* Display lines until done */
4989 for (i = 0; i < height; i++)
4991 /* Display columns until done */
4992 for (j = 0; j < width; j++)
4996 TERM_LEN x = col + j;
4997 TERM_LEN y = row + i;
4999 /* Bigtile mode uses double width */
5000 if (use_bigtile) x += j;
5005 /* Ignore illegal characters */
5006 if (ia > 0x7f || ic > 0xff || ic < ' ' ||
5007 (!use_graphics && ic > 0x7f))
5013 /* Force correct code for both ASCII character and tile */
5014 if (c & 0x80) a |= 0x80;
5016 /* Display symbol */
5017 Term_queue_bigchar(x, y, a, c, 0, 0);
5024 * Place the cursor at the collect position for visual mode
5026 static void place_visual_list_cursor(TERM_LEN col, TERM_LEN row, TERM_COLOR a, byte c, TERM_COLOR attr_top, byte char_left)
5028 int i = (a & 0x7f) - attr_top;
5029 int j = c - char_left;
5031 TERM_LEN x = col + j;
5032 TERM_LEN y = row + i;
5034 /* Bigtile mode uses double width */
5035 if (use_bigtile) x += j;
5037 /* Place the cursor */
5043 * Clipboard variables for copy&paste in visual mode
5045 static TERM_COLOR attr_idx = 0;
5046 static SYMBOL_CODE char_idx = 0;
5048 /* Hack -- for feature lighting */
5049 static TERM_COLOR attr_idx_feat[F_LIT_MAX];
5050 static SYMBOL_CODE char_idx_feat[F_LIT_MAX];
5053 * Do visual mode command -- Change symbols
5055 static bool visual_mode_command(char ch, bool *visual_list_ptr,
5056 int height, int width,
5057 TERM_COLOR *attr_top_ptr, byte *char_left_ptr,
5058 TERM_COLOR *cur_attr_ptr, SYMBOL_CODE *cur_char_ptr, bool *need_redraw)
5060 static TERM_COLOR attr_old = 0;
5061 static SYMBOL_CODE char_old = 0;
5066 if (*visual_list_ptr)
5069 *cur_attr_ptr = attr_old;
5070 *cur_char_ptr = char_old;
5071 *visual_list_ptr = FALSE;
5079 if (*visual_list_ptr)
5082 *visual_list_ptr = FALSE;
5083 *need_redraw = TRUE;
5091 if (!*visual_list_ptr)
5093 *visual_list_ptr = TRUE;
5095 *attr_top_ptr = MAX(0, (*cur_attr_ptr & 0x7f) - 5);
5096 *char_left_ptr = MAX(0, *cur_char_ptr - 10);
5098 attr_old = *cur_attr_ptr;
5099 char_old = *cur_char_ptr;
5110 /* Set the visual */
5111 attr_idx = *cur_attr_ptr;
5112 char_idx = *cur_char_ptr;
5114 /* Hack -- for feature lighting */
5115 for (i = 0; i < F_LIT_MAX; i++)
5117 attr_idx_feat[i] = 0;
5118 char_idx_feat[i] = 0;
5125 if (attr_idx || (!(char_idx & 0x80) && char_idx)) /* Allow TERM_DARK text */
5128 *cur_attr_ptr = attr_idx;
5129 *attr_top_ptr = MAX(0, (*cur_attr_ptr & 0x7f) - 5);
5130 if (!*visual_list_ptr) *need_redraw = TRUE;
5136 *cur_char_ptr = char_idx;
5137 *char_left_ptr = MAX(0, *cur_char_ptr - 10);
5138 if (!*visual_list_ptr) *need_redraw = TRUE;
5144 if (*visual_list_ptr)
5147 int d = get_keymap_dir(ch);
5148 TERM_COLOR a = (*cur_attr_ptr & 0x7f);
5149 SYMBOL_CODE c = *cur_char_ptr;
5151 if (use_bigtile) eff_width = width / 2;
5152 else eff_width = width;
5154 /* Restrict direction */
5155 if ((a == 0) && (ddy[d] < 0)) d = 0;
5156 if ((c == 0) && (ddx[d] < 0)) d = 0;
5157 if ((a == 0x7f) && (ddy[d] > 0)) d = 0;
5158 if ((c == 0xff) && (ddx[d] > 0)) d = 0;
5160 a += (TERM_COLOR)ddy[d];
5161 c += (SYMBOL_CODE)ddx[d];
5163 /* Force correct code for both ASCII character and tile */
5164 if (c & 0x80) a |= 0x80;
5166 /* Set the visual */
5171 /* Move the frame */
5172 if ((ddx[d] < 0) && *char_left_ptr > MAX(0, (int)c - 10)) (*char_left_ptr)--;
5173 if ((ddx[d] > 0) && *char_left_ptr + eff_width < MIN(0xff, (int)c + 10)) (*char_left_ptr)++;
5174 if ((ddy[d] < 0) && *attr_top_ptr > MAX(0, (int)(a & 0x7f) - 4)) (*attr_top_ptr)--;
5175 if ((ddy[d] > 0) && *attr_top_ptr + height < MIN(0x7f, (a & 0x7f) + 4)) (*attr_top_ptr)++;
5181 /* Visual mode command is not used */
5187 * Display the monsters in a group.
5189 static void display_monster_list(int col, int row, int per_page, s16b mon_idx[],
5190 int mon_cur, int mon_top, bool visual_only)
5194 /* Display lines until done */
5195 for (i = 0; i < per_page && (mon_idx[mon_top + i] >= 0); i++)
5199 /* Get the race index */
5200 MONRACE_IDX r_idx = mon_idx[mon_top + i] ;
5202 /* Access the race */
5203 monster_race *r_ptr = &r_info[r_idx];
5205 /* Choose a color */
5206 attr = ((i + mon_top == mon_cur) ? TERM_L_BLUE : TERM_WHITE);
5208 /* Display the name */
5209 c_prt(attr, (r_name + r_ptr->name), row + i, col);
5211 /* Hack -- visual_list mode */
5214 c_prt(attr, format("%02x/%02x", r_ptr->x_attr, r_ptr->x_char), row + i, (p_ptr->wizard || visual_only) ? 56 : 61);
5216 if (p_ptr->wizard || visual_only)
5218 c_prt(attr, format("%d", r_idx), row + i, 62);
5221 /* Erase chars before overwritten by the race letter */
5222 Term_erase(69, row + i, 255);
5224 /* Display symbol */
5225 Term_queue_bigchar(use_bigtile ? 69 : 70, row + i, r_ptr->x_attr, r_ptr->x_char, 0, 0);
5230 if (!(r_ptr->flags1 & RF1_UNIQUE))
5231 put_str(format("%5d", r_ptr->r_pkills), row + i, 73);
5233 c_put_str((r_ptr->max_num == 0 ? TERM_L_DARK : TERM_WHITE),
5234 (r_ptr->max_num == 0 ? _("死亡", " dead") : _("生存", "alive")), row + i, 74);
5238 /* Clear remaining lines */
5239 for (; i < per_page; i++)
5241 Term_erase(col, row + i, 255);
5247 * Display known monsters.
5249 static void do_cmd_knowledge_monsters(bool *need_redraw, bool visual_only, IDX direct_r_idx)
5253 IDX grp_cur, grp_top, old_grp_cur;
5254 IDX mon_cur, mon_top;
5255 IDX grp_cnt, grp_idx[100];
5263 bool visual_list = FALSE;
5264 TERM_COLOR attr_top = 0;
5272 Term_get_size(&wid, &hgt);
5274 browser_rows = hgt - 8;
5276 /* Allocate the "mon_idx" array */
5277 C_MAKE(mon_idx, max_r_idx, MONRACE_IDX);
5282 if (direct_r_idx < 0)
5284 mode = visual_only ? 0x03 : 0x01;
5286 /* Check every group */
5287 for (i = 0; monster_group_text[i] != NULL; i++)
5289 /* Measure the label */
5290 len = strlen(monster_group_text[i]);
5292 /* Save the maximum length */
5293 if (len > max) max = len;
5295 /* See if any monsters are known */
5296 if ((monster_group_char[i] == ((char *) -1L)) || collect_monsters(i, mon_idx, mode))
5298 /* Build a list of groups with known monsters */
5299 grp_idx[grp_cnt++] = i;
5307 mon_idx[0] = direct_r_idx;
5310 /* Terminate the list */
5313 (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
5314 &attr_top, &char_left, &r_info[direct_r_idx].x_attr, &r_info[direct_r_idx].x_char, need_redraw);
5317 /* Terminate the list */
5318 grp_idx[grp_cnt] = -1;
5321 grp_cur = grp_top = 0;
5322 mon_cur = mon_top = 0;
5327 mode = visual_only ? 0x02 : 0x00;
5332 monster_race *r_ptr;
5337 prt(format(_("%s - モンスター", "%s - monsters"), !visual_only ? _("知識", "Knowledge") : _("表示", "Visuals")), 2, 0);
5338 if (direct_r_idx < 0) prt(_("グループ", "Group"), 4, 0);
5339 prt(_("名前", "Name"), 4, max + 3);
5340 if (p_ptr->wizard || visual_only) prt("Idx", 4, 62);
5341 prt(_("文字", "Sym"), 4, 67);
5342 if (!visual_only) prt(_("殺害数", "Kills"), 4, 72);
5344 for (i = 0; i < 78; i++)
5346 Term_putch(i, 5, TERM_WHITE, '=');
5349 if (direct_r_idx < 0)
5351 for (i = 0; i < browser_rows; i++)
5353 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
5360 if (direct_r_idx < 0)
5362 /* Scroll group list */
5363 if (grp_cur < grp_top) grp_top = grp_cur;
5364 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
5366 /* Display a list of monster groups */
5367 display_group_list(0, 6, max, browser_rows, grp_idx, monster_group_text, grp_cur, grp_top);
5369 if (old_grp_cur != grp_cur)
5371 old_grp_cur = grp_cur;
5373 /* Get a list of monsters in the current group */
5374 mon_cnt = collect_monsters(grp_idx[grp_cur], mon_idx, mode);
5377 /* Scroll monster list */
5378 while (mon_cur < mon_top)
5379 mon_top = MAX(0, mon_top - browser_rows/2);
5380 while (mon_cur >= mon_top + browser_rows)
5381 mon_top = MIN(mon_cnt - browser_rows, mon_top + browser_rows/2);
5386 /* Display a list of monsters in the current group */
5387 display_monster_list(max + 3, 6, browser_rows, mon_idx, mon_cur, mon_top, visual_only);
5393 /* Display a monster name */
5394 display_monster_list(max + 3, 6, 1, mon_idx, mon_cur, mon_top, visual_only);
5396 /* Display visual list below first monster */
5397 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
5401 prt(format(_("<方向>%s%s%s, ESC", "<dir>%s%s%s, ESC"),
5402 (!visual_list && !visual_only) ? _(", 'r'で思い出を見る", ", 'r' to recall") : "",
5403 visual_list ? _(", ENTERで決定", ", ENTER to accept") : _(", 'v'でシンボル変更", ", 'v' for visuals"),
5404 (attr_idx || char_idx) ? _(", 'c', 'p'でペースト", ", 'c', 'p' to paste") : _(", 'c'でコピー", ", 'c' to copy")),
5407 /* Get the current monster */
5408 r_ptr = &r_info[mon_idx[mon_cur]];
5412 /* Mega Hack -- track this monster race */
5413 if (mon_cnt) monster_race_track(mon_idx[mon_cur]);
5419 place_visual_list_cursor(max + 3, 7, r_ptr->x_attr, r_ptr->x_char, attr_top, char_left);
5423 Term_gotoxy(0, 6 + (grp_cur - grp_top));
5427 Term_gotoxy(max + 3, 6 + (mon_cur - mon_top));
5432 /* Do visual mode command if needed */
5433 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))
5435 if (direct_r_idx >= 0)
5460 /* Recall on screen */
5461 if (!visual_list && !visual_only && (mon_idx[mon_cur] > 0))
5463 screen_roff(mon_idx[mon_cur], 0);
5474 /* Move the cursor */
5475 browser_cursor(ch, &column, &grp_cur, grp_cnt, &mon_cur, mon_cnt);
5482 /* Free the "mon_idx" array */
5483 C_KILL(mon_idx, max_r_idx, MONRACE_IDX);
5488 * Display the objects in a group.
5490 static void display_object_list(int col, int row, int per_page, IDX object_idx[],
5491 int object_cur, int object_top, bool visual_only)
5495 /* Display lines until done */
5496 for (i = 0; i < per_page && (object_idx[object_top + i] >= 0); i++)
5498 GAME_TEXT o_name[MAX_NLEN];
5501 object_kind *flavor_k_ptr;
5503 /* Get the object index */
5504 KIND_OBJECT_IDX k_idx = object_idx[object_top + i];
5506 /* Access the object */
5507 object_kind *k_ptr = &k_info[k_idx];
5509 /* Choose a color */
5510 TERM_COLOR attr = ((k_ptr->aware || visual_only) ? TERM_WHITE : TERM_SLATE);
5511 byte cursor = ((k_ptr->aware || visual_only) ? TERM_L_BLUE : TERM_BLUE);
5514 if (!visual_only && k_ptr->flavor)
5516 /* Appearance of this object is shuffled */
5517 flavor_k_ptr = &k_info[k_ptr->flavor];
5521 /* Appearance of this object is very normal */
5522 flavor_k_ptr = k_ptr;
5527 attr = ((i + object_top == object_cur) ? cursor : attr);
5529 if (!k_ptr->flavor || (!visual_only && k_ptr->aware))
5532 strip_name(o_name, k_idx);
5537 strcpy(o_name, k_name + flavor_k_ptr->flavor_name);
5540 /* Display the name */
5541 c_prt(attr, o_name, row + i, col);
5543 /* Hack -- visual_list mode */
5546 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);
5548 if (p_ptr->wizard || visual_only)
5550 c_prt(attr, format("%d", k_idx), row + i, 70);
5553 a = flavor_k_ptr->x_attr;
5554 c = flavor_k_ptr->x_char;
5556 /* Display symbol */
5557 Term_queue_bigchar(use_bigtile ? 76 : 77, row + i, a, c, 0, 0);
5560 /* Clear remaining lines */
5561 for (; i < per_page; i++)
5563 Term_erase(col, row + i, 255);
5568 * Describe fake object
5570 static void desc_obj_fake(KIND_OBJECT_IDX k_idx)
5573 object_type object_type_body;
5574 o_ptr = &object_type_body;
5576 object_prep(o_ptr, k_idx);
5578 /* It's fully know */
5579 o_ptr->ident |= IDENT_KNOWN;
5581 /* Track the object */
5582 /* object_actual_track(o_ptr); */
5584 /* Hack - mark as fake */
5585 /* term_obj_real = FALSE; */
5588 if (!screen_object(o_ptr, SCROBJ_FAKE_OBJECT | SCROBJ_FORCE_DETAIL))
5590 msg_print(_("特に変わったところはないようだ。", "You see nothing special."));
5598 * Display known objects
5600 static void do_cmd_knowledge_objects(bool *need_redraw, bool visual_only, IDX direct_k_idx)
5604 IDX grp_cur, grp_top, old_grp_cur;
5605 IDX object_old, object_cur, object_top;
5609 OBJECT_IDX *object_idx;
5615 bool visual_list = FALSE;
5616 TERM_COLOR attr_top = 0;
5624 Term_get_size(&wid, &hgt);
5626 browser_rows = hgt - 8;
5628 /* Allocate the "object_idx" array */
5629 C_MAKE(object_idx, max_k_idx, KIND_OBJECT_IDX);
5634 if (direct_k_idx < 0)
5636 mode = visual_only ? 0x03 : 0x01;
5638 /* Check every group */
5639 for (i = 0; object_group_text[i] != NULL; i++)
5641 /* Measure the label */
5642 len = strlen(object_group_text[i]);
5644 /* Save the maximum length */
5645 if (len > max) max = len;
5647 /* See if any monsters are known */
5648 if (collect_objects(i, object_idx, mode))
5650 /* Build a list of groups with known monsters */
5651 grp_idx[grp_cnt++] = i;
5660 object_kind *k_ptr = &k_info[direct_k_idx];
5661 object_kind *flavor_k_ptr;
5663 if (!visual_only && k_ptr->flavor)
5665 /* Appearance of this object is shuffled */
5666 flavor_k_ptr = &k_info[k_ptr->flavor];
5670 /* Appearance of this object is very normal */
5671 flavor_k_ptr = k_ptr;
5674 object_idx[0] = direct_k_idx;
5675 object_old = direct_k_idx;
5678 /* Terminate the list */
5681 (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
5682 &attr_top, &char_left, &flavor_k_ptr->x_attr, &flavor_k_ptr->x_char, need_redraw);
5685 /* Terminate the list */
5686 grp_idx[grp_cnt] = -1;
5689 grp_cur = grp_top = 0;
5690 object_cur = object_top = 0;
5695 mode = visual_only ? 0x02 : 0x00;
5700 object_kind *k_ptr, *flavor_k_ptr;
5707 prt(format("%s - アイテム", !visual_only ? "知識" : "表示"), 2, 0);
5708 if (direct_k_idx < 0) prt("グループ", 4, 0);
5709 prt("名前", 4, max + 3);
5710 if (p_ptr->wizard || visual_only) prt("Idx", 4, 70);
5713 prt(format("%s - objects", !visual_only ? "Knowledge" : "Visuals"), 2, 0);
5714 if (direct_k_idx < 0) prt("Group", 4, 0);
5715 prt("Name", 4, max + 3);
5716 if (p_ptr->wizard || visual_only) prt("Idx", 4, 70);
5720 for (i = 0; i < 78; i++)
5722 Term_putch(i, 5, TERM_WHITE, '=');
5725 if (direct_k_idx < 0)
5727 for (i = 0; i < browser_rows; i++)
5729 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
5736 if (direct_k_idx < 0)
5738 /* Scroll group list */
5739 if (grp_cur < grp_top) grp_top = grp_cur;
5740 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
5742 /* Display a list of object groups */
5743 display_group_list(0, 6, max, browser_rows, grp_idx, object_group_text, grp_cur, grp_top);
5745 if (old_grp_cur != grp_cur)
5747 old_grp_cur = grp_cur;
5749 /* Get a list of objects in the current group */
5750 object_cnt = collect_objects(grp_idx[grp_cur], object_idx, mode);
5753 /* Scroll object list */
5754 while (object_cur < object_top)
5755 object_top = MAX(0, object_top - browser_rows/2);
5756 while (object_cur >= object_top + browser_rows)
5757 object_top = MIN(object_cnt - browser_rows, object_top + browser_rows/2);
5762 /* Display a list of objects in the current group */
5763 display_object_list(max + 3, 6, browser_rows, object_idx, object_cur, object_top, visual_only);
5767 object_top = object_cur;
5769 /* Display a list of objects in the current group */
5770 display_object_list(max + 3, 6, 1, object_idx, object_cur, object_top, visual_only);
5772 /* Display visual list below first object */
5773 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
5776 /* Get the current object */
5777 k_ptr = &k_info[object_idx[object_cur]];
5779 if (!visual_only && k_ptr->flavor)
5781 /* Appearance of this object is shuffled */
5782 flavor_k_ptr = &k_info[k_ptr->flavor];
5786 /* Appearance of this object is very normal */
5787 flavor_k_ptr = k_ptr;
5792 prt(format("<方向>%s%s%s, ESC",
5793 (!visual_list && !visual_only) ? ", 'r'で詳細を見る" : "",
5794 visual_list ? ", ENTERで決定" : ", 'v'でシンボル変更",
5795 (attr_idx || char_idx) ? ", 'c', 'p'でペースト" : ", 'c'でコピー"),
5798 prt(format("<dir>%s%s%s, ESC",
5799 (!visual_list && !visual_only) ? ", 'r' to recall" : "",
5800 visual_list ? ", ENTER to accept" : ", 'v' for visuals",
5801 (attr_idx || char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"),
5807 /* Mega Hack -- track this object */
5808 if (object_cnt) object_kind_track(object_idx[object_cur]);
5810 /* The "current" object changed */
5811 if (object_old != object_idx[object_cur])
5815 /* Remember the "current" object */
5816 object_old = object_idx[object_cur];
5822 place_visual_list_cursor(max + 3, 7, flavor_k_ptr->x_attr, flavor_k_ptr->x_char, attr_top, char_left);
5826 Term_gotoxy(0, 6 + (grp_cur - grp_top));
5830 Term_gotoxy(max + 3, 6 + (object_cur - object_top));
5835 /* Do visual mode command if needed */
5836 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))
5838 if (direct_k_idx >= 0)
5863 /* Recall on screen */
5864 if (!visual_list && !visual_only && (grp_cnt > 0))
5866 desc_obj_fake(object_idx[object_cur]);
5874 /* Move the cursor */
5875 browser_cursor(ch, &column, &grp_cur, grp_cnt, &object_cur, object_cnt);
5881 /* Free the "object_idx" array */
5882 C_KILL(object_idx, max_k_idx, KIND_OBJECT_IDX);
5887 * Display the features in a group.
5889 static void display_feature_list(int col, int row, int per_page, FEAT_IDX *feat_idx,
5890 FEAT_IDX feat_cur, FEAT_IDX feat_top, bool visual_only, int lighting_level)
5892 int lit_col[F_LIT_MAX], i, j;
5893 int f_idx_col = use_bigtile ? 62 : 64;
5895 /* Correct columns 1 and 4 */
5896 lit_col[F_LIT_STANDARD] = use_bigtile ? (71 - F_LIT_MAX) : 71;
5897 for (i = F_LIT_NS_BEGIN; i < F_LIT_MAX; i++)
5898 lit_col[i] = lit_col[F_LIT_STANDARD] + 2 + (i - F_LIT_NS_BEGIN) * 2 + (use_bigtile ? i : 0);
5900 /* Display lines until done */
5901 for (i = 0; i < per_page && (feat_idx[feat_top + i] >= 0); i++)
5904 FEAT_IDX f_idx = feat_idx[feat_top + i];
5905 feature_type *f_ptr = &f_info[f_idx];
5906 int row_i = row + i;
5908 /* Choose a color */
5909 attr = ((i + feat_top == feat_cur) ? TERM_L_BLUE : TERM_WHITE);
5911 /* Display the name */
5912 c_prt(attr, f_name + f_ptr->name, row_i, col);
5914 /* Hack -- visual_list mode */
5917 /* Display lighting level */
5918 c_prt(attr, format("(%s)", lighting_level_str[lighting_level]), row_i, col + 1 + strlen(f_name + f_ptr->name));
5920 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));
5922 if (p_ptr->wizard || visual_only)
5924 c_prt(attr, format("%d", f_idx), row_i, f_idx_col);
5927 /* Display symbol */
5928 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);
5930 Term_putch(lit_col[F_LIT_NS_BEGIN], row_i, TERM_SLATE, '(');
5931 for (j = F_LIT_NS_BEGIN + 1; j < F_LIT_MAX; j++)
5933 Term_putch(lit_col[j], row_i, TERM_SLATE, '/');
5935 Term_putch(lit_col[F_LIT_MAX - 1] + (use_bigtile ? 3 : 2), row_i, TERM_SLATE, ')');
5937 /* Mega-hack -- Use non-standard colour */
5938 for (j = F_LIT_NS_BEGIN; j < F_LIT_MAX; j++)
5940 Term_queue_bigchar(lit_col[j] + 1, row_i, f_ptr->x_attr[j], f_ptr->x_char[j], 0, 0);
5944 /* Clear remaining lines */
5945 for (; i < per_page; i++)
5947 Term_erase(col, row + i, 255);
5953 * Interact with feature visuals.
5955 static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX direct_f_idx, IDX *lighting_level)
5959 FEAT_IDX grp_cur, grp_top, old_grp_cur;
5960 FEAT_IDX feat_cur, feat_top;
5962 FEAT_IDX grp_idx[100];
5966 TERM_LEN column = 0;
5970 bool visual_list = FALSE;
5971 TERM_COLOR attr_top = 0;
5974 TERM_LEN browser_rows;
5977 TERM_COLOR attr_old[F_LIT_MAX];
5978 SYMBOL_CODE char_old[F_LIT_MAX];
5979 TERM_COLOR *cur_attr_ptr;
5980 SYMBOL_CODE *cur_char_ptr;
5982 (void)C_WIPE(attr_old, F_LIT_MAX, TERM_COLOR);
5983 (void)C_WIPE(char_old, F_LIT_MAX, SYMBOL_CODE);
5985 Term_get_size(&wid, &hgt);
5987 browser_rows = hgt - 8;
5989 /* Allocate the "feat_idx" array */
5990 C_MAKE(feat_idx, max_f_idx, FEAT_IDX);
5995 if (direct_f_idx < 0)
5997 /* Check every group */
5998 for (i = 0; feature_group_text[i] != NULL; i++)
6000 /* Measure the label */
6001 len = strlen(feature_group_text[i]);
6003 /* Save the maximum length */
6004 if (len > max) max = len;
6006 /* See if any features are known */
6007 if (collect_features(i, feat_idx, 0x01))
6009 /* Build a list of groups with known features */
6010 grp_idx[grp_cnt++] = i;
6018 feature_type *f_ptr = &f_info[direct_f_idx];
6020 feat_idx[0] = direct_f_idx;
6023 /* Terminate the list */
6026 (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
6027 &attr_top, &char_left, &f_ptr->x_attr[*lighting_level], &f_ptr->x_char[*lighting_level], need_redraw);
6029 for (i = 0; i < F_LIT_MAX; i++)
6031 attr_old[i] = f_ptr->x_attr[i];
6032 char_old[i] = f_ptr->x_char[i];
6036 /* Terminate the list */
6037 grp_idx[grp_cnt] = -1;
6040 grp_cur = grp_top = 0;
6041 feat_cur = feat_top = 0;
6049 feature_type *f_ptr;
6055 prt(_("表示 - 地形", "Visuals - features"), 2, 0);
6056 if (direct_f_idx < 0) prt(_("グループ", "Group"), 4, 0);
6057 prt(_("名前", "Name"), 4, max + 3);
6060 if (p_ptr->wizard || visual_only) prt("Idx", 4, 62);
6061 prt(_("文字 ( l/ d)", "Sym ( l/ d)"), 4, 66);
6065 if (p_ptr->wizard || visual_only) prt("Idx", 4, 64);
6066 prt(_("文字 (l/d)", "Sym (l/d)"), 4, 68);
6069 for (i = 0; i < 78; i++)
6071 Term_putch(i, 5, TERM_WHITE, '=');
6074 if (direct_f_idx < 0)
6076 for (i = 0; i < browser_rows; i++)
6078 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
6085 if (direct_f_idx < 0)
6087 /* Scroll group list */
6088 if (grp_cur < grp_top) grp_top = grp_cur;
6089 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
6091 /* Display a list of feature groups */
6092 display_group_list(0, 6, max, browser_rows, grp_idx, feature_group_text, grp_cur, grp_top);
6094 if (old_grp_cur != grp_cur)
6096 old_grp_cur = grp_cur;
6098 /* Get a list of features in the current group */
6099 feat_cnt = collect_features(grp_idx[grp_cur], feat_idx, 0x00);
6102 /* Scroll feature list */
6103 while (feat_cur < feat_top)
6104 feat_top = MAX(0, feat_top - browser_rows/2);
6105 while (feat_cur >= feat_top + browser_rows)
6106 feat_top = MIN(feat_cnt - browser_rows, feat_top + browser_rows/2);
6111 /* Display a list of features in the current group */
6112 display_feature_list(max + 3, 6, browser_rows, feat_idx, feat_cur, feat_top, visual_only, F_LIT_STANDARD);
6116 feat_top = feat_cur;
6118 /* Display a list of features in the current group */
6119 display_feature_list(max + 3, 6, 1, feat_idx, feat_cur, feat_top, visual_only, *lighting_level);
6121 /* Display visual list below first object */
6122 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
6126 prt(format(_("<方向>%s, 'd'で標準光源効果%s, ESC", "<dir>%s, 'd' for default lighting%s, ESC"),
6127 visual_list ? _(", ENTERで決定, 'a'で対象明度変更", ", ENTER to accept, 'a' for lighting level") : _(", 'v'でシンボル変更", ", 'v' for visuals"),
6128 (attr_idx || char_idx) ? _(", 'c', 'p'でペースト", ", 'c', 'p' to paste") : _(", 'c'でコピー", ", 'c' to copy")),
6131 /* Get the current feature */
6132 f_ptr = &f_info[feat_idx[feat_cur]];
6133 cur_attr_ptr = &f_ptr->x_attr[*lighting_level];
6134 cur_char_ptr = &f_ptr->x_char[*lighting_level];
6138 place_visual_list_cursor(max + 3, 7, *cur_attr_ptr, *cur_char_ptr, attr_top, char_left);
6142 Term_gotoxy(0, 6 + (grp_cur - grp_top));
6146 Term_gotoxy(max + 3, 6 + (feat_cur - feat_top));
6151 if (visual_list && ((ch == 'A') || (ch == 'a')))
6153 int prev_lighting_level = *lighting_level;
6157 if (*lighting_level <= 0) *lighting_level = F_LIT_MAX - 1;
6158 else (*lighting_level)--;
6162 if (*lighting_level >= F_LIT_MAX - 1) *lighting_level = 0;
6163 else (*lighting_level)++;
6166 if (f_ptr->x_attr[prev_lighting_level] != f_ptr->x_attr[*lighting_level])
6167 attr_top = MAX(0, (f_ptr->x_attr[*lighting_level] & 0x7f) - 5);
6169 if (f_ptr->x_char[prev_lighting_level] != f_ptr->x_char[*lighting_level])
6170 char_left = MAX(0, f_ptr->x_char[*lighting_level] - 10);
6175 else if ((ch == 'D') || (ch == 'd'))
6177 TERM_COLOR prev_x_attr = f_ptr->x_attr[*lighting_level];
6178 byte prev_x_char = f_ptr->x_char[*lighting_level];
6180 apply_default_feat_lighting(f_ptr->x_attr, f_ptr->x_char);
6184 if (prev_x_attr != f_ptr->x_attr[*lighting_level])
6185 attr_top = MAX(0, (f_ptr->x_attr[*lighting_level] & 0x7f) - 5);
6187 if (prev_x_char != f_ptr->x_char[*lighting_level])
6188 char_left = MAX(0, f_ptr->x_char[*lighting_level] - 10);
6190 else *need_redraw = TRUE;
6195 /* Do visual mode command if needed */
6196 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))
6200 /* Restore previous visual settings */
6202 for (i = 0; i < F_LIT_MAX; i++)
6204 f_ptr->x_attr[i] = attr_old[i];
6205 f_ptr->x_char[i] = char_old[i];
6212 if (direct_f_idx >= 0) flag = TRUE;
6213 else *lighting_level = F_LIT_STANDARD;
6216 /* Preserve current visual settings */
6219 for (i = 0; i < F_LIT_MAX; i++)
6221 attr_old[i] = f_ptr->x_attr[i];
6222 char_old[i] = f_ptr->x_char[i];
6224 *lighting_level = F_LIT_STANDARD;
6231 for (i = 0; i < F_LIT_MAX; i++)
6233 attr_idx_feat[i] = f_ptr->x_attr[i];
6234 char_idx_feat[i] = f_ptr->x_char[i];
6243 /* Allow TERM_DARK text */
6244 for (i = F_LIT_NS_BEGIN; i < F_LIT_MAX; i++)
6246 if (attr_idx_feat[i] || (!(char_idx_feat[i] & 0x80) && char_idx_feat[i])) f_ptr->x_attr[i] = attr_idx_feat[i];
6247 if (char_idx_feat[i]) f_ptr->x_char[i] = char_idx_feat[i];
6265 /* Move the cursor */
6266 browser_cursor(ch, &column, &grp_cur, grp_cnt, &feat_cur, feat_cnt);
6272 /* Free the "feat_idx" array */
6273 C_KILL(feat_idx, max_f_idx, FEAT_IDX);
6278 * List wanted monsters
6280 static void do_cmd_knowledge_kubi(void)
6285 GAME_TEXT file_name[1024];
6288 /* Open a new file */
6289 fff = my_fopen_temp(file_name, 1024);
6291 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
6298 bool listed = FALSE;
6300 fprintf(fff, _("今日のターゲット : %s\n", "Today target : %s\n"),
6301 (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : _("不明", "unknown")));
6303 fprintf(fff, _("賞金首リスト\n", "List of wanted monsters\n"));
6304 fprintf(fff, "----------------------------------------------\n");
6306 for (i = 0; i < MAX_KUBI; i++)
6308 if (current_world_ptr->bounty_r_idx[i] <= 10000)
6310 fprintf(fff,"%s\n", r_name + r_info[current_world_ptr->bounty_r_idx[i]].name);
6318 fprintf(fff,"\n%s\n", _("賞金首はもう残っていません。", "There is no more wanted monster."));
6323 /* Display the file contents */
6324 show_file(TRUE, file_name, _("賞金首の一覧", "Wanted monsters"), 0, 0);
6329 * List virtues & status
6331 static void do_cmd_knowledge_virtues(void)
6334 GAME_TEXT file_name[1024];
6336 /* Open a new file */
6337 fff = my_fopen_temp(file_name, 1024);
6339 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
6346 fprintf(fff, _("現在の属性 : %s\n\n", "Your alighnment : %s\n\n"), your_alignment(p_ptr));
6347 dump_virtues(p_ptr, fff);
6351 /* Display the file contents */
6352 show_file(TRUE, file_name, _("八つの徳", "Virtues"), 0, 0);
6359 static void do_cmd_knowledge_dungeon(void)
6363 GAME_TEXT file_name[1024];
6366 /* Open a new file */
6367 fff = my_fopen_temp(file_name, 1024);
6369 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
6376 for (i = 1; i < max_d_idx; i++)
6380 if (!d_info[i].maxdepth) continue;
6381 if (!max_dlv[i]) continue;
6382 if (d_info[i].final_guardian)
6384 if (!r_info[d_info[i].final_guardian].max_num) seiha = TRUE;
6386 else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
6388 fprintf(fff, _("%c%-12s : %3d 階\n", "%c%-16s : level %3d\n"), seiha ? '!' : ' ', d_name + d_info[i].name, (int)max_dlv[i]);
6393 /* Display the file contents */
6394 show_file(TRUE, file_name, _("今までに入ったダンジョン", "Dungeon"), 0, 0);
6399 * List virtues & status
6402 static void do_cmd_knowledge_stat(void)
6406 GAME_TEXT file_name[1024];
6409 /* Open a new file */
6410 fff = my_fopen_temp(file_name, 1024);
6412 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
6419 percent = (int)(((long)p_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
6420 (2 * p_ptr->hitdie +
6421 ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
6423 if (p_ptr->knowledge & KNOW_HPRATE)
6424 fprintf(fff, _("現在の体力ランク : %d/100\n\n", "Your current Life Rating is %d/100.\n\n"), percent);
6425 else fprintf(fff, _("現在の体力ランク : ???\n\n", "Your current Life Rating is ???.\n\n"));
6427 fprintf(fff, _("能力の最大値\n\n", "Limits of maximum stats\n\n"));
6428 for (v_nr = 0; v_nr < A_MAX; v_nr++)
6430 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);
6431 else fprintf(fff, "%s ???\n", stat_names[v_nr]);
6435 dump_yourself(p_ptr, fff);
6438 /* Display the file contents */
6439 show_file(TRUE, file_name, _("自分に関する情報", "HP-rate & Max stat"), 0, 0);
6445 * Print all active quests
6447 static void do_cmd_knowledge_quests_current(FILE *fff)
6450 char rand_tmp_str[120] = "\0";
6451 GAME_TEXT name[MAX_NLEN];
6452 monster_race *r_ptr;
6454 int rand_level = 100;
6457 fprintf(fff, _("《遂行中のクエスト》\n", "< Current Quest >\n"));
6459 for (i = 1; i < max_q_idx; i++)
6461 if ((quest[i].status == QUEST_STATUS_TAKEN) ||
6462 ((quest[i].status == QUEST_STATUS_STAGE_COMPLETED) && (quest[i].type == QUEST_TYPE_TOWER)) ||
6463 (quest[i].status == QUEST_STATUS_COMPLETED))
6465 /* Set the quest number temporary */
6466 QUEST_IDX old_quest = p_ptr->inside_quest;
6469 /* Clear the text */
6470 for (j = 0; j < 10; j++) quest_text[j][0] = '\0';
6471 quest_text_line = 0;
6473 p_ptr->inside_quest = i;
6475 /* Get the quest text */
6476 init_flags = INIT_SHOW_TEXT;
6478 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
6480 /* Reset the old quest number */
6481 p_ptr->inside_quest = old_quest;
6483 /* No info from "silent" quests */
6484 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
6488 if (quest[i].type != QUEST_TYPE_RANDOM)
6490 char note[80] = "\0";
6492 if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_STAGE_COMPLETED)
6494 switch (quest[i].type)
6496 case QUEST_TYPE_KILL_LEVEL:
6497 case QUEST_TYPE_KILL_ANY_LEVEL:
6498 r_ptr = &r_info[quest[i].r_idx];
6499 strcpy(name, r_name + r_ptr->name);
6500 if (quest[i].max_num > 1)
6503 sprintf(note," - %d 体の%sを倒す。(あと %d 体)",
6504 (int)quest[i].max_num, name, (int)(quest[i].max_num - quest[i].cur_num));
6507 sprintf(note," - kill %d %s, have killed %d.",
6508 (int)quest[i].max_num, name, (int)quest[i].cur_num);
6512 sprintf(note,_(" - %sを倒す。", " - kill %s."),name);
6515 case QUEST_TYPE_FIND_ARTIFACT:
6518 artifact_type *a_ptr = &a_info[quest[i].k_idx];
6520 object_type *q_ptr = &forge;
6521 KIND_OBJECT_IDX k_idx = lookup_kind(a_ptr->tval, a_ptr->sval);
6522 object_prep(q_ptr, k_idx);
6523 q_ptr->name1 = quest[i].k_idx;
6524 q_ptr->ident = IDENT_STORE;
6525 object_desc(name, q_ptr, OD_NAME_ONLY);
6527 sprintf(note,_("\n - %sを見つけ出す。", "\n - Find out %s."), name);
6529 case QUEST_TYPE_FIND_EXIT:
6530 sprintf(note,_(" - 出口に到達する。", " - Reach to Exit."));
6533 case QUEST_TYPE_KILL_NUMBER:
6535 sprintf(note," - %d 体のモンスターを倒す。(あと %d 体)",
6536 (int)quest[i].max_num, (int)(quest[i].max_num - quest[i].cur_num));
6538 sprintf(note," - Kill %d monsters, have killed %d.",
6539 (int)quest[i].max_num, (int)quest[i].cur_num);
6543 case QUEST_TYPE_KILL_ALL:
6544 case QUEST_TYPE_TOWER:
6545 sprintf(note,_(" - 全てのモンスターを倒す。", " - Kill all monsters."));
6550 /* Print the quest info */
6551 sprintf(tmp_str, _(" %s (危険度:%d階相当)%s\n", " %s (Danger level: %d)%s\n"),
6552 quest[i].name, (int)quest[i].level, note);
6554 fputs(tmp_str, fff);
6556 if (quest[i].status == QUEST_STATUS_COMPLETED)
6558 sprintf(tmp_str, _(" クエスト達成 - まだ報酬を受けとってない。\n", " Quest Completed - Unrewarded\n"));
6559 fputs(tmp_str, fff);
6565 while (quest_text[j][0] && j < 10)
6567 fprintf(fff, " %s\n", quest_text[j]);
6572 else if (quest[i].level < rand_level) /* QUEST_TYPE_RANDOM */
6575 rand_level = quest[i].level;
6577 if (max_dlv[DUNGEON_ANGBAND] >= rand_level)
6579 /* Print the quest info */
6580 r_ptr = &r_info[quest[i].r_idx];
6581 strcpy(name, r_name + r_ptr->name);
6583 if (quest[i].max_num > 1)
6586 sprintf(rand_tmp_str," %s (%d 階) - %d 体の%sを倒す。(あと %d 体)\n",
6587 quest[i].name, (int)quest[i].level,
6588 (int)quest[i].max_num, name, (int)(quest[i].max_num - quest[i].cur_num));
6592 sprintf(rand_tmp_str," %s (Dungeon level: %d)\n Kill %d %s, have killed %d.\n",
6593 quest[i].name, (int)quest[i].level,
6594 (int)quest[i].max_num, name, (int)quest[i].cur_num);
6599 sprintf(rand_tmp_str,_(" %s (%d 階) - %sを倒す。\n", " %s (Dungeon level: %d)\n Kill %s.\n"),
6600 quest[i].name, (int)quest[i].level, name);
6607 /* Print the current random quest */
6608 if (rand_tmp_str[0]) fputs(rand_tmp_str, fff);
6610 if (!total) fprintf(fff, _(" なし\n", " Nothing.\n"));
6614 static bool do_cmd_knowledge_quests_aux(FILE *fff, IDX q_idx)
6617 char playtime_str[16];
6618 quest_type* const q_ptr = &quest[q_idx];
6620 if (is_fixed_quest_idx(q_idx))
6622 /* Set the quest number temporary */
6623 IDX old_quest = p_ptr->inside_quest;
6625 p_ptr->inside_quest = q_idx;
6628 init_flags = INIT_NAME_ONLY;
6630 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
6632 /* Reset the old quest number */
6633 p_ptr->inside_quest = old_quest;
6635 /* No info from "silent" quests */
6636 if (q_ptr->flags & QUEST_FLAG_SILENT) return FALSE;
6639 strnfmt(playtime_str, sizeof(playtime_str), "%02d:%02d:%02d",
6640 q_ptr->comptime/(60*60), (q_ptr->comptime/60)%60, q_ptr->comptime%60);
6642 if (!is_fixed_quest_idx(q_idx) && q_ptr->r_idx)
6644 /* Print the quest info */
6645 if (q_ptr->complev == 0)
6648 _(" %-35s (%3d階) - 不戦勝 - %s\n",
6649 " %-35s (Dungeon level: %3d) - Unearned - %s\n") ,
6650 r_name+r_info[q_ptr->r_idx].name,
6651 (int)q_ptr->level, playtime_str);
6656 _(" %-35s (%3d階) - レベル%2d - %s\n",
6657 " %-35s (Dungeon level: %3d) - level %2d - %s\n") ,
6658 r_name+r_info[q_ptr->r_idx].name,
6666 /* Print the quest info */
6668 _(" %-35s (危険度:%3d階相当) - レベル%2d - %s\n",
6669 " %-35s (Danger level: %3d) - level %2d - %s\n") ,
6670 q_ptr->name, (int)q_ptr->level, q_ptr->complev, playtime_str);
6673 fputs(tmp_str, fff);
6679 * Print all finished quests
6681 void do_cmd_knowledge_quests_completed(FILE *fff, QUEST_IDX quest_num[])
6684 QUEST_IDX total = 0;
6686 fprintf(fff, _("《達成したクエスト》\n", "< Completed Quest >\n"));
6687 for (i = 1; i < max_q_idx; i++)
6689 QUEST_IDX q_idx = quest_num[i];
6690 quest_type* const q_ptr = &quest[q_idx];
6692 if (q_ptr->status == QUEST_STATUS_FINISHED && do_cmd_knowledge_quests_aux(fff, q_idx))
6697 if (!total) fprintf(fff, _(" なし\n", " Nothing.\n"));
6702 * Print all failed quests
6704 void do_cmd_knowledge_quests_failed(FILE *fff, QUEST_IDX quest_num[])
6707 QUEST_IDX total = 0;
6709 fprintf(fff, _("《失敗したクエスト》\n", "< Failed Quest >\n"));
6710 for (i = 1; i < max_q_idx; i++)
6712 QUEST_IDX q_idx = quest_num[i];
6713 quest_type* const q_ptr = &quest[q_idx];
6715 if (((q_ptr->status == QUEST_STATUS_FAILED_DONE) || (q_ptr->status == QUEST_STATUS_FAILED)) &&
6716 do_cmd_knowledge_quests_aux(fff, q_idx))
6721 if (!total) fprintf(fff, _(" なし\n", " Nothing.\n"));
6726 * Print all random quests
6728 static void do_cmd_knowledge_quests_wiz_random(FILE *fff)
6730 GAME_TEXT tmp_str[120];
6732 QUEST_IDX total = 0;
6734 fprintf(fff, _("《残りのランダムクエスト》\n", "< Remaining Random Quest >\n"));
6735 for (i = 1; i < max_q_idx; i++)
6737 /* No info from "silent" quests */
6738 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
6740 if ((quest[i].type == QUEST_TYPE_RANDOM) && (quest[i].status == QUEST_STATUS_TAKEN))
6744 /* Print the quest info */
6745 sprintf(tmp_str, _(" %s (%d階, %s)\n", " %s (%d, %s)\n"),
6746 quest[i].name, (int)quest[i].level, r_name+r_info[quest[i].r_idx].name);
6747 fputs(tmp_str, fff);
6750 if (!total) fprintf(fff, _(" なし\n", " Nothing.\n"));
6754 * Print quest status of all active quests
6756 static void do_cmd_knowledge_quests(void)
6759 GAME_TEXT file_name[1024];
6764 /* Open a new file */
6765 fff = my_fopen_temp(file_name, 1024);
6768 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
6773 /* Allocate Memory */
6774 C_MAKE(quest_num, max_q_idx, QUEST_IDX);
6776 /* Sort by compete level */
6777 for (i = 1; i < max_q_idx; i++) quest_num[i] = i;
6778 ang_sort(quest_num, &dummy, max_q_idx, ang_sort_comp_quest_num, ang_sort_swap_quest_num);
6780 /* Dump Quest Information */
6781 do_cmd_knowledge_quests_current(fff);
6783 do_cmd_knowledge_quests_completed(fff, quest_num);
6785 do_cmd_knowledge_quests_failed(fff, quest_num);
6789 do_cmd_knowledge_quests_wiz_random(fff);
6793 /* Display the file contents */
6794 show_file(TRUE, file_name, _("クエスト達成状況", "Quest status"), 0, 0);
6798 C_KILL(quest_num, max_q_idx, QUEST_IDX);
6805 static void do_cmd_knowledge_home(void)
6810 GAME_TEXT file_name[1024];
6812 GAME_TEXT o_name[MAX_NLEN];
6813 concptr paren = ")";
6815 process_dungeon_file("w_info.txt", 0, 0, current_world_ptr->max_wild_y, current_world_ptr->max_wild_x);
6817 /* Open a new file */
6818 fff = my_fopen_temp(file_name, 1024);
6820 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
6827 /* Print all homes in the different towns */
6828 st_ptr = &town_info[1].store[STORE_HOME];
6830 /* Home -- if anything there */
6831 if (st_ptr->stock_num)
6836 /* Header with name of the town */
6837 fprintf(fff, _(" [ 我が家のアイテム ]\n", " [Home Inventory]\n"));
6839 /* Dump all available items */
6840 for (i = 0; i < st_ptr->stock_num; i++)
6843 if ((i % 12) == 0) fprintf(fff, "\n ( %d ページ )\n", x++);
6844 object_desc(o_name, &st_ptr->stock[i], 0);
6845 if (strlen(o_name) <= 80-3)
6847 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
6853 for (n = 0, t = o_name; n < 80-3; n++, t++)
6854 if(iskanji(*t)) {t++; n++;}
6855 if (n == 81-3) n = 79-3; /* 最後が漢字半分 */
6857 fprintf(fff, "%c%s %.*s\n", I2A(i%12), paren, n, o_name);
6858 fprintf(fff, " %.77s\n", o_name+n);
6861 object_desc(o_name, &st_ptr->stock[i], 0);
6862 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
6867 /* Add an empty line */
6868 fprintf(fff, "\n\n");
6873 /* Display the file contents */
6874 show_file(TRUE, file_name, _("我が家のアイテム", "Home Inventory"), 0, 0);
6880 * Check the status of "autopick"
6882 static void do_cmd_knowledge_autopick(void)
6886 GAME_TEXT file_name[1024];
6888 /* Open a new file */
6889 fff = my_fopen_temp(file_name, 1024);
6893 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
6900 fprintf(fff, _("自動破壊/拾いには何も登録されていません。", "No preference for auto picker/destroyer."));
6904 fprintf(fff, _(" 自動拾い/破壊には現在 %d行登録されています。\n\n",
6905 " There are %d registered lines for auto picker/destroyer.\n\n"), max_autopick);
6908 for (k = 0; k < max_autopick; k++)
6911 byte act = autopick_list[k].action;
6912 if (act & DONT_AUTOPICK)
6914 tmp = _("放置", "Leave");
6916 else if (act & DO_AUTODESTROY)
6918 tmp = _("破壊", "Destroy");
6920 else if (act & DO_AUTOPICK)
6922 tmp = _("拾う", "Pickup");
6926 tmp = _("確認", "Query");
6929 if (act & DO_DISPLAY)
6930 fprintf(fff, "%11s", format("[%s]", tmp));
6932 fprintf(fff, "%11s", format("(%s)", tmp));
6934 tmp = autopick_line_from_entry(&autopick_list[k]);
6935 fprintf(fff, " %s", tmp);
6940 /* Display the file contents */
6941 show_file(TRUE, file_name, _("自動拾い/破壊 設定リスト", "Auto-picker/Destroyer"), 0, 0);
6947 * Interact with "knowledge"
6949 void do_cmd_knowledge(void)
6952 bool need_redraw = FALSE;
6954 /* File type is "TEXT" */
6955 FILE_TYPE(FILE_TYPE_TEXT);
6958 /* Interact until done */
6963 /* Ask for a choice */
6964 prt(format(_("%d/2 ページ", "page %d/2"), (p+1)), 2, 65);
6965 prt(_("現在の知識を確認する", "Display current knowledge"), 3, 0);
6967 /* Give some choices */
6971 prt("(1) 既知の伝説のアイテム の一覧", 6, 5);
6972 prt("(2) 既知のアイテム の一覧", 7, 5);
6973 prt("(3) 既知の生きているユニーク・モンスター の一覧", 8, 5);
6974 prt("(4) 既知のモンスター の一覧", 9, 5);
6975 prt("(5) 倒した敵の数 の一覧", 10, 5);
6976 if (!vanilla_town) prt("(6) 賞金首 の一覧", 11, 5);
6977 prt("(7) 現在のペット の一覧", 12, 5);
6978 prt("(8) 我が家のアイテム の一覧", 13, 5);
6979 prt("(9) *鑑定*済み装備の耐性 の一覧", 14, 5);
6980 prt("(0) 地形の表示文字/タイル の一覧", 15, 5);
6984 prt("(a) 自分に関する情報 の一覧", 6, 5);
6985 prt("(b) 突然変異 の一覧", 7, 5);
6986 prt("(c) 武器の経験値 の一覧", 8, 5);
6987 prt("(d) 魔法の経験値 の一覧", 9, 5);
6988 prt("(e) 技能の経験値 の一覧", 10, 5);
6989 prt("(f) プレイヤーの徳 の一覧", 11, 5);
6990 prt("(g) 入ったダンジョン の一覧", 12, 5);
6991 prt("(h) 実行中のクエスト の一覧", 13, 5);
6992 prt("(i) 現在の自動拾い/破壊設定 の一覧", 14, 5);
6997 prt("(1) Display known artifacts", 6, 5);
6998 prt("(2) Display known objects", 7, 5);
6999 prt("(3) Display remaining uniques", 8, 5);
7000 prt("(4) Display known monster", 9, 5);
7001 prt("(5) Display kill count", 10, 5);
7002 if (!vanilla_town) prt("(6) Display wanted monsters", 11, 5);
7003 prt("(7) Display current pets", 12, 5);
7004 prt("(8) Display home inventory", 13, 5);
7005 prt("(9) Display *identified* equip.", 14, 5);
7006 prt("(0) Display terrain symbols.", 15, 5);
7010 prt("(a) Display about yourself", 6, 5);
7011 prt("(b) Display mutations", 7, 5);
7012 prt("(c) Display weapon proficiency", 8, 5);
7013 prt("(d) Display spell proficiency", 9, 5);
7014 prt("(e) Display misc. proficiency", 10, 5);
7015 prt("(f) Display virtues", 11, 5);
7016 prt("(g) Display dungeons", 12, 5);
7017 prt("(h) Display current quests", 13, 5);
7018 prt("(i) Display auto pick/destroy", 14, 5);
7022 prt(_("-続く-", "-more-"), 17, 8);
7023 prt(_("ESC) 抜ける", "ESC) Exit menu"), 21, 1);
7024 prt(_("SPACE) 次ページ", "SPACE) Next page"), 21, 30);
7025 /*prt("-) 前ページ", 21, 60);*/
7026 prt(_("コマンド:", "Command: "), 20, 0);
7029 if (i == ESCAPE) break;
7032 case ' ': /* Page change */
7036 case '1': /* Artifacts */
7037 do_cmd_knowledge_artifacts();
7039 case '2': /* Objects */
7040 do_cmd_knowledge_objects(&need_redraw, FALSE, -1);
7042 case '3': /* Uniques */
7043 do_cmd_knowledge_uniques();
7045 case '4': /* Monsters */
7046 do_cmd_knowledge_monsters(&need_redraw, FALSE, -1);
7048 case '5': /* Kill count */
7049 do_cmd_knowledge_kill_count();
7051 case '6': /* wanted */
7052 if (!vanilla_town) do_cmd_knowledge_kubi();
7054 case '7': /* Pets */
7055 do_cmd_knowledge_pets();
7057 case '8': /* Home */
7058 do_cmd_knowledge_home();
7060 case '9': /* Resist list */
7061 do_cmd_knowledge_inven();
7063 case '0': /* Feature list */
7065 IDX lighting_level = F_LIT_STANDARD;
7066 do_cmd_knowledge_features(&need_redraw, FALSE, -1, &lighting_level);
7070 case 'a': /* Max stat */
7071 do_cmd_knowledge_stat();
7073 case 'b': /* Mutations */
7074 do_cmd_knowledge_mutations(p_ptr);
7076 case 'c': /* weapon-exp */
7077 do_cmd_knowledge_weapon_exp();
7079 case 'd': /* spell-exp */
7080 do_cmd_knowledge_spell_exp();
7082 case 'e': /* skill-exp */
7083 do_cmd_knowledge_skill_exp();
7085 case 'f': /* Virtues */
7086 do_cmd_knowledge_virtues();
7088 case 'g': /* Dungeon */
7089 do_cmd_knowledge_dungeon();
7091 case 'h': /* Quests */
7092 do_cmd_knowledge_quests();
7094 case 'i': /* Autopick */
7095 do_cmd_knowledge_autopick();
7097 default: /* Unknown option */
7105 if (need_redraw) do_cmd_redraw(p_ptr);
7110 * Check on the status of an active quest
7112 void do_cmd_checkquest(void)
7114 /* File type is "TEXT" */
7115 FILE_TYPE(FILE_TYPE_TEXT);
7119 do_cmd_knowledge_quests();
7125 * Display the time and date
7127 void do_cmd_time(void)
7129 int day, hour, min, full, start, end, num;
7137 extract_day_hour_min(&day, &hour, &min);
7139 full = hour * 100 + min;
7146 strcpy(desc, _("変な時刻だ。", "It is a strange time."));
7148 if (day < MAX_DAYS) sprintf(day_buf, "%d", day);
7149 else strcpy(day_buf, "*****");
7151 msg_format(_("%s日目, 時刻は%d:%02d %sです。", "This is day %s. The time is %d:%02d %s."),
7152 day_buf, (hour % 12 == 0) ? 12 : (hour % 12), min, (hour < 12) ? "AM" : "PM");
7155 if (!randint0(10) || p_ptr->image)
7157 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, _("timefun_j.txt", "timefun.txt"));
7161 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, _("timenorm_j.txt", "timenorm.txt"));
7164 /* Open this file */
7165 fff = my_fopen(buf, "rt");
7169 /* Find this time */
7170 while (!my_fgets(fff, buf, sizeof(buf)))
7172 /* Ignore comments */
7173 if (!buf[0] || (buf[0] == '#')) continue;
7175 /* Ignore invalid lines */
7176 if (buf[1] != ':') continue;
7178 /* Process 'Start' */
7181 /* Extract the starting time */
7182 start = atoi(buf + 2);
7184 /* Assume valid for an hour */
7194 /* Extract the ending time */
7195 end = atoi(buf + 2);
7201 /* Ignore incorrect range */
7202 if ((start > full) || (full > end)) continue;
7204 /* Process 'Description' */
7209 /* Apply the randomizer */
7210 if (!randint0(num)) strcpy(desc, buf + 2);