OSDN Git Service

[Refactor] #40647 Moved set_high_resistance_info() from self-info.c to resisntance...
authorHourier <hourier@users.sourceforge.jp>
Fri, 21 Aug 2020 03:36:54 +0000 (12:36 +0900)
committerHourier <hourier@users.sourceforge.jp>
Fri, 21 Aug 2020 03:36:54 +0000 (12:36 +0900)
src/player-info/resistance-info.c
src/player-info/resistance-info.h
src/player-info/self-info.c

index a031de7..d3894ab 100644 (file)
@@ -51,3 +51,41 @@ void set_element_resistance_info(player_type* creature_ptr, self_info_type* si_p
         si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Í\93Å\82Ö\82Ì\91Ï\90«\82ð\8e\9d\82Á\82Ä\82¢\82é\81B", "You are resistant to poison.");
     }
 }
+
+void set_high_resistance_info(player_type *creature_ptr, self_info_type *si_ptr)
+{
+    if (creature_ptr->resist_lite)
+        si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Í\91M\8cõ\82Ö\82Ì\91Ï\90«\82ð\8e\9d\82Á\82Ä\82¢\82é\81B", "You are resistant to bright light.");
+
+    if (is_specific_player_race(creature_ptr, RACE_VAMPIRE) || is_specific_player_race(creature_ptr, RACE_S_FAIRY)
+        || (creature_ptr->mimic_form == MIMIC_VAMPIRE))
+        si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Í\91M\8cõ\82É\8eã\82¢\81B", "You are susceptible to damage from bright light.");
+
+    if (is_specific_player_race(creature_ptr, RACE_VAMPIRE) || (creature_ptr->mimic_form == MIMIC_VAMPIRE) || creature_ptr->wraith_form)
+        si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Í\88Ã\8d\95\82É\91Î\82·\82é\8a®\91S\82È\82é\96Æ\89u\82ð\8e\9d\82Á\82Ä\82¢\82é\81B", "You are completely immune to darkness.");
+    else if (creature_ptr->resist_dark)
+        si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Í\88Ã\8d\95\82Ö\82Ì\91Ï\90«\82ð\8e\9d\82Á\82Ä\82¢\82é\81B", "You are resistant to darkness.");
+    
+    if (creature_ptr->resist_conf)
+        si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Í\8d¬\97\90\82Ö\82Ì\91Ï\90«\82ð\8e\9d\82Á\82Ä\82¢\82é\81B", "You are resistant to confusion.");
+    
+    if (creature_ptr->resist_sound)
+        si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Í\89¹\94g\82Ì\8fÕ\8c\82\82Ö\82Ì\91Ï\90«\82ð\8e\9d\82Á\82Ä\82¢\82é\81B", "You are resistant to sonic attacks.");
+    
+    if (creature_ptr->resist_disen)
+        si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Í\97ò\89»\82Ö\82Ì\91Ï\90«\82ð\8e\9d\82Á\82Ä\82¢\82é\81B", "You are resistant to disenchantment.");
+    
+    if (creature_ptr->resist_chaos)
+        si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Í\83J\83I\83X\82Ì\97Í\82Ö\82Ì\91Ï\90«\82ð\8e\9d\82Á\82Ä\82¢\82é\81B", "You are resistant to chaos.");
+    
+    if (creature_ptr->resist_shard)
+        si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Í\94j\95Ð\82Ì\8dU\8c\82\82Ö\82Ì\91Ï\90«\82ð\8e\9d\82Á\82Ä\82¢\82é\81B", "You are resistant to blasts of shards.");
+    
+    if (creature_ptr->resist_nexus)
+        si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Í\88ö\89Ê\8d¬\97\90\82Ì\8dU\8c\82\82Ö\82Ì\91Ï\90«\82ð\8e\9d\82Á\82Ä\82¢\82é\81B", "You are resistant to nexus attacks.");
+
+    if (is_specific_player_race(creature_ptr, RACE_SPECTRE))
+        si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Í\92n\8d\96\82Ì\97Í\82ð\8bz\8eû\82Å\82«\82é\81B", "You can drain nether forces.");
+    else if (creature_ptr->resist_neth)
+        si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Í\92n\8d\96\82Ì\97Í\82Ö\82Ì\91Ï\90«\82ð\8e\9d\82Á\82Ä\82¢\82é\81B", "You are resistant to nether forces.");
+}
index 8b6fa74..e5aa46a 100644 (file)
@@ -4,3 +4,4 @@
 
 typedef struct self_info_type self_info_type;
 void set_element_resistance_info(player_type *creature_ptr, self_info_type *si_ptr);
+void set_high_resistance_info(player_type *creature_ptr, self_info_type *si_ptr);
index f2af6b9..d6df64a 100644 (file)
@@ -366,44 +366,7 @@ void self_knowledge(player_type *creature_ptr)
     set_esp_info(creature_ptr, si_ptr);
     set_body_improvement_info_3(creature_ptr, si_ptr);
     set_element_resistance_info(creature_ptr, si_ptr);
-    if (creature_ptr->resist_lite) {
-        si_ptr->info[si_ptr->line++] = _("あなたは閃光への耐性を持っている。", "You are resistant to bright light.");
-    }
-
-    if (is_specific_player_race(creature_ptr, RACE_VAMPIRE) || is_specific_player_race(creature_ptr, RACE_S_FAIRY)
-        || (creature_ptr->mimic_form == MIMIC_VAMPIRE)) {
-        si_ptr->info[si_ptr->line++] = _("あなたは閃光に弱い。", "You are susceptible to damage from bright light.");
-    }
-
-    if (is_specific_player_race(creature_ptr, RACE_VAMPIRE) || (creature_ptr->mimic_form == MIMIC_VAMPIRE) || creature_ptr->wraith_form) {
-        si_ptr->info[si_ptr->line++] = _("あなたは暗黒に対する完全なる免疫を持っている。", "You are completely immune to darkness.");
-    } else if (creature_ptr->resist_dark) {
-        si_ptr->info[si_ptr->line++] = _("あなたは暗黒への耐性を持っている。", "You are resistant to darkness.");
-    }
-    if (creature_ptr->resist_conf) {
-        si_ptr->info[si_ptr->line++] = _("あなたは混乱への耐性を持っている。", "You are resistant to confusion.");
-    }
-    if (creature_ptr->resist_sound) {
-        si_ptr->info[si_ptr->line++] = _("あなたは音波の衝撃への耐性を持っている。", "You are resistant to sonic attacks.");
-    }
-    if (creature_ptr->resist_disen) {
-        si_ptr->info[si_ptr->line++] = _("あなたは劣化への耐性を持っている。", "You are resistant to disenchantment.");
-    }
-    if (creature_ptr->resist_chaos) {
-        si_ptr->info[si_ptr->line++] = _("あなたはカオスの力への耐性を持っている。", "You are resistant to chaos.");
-    }
-    if (creature_ptr->resist_shard) {
-        si_ptr->info[si_ptr->line++] = _("あなたは破片の攻撃への耐性を持っている。", "You are resistant to blasts of shards.");
-    }
-    if (creature_ptr->resist_nexus) {
-        si_ptr->info[si_ptr->line++] = _("あなたは因果混乱の攻撃への耐性を持っている。", "You are resistant to nexus attacks.");
-    }
-
-    if (is_specific_player_race(creature_ptr, RACE_SPECTRE)) {
-        si_ptr->info[si_ptr->line++] = _("あなたは地獄の力を吸収できる。", "You can drain nether forces.");
-    } else if (creature_ptr->resist_neth) {
-        si_ptr->info[si_ptr->line++] = _("あなたは地獄の力への耐性を持っている。", "You are resistant to nether forces.");
-    }
+    set_high_resistance_info(creature_ptr, si_ptr);
     if (creature_ptr->resist_fear) {
         si_ptr->info[si_ptr->line++] = _("あなたは全く恐怖を感じない。", "You are completely fearless.");
     }