1 #include "market/building-monster.h"
3 #include "core/stuff-handler.h"
4 #include "monster/monster1.h"
5 #include "monster/monster2.h"
6 #include "term/gameterm.h"
7 #include "term/term-color-types.h"
8 #include "view/display-main-window.h"
11 * @brief 施設でモンスターの情報を知るメインルーチン / research_mon -KMW-
12 * @param player_ptr プレーヤーへの参照ポインタ
14 * @todo 返り値が意味不明なので直した方が良いかもしれない。
16 bool research_mon(player_type *player_ptr)
29 static int old_sym = '\0';
35 _("モンスターの文字を入力して下さい(記号 or ^A全,^Uユ,^N非ユ,^M名前):", "Enter character to be identified(^A:All,^U:Uniqs,^N:Non uniqs,^M:Name): "),
44 for (i = 0; ident_info[i]; ++i) {
45 if (sym == ident_info[i][0])
49 /* XTRA HACK WHATSEARCH */
50 if (sym == KTRL('A')) {
52 strcpy(buf, _("全モンスターのリスト", "Full monster list."));
53 } else if (sym == KTRL('U')) {
55 strcpy(buf, _("ユニーク・モンスターのリスト", "Unique monster list."));
56 } else if (sym == KTRL('N')) {
58 strcpy(buf, _("ユニーク外モンスターのリスト", "Non-unique monster list."));
59 } else if (sym == KTRL('M')) {
61 if (!get_string(_("名前(英語の場合小文字で可)", "Enter name:"), temp, 70)) {
68 sprintf(buf, _("名前:%sにマッチ", "Monsters with a name \"%s\""), temp);
69 } else if (ident_info[i]) {
70 sprintf(buf, "%c - %s.", sym, ident_info[i] + 2);
72 sprintf(buf, "%c - %s", sym, _("無効な文字", "Unknown Symbol"));
75 /* Display the result */
78 /* Allocate the "who" array */
79 C_MAKE(who, max_r_idx, MONRACE_IDX);
81 /* Collect matching monsters */
83 for (i = 1; i < max_r_idx; i++) {
84 monster_race *r_ptr = &r_info[i];
90 /* XTRA HACK WHATSEARCH */
91 /* Require non-unique monsters if needed */
92 if (norm && (r_ptr->flags1 & (RF1_UNIQUE)))
95 /* Require unique monsters if needed */
96 if (uniq && !(r_ptr->flags1 & (RF1_UNIQUE)))
101 for (int xx = 0; temp[xx] && xx < 80; xx++) {
103 if (iskanji(temp[xx])) {
108 if (isupper(temp[xx]))
109 temp[xx] = (char)tolower(temp[xx]);
114 strcpy(temp2, r_name + r_ptr->E_name);
116 strcpy(temp2, r_name + r_ptr->name);
118 for (int xx = 0; temp2[xx] && xx < 80; xx++) {
119 if (isupper(temp2[xx]))
120 temp2[xx] = (char)tolower(temp2[xx]);
124 if (my_strstr(temp2, temp) || my_strstr(r_name + r_ptr->name, temp))
126 if (my_strstr(temp2, temp))
129 } else if (all || (r_ptr->d_char == sym)) {
135 C_KILL(who, max_r_idx, MONRACE_IDX);
145 ang_sort(who, &why, n, ang_sort_comp_hook, ang_sort_swap_hook);
148 if (old_sym == sym && old_i < n)
158 Term_addstr(-1, TERM_WHITE, _(" ['r'思い出, ' 'で続行, ESC]", " [(r)ecall, ESC, space to continue]"));
161 lore_do_probe(player_ptr, r_idx);
162 monster_race_track(player_ptr, r_idx);
163 handle_stuff(player_ptr);
164 screen_roff(player_ptr, r_idx, 0x01);
197 C_KILL(who, max_r_idx, MONRACE_IDX);