2 * @brief モンスターの思い出を表示する処理
7 #include "view/display-lore.h"
8 #include "lore/monster-lore.h"
9 #include "monster-race/race-flags1.h"
10 #include "monster-race/race-flags2.h"
11 #include "monster-race/race-flags3.h"
12 #include "monster-race/race-indice-types.h"
13 #include "term/term-color-types.h"
14 #include "world/world.h"
17 * @brief モンスター情報のヘッダを記述する
18 * Hack -- Display the "name" and "attr/chars" of a monster race
19 * @param r_idx モンスターの種族ID
22 void roff_top(MONRACE_IDX r_idx)
24 monster_race *r_ptr = &r_info[r_idx];
25 char c1 = r_ptr->d_char;
26 char c2 = r_ptr->x_char;
28 TERM_COLOR a1 = r_ptr->d_attr;
29 TERM_COLOR a2 = r_ptr->x_attr;
31 Term_erase(0, 0, 255);
36 if (!(r_ptr->flags1 & RF1_UNIQUE)) {
37 Term_addstr(-1, TERM_WHITE, "The ");
41 Term_addstr(-1, TERM_WHITE, (r_name + r_ptr->name));
43 Term_addstr(-1, TERM_WHITE, " ('");
44 Term_add_bigch(a1, c1);
45 Term_addstr(-1, TERM_WHITE, "')");
47 Term_addstr(-1, TERM_WHITE, "/('");
48 Term_add_bigch(a2, c2);
49 Term_addstr(-1, TERM_WHITE, "'):");
51 if (!current_world_ptr->wizard)
55 sprintf(buf, "%d", r_idx);
56 Term_addstr(-1, TERM_WHITE, " (");
57 Term_addstr(-1, TERM_L_BLUE, buf);
58 Term_addch(TERM_WHITE, ')');
62 * @brief モンスター情報の表示と共に画面を一時消去するサブルーチン /
63 * Hack -- describe the given monster race at the top of the screen
64 * @param r_idx モンスターの種族ID
68 void screen_roff(player_type *player_ptr, MONRACE_IDX r_idx, BIT_FLAGS mode)
71 Term_erase(0, 1, 255);
73 process_monster_lore(player_ptr, r_idx, mode);
78 * @brief モンスター情報の現在のウィンドウに表示する /
79 * Hack -- describe the given monster race in the current "term" window
80 * @param r_idx モンスターの種族ID
83 void display_roff(player_type *player_ptr)
85 for (int y = 0; y < Term->hgt; y++) {
86 Term_erase(0, y, 255);
91 MONRACE_IDX r_idx = player_ptr->monster_race_idx;
92 process_monster_lore(player_ptr, r_idx, 0);
97 * @brief モンスター詳細情報を自動スポイラー向けに出力する /
98 * Hack -- output description of the given monster race
99 * @param r_idx モンスターの種族ID
100 * @param roff_func 出力処理を行う関数ポインタ
103 void output_monster_spoiler(player_type *player_ptr, MONRACE_IDX r_idx, void (*roff_func)(TERM_COLOR attr, concptr str))
105 hook_c_roff = roff_func;
106 process_monster_lore(player_ptr, r_idx, 0x03);
109 static bool display_kill_unique(lore_type *lore_ptr)
111 if ((lore_ptr->flags1 & RF1_UNIQUE) == 0)
114 bool dead = (lore_ptr->r_ptr->max_num == 0);
115 if (lore_ptr->r_ptr->r_deaths) {
116 hooked_roff(format(_("%^sはあなたの先祖を %d 人葬っている", "%^s has slain %d of your ancestors"), wd_he[lore_ptr->msex], lore_ptr->r_ptr->r_deaths));
120 _(format("が、すでに仇討ちは果たしている!"), format(", but you have avenged %s! ", plural(lore_ptr->r_ptr->r_deaths, "him", "them"))));
123 _(format("のに、まだ仇討ちを果たしていない。"), format(", who %s unavenged. ", plural(lore_ptr->r_ptr->r_deaths, "remains", "remain"))));
128 hooked_roff(_("あなたはこの仇敵をすでに葬り去っている。", "You have slain this foe. "));
135 static bool display_killed(lore_type *lore_ptr)
137 if (lore_ptr->r_ptr->r_deaths == 0)
140 hooked_roff(_(format("このモンスターはあなたの先祖を %d 人葬っている", lore_ptr->r_ptr->r_deaths),
141 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"))));
143 if (lore_ptr->r_ptr->r_pkills) {
144 hooked_roff(format(_("が、あなたはこのモンスターを少なくとも %d 体は倒している。", "and you have exterminated at least %d of the creatures. "),
145 lore_ptr->r_ptr->r_pkills));
146 } else if (lore_ptr->r_ptr->r_tkills) {
148 _("が、あなたの先祖はこのモンスターを少なくとも %d 体は倒している。", "and your ancestors have exterminated at least %d of the creatures. "),
149 lore_ptr->r_ptr->r_tkills));
151 hooked_roff(format(_("が、まだ%sを倒したことはない。", "and %s is not ever known to have been defeated. "), wd_he[lore_ptr->msex]));
158 void display_kill_numbers(lore_type *lore_ptr)
160 if ((lore_ptr->mode & 0x02) != 0)
163 if (display_kill_unique(lore_ptr))
166 if (display_killed(lore_ptr))
169 if (lore_ptr->r_ptr->r_pkills) {
171 _("あなたはこのモンスターを少なくとも %d 体は殺している。", "You have killed at least %d of these creatures. "), lore_ptr->r_ptr->r_pkills));
172 } else if (lore_ptr->r_ptr->r_tkills) {
173 hooked_roff(format(_("あなたの先祖はこのモンスターを少なくとも %d 体は殺している。", "Your ancestors have killed at least %d of these creatures. "),
174 lore_ptr->r_ptr->r_tkills));
176 hooked_roff(_("このモンスターを倒したことはない。", "No battles to the death are recalled. "));
183 * @brief どこに出没するかを表示する
184 * @param lore_ptr モンスターの思い出構造体への参照ポインタ
185 * @return たぬきならFALSE、それ以外はTRUE
187 bool display_where_to_appear(lore_type *lore_ptr)
189 lore_ptr->old = FALSE;
190 if (lore_ptr->r_ptr->level == 0) {
191 hooked_roff(format(_("%^sは町に住み", "%^s lives in the town"), wd_he[lore_ptr->msex]));
192 lore_ptr->old = TRUE;
193 } else if (lore_ptr->r_ptr->r_tkills || lore_ptr->know_everything) {
196 _("%^sは通常地下 %d フィートで出現し", "%^s is normally found at depths of %d feet"), wd_he[lore_ptr->msex], lore_ptr->r_ptr->level * 50));
198 hooked_roff(format(_("%^sは通常地下 %d 階で出現し", "%^s is normally found on dungeon level %d"), wd_he[lore_ptr->msex], lore_ptr->r_ptr->level));
201 lore_ptr->old = TRUE;
204 if (lore_ptr->r_idx == MON_CHAMELEON) {
205 hooked_roff(_("、他のモンスターに化ける。", "and can take the shape of other monster."));
210 hooked_roff(_("、", ", and "));
212 hooked_roff(format(_("%^sは", "%^s "), wd_he[lore_ptr->msex]));
213 lore_ptr->old = TRUE;
219 void display_monster_move(lore_type *lore_ptr)
223 hooked_roff("moves");
226 display_random_move(lore_ptr);
227 if (lore_ptr->speed > 110) {
228 if (lore_ptr->speed > 139)
229 hook_c_roff(TERM_RED, _("信じ難いほど", " incredibly"));
230 else if (lore_ptr->speed > 134)
231 hook_c_roff(TERM_ORANGE, _("猛烈に", " extremely"));
232 else if (lore_ptr->speed > 129)
233 hook_c_roff(TERM_ORANGE, _("非常に", " very"));
234 else if (lore_ptr->speed > 124)
235 hook_c_roff(TERM_UMBER, _("かなり", " fairly"));
236 else if (lore_ptr->speed < 120)
237 hook_c_roff(TERM_L_UMBER, _("やや", " somewhat"));
238 hook_c_roff(TERM_L_RED, _("素早く", " quickly"));
239 } else if (lore_ptr->speed < 110) {
240 if (lore_ptr->speed < 90)
241 hook_c_roff(TERM_L_GREEN, _("信じ難いほど", " incredibly"));
242 else if (lore_ptr->speed < 95)
243 hook_c_roff(TERM_BLUE, _("非常に", " very"));
244 else if (lore_ptr->speed < 100)
245 hook_c_roff(TERM_BLUE, _("かなり", " fairly"));
246 else if (lore_ptr->speed > 104)
247 hook_c_roff(TERM_GREEN, _("やや", " somewhat"));
248 hook_c_roff(TERM_L_BLUE, _("ゆっくりと", " slowly"));
250 hooked_roff(_("普通の速さで", " at normal speed"));
254 hooked_roff("動いている");
258 void display_random_move(lore_type *lore_ptr)
260 if (((lore_ptr->flags1 & RF1_RAND_50) == 0) && ((lore_ptr->flags1 & RF1_RAND_25) == 0))
263 if ((lore_ptr->flags1 & RF1_RAND_50) && (lore_ptr->flags1 & RF1_RAND_25)) {
264 hooked_roff(_("かなり", " extremely"));
265 } else if (lore_ptr->flags1 & RF1_RAND_50) {
266 hooked_roff(_("幾分", " somewhat"));
267 } else if (lore_ptr->flags1 & RF1_RAND_25) {
268 hooked_roff(_("少々", " a bit"));
271 hooked_roff(_("不規則に", " erratically"));
272 if (lore_ptr->speed != 110)
273 hooked_roff(_("、かつ", ", and"));
276 void display_monster_never_move(lore_type *lore_ptr)
278 if ((lore_ptr->flags1 & RF1_NEVER_MOVE) == 0)
282 hooked_roff(_("、しかし", ", but "));
284 hooked_roff(format(_("%^sは", "%^s "), wd_he[lore_ptr->msex]));
285 lore_ptr->old = TRUE;
288 hooked_roff(_("侵入者を追跡しない", "does not deign to chase intruders"));
291 void display_monster_kind(lore_type *lore_ptr)
293 if (((lore_ptr->flags3 & (RF3_DRAGON | RF3_DEMON | RF3_GIANT | RF3_TROLL | RF3_ORC | RF3_ANGEL)) == 0) && ((lore_ptr->flags2 & (RF2_QUANTUM | RF2_HUMAN)) == 0)) {
294 hooked_roff(_("モンスター", " creature"));
298 if (lore_ptr->flags3 & RF3_DRAGON)
299 hook_c_roff(TERM_ORANGE, _("ドラゴン", " dragon"));
301 if (lore_ptr->flags3 & RF3_DEMON)
302 hook_c_roff(TERM_VIOLET, _("デーモン", " demon"));
304 if (lore_ptr->flags3 & RF3_GIANT)
305 hook_c_roff(TERM_L_UMBER, _("巨人", " giant"));
307 if (lore_ptr->flags3 & RF3_TROLL)
308 hook_c_roff(TERM_BLUE, _("トロル", " troll"));
310 if (lore_ptr->flags3 & RF3_ORC)
311 hook_c_roff(TERM_UMBER, _("オーク", " orc"));
313 if (lore_ptr->flags2 & RF2_HUMAN)
314 hook_c_roff(TERM_L_WHITE, _("人間", " human"));
316 if (lore_ptr->flags2 & RF2_QUANTUM)
317 hook_c_roff(TERM_VIOLET, _("量子生物", " quantum creature"));
319 if (lore_ptr->flags3 & RF3_ANGEL)
320 hook_c_roff(TERM_YELLOW, _("天使", " angel"));
323 void display_monster_alignment(lore_type *lore_ptr)
325 if (lore_ptr->flags2 & RF2_ELDRITCH_HORROR)
326 hook_c_roff(TERM_VIOLET, _("狂気を誘う", " sanity-blasting"));
328 if (lore_ptr->flags3 & RF3_ANIMAL)
329 hook_c_roff(TERM_L_GREEN, _("自然界の", " natural"));
331 if (lore_ptr->flags3 & RF3_EVIL)
332 hook_c_roff(TERM_L_DARK, _("邪悪なる", " evil"));
334 if (lore_ptr->flags3 & RF3_GOOD)
335 hook_c_roff(TERM_YELLOW, _("善良な", " good"));
337 if (lore_ptr->flags3 & RF3_UNDEAD)
338 hook_c_roff(TERM_VIOLET, _("アンデッドの", " undead"));
340 if (lore_ptr->flags3 & RF3_AMBERITE)
341 hook_c_roff(TERM_VIOLET, _("アンバーの王族の", " Amberite"));
344 void display_monster_exp(player_type *player_ptr, lore_type *lore_ptr)
347 hooked_roff("を倒すことは");
349 long exp_integer = (long)lore_ptr->r_ptr->mexp * lore_ptr->r_ptr->level / (player_ptr->max_plv + 2) * 3 / 2;
351 = ((((long)lore_ptr->r_ptr->mexp * lore_ptr->r_ptr->level % (player_ptr->max_plv + 2) * 3 / 2) * (long)1000 / (player_ptr->max_plv + 2) + 5) / 10);
354 hooked_roff(format(" %d レベルのキャラクタにとって 約%ld.%02ld ポイントの経験となる。", player_ptr->lev, (long)exp_integer, (long)exp_decimal));
356 hooked_roff(format(" is worth about %ld.%02ld point%s", (long)exp_integer, (long)exp_decimal, ((exp_integer == 1) && (exp_decimal == 0)) ? "" : "s"));
360 exp_integer = player_ptr->lev % 10;
361 if ((player_ptr->lev / 10) != 1) {
362 if (exp_integer == 1)
364 else if (exp_integer == 2)
366 else if (exp_integer == 3)
372 exp_integer = player_ptr->lev;
373 if ((exp_integer == 8) || (exp_integer == 11) || (exp_integer == 18))
376 hooked_roff(format(" for a%s %lu%s level character. ", vowel, (long)exp_integer, ordinal));
380 void display_monster_aura(lore_type *lore_ptr)
382 if ((lore_ptr->flags2 & RF2_AURA_FIRE) && (lore_ptr->flags2 & RF2_AURA_ELEC) && (lore_ptr->flags3 & RF3_AURA_COLD))
384 TERM_VIOLET, format(_("%^sは炎と氷とスパークに包まれている。", "%^s is surrounded by flames, ice and electricity. "), wd_he[lore_ptr->msex]));
385 else if ((lore_ptr->flags2 & RF2_AURA_FIRE) && (lore_ptr->flags2 & RF2_AURA_ELEC))
386 hook_c_roff(TERM_L_RED, format(_("%^sは炎とスパークに包まれている。", "%^s is surrounded by flames and electricity. "), wd_he[lore_ptr->msex]));
387 else if ((lore_ptr->flags2 & RF2_AURA_FIRE) && (lore_ptr->flags3 & RF3_AURA_COLD))
388 hook_c_roff(TERM_BLUE, format(_("%^sは炎と氷に包まれている。", "%^s is surrounded by flames and ice. "), wd_he[lore_ptr->msex]));
389 else if ((lore_ptr->flags3 & RF3_AURA_COLD) && (lore_ptr->flags2 & RF2_AURA_ELEC))
390 hook_c_roff(TERM_L_GREEN, format(_("%^sは氷とスパークに包まれている。", "%^s is surrounded by ice and electricity. "), wd_he[lore_ptr->msex]));
391 else if (lore_ptr->flags2 & RF2_AURA_FIRE)
392 hook_c_roff(TERM_RED, format(_("%^sは炎に包まれている。", "%^s is surrounded by flames. "), wd_he[lore_ptr->msex]));
393 else if (lore_ptr->flags3 & RF3_AURA_COLD)
394 hook_c_roff(TERM_BLUE, format(_("%^sは氷に包まれている。", "%^s is surrounded by ice. "), wd_he[lore_ptr->msex]));
395 else if (lore_ptr->flags2 & RF2_AURA_ELEC)
396 hook_c_roff(TERM_L_BLUE, format(_("%^sはスパークに包まれている。", "%^s is surrounded by electricity. "), wd_he[lore_ptr->msex]));
399 void display_lore_this(player_type *player_ptr, lore_type *lore_ptr)
401 if ((lore_ptr->r_ptr->r_tkills == 0) && !lore_ptr->know_everything)
407 if (lore_ptr->flags1 & RF1_UNIQUE) {
408 hooked_roff("Killing this");
410 hooked_roff("A kill of this");
414 display_monster_alignment(lore_ptr);
415 display_monster_kind(lore_ptr);
416 display_monster_exp(player_ptr, lore_ptr);
419 static void display_monster_escort_contents(lore_type *lore_ptr)
421 if (!lore_ptr->reinforce)
424 hooked_roff(_("護衛の構成は", "These escorts"));
425 if ((lore_ptr->flags1 & RF1_ESCORT) || (lore_ptr->flags1 & RF1_ESCORTS)) {
426 hooked_roff(_("少なくとも", " at the least"));
431 hooked_roff(" contain ");
434 for (int n = 0; n < A_MAX; n++) {
435 bool is_reinforced = lore_ptr->r_ptr->reinforce_id[n] > 0;
436 is_reinforced &= lore_ptr->r_ptr->reinforce_dd[n] > 0;
437 is_reinforced &= lore_ptr->r_ptr->reinforce_ds[n] > 0;
441 monster_race *rf_ptr = &r_info[lore_ptr->r_ptr->reinforce_id[n]];
442 if (rf_ptr->flags1 & RF1_UNIQUE) {
443 hooked_roff(format(_("、%s", ", %s"), r_name + rf_ptr->name));
448 hooked_roff(format("、 %dd%d 体の%s", lore_ptr->r_ptr->reinforce_dd[n], lore_ptr->r_ptr->reinforce_ds[n], r_name + rf_ptr->name));
450 bool plural = (lore_ptr->r_ptr->reinforce_dd[n] * lore_ptr->r_ptr->reinforce_ds[n] > 1);
451 GAME_TEXT name[MAX_NLEN];
452 strcpy(name, r_name + rf_ptr->name);
455 hooked_roff(format(",%dd%d %s", lore_ptr->r_ptr->reinforce_dd[n], lore_ptr->r_ptr->reinforce_ds[n], name));
459 hooked_roff(_("で成り立っている。", "."));
462 void display_monster_collective(lore_type *lore_ptr)
464 if ((lore_ptr->flags1 & RF1_ESCORT) || (lore_ptr->flags1 & RF1_ESCORTS) || lore_ptr->reinforce) {
465 hooked_roff(format(_("%^sは通常護衛を伴って現れる。", "%^s usually appears with escorts. "), wd_he[lore_ptr->msex]));
466 display_monster_escort_contents(lore_ptr);
468 else if (lore_ptr->flags1 & RF1_FRIENDS) {
469 hooked_roff(format(_("%^sは通常集団で現れる。", "%^s usually appears in groups. "), wd_he[lore_ptr->msex]));