1 #include "view/display-monster-lore.h"
2 #include "lore/monster-lore.h"
3 #include "monster-race/race-flags1.h"
4 #include "monster-race/race-indice-types.h"
5 #include "term/term-color-types.h"
6 #include "world/world.h"
9 * @brief モンスター情報のヘッダを記述する
10 * Hack -- Display the "name" and "attr/chars" of a monster race
11 * @param r_idx モンスターの種族ID
14 void roff_top(MONRACE_IDX r_idx)
16 monster_race *r_ptr = &r_info[r_idx];
17 char c1 = r_ptr->d_char;
18 char c2 = r_ptr->x_char;
20 TERM_COLOR a1 = r_ptr->d_attr;
21 TERM_COLOR a2 = r_ptr->x_attr;
23 Term_erase(0, 0, 255);
28 if (!(r_ptr->flags1 & RF1_UNIQUE)) {
29 Term_addstr(-1, TERM_WHITE, "The ");
33 Term_addstr(-1, TERM_WHITE, (r_name + r_ptr->name));
35 Term_addstr(-1, TERM_WHITE, " ('");
36 Term_add_bigch(a1, c1);
37 Term_addstr(-1, TERM_WHITE, "')");
39 Term_addstr(-1, TERM_WHITE, "/('");
40 Term_add_bigch(a2, c2);
41 Term_addstr(-1, TERM_WHITE, "'):");
43 if (!current_world_ptr->wizard)
47 sprintf(buf, "%d", r_idx);
48 Term_addstr(-1, TERM_WHITE, " (");
49 Term_addstr(-1, TERM_L_BLUE, buf);
50 Term_addch(TERM_WHITE, ')');
54 * @brief モンスター情報の表示と共に画面を一時消去するサブルーチン /
55 * Hack -- describe the given monster race at the top of the screen
56 * @param r_idx モンスターの種族ID
60 void screen_roff(player_type *player_ptr, MONRACE_IDX r_idx, BIT_FLAGS mode)
63 Term_erase(0, 1, 255);
65 process_monster_lore(player_ptr, r_idx, mode);
70 * @brief モンスター情報の現在のウィンドウに表示する /
71 * Hack -- describe the given monster race in the current "term" window
72 * @param r_idx モンスターの種族ID
75 void display_roff(player_type *player_ptr)
77 for (int y = 0; y < Term->hgt; y++) {
78 Term_erase(0, y, 255);
83 MONRACE_IDX r_idx = player_ptr->monster_race_idx;
84 process_monster_lore(player_ptr, r_idx, 0);
89 * @brief モンスター詳細情報を自動スポイラー向けに出力する /
90 * Hack -- output description of the given monster race
91 * @param r_idx モンスターの種族ID
92 * @param roff_func 出力処理を行う関数ポインタ
95 void output_monster_spoiler(player_type *player_ptr, MONRACE_IDX r_idx, void (*roff_func)(TERM_COLOR attr, concptr str))
97 hook_c_roff = roff_func;
98 process_monster_lore(player_ptr, r_idx, 0x03);
101 static bool display_kill_unique(lore_type *lore_ptr)
103 if ((lore_ptr->flags1 & RF1_UNIQUE) == 0)
106 bool dead = (lore_ptr->r_ptr->max_num == 0);
107 if (lore_ptr->r_ptr->r_deaths) {
108 hooked_roff(format(_("%^sはあなたの先祖を %d 人葬っている", "%^s has slain %d of your ancestors"), wd_he[lore_ptr->msex], lore_ptr->r_ptr->r_deaths));
112 _(format("が、すでに仇討ちは果たしている!"), format(", but you have avenged %s! ", plural(lore_ptr->r_ptr->r_deaths, "him", "them"))));
115 _(format("のに、まだ仇討ちを果たしていない。"), format(", who %s unavenged. ", plural(lore_ptr->r_ptr->r_deaths, "remains", "remain"))));
120 hooked_roff(_("あなたはこの仇敵をすでに葬り去っている。", "You have slain this foe. "));
127 static bool display_killed(lore_type *lore_ptr)
129 if (lore_ptr->r_ptr->r_deaths == 0)
132 hooked_roff(_(format("このモンスターはあなたの先祖を %d 人葬っている", lore_ptr->r_ptr->r_deaths),
133 format("%d of your ancestors %s been killed by this creature, ", lore_ptr->r_ptr->r_deaths, plural(lore_ptr->r_ptr->r_deaths, "has", "have"))));
135 if (lore_ptr->r_ptr->r_pkills) {
136 hooked_roff(format(_("が、あなたはこのモンスターを少なくとも %d 体は倒している。", "and you have exterminated at least %d of the creatures. "),
137 lore_ptr->r_ptr->r_pkills));
138 } else if (lore_ptr->r_ptr->r_tkills) {
140 _("が、あなたの先祖はこのモンスターを少なくとも %d 体は倒している。", "and your ancestors have exterminated at least %d of the creatures. "),
141 lore_ptr->r_ptr->r_tkills));
143 hooked_roff(format(_("が、まだ%sを倒したことはない。", "and %s is not ever known to have been defeated. "), wd_he[lore_ptr->msex]));
150 void display_kill_numbers(lore_type *lore_ptr)
152 if ((lore_ptr->mode & 0x02) != 0)
155 if (display_kill_unique(lore_ptr))
158 if (display_killed(lore_ptr))
161 if (lore_ptr->r_ptr->r_pkills) {
163 _("あなたはこのモンスターを少なくとも %d 体は殺している。", "You have killed at least %d of these creatures. "), lore_ptr->r_ptr->r_pkills));
164 } else if (lore_ptr->r_ptr->r_tkills) {
165 hooked_roff(format(_("あなたの先祖はこのモンスターを少なくとも %d 体は殺している。", "Your ancestors have killed at least %d of these creatures. "),
166 lore_ptr->r_ptr->r_tkills));
168 hooked_roff(_("このモンスターを倒したことはない。", "No battles to the death are recalled. "));
175 * @brief どこに出没するかを表示する
176 * @param lore_ptr モンスターの思い出構造体への参照ポインタ
177 * @return たぬきならFALSE、それ以外はTRUE
179 bool display_where_to_appear(lore_type *lore_ptr)
181 lore_ptr->old = FALSE;
182 if (lore_ptr->r_ptr->level == 0) {
183 hooked_roff(format(_("%^sは町に住み", "%^s lives in the town"), wd_he[lore_ptr->msex]));
184 lore_ptr->old = TRUE;
185 } else if (lore_ptr->r_ptr->r_tkills || lore_ptr->know_everything) {
188 _("%^sは通常地下 %d フィートで出現し", "%^s is normally found at depths of %d feet"), wd_he[lore_ptr->msex], lore_ptr->r_ptr->level * 50));
190 hooked_roff(format(_("%^sは通常地下 %d 階で出現し", "%^s is normally found on dungeon level %d"), wd_he[lore_ptr->msex], lore_ptr->r_ptr->level));
193 lore_ptr->old = TRUE;
196 if (lore_ptr->r_idx == MON_CHAMELEON) {
197 hooked_roff(_("、他のモンスターに化ける。", "and can take the shape of other monster."));
202 hooked_roff(_("、", ", and "));
204 hooked_roff(format(_("%^sは", "%^s "), wd_he[lore_ptr->msex]));
205 lore_ptr->old = TRUE;
211 void display_monster_move(lore_type *lore_ptr)
215 hooked_roff("moves");
218 display_random_move(lore_ptr);
219 if (lore_ptr->speed > 110) {
220 if (lore_ptr->speed > 139)
221 hook_c_roff(TERM_RED, _("信じ難いほど", " incredibly"));
222 else if (lore_ptr->speed > 134)
223 hook_c_roff(TERM_ORANGE, _("猛烈に", " extremely"));
224 else if (lore_ptr->speed > 129)
225 hook_c_roff(TERM_ORANGE, _("非常に", " very"));
226 else if (lore_ptr->speed > 124)
227 hook_c_roff(TERM_UMBER, _("かなり", " fairly"));
228 else if (lore_ptr->speed < 120)
229 hook_c_roff(TERM_L_UMBER, _("やや", " somewhat"));
230 hook_c_roff(TERM_L_RED, _("素早く", " quickly"));
231 } else if (lore_ptr->speed < 110) {
232 if (lore_ptr->speed < 90)
233 hook_c_roff(TERM_L_GREEN, _("信じ難いほど", " incredibly"));
234 else if (lore_ptr->speed < 95)
235 hook_c_roff(TERM_BLUE, _("非常に", " very"));
236 else if (lore_ptr->speed < 100)
237 hook_c_roff(TERM_BLUE, _("かなり", " fairly"));
238 else if (lore_ptr->speed > 104)
239 hook_c_roff(TERM_GREEN, _("やや", " somewhat"));
240 hook_c_roff(TERM_L_BLUE, _("ゆっくりと", " slowly"));
242 hooked_roff(_("普通の速さで", " at normal speed"));
246 hooked_roff("動いている");
250 void display_random_move(lore_type *lore_ptr)
252 if (((lore_ptr->flags1 & RF1_RAND_50) == 0) && ((lore_ptr->flags1 & RF1_RAND_25) == 0))
255 if ((lore_ptr->flags1 & RF1_RAND_50) && (lore_ptr->flags1 & RF1_RAND_25)) {
256 hooked_roff(_("かなり", " extremely"));
257 } else if (lore_ptr->flags1 & RF1_RAND_50) {
258 hooked_roff(_("幾分", " somewhat"));
259 } else if (lore_ptr->flags1 & RF1_RAND_25) {
260 hooked_roff(_("少々", " a bit"));
263 hooked_roff(_("不規則に", " erratically"));
264 if (lore_ptr->speed != 110)
265 hooked_roff(_("、かつ", ", and"));
268 void display_monster_never_move(lore_type *lore_ptr)
270 if ((lore_ptr->flags1 & RF1_NEVER_MOVE) == 0)
274 hooked_roff(_("、しかし", ", but "));
276 hooked_roff(format(_("%^sは", "%^s "), wd_he[lore_ptr->msex]));
277 lore_ptr->old = TRUE;
280 hooked_roff(_("侵入者を追跡しない", "does not deign to chase intruders"));