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.
15 * The dump commands of original Angband simply add new lines to
16 * existing files; these files will become bigger and bigger unless
17 * an user deletes some or all of these files by hand at some
19 * These three functions automatically delete old dumped lines
20 * before adding new ones. Since there are various kinds of automatic
21 * dumps in a single file, we add a header and a footer with a type
22 * name for every automatic dump, and kill old lines only when the
23 * lines have the correct type of header and footer.
24 * We need to be quite paranoid about correctness; the user might
25 * (mistakenly) edit the file by hand, and see all their work come
26 * to nothing on the next auto dump otherwise. The current code only
27 * detects changes by noting inconsistencies between the actual number
28 * of lines and the number written in the footer. Note that this will
29 * not catch single-line edits.
37 #include "core/show-file.h"
38 #include "io/read-pref-file.h"
39 #include "io/write-diary.h"
48 #include "view/display-player.h"
49 #include "player/process-name.h"
50 #include "player-effects.h"
51 #include "player-status.h"
52 #include "player-skill.h"
53 #include "player-personality.h"
60 #include "object-flavor.h"
61 #include "object-hook.h"
63 #include "monster-status.h"
64 #include "view-mainwindow.h"
65 #include "dungeon-file.h"
66 #include "io/interpret-pref-file.h"
69 #include "objectkind.h"
70 #include "floor-town.h"
71 #include "cmd/feeling-table.h"
72 #include "cmd/monster-group-table.h"
73 #include "cmd/diary-subtitle-table.h"
74 #include "cmd/object-group-table.h"
75 #include "view-mainwindow.h" // 暫定。後で消す
79 static void do_cmd_knowledge_monsters(player_type *creature_ptr, bool *need_redraw, bool visual_only, IDX direct_r_idx);
80 static void do_cmd_knowledge_objects(player_type *creature_ptr, bool *need_redraw, bool visual_only, IDX direct_k_idx);
81 static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX direct_f_idx, IDX *lighting_level);
83 // Clipboard variables for copy&paste in visual mode
84 static TERM_COLOR attr_idx = 0;
85 static SYMBOL_CODE char_idx = 0;
87 static TERM_COLOR attr_idx_feat[F_LIT_MAX];
88 static SYMBOL_CODE char_idx_feat[F_LIT_MAX];
90 // Encode the screen colors
91 static char hack[17] = "dwsorgbuDWvyRGBU";
94 * @brief 日記のタイトル表記と内容出力
95 * @param creature_ptr プレーヤーへの参照ポインタ
98 static void display_diary(player_type *creature_ptr)
100 char diary_title[256];
101 GAME_TEXT file_name[MAX_NLEN];
104 sprintf(file_name, _("playrecord-%s.txt", "playrec-%s.txt"), savefile_base);
105 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
107 if (creature_ptr->pclass == CLASS_WARRIOR || creature_ptr->pclass == CLASS_MONK || creature_ptr->pclass == CLASS_SAMURAI || creature_ptr->pclass == CLASS_BERSERKER)
108 strcpy(tmp, subtitle[randint0(MAX_SUBTITLE - 1)]);
109 else if (IS_WIZARD_CLASS(creature_ptr))
110 strcpy(tmp, subtitle[randint0(MAX_SUBTITLE - 1) + 1]);
111 else strcpy(tmp, subtitle[randint0(MAX_SUBTITLE - 2) + 1]);
114 sprintf(diary_title, "「%s%s%sの伝説 -%s-」", ap_ptr->title, ap_ptr->no ? "の" : "", creature_ptr->name, tmp);
116 sprintf(diary_title, "Legend of %s %s '%s'", ap_ptr->title, creature_ptr->name, tmp);
119 (void)show_file(creature_ptr, FALSE, buf, diary_title, -1, 0);
124 * @brief 日記に任意の内容を表記するコマンドのメインルーチン /
127 static void add_diary_note(player_type *creature_ptr)
130 char bunshou[80] = "\0";
131 if (get_string(_("内容: ", "diary note: "), tmp, 79))
133 strcpy(bunshou, tmp);
134 exe_write_diary(creature_ptr, DIARY_DESCRIPTION, 0, bunshou);
139 * @brief 最後に取得したアイテムの情報を日記に追加するメインルーチン /
142 static void do_cmd_last_get(player_type *creaute_ptr)
144 if (record_o_name[0] == '\0') return;
147 sprintf(buf, _("%sの入手を記録します。", "Do you really want to record getting %s? "), record_o_name);
148 if (!get_check(buf)) return;
150 GAME_TURN turn_tmp = current_world_ptr->game_turn;
151 current_world_ptr->game_turn = record_turn;
152 sprintf(buf, _("%sを手に入れた。", "discover %s."), record_o_name);
153 exe_write_diary(creaute_ptr, DIARY_DESCRIPTION, 0, buf);
154 current_world_ptr->game_turn = turn_tmp;
159 * @brief ファイル中の全日記記録を消去する /
162 static void do_cmd_erase_diary(void)
164 GAME_TEXT file_name[MAX_NLEN];
168 if (!get_check(_("本当に記録を消去しますか?", "Do you really want to delete all your record? "))) return;
169 sprintf(file_name, _("playrecord-%s.txt", "playrec-%s.txt"), savefile_base);
170 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
173 fff = my_fopen(buf, "w");
177 msg_format(_("記録を消去しました。", "deleted record."));
181 msg_format(_("%s の消去に失敗しました。", "failed to delete %s."), buf);
190 * @param crerature_ptr プレーヤーへの参照ポインタ
193 void do_cmd_diary(player_type *creature_ptr)
195 FILE_TYPE(FILE_TYPE_TEXT);
201 prt(_("[ 記録の設定 ]", "[ Play Record ]"), 2, 0);
202 prt(_("(1) 記録を見る", "(1) Display your record"), 4, 5);
203 prt(_("(2) 文章を記録する", "(2) Add record"), 5, 5);
204 prt(_("(3) 直前に入手又は鑑定したものを記録する", "(3) Record the last item you got or identified"), 6, 5);
205 prt(_("(4) 記録を消去する", "(4) Delete your record"), 7, 5);
206 prt(_("(R) プレイ動画を記録する/中止する", "(R) Record playing movie / or stop it"), 9, 5);
207 prt(_("コマンド:", "Command: "), 18, 0);
209 if (i == ESCAPE) break;
214 display_diary(creature_ptr);
217 add_diary_note(creature_ptr);
220 do_cmd_last_get(creature_ptr);
223 do_cmd_erase_diary();
227 prepare_movie_hooks();
241 * @brief 画面を再描画するコマンドのメインルーチン
242 * Hack -- redraw the screen
243 * @param creature_ptr プレーヤーへの参照ポインタ
247 * This command performs various low level updates, clears all the "extra"
248 * windows, does a total redraw of the main window, and requests all of the
249 * interesting updates and redraws that I can think of.
251 * This command is also used to "instantiate" the results of the user
252 * selecting various things, such as graphics mode, so it must call
253 * the "TERM_XTRA_REACT" hook before redrawing the windows.
256 void do_cmd_redraw(player_type *creature_ptr)
258 Term_xtra(TERM_XTRA_REACT, 0);
260 creature_ptr->update |= (PU_COMBINE | PU_REORDER);
261 creature_ptr->update |= (PU_TORCH);
262 creature_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
263 creature_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
264 creature_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
265 creature_ptr->update |= (PU_MONSTERS);
267 creature_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
269 creature_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
270 creature_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
273 handle_stuff(creature_ptr);
274 if (creature_ptr->prace == RACE_ANDROID) calc_android_exp(creature_ptr);
277 for (int j = 0; j < 8; j++)
279 if (!angband_term[j]) continue;
281 Term_activate(angband_term[j]);
290 * @brief プレイヤーのステータス表示
293 void do_cmd_player_status(player_type *creature_ptr)
301 display_player(creature_ptr, mode, map_name);
306 display_player(creature_ptr, mode, map_name);
309 Term_putstr(2, 23, -1, TERM_WHITE,
310 _("['c'で名前変更, 'f'でファイルへ書出, 'h'でモード変更, ESCで終了]", "['c' to change name, 'f' to file, 'h' to change mode, or ESC]"));
312 if (c == ESCAPE) break;
316 get_name(creature_ptr);
317 process_player_name(creature_ptr, FALSE);
321 sprintf(tmp, "%s.txt", creature_ptr->base_name);
322 if (get_string(_("ファイル名: ", "File name: "), tmp, 80))
324 if (tmp[0] && (tmp[0] != ' '))
326 file_character(creature_ptr, tmp, update_playtime, display_player, map_name);
343 creature_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
344 handle_stuff(creature_ptr);
349 * @brief 最近表示されたメッセージを再表示するコマンドのメインルーチン
350 * Recall the most recent message
353 void do_cmd_message_one(void)
355 prt(format("> %s", message_str(0)), 0, 0);
360 * @brief メッセージのログを表示するコマンドのメインルーチン
361 * Recall the most recent message
365 * Show previous messages to the user -BEN-
367 * The screen format uses line 0 and 23 for headers and prompts,
368 * skips line 1 and 22, and uses line 2 thru 21 for old messages.
370 * This command shows you which commands you are viewing, and allows
371 * you to "search" for strings in the recall.
373 * Note that messages may be longer than 80 characters, but they are
374 * displayed using "infinite" length, with a special sub-command to
375 * "slide" the virtual display to the left or right.
377 * Attempt to only hilite the matching portions of the string.
380 void do_cmd_messages(int num_now)
385 concptr shower = NULL;
387 Term_get_size(&wid, &hgt);
388 int num_lines = hgt - 4;
389 strcpy(finder_str, "");
390 strcpy(shower_str, "");
391 int n = message_num();
399 for (j = 0; (j < num_lines) && (i + j < n); j++)
401 concptr msg = message_str(i + j);
402 c_prt((i + j < num_now ? TERM_WHITE : TERM_SLATE), msg, num_lines + 1 - j, 0);
403 if (!shower || !shower[0]) continue;
406 while ((str = my_strstr(str, shower)) != NULL)
408 int len = strlen(shower);
409 Term_putstr(str - msg, num_lines + 1 - j, len, TERM_YELLOW, shower);
414 for (; j < num_lines; j++)
415 Term_erase(0, num_lines + 1 - j, 255);
417 prt(format(_("以前のメッセージ %d-%d 全部で(%d)", "Message Recall (%d-%d of %d)"),
418 i, i + j - 1, n), 0, 0);
419 prt(_("[ 'p' で更に古いもの, 'n' で更に新しいもの, '/' で検索, ESC で中断 ]",
420 "[Press 'p' for older, 'n' for newer, ..., or ESCAPE]"), hgt - 1, 0);
421 skey = inkey_special(TRUE);
422 if (skey == ESCAPE) break;
428 prt(_("強調: ", "Show: "), hgt - 1, 0);
429 strcpy(back_str, shower_str);
430 if (askfor(shower_str, 80))
431 shower = shower_str[0] ? shower_str : NULL;
433 strcpy(shower_str, back_str);
439 prt(_("検索: ", "Find: "), hgt - 1, 0);
440 strcpy(back_str, finder_str);
441 if (!askfor(finder_str, 80))
443 strcpy(finder_str, back_str);
446 else if (!finder_str[0])
453 for (int z = i + 1; z < n; z++)
455 concptr msg = message_str(z);
456 if (my_strstr(msg, finder_str))
476 i = MIN(i + 1, n - num_lines);
479 i = MIN(i + 10, n - num_lines);
485 i = MIN(i + num_lines, n - num_lines);
490 i = MAX(0, i - num_lines);
509 * @brief prefファイルを選択して処理する /
510 * Ask for a "user pref line" and process it
511 * @param creature_ptr プレーヤーへの参照ポインタ
514 * Allow absolute file names?
516 void do_cmd_pref(player_type *creature_ptr)
520 if (!get_string(_("設定変更コマンド: ", "Pref: "), buf, 80)) return;
522 (void)interpret_pref_file(creature_ptr, buf);
527 * @brief 自動拾い設定ファイルをロードするコマンドのメインルーチン /
528 * @param creature_ptr プレーヤーへの参照ポインタ
531 void do_cmd_reload_autopick(player_type *creature_ptr)
533 if (!get_check(_("自動拾い設定ファイルをロードしますか? ", "Reload auto-pick preference file? ")))
536 autopick_load_pref(creature_ptr, TRUE);
543 static concptr lighting_level_str[F_LIT_MAX] =
545 _("標準色", "standard"),
546 _("明色", "brightly lit"),
552 * @brief キャラクタのビジュアルIDを変更する際の対象指定関数
553 * @param i 指定対象となるキャラクタコード
554 * @param num 指定されたビジュアルIDを返す参照ポインタ
555 * @param max ビジュアルIDの最大数
556 * @return 指定が実際に行われた場合TRUE、キャンセルされた場合FALSE
558 static bool cmd_visuals_aux(int i, IDX *num, IDX max)
563 sprintf(str, "%d", *num);
564 if (!get_string(format("Input new number(0-%d): ", max - 1), str, 4))
567 IDX tmp = (IDX)strtol(str, NULL, 0);
568 if (tmp >= 0 && tmp < max)
572 *num = (*num + max - 1) % max;
574 *num = (*num + 1) % max;
580 * @brief キャラクタの変更メニュー表示
581 * @param choice_msg 選択メッセージ
584 static void print_visuals_menu(concptr choice_msg)
586 prt(_("[ 画面表示の設定 ]", "Interact with Visuals"), 1, 0);
587 prt(_("(0) ユーザー設定ファイルのロード", "(0) Load a user pref file"), 3, 5);
588 prt(_("(1) モンスターの 色/文字 をファイルに書き出す", "(1) Dump monster attr/chars"), 4, 5);
589 prt(_("(2) アイテムの 色/文字 をファイルに書き出す", "(2) Dump object attr/chars"), 5, 5);
590 prt(_("(3) 地形の 色/文字 をファイルに書き出す", "(3) Dump feature attr/chars"), 6, 5);
591 prt(_("(4) モンスターの 色/文字 を変更する (数値操作)", "(4) Change monster attr/chars (numeric operation)"), 7, 5);
592 prt(_("(5) アイテムの 色/文字 を変更する (数値操作)", "(5) Change object attr/chars (numeric operation)"), 8, 5);
593 prt(_("(6) 地形の 色/文字 を変更する (数値操作)", "(6) Change feature attr/chars (numeric operation)"), 9, 5);
594 prt(_("(7) モンスターの 色/文字 を変更する (シンボルエディタ)", "(7) Change monster attr/chars (visual mode)"), 10, 5);
595 prt(_("(8) アイテムの 色/文字 を変更する (シンボルエディタ)", "(8) Change object attr/chars (visual mode)"), 11, 5);
596 prt(_("(9) 地形の 色/文字 を変更する (シンボルエディタ)", "(9) Change feature attr/chars (visual mode)"), 12, 5);
597 prt(_("(R) 画面表示方法の初期化", "(R) Reset visuals"), 13, 5);
598 prt(format("コマンド: %s", choice_msg ? choice_msg : _("", "")), 15, 0);
603 * Interact with "visuals"
605 void do_cmd_visuals(player_type *creature_ptr)
609 bool need_redraw = FALSE;
610 concptr empty_symbol = "<< ? >>";
611 if (use_bigtile) empty_symbol = "<< ?? >>";
613 FILE_TYPE(FILE_TYPE_TEXT);
618 print_visuals_menu(NULL);
620 if (i == ESCAPE) break;
626 prt(_("コマンド: ユーザー設定ファイルのロード", "Command: Load a user pref file"), 15, 0);
627 prt(_("ファイル: ", "File: "), 17, 0);
628 sprintf(tmp, "%s.prf", creature_ptr->base_name);
629 if (!askfor(tmp, 70)) continue;
631 (void)process_pref_file(creature_ptr, tmp);
637 static concptr mark = "Monster attr/chars";
638 prt(_("コマンド: モンスターの[色/文字]をファイルに書き出します", "Command: Dump monster attr/chars"), 15, 0);
639 prt(_("ファイル: ", "File: "), 17, 0);
640 sprintf(tmp, "%s.prf", creature_ptr->base_name);
641 if (!askfor(tmp, 70)) continue;
643 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
644 if (!open_auto_dump(buf, mark)) continue;
646 auto_dump_printf(_("\n# モンスターの[色/文字]の設定\n\n", "\n# Monster attr/char definitions\n\n"));
647 for (i = 0; i < max_r_idx; i++)
649 monster_race *r_ptr = &r_info[i];
650 if (!r_ptr->name) continue;
652 auto_dump_printf("# %s\n", (r_name + r_ptr->name));
653 auto_dump_printf("R:%d:0x%02X/0x%02X\n\n", i,
654 (byte)(r_ptr->x_attr), (byte)(r_ptr->x_char));
658 msg_print(_("モンスターの[色/文字]をファイルに書き出しました。", "Dumped monster attr/chars."));
663 static concptr mark = "Object attr/chars";
664 prt(_("コマンド: アイテムの[色/文字]をファイルに書き出します", "Command: Dump object attr/chars"), 15, 0);
665 prt(_("ファイル: ", "File: "), 17, 0);
666 sprintf(tmp, "%s.prf", creature_ptr->base_name);
667 if (!askfor(tmp, 70)) continue;
669 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
670 if (!open_auto_dump(buf, mark)) continue;
672 auto_dump_printf(_("\n# アイテムの[色/文字]の設定\n\n", "\n# Object attr/char definitions\n\n"));
673 for (KIND_OBJECT_IDX k_idx = 0; k_idx < max_k_idx; k_idx++)
675 GAME_TEXT o_name[MAX_NLEN];
676 object_kind *k_ptr = &k_info[k_idx];
677 if (!k_ptr->name) continue;
681 strip_name(o_name, k_idx);
686 object_prep(&forge, k_idx);
687 object_desc(creature_ptr, o_name, &forge, OD_FORCE_FLAVOR);
690 auto_dump_printf("# %s\n", o_name);
691 auto_dump_printf("K:%d:0x%02X/0x%02X\n\n", (int)k_idx,
692 (byte)(k_ptr->x_attr), (byte)(k_ptr->x_char));
696 msg_print(_("アイテムの[色/文字]をファイルに書き出しました。", "Dumped object attr/chars."));
701 static concptr mark = "Feature attr/chars";
702 prt(_("コマンド: 地形の[色/文字]をファイルに書き出します", "Command: Dump feature attr/chars"), 15, 0);
703 prt(_("ファイル: ", "File: "), 17, 0);
704 sprintf(tmp, "%s.prf", creature_ptr->base_name);
705 if (!askfor(tmp, 70)) continue;
707 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
708 if (!open_auto_dump(buf, mark)) continue;
710 auto_dump_printf(_("\n# 地形の[色/文字]の設定\n\n", "\n# Feature attr/char definitions\n\n"));
711 for (i = 0; i < max_f_idx; i++)
713 feature_type *f_ptr = &f_info[i];
714 if (!f_ptr->name) continue;
715 if (f_ptr->mimic != i) continue;
717 auto_dump_printf("# %s\n", (f_name + f_ptr->name));
718 auto_dump_printf("F:%d:0x%02X/0x%02X:0x%02X/0x%02X:0x%02X/0x%02X\n\n", i,
719 (byte)(f_ptr->x_attr[F_LIT_STANDARD]), (byte)(f_ptr->x_char[F_LIT_STANDARD]),
720 (byte)(f_ptr->x_attr[F_LIT_LITE]), (byte)(f_ptr->x_char[F_LIT_LITE]),
721 (byte)(f_ptr->x_attr[F_LIT_DARK]), (byte)(f_ptr->x_char[F_LIT_DARK]));
725 msg_print(_("地形の[色/文字]をファイルに書き出しました。", "Dumped feature attr/chars."));
730 static concptr choice_msg = _("モンスターの[色/文字]を変更します", "Change monster attr/chars");
731 static MONRACE_IDX r = 0;
732 prt(format(_("コマンド: %s", "Command: %s"), choice_msg), 15, 0);
735 monster_race *r_ptr = &r_info[r];
739 TERM_COLOR da = r_ptr->d_attr;
740 byte dc = r_ptr->d_char;
741 TERM_COLOR ca = r_ptr->x_attr;
742 byte cc = r_ptr->x_char;
744 Term_putstr(5, 17, -1, TERM_WHITE,
745 format(_("モンスター = %d, 名前 = %-40.40s", "Monster = %d, Name = %-40.40s"), r, (r_name + r_ptr->name)));
746 Term_putstr(10, 19, -1, TERM_WHITE,
747 format(_("初期値 色 / 文字 = %3u / %3u", "Default attr/char = %3u / %3u"), da, dc));
748 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
749 Term_queue_bigchar(43, 19, da, dc, 0, 0);
750 Term_putstr(10, 20, -1, TERM_WHITE,
751 format(_("現在値 色 / 文字 = %3u / %3u", "Current attr/char = %3u / %3u"), ca, cc));
752 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
753 Term_queue_bigchar(43, 20, ca, cc, 0, 0);
754 Term_putstr(0, 22, -1, TERM_WHITE,
755 _("コマンド (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): "));
757 if (i == ESCAPE) break;
759 if (iscntrl(i)) c = 'a' + i - KTRL('A');
760 else if (isupper(i)) c = 'a' + i - 'A';
770 if (!cmd_visuals_aux(i, &r, max_r_idx))
775 } while (!r_info[r].name);
780 t = (int)r_ptr->x_attr;
781 (void)cmd_visuals_aux(i, &t, 256);
782 r_ptr->x_attr = (byte)t;
786 t = (int)r_ptr->x_char;
787 (void)cmd_visuals_aux(i, &t, 256);
788 r_ptr->x_char = (byte)t;
792 do_cmd_knowledge_monsters(creature_ptr, &need_redraw, TRUE, r);
794 print_visuals_menu(choice_msg);
803 static concptr choice_msg = _("アイテムの[色/文字]を変更します", "Change object attr/chars");
805 prt(format(_("コマンド: %s", "Command: %s"), choice_msg), 15, 0);
808 object_kind *k_ptr = &k_info[k];
812 TERM_COLOR da = k_ptr->d_attr;
813 SYMBOL_CODE dc = k_ptr->d_char;
814 TERM_COLOR ca = k_ptr->x_attr;
815 SYMBOL_CODE cc = k_ptr->x_char;
817 Term_putstr(5, 17, -1, TERM_WHITE,
818 format(_("アイテム = %d, 名前 = %-40.40s", "Object = %d, Name = %-40.40s"),
819 k, k_name + (!k_ptr->flavor ? k_ptr->name : k_ptr->flavor_name)));
820 Term_putstr(10, 19, -1, TERM_WHITE,
821 format(_("初期値 色 / 文字 = %3d / %3d", "Default attr/char = %3d / %3d"), da, dc));
822 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
823 Term_queue_bigchar(43, 19, da, dc, 0, 0);
824 Term_putstr(10, 20, -1, TERM_WHITE,
825 format(_("現在値 色 / 文字 = %3d / %3d", "Current attr/char = %3d / %3d"), ca, cc));
826 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
827 Term_queue_bigchar(43, 20, ca, cc, 0, 0);
828 Term_putstr(0, 22, -1, TERM_WHITE,
829 _("コマンド (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): "));
832 if (i == ESCAPE) break;
834 if (iscntrl(i)) c = 'a' + i - KTRL('A');
835 else if (isupper(i)) c = 'a' + i - 'A';
845 if (!cmd_visuals_aux(i, &k, max_k_idx))
850 } while (!k_info[k].name);
855 t = (int)k_ptr->x_attr;
856 (void)cmd_visuals_aux(i, &t, 256);
857 k_ptr->x_attr = (byte)t;
861 t = (int)k_ptr->x_char;
862 (void)cmd_visuals_aux(i, &t, 256);
863 k_ptr->x_char = (byte)t;
867 do_cmd_knowledge_objects(creature_ptr, &need_redraw, TRUE, k);
869 print_visuals_menu(choice_msg);
878 static concptr choice_msg = _("地形の[色/文字]を変更します", "Change feature attr/chars");
880 static IDX lighting_level = F_LIT_STANDARD;
881 prt(format(_("コマンド: %s", "Command: %s"), choice_msg), 15, 0);
884 feature_type *f_ptr = &f_info[f];
888 TERM_COLOR da = f_ptr->d_attr[lighting_level];
889 byte dc = f_ptr->d_char[lighting_level];
890 TERM_COLOR ca = f_ptr->x_attr[lighting_level];
891 byte cc = f_ptr->x_char[lighting_level];
894 Term_putstr(5, 17, -1, TERM_WHITE,
895 format(_("地形 = %d, 名前 = %s, 明度 = %s", "Terrain = %d, Name = %s, Lighting = %s"),
896 f, (f_name + f_ptr->name), lighting_level_str[lighting_level]));
897 Term_putstr(10, 19, -1, TERM_WHITE,
898 format(_("初期値 色 / 文字 = %3d / %3d", "Default attr/char = %3d / %3d"), da, dc));
899 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
900 Term_queue_bigchar(43, 19, da, dc, 0, 0);
901 Term_putstr(10, 20, -1, TERM_WHITE,
902 format(_("現在値 色 / 文字 = %3d / %3d", "Current attr/char = %3d / %3d"), ca, cc));
903 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
904 Term_queue_bigchar(43, 20, ca, cc, 0, 0);
905 Term_putstr(0, 22, -1, TERM_WHITE,
906 _("コマンド (n/N/^N/a/A/^A/c/C/^C/l/L/^L/d/D/^D/v/V/^V): ", "Command (n/N/^N/a/A/^A/c/C/^C/l/L/^L/d/D/^D/v/V/^V): "));
909 if (i == ESCAPE) break;
911 if (iscntrl(i)) c = 'a' + i - KTRL('A');
912 else if (isupper(i)) c = 'a' + i - 'A';
922 if (!cmd_visuals_aux(i, &f, max_f_idx))
927 } while (!f_info[f].name || (f_info[f].mimic != f));
932 t = (int)f_ptr->x_attr[lighting_level];
933 (void)cmd_visuals_aux(i, &t, 256);
934 f_ptr->x_attr[lighting_level] = (byte)t;
938 t = (int)f_ptr->x_char[lighting_level];
939 (void)cmd_visuals_aux(i, &t, 256);
940 f_ptr->x_char[lighting_level] = (byte)t;
944 (void)cmd_visuals_aux(i, &lighting_level, F_LIT_MAX);
947 apply_default_feat_lighting(f_ptr->x_attr, f_ptr->x_char);
951 do_cmd_knowledge_features(&need_redraw, TRUE, f, &lighting_level);
953 print_visuals_menu(choice_msg);
961 do_cmd_knowledge_monsters(creature_ptr, &need_redraw, TRUE, -1);
964 do_cmd_knowledge_objects(creature_ptr, &need_redraw, TRUE, -1);
968 IDX lighting_level = F_LIT_STANDARD;
969 do_cmd_knowledge_features(&need_redraw, TRUE, -1, &lighting_level);
974 reset_visuals(creature_ptr);
975 msg_print(_("画面上の[色/文字]を初期値にリセットしました。", "Visual attr/char tables reset."));
987 if (need_redraw) do_cmd_redraw(creature_ptr);
992 * Interact with "colors"
994 void do_cmd_colors(player_type *creature_ptr)
999 FILE_TYPE(FILE_TYPE_TEXT);
1004 prt(_("[ カラーの設定 ]", "Interact with Colors"), 2, 0);
1005 prt(_("(1) ユーザー設定ファイルのロード", "(1) Load a user pref file"), 4, 5);
1006 prt(_("(2) カラーの設定をファイルに書き出す", "(2) Dump colors"), 5, 5);
1007 prt(_("(3) カラーの設定を変更する", "(3) Modify colors"), 6, 5);
1008 prt(_("コマンド: ", "Command: "), 8, 0);
1010 if (i == ESCAPE) break;
1014 prt(_("コマンド: ユーザー設定ファイルをロードします", "Command: Load a user pref file"), 8, 0);
1015 prt(_("ファイル: ", "File: "), 10, 0);
1016 sprintf(tmp, "%s.prf", creature_ptr->base_name);
1017 if (!askfor(tmp, 70)) continue;
1019 (void)process_pref_file(creature_ptr, tmp);
1020 Term_xtra(TERM_XTRA_REACT, 0);
1025 static concptr mark = "Colors";
1026 prt(_("コマンド: カラーの設定をファイルに書き出します", "Command: Dump colors"), 8, 0);
1027 prt(_("ファイル: ", "File: "), 10, 0);
1028 sprintf(tmp, "%s.prf", creature_ptr->base_name);
1029 if (!askfor(tmp, 70)) continue;
1031 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
1032 if (!open_auto_dump(buf, mark)) continue;
1034 auto_dump_printf(_("\n# カラーの設定\n\n", "\n# Color redefinitions\n\n"));
1035 for (i = 0; i < 256; i++)
1037 int kv = angband_color_table[i][0];
1038 int rv = angband_color_table[i][1];
1039 int gv = angband_color_table[i][2];
1040 int bv = angband_color_table[i][3];
1042 concptr name = _("未知", "unknown");
1043 if (!kv && !rv && !gv && !bv) continue;
1045 if (i < 16) name = color_names[i];
1047 auto_dump_printf(_("# カラー '%s'\n", "# Color '%s'\n"), name);
1048 auto_dump_printf("V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n",
1053 msg_print(_("カラーの設定をファイルに書き出しました。", "Dumped color redefinitions."));
1058 prt(_("コマンド: カラーの設定を変更します", "Command: Modify colors"), 8, 0);
1063 for (byte j = 0; j < 16; j++)
1065 Term_putstr(j * 4, 20, -1, a, "###");
1066 Term_putstr(j * 4, 22, -1, j, format("%3d", j));
1069 name = ((a < 16) ? color_names[a] : _("未定義", "undefined"));
1070 Term_putstr(5, 10, -1, TERM_WHITE,
1071 format(_("カラー = %d, 名前 = %s", "Color = %d, Name = %s"), a, name));
1072 Term_putstr(5, 12, -1, TERM_WHITE,
1073 format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x",
1074 angband_color_table[a][0],
1075 angband_color_table[a][1],
1076 angband_color_table[a][2],
1077 angband_color_table[a][3]));
1078 Term_putstr(0, 14, -1, TERM_WHITE,
1079 _("コマンド (n/N/k/K/r/R/g/G/b/B): ", "Command (n/N/k/K/r/R/g/G/b/B): "));
1081 if (i == ESCAPE) break;
1083 if (i == 'n') a = (byte)(a + 1);
1084 if (i == 'N') a = (byte)(a - 1);
1085 if (i == 'k') angband_color_table[a][0] = (byte)(angband_color_table[a][0] + 1);
1086 if (i == 'K') angband_color_table[a][0] = (byte)(angband_color_table[a][0] - 1);
1087 if (i == 'r') angband_color_table[a][1] = (byte)(angband_color_table[a][1] + 1);
1088 if (i == 'R') angband_color_table[a][1] = (byte)(angband_color_table[a][1] - 1);
1089 if (i == 'g') angband_color_table[a][2] = (byte)(angband_color_table[a][2] + 1);
1090 if (i == 'G') angband_color_table[a][2] = (byte)(angband_color_table[a][2] - 1);
1091 if (i == 'b') angband_color_table[a][3] = (byte)(angband_color_table[a][3] + 1);
1092 if (i == 'B') angband_color_table[a][3] = (byte)(angband_color_table[a][3] - 1);
1094 Term_xtra(TERM_XTRA_REACT, 0);
1111 * Note something in the message recall
1113 void do_cmd_note(void)
1117 if (!get_string(_("メモ: ", "Note: "), buf, 60)) return;
1118 if (!buf[0] || (buf[0] == ' ')) return;
1120 msg_format(_("メモ: %s", "Note: %s"), buf);
1125 * Mention the current version
1127 void do_cmd_version(void)
1129 #if FAKE_VER_EXTRA > 0
1130 msg_format(_("変愚蛮怒(Hengband) %d.%d.%d.%d", "You are playing Hengband %d.%d.%d.%d."),
1131 FAKE_VER_MAJOR - 10, FAKE_VER_MINOR, FAKE_VER_PATCH, FAKE_VER_EXTRA);
1133 msg_format(_("変愚蛮怒(Hengband) %d.%d.%d", "You are playing Hengband %d.%d.%d."),
1134 FAKE_VER_MAJOR - 10, FAKE_VER_MINOR, FAKE_VER_PATCH);
1140 * Note that "feeling" is set to zero unless some time has passed.
1141 * Note that this is done when the level is GENERATED, not entered.
1143 void do_cmd_feeling(player_type *creature_ptr)
1145 if (creature_ptr->wild_mode) return;
1147 if (creature_ptr->current_floor_ptr->inside_quest && !random_quest_number(creature_ptr, creature_ptr->current_floor_ptr->dun_level))
1149 msg_print(_("典型的なクエストのダンジョンのようだ。", "Looks like a typical quest level."));
1153 if (creature_ptr->town_num && !creature_ptr->current_floor_ptr->dun_level)
1155 if (!strcmp(town_info[creature_ptr->town_num].name, _("荒野", "wilderness")))
1157 msg_print(_("何かありそうな荒野のようだ。", "Looks like a strange wilderness."));
1161 msg_print(_("典型的な町のようだ。", "Looks like a typical town."));
1165 if (!creature_ptr->current_floor_ptr->dun_level)
1167 msg_print(_("典型的な荒野のようだ。", "Looks like a typical wilderness."));
1171 if (creature_ptr->muta3 & MUT3_GOOD_LUCK)
1172 msg_print(do_cmd_feeling_text_lucky[creature_ptr->feeling]);
1173 else if (IS_ECHIZEN(creature_ptr))
1174 msg_print(do_cmd_feeling_text_combat[creature_ptr->feeling]);
1176 msg_print(do_cmd_feeling_text[creature_ptr->feeling]);
1181 * todo 引数と戻り値について追記求む
1182 * Build a list of monster indexes in the given group.
1184 * mode & 0x01 : check for non-empty group
1185 * mode & 0x02 : visual operation only
1187 * @param creature_ptr プレーヤーへの参照ポインタ
1188 * @param grp_cur ???
1189 * @param mon_idx[] ???
1191 * @return The number of monsters in the group
1193 static IDX collect_monsters(player_type *creature_ptr, IDX grp_cur, IDX mon_idx[], BIT_FLAGS8 mode)
1195 concptr group_char = monster_group_char[grp_cur];
1196 bool grp_unique = (monster_group_char[grp_cur] == (char *)-1L);
1197 bool grp_riding = (monster_group_char[grp_cur] == (char *)-2L);
1198 bool grp_wanted = (monster_group_char[grp_cur] == (char *)-3L);
1199 bool grp_amberite = (monster_group_char[grp_cur] == (char *)-4L);
1202 for (IDX i = 0; i < max_r_idx; i++)
1204 monster_race *r_ptr = &r_info[i];
1205 if (!r_ptr->name) continue;
1206 if (!(mode & 0x02) && !cheat_know && !r_ptr->r_sights) continue;
1210 if (!(r_ptr->flags1 & RF1_UNIQUE)) continue;
1212 else if (grp_riding)
1214 if (!(r_ptr->flags7 & RF7_RIDING)) continue;
1216 else if (grp_wanted)
1218 bool wanted = FALSE;
1219 for (int j = 0; j < MAX_BOUNTY; j++)
1221 if (current_world_ptr->bounty_r_idx[j] == i || current_world_ptr->bounty_r_idx[j] - 10000 == i ||
1222 (creature_ptr->today_mon && creature_ptr->today_mon == i))
1229 if (!wanted) continue;
1231 else if (grp_amberite)
1233 if (!(r_ptr->flags3 & RF3_AMBERITE)) continue;
1237 if (!my_strchr(group_char, r_ptr->d_char)) continue;
1240 mon_idx[mon_cnt++] = i;
1241 if (mode & 0x01) break;
1244 mon_idx[mon_cnt] = -1;
1246 ang_sort(mon_idx, &dummy_why, mon_cnt, ang_sort_comp_monster_level, ang_sort_swap_hook);
1252 * Build a list of object indexes in the given group. Return the number
1253 * of objects in the group.
1255 * mode & 0x01 : check for non-empty group
1256 * mode & 0x02 : visual operation only
1258 static KIND_OBJECT_IDX collect_objects(int grp_cur, KIND_OBJECT_IDX object_idx[], BIT_FLAGS8 mode)
1260 KIND_OBJECT_IDX object_cnt = 0;
1261 byte group_tval = object_group_tval[grp_cur];
1262 for (KIND_OBJECT_IDX i = 0; i < max_k_idx; i++)
1264 object_kind *k_ptr = &k_info[i];
1265 if (!k_ptr->name) continue;
1269 if (!current_world_ptr->wizard)
1271 if (!k_ptr->flavor) continue;
1272 if (!k_ptr->aware) continue;
1276 for (int j = 0; j < 4; j++)
1277 k += k_ptr->chance[j];
1281 if (TV_LIFE_BOOK == group_tval)
1283 if (TV_LIFE_BOOK <= k_ptr->tval && k_ptr->tval <= TV_HEX_BOOK)
1285 object_idx[object_cnt++] = i;
1290 else if (k_ptr->tval == group_tval)
1292 object_idx[object_cnt++] = i;
1297 if (mode & 0x01) break;
1300 object_idx[object_cnt] = -1;
1306 * Description of each feature group.
1308 static concptr feature_group_text[] =
1316 * Build a list of feature indexes in the given group. Return the number
1317 * of features in the group.
1319 * mode & 0x01 : check for non-empty group
1321 static FEAT_IDX collect_features(FEAT_IDX *feat_idx, BIT_FLAGS8 mode)
1323 FEAT_IDX feat_cnt = 0;
1324 for (FEAT_IDX i = 0; i < max_f_idx; i++)
1326 feature_type *f_ptr = &f_info[i];
1327 if (!f_ptr->name) continue;
1328 if (f_ptr->mimic != i) continue;
1330 feat_idx[feat_cnt++] = i;
1331 if (mode & 0x01) break;
1334 feat_idx[feat_cnt] = -1;
1340 * Hack -- load a screen dump from a file
1342 void do_cmd_load_screen(void)
1345 SYMBOL_CODE c = ' ';
1350 Term_get_size(&wid, &hgt);
1351 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
1352 fff = my_fopen(buf, "r");
1355 msg_format(_("%s を開くことができませんでした。", "Failed to open %s."), buf);
1362 for (TERM_LEN y = 0; okay; y++)
1364 if (!fgets(buf, 1024, fff)) okay = FALSE;
1366 if (buf[0] == '\n' || buf[0] == '\0') break;
1367 if (y >= hgt) continue;
1369 for (TERM_LEN x = 0; x < wid - 1; x++)
1371 if (buf[x] == '\n' || buf[x] == '\0') break;
1373 Term_draw(x, y, TERM_WHITE, buf[x]);
1377 for (TERM_LEN y = 0; okay; y++)
1379 if (!fgets(buf, 1024, fff)) okay = FALSE;
1381 if (buf[0] == '\n' || buf[0] == '\0') break;
1382 if (y >= hgt) continue;
1384 for (TERM_LEN x = 0; x < wid - 1; x++)
1386 if (buf[x] == '\n' || buf[x] == '\0') break;
1388 (void)(Term_what(x, y, &a, &c));
1389 for (int i = 0; i < 16; i++)
1391 if (hack[i] == buf[x]) a = (byte)i;
1394 Term_draw(x, y, a, c);
1399 prt(_("ファイルに書き出された画面(記念撮影)をロードしました。", "Screen dump loaded."), 0, 0);
1405 // todo なぜこんな中途半端なところに? defineも…
1406 concptr inven_res_label = _(" 酸電火冷毒光闇破轟獄因沌劣 盲怖乱痺透命感消復浮",
1407 " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv");
1409 #define IM_FLAG_STR _("*", "* ")
1410 #define HAS_FLAG_STR _("+", "+ ")
1411 #define NO_FLAG_STR _("・", ". ")
1413 #define print_im_or_res_flag(IM, RES) \
1415 fputs(have_flag(flgs, (IM)) ? IM_FLAG_STR : \
1416 (have_flag(flgs, (RES)) ? HAS_FLAG_STR : NO_FLAG_STR), fff); \
1419 #define print_flag(TR) \
1421 fputs(have_flag(flgs, (TR)) ? HAS_FLAG_STR : NO_FLAG_STR, fff); \
1425 static void do_cmd_knowledge_inven_aux(player_type *creature_ptr, FILE *fff, object_type *o_ptr, int *j, OBJECT_TYPE_VALUE tval, char *where)
1427 GAME_TEXT o_name[MAX_NLEN];
1428 BIT_FLAGS flgs[TR_FLAG_SIZE];
1429 if (!o_ptr->k_idx) return;
1430 if (o_ptr->tval != tval) return;
1431 if (!object_is_known(o_ptr)) return;
1433 bool is_special_item_type = (object_is_wearable(o_ptr) && object_is_ego(o_ptr))
1434 || ((tval == TV_AMULET) && (o_ptr->sval == SV_AMULET_RESISTANCE))
1435 || ((tval == TV_RING) && (o_ptr->sval == SV_RING_LORDLY))
1436 || ((tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD))
1437 || ((tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM))
1438 || ((tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES))
1439 || ((tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE))
1440 || object_is_artifact(o_ptr);
1441 if (!is_special_item_type)
1447 object_desc(creature_ptr, o_name, o_ptr, OD_NAME_ONLY);
1448 while (o_name[i] && (i < 26))
1451 if (iskanji(o_name[i])) i++;
1460 o_name[i] = ' '; i++;
1466 fprintf(fff, "%s %s", where, o_name);
1468 if (!OBJECT_IS_FULL_KNOWN(o_ptr))
1470 fputs(_("-------不明--------------- -------不明---------\n",
1471 "-------unknown------------ -------unknown------\n"), fff);
1475 object_flags_known(o_ptr, flgs);
1477 print_im_or_res_flag(TR_IM_ACID, TR_RES_ACID);
1478 print_im_or_res_flag(TR_IM_ELEC, TR_RES_ELEC);
1479 print_im_or_res_flag(TR_IM_FIRE, TR_RES_FIRE);
1480 print_im_or_res_flag(TR_IM_COLD, TR_RES_COLD);
1481 print_flag(TR_RES_POIS);
1482 print_flag(TR_RES_LITE);
1483 print_flag(TR_RES_DARK);
1484 print_flag(TR_RES_SHARDS);
1485 print_flag(TR_RES_SOUND);
1486 print_flag(TR_RES_NETHER);
1487 print_flag(TR_RES_NEXUS);
1488 print_flag(TR_RES_CHAOS);
1489 print_flag(TR_RES_DISEN);
1493 print_flag(TR_RES_BLIND);
1494 print_flag(TR_RES_FEAR);
1495 print_flag(TR_RES_CONF);
1496 print_flag(TR_FREE_ACT);
1497 print_flag(TR_SEE_INVIS);
1498 print_flag(TR_HOLD_EXP);
1499 print_flag(TR_TELEPATHY);
1500 print_flag(TR_SLOW_DIGEST);
1501 print_flag(TR_REGEN);
1502 print_flag(TR_LEVITATION);
1511 fprintf(fff, "%s\n", inven_res_label);
1516 * Display *ID* ed weapons/armors's resistances
1518 static void do_cmd_knowledge_inven(player_type *creature_ptr)
1521 GAME_TEXT file_name[1024];
1523 OBJECT_TYPE_VALUE tval;
1527 fff = my_fopen_temp(file_name, 1024);
1530 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
1535 fprintf(fff, "%s\n", inven_res_label);
1536 for (tval = TV_WEARABLE_BEGIN; tval <= TV_WEARABLE_END; tval++)
1540 for (; j < 9; j++) fputc('\n', fff);
1542 fprintf(fff, "%s\n", inven_res_label);
1545 strcpy(where, _("装", "E "));
1546 for (int i = INVEN_RARM; i < INVEN_TOTAL; i++)
1548 do_cmd_knowledge_inven_aux(creature_ptr, fff, &creature_ptr->inventory_list[i], &j, tval, where);
1551 strcpy(where, _("持", "I "));
1552 for (int i = 0; i < INVEN_PACK; i++)
1554 do_cmd_knowledge_inven_aux(creature_ptr, fff, &creature_ptr->inventory_list[i], &j, tval, where);
1557 st_ptr = &town_info[1].store[STORE_HOME];
1558 strcpy(where, _("家", "H "));
1559 for (int i = 0; i < st_ptr->stock_num; i++)
1561 do_cmd_knowledge_inven_aux(creature_ptr, fff, &st_ptr->stock[i], &j, tval, where);
1566 (void)show_file(creature_ptr, TRUE, file_name, _("*鑑定*済み武器/防具の耐性リスト", "Resistances of *identified* equipment"), 0, 0);
1571 void do_cmd_save_screen_html_aux(char *filename, int message)
1579 concptr html_head[] = {
1580 "<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
1584 concptr html_foot[] = {
1586 "</body>\n</html>\n",
1591 Term_get_size(&wid, &hgt);
1592 FILE_TYPE(FILE_TYPE_TEXT);
1594 fff = my_fopen(filename, "w");
1599 msg_format(_("ファイル %s を開けませんでした。", "Failed to open file %s."), filename);
1606 if (message) screen_save();
1609 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "htmldump.prf");
1611 tmpfff = my_fopen(buf, "r");
1614 for (int i = 0; html_head[i]; i++)
1615 fputs(html_head[i], fff);
1619 bool is_first_line = TRUE;
1620 while (!my_fgets(tmpfff, buf, sizeof(buf)))
1624 if (strncmp(buf, tags[0], strlen(tags[0])) == 0)
1625 is_first_line = FALSE;
1629 if (strncmp(buf, tags[1], strlen(tags[1])) == 0)
1631 fprintf(fff, "%s\n", buf);
1636 for (TERM_LEN y = 0; y < hgt; y++)
1638 if (y != 0) fprintf(fff, "\n");
1640 TERM_COLOR a = 0, old_a = 0;
1642 for (TERM_LEN x = 0; x < wid - 1; x++)
1645 (void)(Term_what(x, y, &a, &c));
1648 case '&': cc = "&"; break;
1649 case '<': cc = "<"; break;
1650 case '>': cc = ">"; break;
1652 case 0x1f: c = '.'; break;
1653 case 0x7f: c = (a == 0x09) ? '%' : '#'; break;
1658 if ((y == 0 && x == 0) || a != old_a)
1660 int rv = angband_color_table[a][1];
1661 int gv = angband_color_table[a][2];
1662 int bv = angband_color_table[a][3];
1663 fprintf(fff, "%s<font color=\"#%02x%02x%02x\">",
1664 ((y == 0 && x == 0) ? "" : "</font>"), rv, gv, bv);
1669 fprintf(fff, "%s", cc);
1671 fprintf(fff, "%c", c);
1675 fprintf(fff, "</font>");
1678 for (int i = 0; html_foot[i]; i++)
1679 fputs(html_foot[i], fff);
1684 bool is_first_line = TRUE;
1685 while (!my_fgets(tmpfff, buf, sizeof(buf)))
1689 if (strncmp(buf, tags[2], strlen(tags[2])) == 0)
1690 is_first_line = FALSE;
1694 if (strncmp(buf, tags[3], strlen(tags[3])) == 0)
1696 fprintf(fff, "%s\n", buf);
1707 msg_print(_("画面(記念撮影)をファイルに書き出しました。", "Screen dump saved."));
1717 * Hack -- save a screen dump to a file
1719 static void do_cmd_save_screen_html(void)
1721 char buf[1024], tmp[256] = "screen.html";
1723 if (!get_string(_("ファイル名: ", "File name: "), tmp, 80))
1725 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
1729 do_cmd_save_screen_html_aux(buf, 1);
1734 * Redefinable "save_screen" action
1736 void(*screendump_aux)(void) = NULL;
1740 * Save a screen dump to a file
1741 * @param creature_ptr プレーヤーへの参照ポインタ
1744 void do_cmd_save_screen(player_type *creature_ptr)
1746 prt(_("記念撮影しますか? [(y)es/(h)tml/(n)o] ", "Save screen dump? [(y)es/(h)tml/(n)o] "), 0, 0);
1747 bool html_dump = FALSE;
1751 if (c == 'Y' || c == 'y')
1753 else if (c == 'H' || c == 'h')
1766 Term_get_size(&wid, &hgt);
1768 bool old_use_graphics = use_graphics;
1769 if (old_use_graphics)
1771 use_graphics = FALSE;
1772 reset_visuals(creature_ptr);
1773 creature_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1774 handle_stuff(creature_ptr);
1779 do_cmd_save_screen_html();
1780 do_cmd_redraw(creature_ptr);
1782 else if (screendump_aux)
1784 (*screendump_aux)();
1790 SYMBOL_CODE c = ' ';
1793 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
1794 FILE_TYPE(FILE_TYPE_TEXT);
1795 fff = my_fopen(buf, "w");
1798 msg_format(_("ファイル %s を開けませんでした。", "Failed to open file %s."), buf);
1804 for (y = 0; y < hgt; y++)
1806 for (x = 0; x < wid - 1; x++)
1808 (void)(Term_what(x, y, &a, &c));
1813 fprintf(fff, "%s\n", buf);
1817 for (y = 0; y < hgt; y++)
1819 for (x = 0; x < wid - 1; x++)
1821 (void)(Term_what(x, y, &a, &c));
1822 buf[x] = hack[a & 0x0F];
1826 fprintf(fff, "%s\n", buf);
1831 msg_print(_("画面(記念撮影)をファイルに書き出しました。", "Screen dump saved."));
1836 if (!old_use_graphics) return;
1838 use_graphics = TRUE;
1839 reset_visuals(creature_ptr);
1840 creature_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1841 handle_stuff(creature_ptr);
1846 * todo okay = 既知のアーティファクト? と思われるが確証がない
1847 * 分かりやすい変数名へ変更求む&万が一未知である旨の配列なら負論理なのでゴソッと差し替えるべき
1848 * Check the status of "artifacts"
1849 * @param player_ptr プレーヤーへの参照ポインタ
1852 static void do_cmd_knowledge_artifacts(player_type *player_ptr)
1855 GAME_TEXT file_name[1024];
1856 fff = my_fopen_temp(file_name, 1024);
1859 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
1865 C_MAKE(who, max_a_idx, ARTIFACT_IDX);
1867 C_MAKE(okay, max_a_idx, bool);
1869 for (ARTIFACT_IDX k = 0; k < max_a_idx; k++)
1871 artifact_type *a_ptr = &a_info[k];
1873 if (!a_ptr->name) continue;
1874 if (!a_ptr->cur_num) continue;
1879 for (POSITION y = 0; y < player_ptr->current_floor_ptr->height; y++)
1881 for (POSITION x = 0; x < player_ptr->current_floor_ptr->width; x++)
1883 grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
1884 OBJECT_IDX this_o_idx, next_o_idx = 0;
1885 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
1888 o_ptr = &player_ptr->current_floor_ptr->o_list[this_o_idx];
1889 next_o_idx = o_ptr->next_o_idx;
1890 if (!object_is_fixed_artifact(o_ptr)) continue;
1891 if (object_is_known(o_ptr)) continue;
1893 okay[o_ptr->name1] = FALSE;
1898 for (ARTIFACT_IDX i = 0; i < INVEN_TOTAL; i++)
1900 object_type *o_ptr = &player_ptr->inventory_list[i];
1901 if (!o_ptr->k_idx) continue;
1902 if (!object_is_fixed_artifact(o_ptr)) continue;
1903 if (object_is_known(o_ptr)) continue;
1905 okay[o_ptr->name1] = FALSE;
1909 for (ARTIFACT_IDX k = 0; k < max_a_idx; k++)
1911 if (okay[k]) who[n++] = k;
1915 ang_sort(who, &why, n, ang_sort_art_comp, ang_sort_art_swap);
1916 for (ARTIFACT_IDX k = 0; k < n; k++)
1918 artifact_type *a_ptr = &a_info[who[k]];
1919 GAME_TEXT base_name[MAX_NLEN];
1920 strcpy(base_name, _("未知の伝説のアイテム", "Unknown Artifact"));
1921 ARTIFACT_IDX z = lookup_kind(a_ptr->tval, a_ptr->sval);
1927 object_prep(q_ptr, z);
1928 q_ptr->name1 = (byte)who[k];
1929 q_ptr->ident |= IDENT_STORE;
1930 object_desc(player_ptr, base_name, q_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1933 fprintf(fff, _(" %s\n", " The %s\n"), base_name);
1936 C_KILL(who, max_a_idx, ARTIFACT_IDX);
1937 C_KILL(okay, max_a_idx, bool);
1939 (void)show_file(player_ptr, TRUE, file_name, _("既知の伝説のアイテム", "Artifacts Seen"), 0, 0);
1945 * Display known uniques
1946 * With "XTRA HACK UNIQHIST" (Originally from XAngband)
1948 static void do_cmd_knowledge_uniques(player_type *creature_ptr)
1952 GAME_TEXT file_name[1024];
1954 int n_alive_surface = 0;
1955 int n_alive_over100 = 0;
1956 int n_alive_total = 0;
1958 for (IDX i = 0; i < 10; i++)
1962 fff = my_fopen_temp(file_name, 1024);
1965 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
1970 C_MAKE(who, max_r_idx, MONRACE_IDX);
1972 for (IDX i = 1; i < max_r_idx; i++)
1974 monster_race *r_ptr = &r_info[i];
1975 if (!r_ptr->name) continue;
1976 if (!(r_ptr->flags1 & RF1_UNIQUE)) continue;
1977 if (!cheat_know && !r_ptr->r_sights) continue;
1978 if (!r_ptr->rarity || ((r_ptr->rarity > 100) && !(r_ptr->flags1 & RF1_QUESTOR))) continue;
1979 if (r_ptr->max_num == 0) continue;
1983 int lev = (r_ptr->level - 1) / 10;
1987 if (max_lev < lev) max_lev = lev;
1998 ang_sort(who, &why, n, ang_sort_comp_hook, ang_sort_swap_hook);
1999 if (n_alive_surface)
2001 fprintf(fff, _(" 地上 生存: %3d体\n", " Surface alive: %3d\n"), n_alive_surface);
2002 n_alive_total += n_alive_surface;
2005 for (IDX i = 0; i <= max_lev; i++)
2007 fprintf(fff, _("%3d-%3d階 生存: %3d体\n", "Level %3d-%3d alive: %3d\n"), 1 + i * 10, 10 + i * 10, n_alive[i]);
2008 n_alive_total += n_alive[i];
2011 if (n_alive_over100)
2013 fprintf(fff, _("101- 階 生存: %3d体\n", "Level 101- alive: %3d\n"), n_alive_over100);
2014 n_alive_total += n_alive_over100;
2019 fputs(_("--------- -----------\n", "------------- ----------\n"), fff);
2020 fprintf(fff, _(" 合計 生存: %3d体\n\n", " Total alive: %3d\n\n"), n_alive_total);
2024 fputs(_("現在は既知の生存ユニークはいません。\n", "No known uniques alive.\n"), fff);
2027 for (int k = 0; k < n; k++)
2029 monster_race *r_ptr = &r_info[who[k]];
2030 fprintf(fff, _(" %s (レベル%d)\n", " %s (level %d)\n"), r_name + r_ptr->name, (int)r_ptr->level);
2033 C_KILL(who, max_r_idx, s16b);
2035 (void)show_file(creature_ptr, TRUE, file_name, _("まだ生きているユニーク・モンスター", "Alive Uniques"), 0, 0);
2041 * Display weapon-exp
2043 static void do_cmd_knowledge_weapon_exp(player_type *creature_ptr)
2046 GAME_TEXT file_name[1024];
2047 fff = my_fopen_temp(file_name, 1024);
2050 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
2055 for (int i = 0; i < 5; i++)
2057 for (int num = 0; num < 64; num++)
2061 for (KIND_OBJECT_IDX j = 0; j < max_k_idx; j++)
2063 object_kind *k_ptr = &k_info[j];
2065 if ((k_ptr->tval != TV_SWORD - i) || (k_ptr->sval != num)) continue;
2066 if ((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON || k_ptr->sval == SV_HARP)) continue;
2068 weapon_exp = creature_ptr->weapon_exp[4 - i][num];
2070 fprintf(fff, "%-25s ", tmp);
2071 if (weapon_exp >= s_info[creature_ptr->pclass].w_max[4 - i][num]) fprintf(fff, "!");
2072 else fprintf(fff, " ");
2073 fprintf(fff, "%s", exp_level_str[weapon_exp_level(weapon_exp)]);
2074 if (cheat_xtra) fprintf(fff, " %d", weapon_exp);
2082 (void)show_file(creature_ptr, TRUE, file_name, _("武器の経験値", "Weapon Proficiency"), 0, 0);
2088 * @brief 魔法の経験値を表示するコマンドのメインルーチン
2092 static void do_cmd_knowledge_spell_exp(player_type *creature_ptr)
2095 GAME_TEXT file_name[1024];
2096 fff = my_fopen_temp(file_name, 1024);
2099 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
2104 if (creature_ptr->realm1 != REALM_NONE)
2106 fprintf(fff, _("%sの魔法書\n", "%s Spellbook\n"), realm_names[creature_ptr->realm1]);
2107 for (SPELL_IDX i = 0; i < 32; i++)
2109 const magic_type *s_ptr;
2110 if (!is_magic(creature_ptr->realm1))
2112 s_ptr = &technic_info[creature_ptr->realm1 - MIN_TECHNIC][i];
2116 s_ptr = &mp_ptr->info[creature_ptr->realm1 - 1][i];
2119 if (s_ptr->slevel >= 99) continue;
2120 SUB_EXP spell_exp = creature_ptr->spell_exp[i];
2121 int exp_level = spell_exp_level(spell_exp);
2122 fprintf(fff, "%-25s ", exe_spell(creature_ptr, creature_ptr->realm1, i, SPELL_NAME));
2123 if (creature_ptr->realm1 == REALM_HISSATSU)
2124 fprintf(fff, "[--]");
2127 if (exp_level >= EXP_LEVEL_MASTER) fprintf(fff, "!");
2128 else fprintf(fff, " ");
2129 fprintf(fff, "%s", exp_level_str[exp_level]);
2132 if (cheat_xtra) fprintf(fff, " %d", spell_exp);
2137 if (creature_ptr->realm2 != REALM_NONE)
2139 fprintf(fff, _("%sの魔法書\n", "\n%s Spellbook\n"), realm_names[creature_ptr->realm2]);
2140 for (SPELL_IDX i = 0; i < 32; i++)
2142 const magic_type *s_ptr;
2143 if (!is_magic(creature_ptr->realm1))
2145 s_ptr = &technic_info[creature_ptr->realm2 - MIN_TECHNIC][i];
2149 s_ptr = &mp_ptr->info[creature_ptr->realm2 - 1][i];
2152 if (s_ptr->slevel >= 99) continue;
2154 SUB_EXP spell_exp = creature_ptr->spell_exp[i + 32];
2155 int exp_level = spell_exp_level(spell_exp);
2156 fprintf(fff, "%-25s ", exe_spell(creature_ptr, creature_ptr->realm2, i, SPELL_NAME));
2157 if (exp_level >= EXP_LEVEL_EXPERT) fprintf(fff, "!");
2158 else fprintf(fff, " ");
2159 fprintf(fff, "%s", exp_level_str[exp_level]);
2160 if (cheat_xtra) fprintf(fff, " %d", spell_exp);
2166 (void)show_file(creature_ptr, TRUE, file_name, _("魔法の経験値", "Spell Proficiency"), 0, 0);
2172 * @brief スキル情報を表示するコマンドのメインルーチン /
2176 static void do_cmd_knowledge_skill_exp(player_type *creature_ptr)
2178 char skill_name[GINOU_TEMPMAX][20] =
2180 _("マーシャルアーツ", "Martial Arts "),
2181 _("二刀流 ", "Dual Wielding "),
2182 _("乗馬 ", "Riding "),
2187 char file_name[1024];
2188 fff = my_fopen_temp(file_name, 1024);
2191 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
2196 for (int i = 0; i < GINOU_TEMPMAX; i++)
2198 int skill_exp = creature_ptr->skill_exp[i];
2199 fprintf(fff, "%-20s ", skill_name[i]);
2200 if (skill_exp >= s_info[creature_ptr->pclass].s_max[i]) fprintf(fff, "!");
2201 else fprintf(fff, " ");
2202 fprintf(fff, "%s", exp_level_str[(i == GINOU_RIDING) ? riding_exp_level(skill_exp) : weapon_exp_level(skill_exp)]);
2203 if (cheat_xtra) fprintf(fff, " %d", skill_exp);
2208 (void)show_file(creature_ptr, TRUE, file_name, _("技能の経験値", "Miscellaneous Proficiency"), 0, 0);
2214 * @brief 現在のペットを表示するコマンドのメインルーチン /
2215 * Display current pets
2216 * @param creature_ptr プレーヤーへの参照ポインタ
2219 static void do_cmd_knowledge_pets(player_type *creature_ptr)
2221 GAME_TEXT file_name[1024];
2223 fff = my_fopen_temp(file_name, 1024);
2226 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
2231 monster_type *m_ptr;
2232 GAME_TEXT pet_name[MAX_NLEN];
2234 for (int i = creature_ptr->current_floor_ptr->m_max - 1; i >= 1; i--)
2236 m_ptr = &creature_ptr->current_floor_ptr->m_list[i];
2237 if (!monster_is_valid(m_ptr)) continue;
2238 if (!is_pet(m_ptr)) continue;
2241 monster_desc(creature_ptr, pet_name, m_ptr, MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2242 fprintf(fff, "%s (%s)\n", pet_name, look_mon_desc(m_ptr, 0x00));
2245 int show_upkeep = calculate_upkeep(creature_ptr);
2247 fprintf(fff, "----------------------------------------------\n");
2249 fprintf(fff, " 合計: %d 体のペット\n", t_friends);
2251 fprintf(fff, " Total: %d pet%s.\n", t_friends, (t_friends == 1 ? "" : "s"));
2253 fprintf(fff, _(" 維持コスト: %d%% MP\n", " Upkeep: %d%% mana.\n"), show_upkeep);
2256 (void)show_file(creature_ptr, TRUE, file_name, _("現在のペット", "Current Pets"), 0, 0);
2262 * @brief 現在のペットを表示するコマンドのメインルーチン /
2263 * @param creature_ptr プレーヤーへの参照ポインタ
2266 * @note the player ghosts are ignored.
2268 static void do_cmd_knowledge_kill_count(player_type *creature_ptr)
2271 GAME_TEXT file_name[1024];
2272 fff = my_fopen_temp(file_name, 1024);
2275 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
2281 C_MAKE(who, max_r_idx, MONRACE_IDX);
2283 for (int kk = 1; kk < max_r_idx; kk++)
2285 monster_race *r_ptr = &r_info[kk];
2287 if (r_ptr->flags1 & (RF1_UNIQUE))
2289 bool dead = (r_ptr->max_num == 0);
2298 MONSTER_NUMBER this_monster = r_ptr->r_pkills;
2300 if (this_monster > 0)
2302 total += this_monster;
2308 fprintf(fff, _("あなたはまだ敵を倒していない。\n\n", "You have defeated no enemies yet.\n\n"));
2311 fprintf(fff, "あなたは%ld体の敵を倒している。\n\n", (long int)total);
2313 fprintf(fff, "You have defeated %ld %s.\n\n", (long int)total, (total == 1) ? "enemy" : "enemies");
2318 for (MONRACE_IDX i = 1; i < max_r_idx; i++)
2320 monster_race *r_ptr = &r_info[i];
2321 if (r_ptr->name) who[n++] = i;
2325 ang_sort(who, &why, n, ang_sort_comp_hook, ang_sort_swap_hook);
2326 for (int k = 0; k < n; k++)
2328 monster_race *r_ptr = &r_info[who[k]];
2329 if (r_ptr->flags1 & (RF1_UNIQUE))
2331 bool dead = (r_ptr->max_num == 0);
2334 fprintf(fff, " %s\n", (r_name + r_ptr->name));
2341 MONSTER_NUMBER this_monster = r_ptr->r_pkills;
2342 if (this_monster <= 0) continue;
2345 if (my_strchr("pt", r_ptr->d_char))
2346 fprintf(fff, " %3d 人の %s\n", (int)this_monster, r_name + r_ptr->name);
2348 fprintf(fff, " %3d 体の %s\n", (int)this_monster, r_name + r_ptr->name);
2350 if (this_monster < 2)
2352 if (my_strstr(r_name + r_ptr->name, "coins"))
2354 fprintf(fff, " 1 pile of %s\n", (r_name + r_ptr->name));
2358 fprintf(fff, " 1 %s\n", (r_name + r_ptr->name));
2364 strcpy(ToPlural, (r_name + r_ptr->name));
2365 plural_aux(ToPlural);
2366 fprintf(fff, " %d %s\n", this_monster, ToPlural);
2369 total += this_monster;
2372 fprintf(fff, "----------------------------------------------\n");
2374 fprintf(fff, " 合計: %lu 体を倒した。\n", (unsigned long int)total);
2376 fprintf(fff, " Total: %lu creature%s killed.\n", (unsigned long int)total, (total == 1 ? "" : "s"));
2379 C_KILL(who, max_r_idx, s16b);
2381 (void)show_file(creature_ptr, TRUE, file_name, _("倒した敵の数", "Kill Count"), 0, 0);
2387 * @brief モンスター情報リスト中のグループを表示する /
2388 * Display the object groups.
2392 * @param per_page リストの表示行
2393 * @param grp_idx グループのID配列
2394 * @param group_text グループ名の文字列配列
2395 * @param grp_cur 現在の選択ID
2396 * @param grp_top 現在の選択リスト最上部ID
2399 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)
2401 for (int i = 0; i < per_page && (grp_idx[i] >= 0); i++)
2403 int grp = grp_idx[grp_top + i];
2404 TERM_COLOR attr = (grp_top + i == grp_cur) ? TERM_L_BLUE : TERM_WHITE;
2405 Term_erase(col, row + i, wid);
2406 c_put_str(attr, group_text[grp], row + i, col);
2412 * Move the cursor in a browser window
2414 static void browser_cursor(char ch, int *column, IDX *grp_cur, int grp_cnt, IDX *list_cur, int list_cnt)
2419 IDX list = *list_cur;
2425 d = get_keymap_dir(ch);
2429 if ((ddx[d] > 0) && ddy[d])
2433 Term_get_size(&wid, &hgt);
2434 browser_rows = hgt - 8;
2438 grp += ddy[d] * (browser_rows - 1);
2439 if (grp >= grp_cnt) grp = grp_cnt - 1;
2440 if (grp < 0) grp = 0;
2441 if (grp != old_grp) list = 0;
2445 list += ddy[d] * browser_rows;
2446 if (list >= list_cnt) list = list_cnt - 1;
2447 if (list < 0) list = 0;
2458 if (col < 0) col = 0;
2459 if (col > 1) col = 1;
2469 if (grp >= grp_cnt) grp = grp_cnt - 1;
2470 if (grp < 0) grp = 0;
2471 if (grp != old_grp) list = 0;
2475 list += (IDX)ddy[d];
2476 if (list >= list_cnt) list = list_cnt - 1;
2477 if (list < 0) list = 0;
2488 static void display_visual_list(int col, int row, int height, int width, TERM_COLOR attr_top, byte char_left)
2490 for (int i = 0; i < height; i++)
2492 Term_erase(col, row + i, width);
2495 if (use_bigtile) width /= 2;
2497 for (int i = 0; i < height; i++)
2499 for (int j = 0; j < width; j++)
2501 TERM_LEN x = col + j;
2502 TERM_LEN y = row + i;
2503 if (use_bigtile) x += j;
2505 TERM_COLOR ia = attr_top + i;
2506 SYMBOL_CODE ic = char_left + j;
2507 if (ia > 0x7f || ic > 0xff || ic < ' ' ||
2508 (!use_graphics && ic > 0x7f))
2513 if (c & 0x80) a |= 0x80;
2515 Term_queue_bigchar(x, y, a, c, 0, 0);
2522 * Place the cursor at the collect position for visual mode
2524 static void place_visual_list_cursor(TERM_LEN col, TERM_LEN row, TERM_COLOR a, byte c, TERM_COLOR attr_top, byte char_left)
2526 int i = (a & 0x7f) - attr_top;
2527 int j = c - char_left;
2529 TERM_LEN x = col + j;
2530 TERM_LEN y = row + i;
2531 if (use_bigtile) x += j;
2538 * Do visual mode command -- Change symbols
2540 static bool visual_mode_command(char ch, bool *visual_list_ptr,
2541 int height, int width,
2542 TERM_COLOR *attr_top_ptr, byte *char_left_ptr,
2543 TERM_COLOR *cur_attr_ptr, SYMBOL_CODE *cur_char_ptr, bool *need_redraw)
2545 static TERM_COLOR attr_old = 0;
2546 static SYMBOL_CODE char_old = 0;
2551 if (*visual_list_ptr)
2553 *cur_attr_ptr = attr_old;
2554 *cur_char_ptr = char_old;
2555 *visual_list_ptr = FALSE;
2564 if (*visual_list_ptr)
2566 *visual_list_ptr = FALSE;
2567 *need_redraw = TRUE;
2576 if (!*visual_list_ptr)
2578 *visual_list_ptr = TRUE;
2580 *attr_top_ptr = MAX(0, (*cur_attr_ptr & 0x7f) - 5);
2581 *char_left_ptr = MAX(0, *cur_char_ptr - 10);
2583 attr_old = *cur_attr_ptr;
2584 char_old = *cur_char_ptr;
2594 attr_idx = *cur_attr_ptr;
2595 char_idx = *cur_char_ptr;
2596 for (int i = 0; i < F_LIT_MAX; i++)
2598 attr_idx_feat[i] = 0;
2599 char_idx_feat[i] = 0;
2607 if (attr_idx || (!(char_idx & 0x80) && char_idx))
2609 *cur_attr_ptr = attr_idx;
2610 *attr_top_ptr = MAX(0, (*cur_attr_ptr & 0x7f) - 5);
2611 if (!*visual_list_ptr) *need_redraw = TRUE;
2617 *cur_char_ptr = char_idx;
2618 *char_left_ptr = MAX(0, *cur_char_ptr - 10);
2619 if (!*visual_list_ptr) *need_redraw = TRUE;
2625 if (*visual_list_ptr)
2628 int d = get_keymap_dir(ch);
2629 TERM_COLOR a = (*cur_attr_ptr & 0x7f);
2630 SYMBOL_CODE c = *cur_char_ptr;
2632 if (use_bigtile) eff_width = width / 2;
2633 else eff_width = width;
2635 if ((a == 0) && (ddy[d] < 0)) d = 0;
2636 if ((c == 0) && (ddx[d] < 0)) d = 0;
2637 if ((a == 0x7f) && (ddy[d] > 0)) d = 0;
2638 if ((c == 0xff) && (ddx[d] > 0)) d = 0;
2640 a += (TERM_COLOR)ddy[d];
2641 c += (SYMBOL_CODE)ddx[d];
2642 if (c & 0x80) a |= 0x80;
2646 if ((ddx[d] < 0) && *char_left_ptr > MAX(0, (int)c - 10)) (*char_left_ptr)--;
2647 if ((ddx[d] > 0) && *char_left_ptr + eff_width < MIN(0xff, (int)c + 10)) (*char_left_ptr)++;
2648 if ((ddy[d] < 0) && *attr_top_ptr > MAX(0, (int)(a & 0x7f) - 4)) (*attr_top_ptr)--;
2649 if ((ddy[d] > 0) && *attr_top_ptr + height < MIN(0x7f, (a & 0x7f) + 4)) (*attr_top_ptr)++;
2661 * Display the monsters in a group.
2663 static void display_monster_list(int col, int row, int per_page, s16b mon_idx[], int mon_cur, int mon_top, bool visual_only)
2666 for (i = 0; i < per_page && (mon_idx[mon_top + i] >= 0); i++)
2669 MONRACE_IDX r_idx = mon_idx[mon_top + i];
2670 monster_race *r_ptr = &r_info[r_idx];
2671 attr = ((i + mon_top == mon_cur) ? TERM_L_BLUE : TERM_WHITE);
2672 c_prt(attr, (r_name + r_ptr->name), row + i, col);
2675 c_prt(attr, format("%02x/%02x", r_ptr->x_attr, r_ptr->x_char), row + i, (current_world_ptr->wizard || visual_only) ? 56 : 61);
2678 if (current_world_ptr->wizard || visual_only)
2680 c_prt(attr, format("%d", r_idx), row + i, 62);
2683 Term_erase(69, row + i, 255);
2684 Term_queue_bigchar(use_bigtile ? 69 : 70, row + i, r_ptr->x_attr, r_ptr->x_char, 0, 0);
2687 if (!(r_ptr->flags1 & RF1_UNIQUE))
2688 put_str(format("%5d", r_ptr->r_pkills), row + i, 73);
2690 c_put_str((r_ptr->max_num == 0 ? TERM_L_DARK : TERM_WHITE),
2691 (r_ptr->max_num == 0 ? _("死亡", " dead") : _("生存", "alive")), row + i, 74);
2695 for (; i < per_page; i++)
2697 Term_erase(col, row + i, 255);
2703 * todo 引数の詳細について加筆求む
2704 * Display known monsters.
2705 * @param creature_ptr プレーヤーへの参照ポインタ
2706 * @param need_redraw 画面の再描画が必要な時TRUE
2707 * @param visual_only ???
2708 * @param direct_r_idx モンスターID
2711 static void do_cmd_knowledge_monsters(player_type *creature_ptr, bool *need_redraw, bool visual_only, IDX direct_r_idx)
2714 Term_get_size(&wid, &hgt);
2716 C_MAKE(mon_idx, max_r_idx, MONRACE_IDX);
2722 bool visual_list = FALSE;
2723 TERM_COLOR attr_top = 0;
2726 int browser_rows = hgt - 8;
2727 if (direct_r_idx < 0)
2729 mode = visual_only ? 0x03 : 0x01;
2731 for (IDX i = 0; monster_group_text[i] != NULL; i++)
2733 len = strlen(monster_group_text[i]);
2734 if (len > max) max = len;
2736 if ((monster_group_char[i] == ((char *)-1L)) || collect_monsters(creature_ptr, i, mon_idx, mode))
2738 grp_idx[grp_cnt++] = i;
2746 mon_idx[0] = direct_r_idx;
2750 (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
2751 &attr_top, &char_left, &r_info[direct_r_idx].x_attr, &r_info[direct_r_idx].x_char, need_redraw);
2754 grp_idx[grp_cnt] = -1;
2755 mode = visual_only ? 0x02 : 0x00;
2756 IDX old_grp_cur = -1;
2769 prt(format(_("%s - モンスター", "%s - monsters"), !visual_only ? _("知識", "Knowledge") : _("表示", "Visuals")), 2, 0);
2770 if (direct_r_idx < 0) prt(_("グループ", "Group"), 4, 0);
2771 prt(_("名前", "Name"), 4, max + 3);
2772 if (current_world_ptr->wizard || visual_only) prt("Idx", 4, 62);
2773 prt(_("文字", "Sym"), 4, 67);
2774 if (!visual_only) prt(_("殺害数", "Kills"), 4, 72);
2776 for (IDX i = 0; i < 78; i++)
2778 Term_putch(i, 5, TERM_WHITE, '=');
2781 if (direct_r_idx < 0)
2783 for (IDX i = 0; i < browser_rows; i++)
2785 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
2792 if (direct_r_idx < 0)
2794 if (grp_cur < grp_top) grp_top = grp_cur;
2795 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
2797 display_group_list(0, 6, max, browser_rows, grp_idx, monster_group_text, grp_cur, grp_top);
2798 if (old_grp_cur != grp_cur)
2800 old_grp_cur = grp_cur;
2801 mon_cnt = collect_monsters(creature_ptr, grp_idx[grp_cur], mon_idx, mode);
2804 while (mon_cur < mon_top)
2805 mon_top = MAX(0, mon_top - browser_rows / 2);
2806 while (mon_cur >= mon_top + browser_rows)
2807 mon_top = MIN(mon_cnt - browser_rows, mon_top + browser_rows / 2);
2812 display_monster_list(max + 3, 6, browser_rows, mon_idx, mon_cur, mon_top, visual_only);
2817 display_monster_list(max + 3, 6, 1, mon_idx, mon_cur, mon_top, visual_only);
2818 display_visual_list(max + 3, 7, browser_rows - 1, wid - (max + 3), attr_top, char_left);
2821 prt(format(_("<方向>%s%s%s, ESC", "<dir>%s%s%s, ESC"),
2822 (!visual_list && !visual_only) ? _(", 'r'で思い出を見る", ", 'r' to recall") : "",
2823 visual_list ? _(", ENTERで決定", ", ENTER to accept") : _(", 'v'でシンボル変更", ", 'v' for visuals"),
2824 (attr_idx || char_idx) ? _(", 'c', 'p'でペースト", ", 'c', 'p' to paste") : _(", 'c'でコピー", ", 'c' to copy")),
2827 monster_race *r_ptr;
2828 r_ptr = &r_info[mon_idx[mon_cur]];
2832 if (mon_cnt) monster_race_track(creature_ptr, mon_idx[mon_cur]);
2833 handle_stuff(creature_ptr);
2838 place_visual_list_cursor(max + 3, 7, r_ptr->x_attr, r_ptr->x_char, attr_top, char_left);
2842 Term_gotoxy(0, 6 + (grp_cur - grp_top));
2846 Term_gotoxy(max + 3, 6 + (mon_cur - mon_top));
2850 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))
2852 if (direct_r_idx >= 0)
2878 if (!visual_list && !visual_only && (mon_idx[mon_cur] > 0))
2880 screen_roff(creature_ptr, mon_idx[mon_cur], 0);
2892 browser_cursor(ch, &column, &grp_cur, grp_cnt, &mon_cur, mon_cnt);
2899 C_KILL(mon_idx, max_r_idx, MONRACE_IDX);
2904 * Display the objects in a group.
2906 static void display_object_list(int col, int row, int per_page, IDX object_idx[],
2907 int object_cur, int object_top, bool visual_only)
2910 for (i = 0; i < per_page && (object_idx[object_top + i] >= 0); i++)
2912 GAME_TEXT o_name[MAX_NLEN];
2915 object_kind *flavor_k_ptr;
2916 KIND_OBJECT_IDX k_idx = object_idx[object_top + i];
2917 object_kind *k_ptr = &k_info[k_idx];
2918 TERM_COLOR attr = ((k_ptr->aware || visual_only) ? TERM_WHITE : TERM_SLATE);
2919 byte cursor = ((k_ptr->aware || visual_only) ? TERM_L_BLUE : TERM_BLUE);
2920 if (!visual_only && k_ptr->flavor)
2922 flavor_k_ptr = &k_info[k_ptr->flavor];
2926 flavor_k_ptr = k_ptr;
2929 attr = ((i + object_top == object_cur) ? cursor : attr);
2930 if (!k_ptr->flavor || (!visual_only && k_ptr->aware))
2932 strip_name(o_name, k_idx);
2936 strcpy(o_name, k_name + flavor_k_ptr->flavor_name);
2939 c_prt(attr, o_name, row + i, col);
2942 c_prt(attr, format("%02x/%02x", flavor_k_ptr->x_attr, flavor_k_ptr->x_char), row + i, (current_world_ptr->wizard || visual_only) ? 64 : 68);
2945 if (current_world_ptr->wizard || visual_only)
2947 c_prt(attr, format("%d", k_idx), row + i, 70);
2950 a = flavor_k_ptr->x_attr;
2951 c = flavor_k_ptr->x_char;
2953 Term_queue_bigchar(use_bigtile ? 76 : 77, row + i, a, c, 0, 0);
2956 for (; i < per_page; i++)
2958 Term_erase(col, row + i, 255);
2964 * Describe fake object
2966 static void desc_obj_fake(player_type *creature_ptr, KIND_OBJECT_IDX k_idx)
2969 object_type object_type_body;
2970 o_ptr = &object_type_body;
2972 object_prep(o_ptr, k_idx);
2974 o_ptr->ident |= IDENT_KNOWN;
2975 handle_stuff(creature_ptr);
2977 if (screen_object(creature_ptr, o_ptr, SCROBJ_FAKE_OBJECT | SCROBJ_FORCE_DETAIL)) return;
2979 msg_print(_("特に変わったところはないようだ。", "You see nothing special."));
2985 * Display known objects
2987 static void do_cmd_knowledge_objects(player_type *creature_ptr, bool *need_redraw, bool visual_only, IDX direct_k_idx)
2989 IDX object_old, object_top;
2992 OBJECT_IDX *object_idx;
2994 bool visual_list = FALSE;
2995 TERM_COLOR attr_top = 0;
3000 Term_get_size(&wid, &hgt);
3002 int browser_rows = hgt - 8;
3003 C_MAKE(object_idx, max_k_idx, KIND_OBJECT_IDX);
3008 if (direct_k_idx < 0)
3010 mode = visual_only ? 0x03 : 0x01;
3011 for (IDX i = 0; object_group_text[i] != NULL; i++)
3013 len = strlen(object_group_text[i]);
3014 if (len > max) max = len;
3016 if (collect_objects(i, object_idx, mode))
3018 grp_idx[grp_cnt++] = i;
3027 object_kind *k_ptr = &k_info[direct_k_idx];
3028 object_kind *flavor_k_ptr;
3030 if (!visual_only && k_ptr->flavor)
3032 flavor_k_ptr = &k_info[k_ptr->flavor];
3036 flavor_k_ptr = k_ptr;
3039 object_idx[0] = direct_k_idx;
3040 object_old = direct_k_idx;
3043 (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
3044 &attr_top, &char_left, &flavor_k_ptr->x_attr, &flavor_k_ptr->x_char, need_redraw);
3047 grp_idx[grp_cnt] = -1;
3048 mode = visual_only ? 0x02 : 0x00;
3049 IDX old_grp_cur = -1;
3052 IDX object_cur = object_top = 0;
3058 object_kind *k_ptr, *flavor_k_ptr;
3065 prt(format("%s - アイテム", !visual_only ? "知識" : "表示"), 2, 0);
3066 if (direct_k_idx < 0) prt("グループ", 4, 0);
3067 prt("名前", 4, max + 3);
3068 if (current_world_ptr->wizard || visual_only) prt("Idx", 4, 70);
3071 prt(format("%s - objects", !visual_only ? "Knowledge" : "Visuals"), 2, 0);
3072 if (direct_k_idx < 0) prt("Group", 4, 0);
3073 prt("Name", 4, max + 3);
3074 if (current_world_ptr->wizard || visual_only) prt("Idx", 4, 70);
3078 for (IDX i = 0; i < 78; i++)
3080 Term_putch(i, 5, TERM_WHITE, '=');
3083 if (direct_k_idx < 0)
3085 for (IDX i = 0; i < browser_rows; i++)
3087 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
3094 if (direct_k_idx < 0)
3096 if (grp_cur < grp_top) grp_top = grp_cur;
3097 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
3099 display_group_list(0, 6, max, browser_rows, grp_idx, object_group_text, grp_cur, grp_top);
3100 if (old_grp_cur != grp_cur)
3102 old_grp_cur = grp_cur;
3103 object_cnt = collect_objects(grp_idx[grp_cur], object_idx, mode);
3106 while (object_cur < object_top)
3107 object_top = MAX(0, object_top - browser_rows / 2);
3108 while (object_cur >= object_top + browser_rows)
3109 object_top = MIN(object_cnt - browser_rows, object_top + browser_rows / 2);
3114 display_object_list(max + 3, 6, browser_rows, object_idx, object_cur, object_top, visual_only);
3118 object_top = object_cur;
3119 display_object_list(max + 3, 6, 1, object_idx, object_cur, object_top, visual_only);
3120 display_visual_list(max + 3, 7, browser_rows - 1, wid - (max + 3), attr_top, char_left);
3123 k_ptr = &k_info[object_idx[object_cur]];
3125 if (!visual_only && k_ptr->flavor)
3127 flavor_k_ptr = &k_info[k_ptr->flavor];
3131 flavor_k_ptr = k_ptr;
3135 prt(format("<方向>%s%s%s, ESC",
3136 (!visual_list && !visual_only) ? ", 'r'で詳細を見る" : "",
3137 visual_list ? ", ENTERで決定" : ", 'v'でシンボル変更",
3138 (attr_idx || char_idx) ? ", 'c', 'p'でペースト" : ", 'c'でコピー"),
3141 prt(format("<dir>%s%s%s, ESC",
3142 (!visual_list && !visual_only) ? ", 'r' to recall" : "",
3143 visual_list ? ", ENTER to accept" : ", 'v' for visuals",
3144 (attr_idx || char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"),
3150 if (object_cnt) object_kind_track(creature_ptr, object_idx[object_cur]);
3152 if (object_old != object_idx[object_cur])
3154 handle_stuff(creature_ptr);
3155 object_old = object_idx[object_cur];
3161 place_visual_list_cursor(max + 3, 7, flavor_k_ptr->x_attr, flavor_k_ptr->x_char, attr_top, char_left);
3165 Term_gotoxy(0, 6 + (grp_cur - grp_top));
3169 Term_gotoxy(max + 3, 6 + (object_cur - object_top));
3173 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))
3175 if (direct_k_idx >= 0)
3200 if (!visual_list && !visual_only && (grp_cnt > 0))
3202 desc_obj_fake(creature_ptr, object_idx[object_cur]);
3211 browser_cursor(ch, &column, &grp_cur, grp_cnt, &object_cur, object_cnt);
3217 C_KILL(object_idx, max_k_idx, KIND_OBJECT_IDX);
3222 * Display the features in a group.
3224 static void display_feature_list(int col, int row, int per_page, FEAT_IDX *feat_idx,
3225 FEAT_IDX feat_cur, FEAT_IDX feat_top, bool visual_only, int lighting_level)
3227 int lit_col[F_LIT_MAX], i;
3228 int f_idx_col = use_bigtile ? 62 : 64;
3230 lit_col[F_LIT_STANDARD] = use_bigtile ? (71 - F_LIT_MAX) : 71;
3231 for (i = F_LIT_NS_BEGIN; i < F_LIT_MAX; i++)
3232 lit_col[i] = lit_col[F_LIT_STANDARD] + 2 + (i - F_LIT_NS_BEGIN) * 2 + (use_bigtile ? i : 0);
3234 for (i = 0; i < per_page && (feat_idx[feat_top + i] >= 0); i++)
3237 FEAT_IDX f_idx = feat_idx[feat_top + i];
3238 feature_type *f_ptr = &f_info[f_idx];
3239 int row_i = row + i;
3240 attr = ((i + feat_top == feat_cur) ? TERM_L_BLUE : TERM_WHITE);
3241 c_prt(attr, f_name + f_ptr->name, row_i, col);
3244 c_prt(attr, format("(%s)", lighting_level_str[lighting_level]), row_i, col + 1 + strlen(f_name + f_ptr->name));
3245 c_prt(attr, format("%02x/%02x", f_ptr->x_attr[lighting_level], f_ptr->x_char[lighting_level]), row_i, f_idx_col - ((current_world_ptr->wizard || visual_only) ? 6 : 2));
3247 if (current_world_ptr->wizard || visual_only)
3249 c_prt(attr, format("%d", f_idx), row_i, f_idx_col);
3252 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);
3253 Term_putch(lit_col[F_LIT_NS_BEGIN], row_i, TERM_SLATE, '(');
3254 for (int j = F_LIT_NS_BEGIN + 1; j < F_LIT_MAX; j++)
3256 Term_putch(lit_col[j], row_i, TERM_SLATE, '/');
3259 Term_putch(lit_col[F_LIT_MAX - 1] + (use_bigtile ? 3 : 2), row_i, TERM_SLATE, ')');
3260 for (int j = F_LIT_NS_BEGIN; j < F_LIT_MAX; j++)
3262 Term_queue_bigchar(lit_col[j] + 1, row_i, f_ptr->x_attr[j], f_ptr->x_char[j], 0, 0);
3266 for (; i < per_page; i++)
3268 Term_erase(col, row + i, 255);
3274 * Interact with feature visuals.
3276 static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX direct_f_idx, IDX *lighting_level)
3278 TERM_COLOR attr_old[F_LIT_MAX];
3279 (void)C_WIPE(attr_old, F_LIT_MAX, TERM_COLOR);
3280 SYMBOL_CODE char_old[F_LIT_MAX];
3281 (void)C_WIPE(char_old, F_LIT_MAX, SYMBOL_CODE);
3284 Term_get_size(&wid, &hgt);
3287 C_MAKE(feat_idx, max_f_idx, FEAT_IDX);
3293 FEAT_IDX grp_idx[100];
3294 TERM_COLOR attr_top = 0;
3295 bool visual_list = FALSE;
3297 TERM_LEN browser_rows = hgt - 8;
3298 if (direct_f_idx < 0)
3300 for (FEAT_IDX i = 0; feature_group_text[i] != NULL; i++)
3302 len = strlen(feature_group_text[i]);
3303 if (len > max) max = len;
3305 if (collect_features(feat_idx, 0x01))
3307 grp_idx[grp_cnt++] = i;
3315 feature_type *f_ptr = &f_info[direct_f_idx];
3317 feat_idx[0] = direct_f_idx;
3321 (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
3322 &attr_top, &char_left, &f_ptr->x_attr[*lighting_level], &f_ptr->x_char[*lighting_level], need_redraw);
3324 for (FEAT_IDX i = 0; i < F_LIT_MAX; i++)
3326 attr_old[i] = f_ptr->x_attr[i];
3327 char_old[i] = f_ptr->x_char[i];
3331 grp_idx[grp_cnt] = -1;
3333 FEAT_IDX old_grp_cur = -1;
3334 FEAT_IDX grp_cur = 0;
3335 FEAT_IDX grp_top = 0;
3336 FEAT_IDX feat_cur = 0;
3337 FEAT_IDX feat_top = 0;
3338 TERM_LEN column = 0;
3341 TERM_COLOR *cur_attr_ptr;
3342 SYMBOL_CODE *cur_char_ptr;
3346 feature_type *f_ptr;
3352 prt(_("表示 - 地形", "Visuals - features"), 2, 0);
3353 if (direct_f_idx < 0) prt(_("グループ", "Group"), 4, 0);
3354 prt(_("名前", "Name"), 4, max + 3);
3357 if (current_world_ptr->wizard || visual_only) prt("Idx", 4, 62);
3358 prt(_("文字 ( l/ d)", "Sym ( l/ d)"), 4, 66);
3362 if (current_world_ptr->wizard || visual_only) prt("Idx", 4, 64);
3363 prt(_("文字 (l/d)", "Sym (l/d)"), 4, 68);
3366 for (FEAT_IDX i = 0; i < 78; i++)
3368 Term_putch(i, 5, TERM_WHITE, '=');
3371 if (direct_f_idx < 0)
3373 for (FEAT_IDX i = 0; i < browser_rows; i++)
3375 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
3382 if (direct_f_idx < 0)
3384 if (grp_cur < grp_top) grp_top = grp_cur;
3385 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
3387 display_group_list(0, 6, max, browser_rows, grp_idx, feature_group_text, grp_cur, grp_top);
3388 if (old_grp_cur != grp_cur)
3390 old_grp_cur = grp_cur;
3391 feat_cnt = collect_features(feat_idx, 0x00);
3394 while (feat_cur < feat_top)
3395 feat_top = MAX(0, feat_top - browser_rows / 2);
3396 while (feat_cur >= feat_top + browser_rows)
3397 feat_top = MIN(feat_cnt - browser_rows, feat_top + browser_rows / 2);
3402 display_feature_list(max + 3, 6, browser_rows, feat_idx, feat_cur, feat_top, visual_only, F_LIT_STANDARD);
3406 feat_top = feat_cur;
3407 display_feature_list(max + 3, 6, 1, feat_idx, feat_cur, feat_top, visual_only, *lighting_level);
3408 display_visual_list(max + 3, 7, browser_rows - 1, wid - (max + 3), attr_top, char_left);
3411 prt(format(_("<方向>%s, 'd'で標準光源効果%s, ESC", "<dir>%s, 'd' for default lighting%s, ESC"),
3412 visual_list ? _(", ENTERで決定, 'a'で対象明度変更", ", ENTER to accept, 'a' for lighting level") : _(", 'v'でシンボル変更", ", 'v' for visuals"),
3413 (attr_idx || char_idx) ? _(", 'c', 'p'でペースト", ", 'c', 'p' to paste") : _(", 'c'でコピー", ", 'c' to copy")),
3416 f_ptr = &f_info[feat_idx[feat_cur]];
3417 cur_attr_ptr = &f_ptr->x_attr[*lighting_level];
3418 cur_char_ptr = &f_ptr->x_char[*lighting_level];
3422 place_visual_list_cursor(max + 3, 7, *cur_attr_ptr, *cur_char_ptr, attr_top, char_left);
3426 Term_gotoxy(0, 6 + (grp_cur - grp_top));
3430 Term_gotoxy(max + 3, 6 + (feat_cur - feat_top));
3434 if (visual_list && ((ch == 'A') || (ch == 'a')))
3436 int prev_lighting_level = *lighting_level;
3440 if (*lighting_level <= 0) *lighting_level = F_LIT_MAX - 1;
3441 else (*lighting_level)--;
3445 if (*lighting_level >= F_LIT_MAX - 1) *lighting_level = 0;
3446 else (*lighting_level)++;
3449 if (f_ptr->x_attr[prev_lighting_level] != f_ptr->x_attr[*lighting_level])
3450 attr_top = MAX(0, (f_ptr->x_attr[*lighting_level] & 0x7f) - 5);
3452 if (f_ptr->x_char[prev_lighting_level] != f_ptr->x_char[*lighting_level])
3453 char_left = MAX(0, f_ptr->x_char[*lighting_level] - 10);
3457 else if ((ch == 'D') || (ch == 'd'))
3459 TERM_COLOR prev_x_attr = f_ptr->x_attr[*lighting_level];
3460 byte prev_x_char = f_ptr->x_char[*lighting_level];
3462 apply_default_feat_lighting(f_ptr->x_attr, f_ptr->x_char);
3466 if (prev_x_attr != f_ptr->x_attr[*lighting_level])
3467 attr_top = MAX(0, (f_ptr->x_attr[*lighting_level] & 0x7f) - 5);
3469 if (prev_x_char != f_ptr->x_char[*lighting_level])
3470 char_left = MAX(0, f_ptr->x_char[*lighting_level] - 10);
3472 else *need_redraw = TRUE;
3476 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))
3481 for (FEAT_IDX i = 0; i < F_LIT_MAX; i++)
3483 f_ptr->x_attr[i] = attr_old[i];
3484 f_ptr->x_char[i] = char_old[i];
3490 if (direct_f_idx >= 0) flag = TRUE;
3491 else *lighting_level = F_LIT_STANDARD;
3495 for (FEAT_IDX i = 0; i < F_LIT_MAX; i++)
3497 attr_old[i] = f_ptr->x_attr[i];
3498 char_old[i] = f_ptr->x_char[i];
3500 *lighting_level = F_LIT_STANDARD;
3507 for (FEAT_IDX i = 0; i < F_LIT_MAX; i++)
3509 attr_idx_feat[i] = f_ptr->x_attr[i];
3510 char_idx_feat[i] = f_ptr->x_char[i];
3519 for (FEAT_IDX i = F_LIT_NS_BEGIN; i < F_LIT_MAX; i++)
3521 if (attr_idx_feat[i] || (!(char_idx_feat[i] & 0x80) && char_idx_feat[i])) f_ptr->x_attr[i] = attr_idx_feat[i];
3522 if (char_idx_feat[i]) f_ptr->x_char[i] = char_idx_feat[i];
3540 browser_cursor(ch, &column, &grp_cur, grp_cnt, &feat_cur, feat_cnt);
3546 C_KILL(feat_idx, max_f_idx, FEAT_IDX);
3551 * List wanted monsters
3552 * @param creature_ptr プレーヤーへの参照ポインタ
3555 static void do_cmd_knowledge_bounty(player_type *creature_ptr)
3558 GAME_TEXT file_name[1024];
3559 fff = my_fopen_temp(file_name, 1024);
3562 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
3567 fprintf(fff, _("今日のターゲット : %s\n", "Today's target : %s\n"),
3568 (creature_ptr->today_mon ? r_name + r_info[creature_ptr->today_mon].name : _("不明", "unknown")));
3570 fprintf(fff, _("賞金首リスト\n", "List of wanted monsters\n"));
3571 fprintf(fff, "----------------------------------------------\n");
3573 bool listed = FALSE;
3574 for (int i = 0; i < MAX_BOUNTY; i++)
3576 if (current_world_ptr->bounty_r_idx[i] <= 10000)
3578 fprintf(fff, "%s\n", r_name + r_info[current_world_ptr->bounty_r_idx[i]].name);
3585 fprintf(fff, "\n%s\n", _("賞金首はもう残っていません。", "There are no more wanted monster."));
3589 (void)show_file(creature_ptr, TRUE, file_name, _("賞金首の一覧", "Wanted monsters"), 0, 0);
3594 * List virtues & status
3596 static void do_cmd_knowledge_virtues(player_type *creature_ptr)
3599 GAME_TEXT file_name[1024];
3600 fff = my_fopen_temp(file_name, 1024);
3603 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
3608 fprintf(fff, _("現在の属性 : %s\n\n", "Your alignment : %s\n\n"), your_alignment(creature_ptr));
3609 dump_virtues(creature_ptr, fff);
3611 (void)show_file(creature_ptr, TRUE, file_name, _("八つの徳", "Virtues"), 0, 0);
3618 static void do_cmd_knowledge_dungeon(player_type *creature_ptr)
3621 GAME_TEXT file_name[1024];
3622 fff = my_fopen_temp(file_name, 1024);
3625 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
3630 for (int i = 1; i < current_world_ptr->max_d_idx; i++)
3634 if (!d_info[i].maxdepth) continue;
3635 if (!max_dlv[i]) continue;
3636 if (d_info[i].final_guardian)
3638 if (!r_info[d_info[i].final_guardian].max_num) seiha = TRUE;
3640 else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
3642 fprintf(fff, _("%c%-12s : %3d 階\n", "%c%-16s : level %3d\n"), seiha ? '!' : ' ', d_name + d_info[i].name, (int)max_dlv[i]);
3646 (void)show_file(creature_ptr, TRUE, file_name, _("今までに入ったダンジョン", "Dungeon"), 0, 0);
3652 * List virtues & status
3655 static void do_cmd_knowledge_stat(player_type *creature_ptr)
3658 GAME_TEXT file_name[1024];
3659 fff = my_fopen_temp(file_name, 1024);
3662 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
3667 int percent = (int)(((long)creature_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
3668 (2 * creature_ptr->hitdie +
3669 ((PY_MAX_LEVEL - 1 + 3) * (creature_ptr->hitdie + 1))));
3671 if (creature_ptr->knowledge & KNOW_HPRATE)
3672 fprintf(fff, _("現在の体力ランク : %d/100\n\n", "Your current Life Rating is %d/100.\n\n"), percent);
3673 else fprintf(fff, _("現在の体力ランク : ???\n\n", "Your current Life Rating is ???.\n\n"));
3675 fprintf(fff, _("能力の最大値\n\n", "Limits of maximum stats\n\n"));
3676 for (int v_nr = 0; v_nr < A_MAX; v_nr++)
3678 if ((creature_ptr->knowledge & KNOW_STAT) || creature_ptr->stat_max[v_nr] == creature_ptr->stat_max_max[v_nr]) fprintf(fff, "%s 18/%d\n", stat_names[v_nr], creature_ptr->stat_max_max[v_nr] - 18);
3679 else fprintf(fff, "%s ???\n", stat_names[v_nr]);
3682 dump_yourself(creature_ptr, fff);
3684 (void)show_file(creature_ptr, TRUE, file_name, _("自分に関する情報", "HP-rate & Max stat"), 0, 0);
3690 * todo player_typeではなくQUEST_IDXを引数にすべきかもしれない
3691 * Print all active quests
3692 * @param creature_ptr プレーヤーへの参照ポインタ
3695 static void do_cmd_knowledge_quests_current(player_type *creature_ptr, FILE *fff)
3698 char rand_tmp_str[120] = "\0";
3699 GAME_TEXT name[MAX_NLEN];
3700 monster_race *r_ptr;
3701 int rand_level = 100;
3704 fprintf(fff, _("《遂行中のクエスト》\n", "< Current Quest >\n"));
3706 for (QUEST_IDX i = 1; i < max_q_idx; i++)
3708 bool is_print = quest[i].status == QUEST_STATUS_TAKEN;
3709 is_print |= (quest[i].status == QUEST_STATUS_STAGE_COMPLETED) && (quest[i].type == QUEST_TYPE_TOWER);
3710 is_print |= quest[i].status == QUEST_STATUS_COMPLETED;
3714 QUEST_IDX old_quest = creature_ptr->current_floor_ptr->inside_quest;
3715 for (int j = 0; j < 10; j++)
3716 quest_text[j][0] = '\0';
3718 quest_text_line = 0;
3719 creature_ptr->current_floor_ptr->inside_quest = i;
3720 init_flags = INIT_SHOW_TEXT;
3721 process_dungeon_file(creature_ptr, "q_info.txt", 0, 0, 0, 0);
3722 creature_ptr->current_floor_ptr->inside_quest = old_quest;
3723 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
3726 if (quest[i].type != QUEST_TYPE_RANDOM)
3728 char note[80] = "\0";
3730 if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_STAGE_COMPLETED)
3732 switch (quest[i].type)
3734 case QUEST_TYPE_KILL_LEVEL:
3735 case QUEST_TYPE_KILL_ANY_LEVEL:
3736 r_ptr = &r_info[quest[i].r_idx];
3737 strcpy(name, r_name + r_ptr->name);
3738 if (quest[i].max_num > 1)
3741 sprintf(note, " - %d 体の%sを倒す。(あと %d 体)",
3742 (int)quest[i].max_num, name, (int)(quest[i].max_num - quest[i].cur_num));
3745 sprintf(note, " - kill %d %s, have killed %d.",
3746 (int)quest[i].max_num, name, (int)quest[i].cur_num);
3750 sprintf(note, _(" - %sを倒す。", " - kill %s."), name);
3753 case QUEST_TYPE_FIND_ARTIFACT:
3756 artifact_type *a_ptr = &a_info[quest[i].k_idx];
3758 object_type *q_ptr = &forge;
3759 KIND_OBJECT_IDX k_idx = lookup_kind(a_ptr->tval, a_ptr->sval);
3760 object_prep(q_ptr, k_idx);
3761 q_ptr->name1 = quest[i].k_idx;
3762 q_ptr->ident = IDENT_STORE;
3763 object_desc(creature_ptr, name, q_ptr, OD_NAME_ONLY);
3765 sprintf(note, _("\n - %sを見つけ出す。", "\n - Find %s."), name);
3767 case QUEST_TYPE_FIND_EXIT:
3768 sprintf(note, _(" - 出口に到達する。", " - Reach exit."));
3771 case QUEST_TYPE_KILL_NUMBER:
3773 sprintf(note, " - %d 体のモンスターを倒す。(あと %d 体)",
3774 (int)quest[i].max_num, (int)(quest[i].max_num - quest[i].cur_num));
3776 sprintf(note, " - Kill %d monsters, have killed %d.",
3777 (int)quest[i].max_num, (int)quest[i].cur_num);
3781 case QUEST_TYPE_KILL_ALL:
3782 case QUEST_TYPE_TOWER:
3783 sprintf(note, _(" - 全てのモンスターを倒す。", " - Kill all monsters."));
3788 sprintf(tmp_str, _(" %s (危険度:%d階相当)%s\n", " %s (Danger level: %d)%s\n"),
3789 quest[i].name, (int)quest[i].level, note);
3790 fputs(tmp_str, fff);
3791 if (quest[i].status == QUEST_STATUS_COMPLETED)
3793 sprintf(tmp_str, _(" クエスト達成 - まだ報酬を受けとってない。\n", " Quest Completed - Unrewarded\n"));
3794 fputs(tmp_str, fff);
3799 while (quest_text[k][0] && k < 10)
3801 fprintf(fff, " %s\n", quest_text[k]);
3808 if (quest[i].level >= rand_level)
3811 rand_level = quest[i].level;
3812 if (max_dlv[DUNGEON_ANGBAND] < rand_level) continue;
3814 r_ptr = &r_info[quest[i].r_idx];
3815 strcpy(name, r_name + r_ptr->name);
3816 if (quest[i].max_num <= 1)
3818 sprintf(rand_tmp_str, _(" %s (%d 階) - %sを倒す。\n", " %s (Dungeon level: %d)\n Kill %s.\n"),
3819 quest[i].name, (int)quest[i].level, name);
3824 sprintf(rand_tmp_str, " %s (%d 階) - %d 体の%sを倒す。(あと %d 体)\n",
3825 quest[i].name, (int)quest[i].level,
3826 (int)quest[i].max_num, name, (int)(quest[i].max_num - quest[i].cur_num));
3830 sprintf(rand_tmp_str, " %s (Dungeon level: %d)\n Kill %d %s, have killed %d.\n",
3831 quest[i].name, (int)quest[i].level,
3832 (int)quest[i].max_num, name, (int)quest[i].cur_num);
3836 if (rand_tmp_str[0]) fputs(rand_tmp_str, fff);
3838 if (!total) fprintf(fff, _(" なし\n", " Nothing.\n"));
3842 static bool do_cmd_knowledge_quests_aux(player_type *player_ptr, FILE *fff, IDX q_idx)
3845 char playtime_str[16];
3846 quest_type* const q_ptr = &quest[q_idx];
3848 floor_type *floor_ptr = player_ptr->current_floor_ptr;
3849 if (is_fixed_quest_idx(q_idx))
3851 IDX old_quest = floor_ptr->inside_quest;
3852 floor_ptr->inside_quest = q_idx;
3853 init_flags = INIT_NAME_ONLY;
3854 process_dungeon_file(player_ptr, "q_info.txt", 0, 0, 0, 0);
3855 floor_ptr->inside_quest = old_quest;
3856 if (q_ptr->flags & QUEST_FLAG_SILENT) return FALSE;
3859 strnfmt(playtime_str, sizeof(playtime_str), "%02d:%02d:%02d",
3860 q_ptr->comptime / (60 * 60), (q_ptr->comptime / 60) % 60, q_ptr->comptime % 60);
3862 if (is_fixed_quest_idx(q_idx) || (q_ptr->r_idx == 0))
3865 _(" %-35s (危険度:%3d階相当) - レベル%2d - %s\n",
3866 " %-35s (Danger level: %3d) - level %2d - %s\n"),
3867 q_ptr->name, (int)q_ptr->level, q_ptr->complev, playtime_str);
3868 fputs(tmp_str, fff);
3872 if (q_ptr->complev == 0)
3875 _(" %-35s (%3d階) - 不戦勝 - %s\n",
3876 " %-35s (Dungeon level: %3d) - Unearned - %s\n"),
3877 r_name + r_info[q_ptr->r_idx].name,
3878 (int)q_ptr->level, playtime_str);
3879 fputs(tmp_str, fff);
3884 _(" %-35s (%3d階) - レベル%2d - %s\n",
3885 " %-35s (Dungeon level: %3d) - level %2d - %s\n"),
3886 r_name + r_info[q_ptr->r_idx].name,
3890 fputs(tmp_str, fff);
3896 * Print all finished quests
3897 * @param creature_ptr プレーヤーへの参照ポインタ
3898 * @param fff セーブファイル (展開済?)
3899 * @param quest_num[] 受注したことのあるクエスト群
3902 void do_cmd_knowledge_quests_completed(player_type *creature_ptr, FILE *fff, QUEST_IDX quest_num[])
3904 fprintf(fff, _("《達成したクエスト》\n", "< Completed Quest >\n"));
3905 QUEST_IDX total = 0;
3906 for (QUEST_IDX i = 1; i < max_q_idx; i++)
3908 QUEST_IDX q_idx = quest_num[i];
3909 quest_type* const q_ptr = &quest[q_idx];
3911 if (q_ptr->status == QUEST_STATUS_FINISHED && do_cmd_knowledge_quests_aux(creature_ptr, fff, q_idx))
3917 if (!total) fprintf(fff, _(" なし\n", " Nothing.\n"));
3922 * Print all failed quests
3923 * @param creature_ptr プレーヤーへの参照ポインタ
3924 * @param fff セーブファイル (展開済?)
3925 * @param quest_num[] 受注したことのあるクエスト群
3928 void do_cmd_knowledge_quests_failed(player_type *creature_ptr, FILE *fff, QUEST_IDX quest_num[])
3930 fprintf(fff, _("《失敗したクエスト》\n", "< Failed Quest >\n"));
3931 QUEST_IDX total = 0;
3932 for (QUEST_IDX i = 1; i < max_q_idx; i++)
3934 QUEST_IDX q_idx = quest_num[i];
3935 quest_type* const q_ptr = &quest[q_idx];
3937 if (((q_ptr->status == QUEST_STATUS_FAILED_DONE) || (q_ptr->status == QUEST_STATUS_FAILED)) &&
3938 do_cmd_knowledge_quests_aux(creature_ptr, fff, q_idx))
3944 if (!total) fprintf(fff, _(" なし\n", " Nothing.\n"));
3949 * Print all random quests
3951 static void do_cmd_knowledge_quests_wiz_random(FILE *fff)
3953 fprintf(fff, _("《残りのランダムクエスト》\n", "< Remaining Random Quest >\n"));
3954 GAME_TEXT tmp_str[120];
3955 QUEST_IDX total = 0;
3956 for (QUEST_IDX i = 1; i < max_q_idx; i++)
3958 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
3960 if ((quest[i].type == QUEST_TYPE_RANDOM) && (quest[i].status == QUEST_STATUS_TAKEN))
3963 sprintf(tmp_str, _(" %s (%d階, %s)\n", " %s (%d, %s)\n"),
3964 quest[i].name, (int)quest[i].level, r_name + r_info[quest[i].r_idx].name);
3965 fputs(tmp_str, fff);
3969 if (!total) fprintf(fff, _(" なし\n", " Nothing.\n"));
3973 * Print quest status of all active quests
3974 * @param creature_ptr プレーヤーへの参照ポインタ
3977 static void do_cmd_knowledge_quests(player_type *creature_ptr)
3980 GAME_TEXT file_name[1024];
3981 fff = my_fopen_temp(file_name, 1024);
3984 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
3990 C_MAKE(quest_num, max_q_idx, QUEST_IDX);
3992 for (IDX i = 1; i < max_q_idx; i++)
3996 ang_sort(quest_num, &dummy, max_q_idx, ang_sort_comp_quest_num, ang_sort_swap_quest_num);
3998 do_cmd_knowledge_quests_current(creature_ptr, fff);
4000 do_cmd_knowledge_quests_completed(creature_ptr, fff, quest_num);
4002 do_cmd_knowledge_quests_failed(creature_ptr, fff, quest_num);
4003 if (current_world_ptr->wizard)
4006 do_cmd_knowledge_quests_wiz_random(fff);
4010 (void)show_file(creature_ptr, TRUE, file_name, _("クエスト達成状況", "Quest status"), 0, 0);
4012 C_KILL(quest_num, max_q_idx, QUEST_IDX);
4018 * @param player_ptr プレーヤーへの参照ポインタ
4021 static void do_cmd_knowledge_home(player_type *player_ptr)
4023 process_dungeon_file(player_ptr, "w_info.txt", 0, 0, current_world_ptr->max_wild_y, current_world_ptr->max_wild_x);
4025 /* Open a new file */
4027 GAME_TEXT file_name[1024];
4028 fff = my_fopen_temp(file_name, 1024);
4031 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
4037 st_ptr = &town_info[1].store[STORE_HOME];
4039 if (st_ptr->stock_num)
4044 fprintf(fff, _(" [ 我が家のアイテム ]\n", " [Home Inventory]\n"));
4045 concptr paren = ")";
4046 GAME_TEXT o_name[MAX_NLEN];
4047 for (int i = 0; i < st_ptr->stock_num; i++)
4050 if ((i % 12) == 0) fprintf(fff, "\n ( %d ページ )\n", x++);
4051 object_desc(player_ptr, o_name, &st_ptr->stock[i], 0);
4052 if (strlen(o_name) <= 80 - 3)
4054 fprintf(fff, "%c%s %s\n", I2A(i % 12), paren, o_name);
4060 for (n = 0, t = o_name; n < 80 - 3; n++, t++)
4061 if (iskanji(*t)) { t++; n++; }
4062 if (n == 81 - 3) n = 79 - 3; /* 最後が漢字半分 */
4064 fprintf(fff, "%c%s %.*s\n", I2A(i % 12), paren, n, o_name);
4065 fprintf(fff, " %.77s\n", o_name + n);
4068 object_desc(player_ptr, o_name, &st_ptr->stock[i], 0);
4069 fprintf(fff, "%c%s %s\n", I2A(i % 12), paren, o_name);
4073 fprintf(fff, "\n\n");
4077 (void)show_file(player_ptr, TRUE, file_name, _("我が家のアイテム", "Home Inventory"), 0, 0);
4083 * Check the status of "autopick"
4085 static void do_cmd_knowledge_autopick(player_type *creature_ptr)
4087 /* Open a new file */
4089 GAME_TEXT file_name[1024];
4090 fff = my_fopen_temp(file_name, 1024);
4093 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
4100 fprintf(fff, _("自動破壊/拾いには何も登録されていません。", "No preference for auto picker/destroyer."));
4104 fprintf(fff, _(" 自動拾い/破壊には現在 %d行登録されています。\n\n",
4105 " There are %d registered lines for auto picker/destroyer.\n\n"), max_autopick);
4108 for (int k = 0; k < max_autopick; k++)
4111 byte act = autopick_list[k].action;
4112 if (act & DONT_AUTOPICK)
4114 tmp = _("放置", "Leave");
4116 else if (act & DO_AUTODESTROY)
4118 tmp = _("破壊", "Destroy");
4120 else if (act & DO_AUTOPICK)
4122 tmp = _("拾う", "Pickup");
4126 tmp = _("確認", "Query");
4129 if (act & DO_DISPLAY)
4130 fprintf(fff, "%11s", format("[%s]", tmp));
4132 fprintf(fff, "%11s", format("(%s)", tmp));
4134 tmp = autopick_line_from_entry(&autopick_list[k]);
4135 fprintf(fff, " %s", tmp);
4142 (void)show_file(creature_ptr, TRUE, file_name, _("自動拾い/破壊 設定リスト", "Auto-picker/Destroyer"), 0, 0);
4148 * Interact with "knowledge"
4150 void do_cmd_knowledge(player_type *creature_ptr)
4153 bool need_redraw = FALSE;
4154 FILE_TYPE(FILE_TYPE_TEXT);
4159 prt(format(_("%d/2 ページ", "page %d/2"), (p + 1)), 2, 65);
4160 prt(_("現在の知識を確認する", "Display current knowledge"), 3, 0);
4165 prt("(1) 既知の伝説のアイテム の一覧", 6, 5);
4166 prt("(2) 既知のアイテム の一覧", 7, 5);
4167 prt("(3) 既知の生きているユニーク・モンスター の一覧", 8, 5);
4168 prt("(4) 既知のモンスター の一覧", 9, 5);
4169 prt("(5) 倒した敵の数 の一覧", 10, 5);
4170 if (!vanilla_town) prt("(6) 賞金首 の一覧", 11, 5);
4171 prt("(7) 現在のペット の一覧", 12, 5);
4172 prt("(8) 我が家のアイテム の一覧", 13, 5);
4173 prt("(9) *鑑定*済み装備の耐性 の一覧", 14, 5);
4174 prt("(0) 地形の表示文字/タイル の一覧", 15, 5);
4178 prt("(a) 自分に関する情報 の一覧", 6, 5);
4179 prt("(b) 突然変異 の一覧", 7, 5);
4180 prt("(c) 武器の経験値 の一覧", 8, 5);
4181 prt("(d) 魔法の経験値 の一覧", 9, 5);
4182 prt("(e) 技能の経験値 の一覧", 10, 5);
4183 prt("(f) プレイヤーの徳 の一覧", 11, 5);
4184 prt("(g) 入ったダンジョン の一覧", 12, 5);
4185 prt("(h) 実行中のクエスト の一覧", 13, 5);
4186 prt("(i) 現在の自動拾い/破壊設定 の一覧", 14, 5);
4191 prt("(1) Display known artifacts", 6, 5);
4192 prt("(2) Display known objects", 7, 5);
4193 prt("(3) Display remaining uniques", 8, 5);
4194 prt("(4) Display known monster", 9, 5);
4195 prt("(5) Display kill count", 10, 5);
4196 if (!vanilla_town) prt("(6) Display wanted monsters", 11, 5);
4197 prt("(7) Display current pets", 12, 5);
4198 prt("(8) Display home inventory", 13, 5);
4199 prt("(9) Display *identified* equip.", 14, 5);
4200 prt("(0) Display terrain symbols.", 15, 5);
4204 prt("(a) Display about yourself", 6, 5);
4205 prt("(b) Display mutations", 7, 5);
4206 prt("(c) Display weapon proficiency", 8, 5);
4207 prt("(d) Display spell proficiency", 9, 5);
4208 prt("(e) Display misc. proficiency", 10, 5);
4209 prt("(f) Display virtues", 11, 5);
4210 prt("(g) Display dungeons", 12, 5);
4211 prt("(h) Display current quests", 13, 5);
4212 prt("(i) Display auto pick/destroy", 14, 5);
4215 prt(_("-続く-", "-more-"), 17, 8);
4216 prt(_("ESC) 抜ける", "ESC) Exit menu"), 21, 1);
4217 prt(_("SPACE) 次ページ", "SPACE) Next page"), 21, 30);
4218 prt(_("コマンド:", "Command: "), 20, 0);
4221 if (i == ESCAPE) break;
4224 case ' ': /* Page change */
4228 case '1': /* Artifacts */
4229 do_cmd_knowledge_artifacts(creature_ptr);
4231 case '2': /* Objects */
4232 do_cmd_knowledge_objects(creature_ptr, &need_redraw, FALSE, -1);
4234 case '3': /* Uniques */
4235 do_cmd_knowledge_uniques(creature_ptr);
4237 case '4': /* Monsters */
4238 do_cmd_knowledge_monsters(creature_ptr, &need_redraw, FALSE, -1);
4240 case '5': /* Kill count */
4241 do_cmd_knowledge_kill_count(creature_ptr);
4243 case '6': /* wanted */
4244 if (!vanilla_town) do_cmd_knowledge_bounty(creature_ptr);
4246 case '7': /* Pets */
4247 do_cmd_knowledge_pets(creature_ptr);
4249 case '8': /* Home */
4250 do_cmd_knowledge_home(creature_ptr);
4252 case '9': /* Resist list */
4253 do_cmd_knowledge_inven(creature_ptr);
4255 case '0': /* Feature list */
4257 IDX lighting_level = F_LIT_STANDARD;
4258 do_cmd_knowledge_features(&need_redraw, FALSE, -1, &lighting_level);
4262 case 'a': /* Max stat */
4263 do_cmd_knowledge_stat(creature_ptr);
4265 case 'b': /* Mutations */
4266 do_cmd_knowledge_mutations(creature_ptr);
4268 case 'c': /* weapon-exp */
4269 do_cmd_knowledge_weapon_exp(creature_ptr);
4271 case 'd': /* spell-exp */
4272 do_cmd_knowledge_spell_exp(creature_ptr);
4274 case 'e': /* skill-exp */
4275 do_cmd_knowledge_skill_exp(creature_ptr);
4277 case 'f': /* Virtues */
4278 do_cmd_knowledge_virtues(creature_ptr);
4280 case 'g': /* Dungeon */
4281 do_cmd_knowledge_dungeon(creature_ptr);
4283 case 'h': /* Quests */
4284 do_cmd_knowledge_quests(creature_ptr);
4286 case 'i': /* Autopick */
4287 do_cmd_knowledge_autopick(creature_ptr);
4289 default: /* Unknown option */
4297 if (need_redraw) do_cmd_redraw(creature_ptr);
4302 * Check on the status of an active quest
4303 * @param creature_ptr プレーヤーへの参照ポインタ
4306 void do_cmd_checkquest(player_type *creature_ptr)
4308 FILE_TYPE(FILE_TYPE_TEXT);
4310 do_cmd_knowledge_quests(creature_ptr);
4316 * Display the time and date
4317 * @param creature_ptr プレーヤーへの参照ポインタ
4320 void do_cmd_time(player_type *creature_ptr)
4323 extract_day_hour_min(creature_ptr, &day, &hour, &min);
4326 strcpy(desc, _("変な時刻だ。", "It is a strange time."));
4329 if (day < MAX_DAYS) sprintf(day_buf, "%d", day);
4330 else strcpy(day_buf, "*****");
4332 msg_format(_("%s日目, 時刻は%d:%02d %sです。", "This is day %s. The time is %d:%02d %s."),
4333 day_buf, (hour % 12 == 0) ? 12 : (hour % 12), min, (hour < 12) ? "AM" : "PM");
4336 if (!randint0(10) || creature_ptr->image)
4338 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, _("timefun_j.txt", "timefun.txt"));
4342 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, _("timenorm_j.txt", "timenorm.txt"));
4346 fff = my_fopen(buf, "rt");
4350 int full = hour * 100 + min;
4354 while (!my_fgets(fff, buf, sizeof(buf)))
4356 if (!buf[0] || (buf[0] == '#')) continue;
4357 if (buf[1] != ':') continue;
4361 start = atoi(buf + 2);
4368 end = atoi(buf + 2);
4372 if ((start > full) || (full > end)) continue;
4377 if (!randint0(num)) strcpy(desc, buf + 2);