OSDN Git Service

[Refactor] #38997 chg_virtue() に player_type * 引数を追加.
[hengband/hengband.git] / src / selfinfo.c
index 04510cb..c49aa4c 100644 (file)
  */
 
 #include "angband.h"
+#include "util.h"
+
 #include "player-status.h"
+#include "player-race.h"
+#include "player-class.h"
 #include "avatar.h"
+#include "realm.h"
 #include "realm-hex.h"
+#include "realm-song.h"
 
 /*!
  * @brief 自己分析処理(Nethackからのアイデア) / self-knowledge... idea from nethack.
@@ -74,17 +80,15 @@ void self_knowledge(void)
        info[i++] = buf[0];
        info[i++] = "";
 
-       chg_virtue(V_KNOWLEDGE, 1);
-       chg_virtue(V_ENLIGHTEN, 1);
+       chg_virtue(p_ptr, V_KNOWLEDGE, 1);
+       chg_virtue(p_ptr, V_ENLIGHTEN, 1);
 
        /* Acquire item flags from equipment */
        for (k = INVEN_RARM; k < INVEN_TOTAL; k++)
        {
                u32b tflgs[TR_FLAG_SIZE];
 
-               o_ptr = &inventory[k];
-
-               /* Skip non-objects */
+               o_ptr = &p_ptr->inventory_list[k];
                if (!o_ptr->k_idx) continue;
                object_flags(o_ptr, tflgs);
 
@@ -1249,7 +1253,7 @@ void self_knowledge(void)
                info[i++] = _("あなたは電撃への耐性を持っている。", "You are resistant to lightning.");
        }
 
-       if (prace_is_(RACE_ANDROID) && !p_ptr->immune_elec)
+       if (PRACE_IS_(p_ptr, RACE_ANDROID) && !p_ptr->immune_elec)
        {
                info[i++] = _("あなたは電撃に弱い。", "You are susceptible to damage from lightning.");
        }
@@ -1267,7 +1271,7 @@ void self_knowledge(void)
                info[i++] = _("あなたは火への耐性を持っている。", "You are resistant to fire.");
        }
 
-       if (prace_is_(RACE_ENT) && !p_ptr->immune_fire)
+       if (PRACE_IS_(p_ptr, RACE_ENT) && !p_ptr->immune_fire)
        {
                info[i++] = _("あなたは火に弱い。", "You are susceptible to damage from fire.");
        }
@@ -1299,12 +1303,12 @@ void self_knowledge(void)
                info[i++] = _("あなたは閃光への耐性を持っている。", "You are resistant to bright light.");
        }
 
-       if (prace_is_(RACE_VAMPIRE) || prace_is_(RACE_S_FAIRY) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
+       if (PRACE_IS_(p_ptr, RACE_VAMPIRE) || PRACE_IS_(p_ptr, RACE_S_FAIRY) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
        {
                info[i++] = _("あなたは閃光に弱い。", "You are susceptible to damage from bright light.");
        }
 
-       if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form)
+       if (PRACE_IS_(p_ptr, RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form)
        {
                info[i++] = _("あなたは暗黒に対する完全なる免疫を持っている。", "You are completely immune to darkness.");
        }
@@ -1338,7 +1342,7 @@ void self_knowledge(void)
                info[i++] = _("あなたは因果混乱の攻撃への耐性を持っている。", "You are resistant to nexus attacks.");
        }
 
-       if (prace_is_(RACE_SPECTRE))
+       if (PRACE_IS_(p_ptr, RACE_SPECTRE))
        {
                info[i++] = _("あなたは地獄の力を吸収できる。", "You can drain nether forces.");
        }
@@ -1436,7 +1440,7 @@ void self_knowledge(void)
 
 
        /* Access the current weapon */
-       o_ptr = &inventory[INVEN_RARM];
+       o_ptr = &p_ptr->inventory_list[INVEN_RARM];
 
        /* Analyze the weapon */
        if (o_ptr->k_idx)