From 9635e6e1a0c2eb5f076049eb1c6697a23fd7b5d5 Mon Sep 17 00:00:00 2001 From: Hourier Date: Thu, 11 Jun 2020 22:55:37 +0900 Subject: [PATCH] [Refactor] #40414 Separated display_never_move() from process_monster_lore() --- src/lore/monster-lore.c | 17 ++++++----------- src/view/display-monster-lore.c | 15 +++++++++++++++ src/view/display-monster-lore.h | 1 + 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/lore/monster-lore.c b/src/lore/monster-lore.c index e87a8818a..e156194c7 100644 --- a/src/lore/monster-lore.c +++ b/src/lore/monster-lore.c @@ -302,17 +302,7 @@ void process_monster_lore(player_type *player_ptr, MONRACE_IDX r_idx, BIT_FLAGS return; display_monster_move(lore_ptr); - if (lore_ptr->flags1 & RF1_NEVER_MOVE) { - if (lore_ptr->old) { - hooked_roff(_("、しかし", ", but ")); - } else { - hooked_roff(format(_("%^sは", "%^s "), wd_he[lore_ptr->msex])); - lore_ptr->old = TRUE; - } - - hooked_roff(_("侵入者を追跡しない", "does not deign to chase intruders")); - } - + display_monster_never_move(lore_ptr); if (lore_ptr->old) { hooked_roff(_("。", ". ")); lore_ptr->old = FALSE; @@ -331,14 +321,19 @@ void process_monster_lore(player_type *player_ptr, MONRACE_IDX r_idx, BIT_FLAGS if (lore_ptr->flags2 & RF2_ELDRITCH_HORROR) hook_c_roff(TERM_VIOLET, _("狂気を誘う", " sanity-blasting")); + if (lore_ptr->flags3 & RF3_ANIMAL) hook_c_roff(TERM_L_GREEN, _("自然界の", " natural")); + if (lore_ptr->flags3 & RF3_EVIL) hook_c_roff(TERM_L_DARK, _("邪悪なる", " evil")); + if (lore_ptr->flags3 & RF3_GOOD) hook_c_roff(TERM_YELLOW, _("善良な", " good")); + if (lore_ptr->flags3 & RF3_UNDEAD) hook_c_roff(TERM_VIOLET, _("アンデッドの", " undead")); + if (lore_ptr->flags3 & RF3_AMBERITE) hook_c_roff(TERM_VIOLET, _("アンバーの王族の", " Amberite")); diff --git a/src/view/display-monster-lore.c b/src/view/display-monster-lore.c index a8799b9de..9bc674ebd 100644 --- a/src/view/display-monster-lore.c +++ b/src/view/display-monster-lore.c @@ -264,3 +264,18 @@ void display_random_move(lore_type *lore_ptr) if (lore_ptr->speed != 110) hooked_roff(_("、かつ", ", and")); } + +void display_monster_never_move(lore_type *lore_ptr) +{ + if ((lore_ptr->flags1 & RF1_NEVER_MOVE) == 0) + return; + + if (lore_ptr->old) { + hooked_roff(_("、しかし", ", but ")); + } else { + hooked_roff(format(_("%^sは", "%^s "), wd_he[lore_ptr->msex])); + lore_ptr->old = TRUE; + } + + hooked_roff(_("侵入者を追跡しない", "does not deign to chase intruders")); +} diff --git a/src/view/display-monster-lore.h b/src/view/display-monster-lore.h index f78255488..784c230fa 100644 --- a/src/view/display-monster-lore.h +++ b/src/view/display-monster-lore.h @@ -11,3 +11,4 @@ void display_kill_numbers(lore_type *lore_ptr); bool display_where_to_appear(lore_type *lore_ptr); void display_random_move(lore_type *lore_ptr); void display_monster_move(lore_type *lore_ptr); +void display_monster_never_move(lore_type *lore_ptr); -- 2.11.0