OSDN Git Service

[Refctor] #40014 Separated display_lore_this() from process_monster_lore()
authorHourier <hourier@users.sourceforge.jp>
Fri, 12 Jun 2020 09:49:36 +0000 (18:49 +0900)
committerHourier <hourier@users.sourceforge.jp>
Fri, 12 Jun 2020 09:49:36 +0000 (18:49 +0900)
src/lore/monster-lore.c
src/view/display-monster-lore.c
src/view/display-monster-lore.h

index d328dbe..e98b778 100644 (file)
@@ -308,22 +308,7 @@ void process_monster_lore(player_type *player_ptr, MONRACE_IDX r_idx, BIT_FLAGS
         lore_ptr->old = FALSE;
     }
 
-    if (lore_ptr->r_ptr->r_tkills || lore_ptr->know_everything) {
-#ifdef JP
-        hooked_roff("この");
-#else
-        if (lore_ptr->flags1 & RF1_UNIQUE) {
-            hooked_roff("Killing this");
-        } else {
-            hooked_roff("A kill of this");
-        }
-#endif
-
-        display_monster_alignment(lore_ptr);
-        display_monster_kind(lore_ptr);
-        display_monster_exp(player_ptr, lore_ptr);
-    }
-
+    display_lore_this(player_ptr, lore_ptr);
     display_monster_aura(lore_ptr);
     if (lore_ptr->flags2 & RF2_REFLECTING)
         hooked_roff(format(_("%^sは矢の呪文を跳ね返す。", "%^s reflects bolt spells.  "), wd_he[lore_ptr->msex]));
index 35bf269..0840842 100644 (file)
@@ -389,3 +389,23 @@ void display_monster_aura(lore_type *lore_ptr)
     else if (lore_ptr->flags2 & RF2_AURA_ELEC)
         hook_c_roff(TERM_L_BLUE, format(_("%^sはスパークに包まれている。", "%^s is surrounded by electricity.  "), wd_he[lore_ptr->msex]));
 }
+
+void display_lore_this(player_type *player_ptr, lore_type *lore_ptr)
+{
+    if ((lore_ptr->r_ptr->r_tkills == 0) && !lore_ptr->know_everything)
+        return;
+
+#ifdef JP
+    hooked_roff("この");
+#else
+    if (lore_ptr->flags1 & RF1_UNIQUE) {
+        hooked_roff("Killing this");
+    } else {
+        hooked_roff("A kill of this");
+    }
+#endif
+
+    display_monster_alignment(lore_ptr);
+    display_monster_kind(lore_ptr);
+    display_monster_exp(player_ptr, lore_ptr);
+}
index ab49a52..5f1178b 100644 (file)
@@ -16,3 +16,4 @@ void display_monster_kind(lore_type *lore_ptr);
 void display_monster_alignment(lore_type *lore_ptr);
 void display_monster_exp(player_type *player_ptr, lore_type *lore_ptr);
 void display_monster_aura(lore_type *lore_ptr);
+void display_lore_this(player_type *player_ptr, lore_type *lore_ptr);