1 #include "market/building-monster.h"
2 #include "core/asking-player.h"
4 #include "core/stuff-handler.h"
5 #include "game-option/game-play-options.h"
6 #include "io/input-key-acceptor.h"
7 #include "monster-race/monster-race.h"
8 #include "monster-race/race-flags1.h"
9 #include "lore/lore-store.h"
10 #include "term/gameterm.h"
11 #include "term/screen-processor.h"
12 #include "term/term-color-types.h"
13 #include "util/int-char-converter.h"
14 #include "util/string-processor.h"
15 #include "view/display-lore.h"
18 * @brief 施設でモンスターの情報を知るメインルーチン / research_mon -KMW-
19 * @param player_ptr プレーヤーへの参照ポインタ
21 * @todo 返り値が意味不明なので直した方が良いかもしれない。
23 bool research_mon(player_type *player_ptr)
36 static int old_sym = '\0';
42 _("モンスターの文字を入力して下さい(記号 or ^A全,^Uユ,^N非ユ,^M名前):", "Enter character to be identified(^A:All,^U:Uniqs,^N:Non uniqs,^M:Name): "),
51 for (i = 0; ident_info[i]; ++i) {
52 if (sym == ident_info[i][0])
56 /* XTRA HACK WHATSEARCH */
57 if (sym == KTRL('A')) {
59 strcpy(buf, _("全モンスターのリスト", "Full monster list."));
60 } else if (sym == KTRL('U')) {
62 strcpy(buf, _("ユニーク・モンスターのリスト", "Unique monster list."));
63 } else if (sym == KTRL('N')) {
65 strcpy(buf, _("ユニーク外モンスターのリスト", "Non-unique monster list."));
66 } else if (sym == KTRL('M')) {
68 if (!get_string(_("名前(英語の場合小文字で可)", "Enter name:"), temp, 70)) {
75 sprintf(buf, _("名前:%sにマッチ", "Monsters with a name \"%s\""), temp);
76 } else if (ident_info[i]) {
77 sprintf(buf, "%c - %s.", sym, ident_info[i] + 2);
79 sprintf(buf, "%c - %s", sym, _("無効な文字", "Unknown Symbol"));
82 /* Display the result */
85 /* Allocate the "who" array */
86 C_MAKE(who, max_r_idx, MONRACE_IDX);
88 /* Collect matching monsters */
90 for (i = 1; i < max_r_idx; i++) {
91 monster_race *r_ptr = &r_info[i];
97 /* XTRA HACK WHATSEARCH */
98 /* Require non-unique monsters if needed */
99 if (norm && (r_ptr->flags1 & (RF1_UNIQUE)))
102 /* Require unique monsters if needed */
103 if (uniq && !(r_ptr->flags1 & (RF1_UNIQUE)))
108 for (int xx = 0; temp[xx] && xx < 80; xx++) {
110 if (iskanji(temp[xx])) {
115 if (isupper(temp[xx]))
116 temp[xx] = (char)tolower(temp[xx]);
121 strcpy(temp2, r_name + r_ptr->E_name);
123 strcpy(temp2, r_name + r_ptr->name);
125 for (int xx = 0; temp2[xx] && xx < 80; xx++) {
126 if (isupper(temp2[xx]))
127 temp2[xx] = (char)tolower(temp2[xx]);
131 if (angband_strstr(temp2, temp) || angband_strstr(r_name + r_ptr->name, temp))
133 if (angband_strstr(temp2, temp))
136 } else if (all || (r_ptr->d_char == sym)) {
142 C_KILL(who, max_r_idx, MONRACE_IDX);
152 ang_sort(player_ptr, who, &why, n, ang_sort_comp_hook, ang_sort_swap_hook);
155 if (old_sym == sym && old_i < n)
165 term_addstr(-1, TERM_WHITE, _(" ['r'思い出, ' 'で続行, ESC]", " [(r)ecall, ESC, space to continue]"));
168 lore_do_probe(player_ptr, r_idx);
169 monster_race_track(player_ptr, r_idx);
170 handle_stuff(player_ptr);
171 screen_roff(player_ptr, r_idx, 0x01);
204 C_KILL(who, max_r_idx, MONRACE_IDX);