OSDN Git Service

[Refactor] #37353 自己分析処理を selfinfo.c/h に分離。 / Separate self knoledge spells to selfin...
[hengband/hengband.git] / src / mutation.c
index 81065c4..aa4ec13 100644 (file)
@@ -12,6 +12,7 @@
  */
 
 #include "angband.h"
+#include "selfinfo.h"
 
 /*!
  * @brief プレイヤーに突然変異を与える
@@ -1478,6 +1479,19 @@ bool lose_mutation(int choose_mut)
        }
 }
 
+void lose_all_mutations(void)
+{
+       if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3)
+       {
+               chg_virtue(V_CHANCE, -5);
+               msg_print(_("全ての突然変異が治った。", "You are cured of all mutations."));
+               p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
+               p_ptr->update |= PU_BONUS;
+               handle_stuff();
+               mutant_regenerate_mod = calc_mutant_regenerate_mod();
+       }
+}
+
 /*!
  * @brief ファイルポインタを通じて突然変異の一覧を出力する
  * @param OutFile 出力先ファイルポインタ
@@ -2010,7 +2024,7 @@ void do_cmd_knowledge_mutations(void)
  * @param x ビット数を調べたい変数
  * @return ビット数
  */
-int count_bits(u32b x)
+int count_bits(BIT_FLAGS x)
 {
        int n = 0;
 
@@ -2073,7 +2087,7 @@ int calc_mutant_regenerate_mod(void)
  * @brief 突然変異レイシャル上で口を使うよりを行った際に歌や呪術を停止する /
  * @return なし
  */
-void mutation_stop_mouth()
+static void mutation_stop_mouth(void)
 {
        if (music_singing_any()) stop_singing();
        if (hex_spelling_any()) stop_hex_spell_all();
@@ -2106,7 +2120,7 @@ bool mutation_power_aux(u32b power)
                        mutation_stop_mouth();
                        msg_print(_("あなたは火炎のブレスを吐いた...", "You breathe fire..."));
 
-                       fire_ball(GF_FIRE, dir, lvl * 2, 1 + (lvl / 20));
+                       fire_breath(GF_FIRE, dir, lvl * 2, 1 + (lvl / 20));
                        break;
 
                case MUT1_HYPN_GAZE:
@@ -2149,8 +2163,8 @@ bool mutation_power_aux(u32b power)
 
                                /* Only works on adjacent monsters */
                                if (!get_rep_dir2(&dir)) return FALSE;
-                               y = py + ddy[dir];
-                               x = px + ddx[dir];
+                               y = p_ptr->y + ddy[dir];
+                               x = p_ptr->x + ddx[dir];
                                c_ptr = &cave[y][x];
 
                                mutation_stop_mouth();
@@ -2167,7 +2181,7 @@ bool mutation_power_aux(u32b power)
 
                                dummy = lvl * 2;
 
-                               if (drain_life(dir, dummy))
+                               if (hypodynamic_bolt(dir, dummy))
                                {
                                        if (p_ptr->food < PY_FOOD_FULL)
                                                /* No heal if we are "full" */
@@ -2210,8 +2224,8 @@ bool mutation_power_aux(u32b power)
                                feature_type *f_ptr, *mimic_f_ptr;
 
                                if (!get_rep_dir2(&dir)) return FALSE;
-                               y = py + ddy[dir];
-                               x = px + ddx[dir];
+                               y = p_ptr->y + ddy[dir];
+                               x = p_ptr->x + ddx[dir];
                                c_ptr = &cave[y][x];
                                f_ptr = &f_info[c_ptr->feat];
                                mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)];
@@ -2326,7 +2340,7 @@ bool mutation_power_aux(u32b power)
                                int i;
                                for (i = 0; i < 8; i++)
                                {
-                                       summon_specific(-1, py, px, lvl, SUMMON_MOLD, PM_FORCE_PET);
+                                       summon_specific(-1, p_ptr->y, p_ptr->x, lvl, SUMMON_MOLD, PM_FORCE_PET);
                                }
                        }
                        break;
@@ -2334,7 +2348,7 @@ bool mutation_power_aux(u32b power)
                case MUT1_RESIST:
                        {
                                int num = lvl / 10;
-                               int dur = randint1(20) + 20;
+                               TIME_EFFECT dur = randint1(20) + 20;
 
                                if (randint0(5) < num)
                                {
@@ -2365,7 +2379,7 @@ bool mutation_power_aux(u32b power)
                        break;
 
                case MUT1_EARTHQUAKE:
-                       (void)earthquake(py, px, 10);
+                       (void)earthquake(p_ptr->y, p_ptr->x, 10);
                        break;
 
                case MUT1_EAT_MAGIC:
@@ -2394,8 +2408,8 @@ bool mutation_power_aux(u32b power)
                                int x, y;
 
                                if (!get_rep_dir2(&dir)) return FALSE;
-                               y = py + ddy[dir];
-                               x = px + ddx[dir];
+                               y = p_ptr->y + ddy[dir];
+                               x = p_ptr->x + ddx[dir];
                                if (cave[y][x].m_idx)
                                {
                                        py_attack(y, x, 0);
@@ -2435,8 +2449,8 @@ bool mutation_power_aux(u32b power)
                                monster_race *r_ptr;
 
                                if (!get_rep_dir2(&dir)) return FALSE;
-                               y = py + ddy[dir];
-                               x = px + ddx[dir];
+                               y = p_ptr->y + ddy[dir];
+                               x = p_ptr->x + ddx[dir];
                                c_ptr = &cave[y][x];
 
                                if (!c_ptr->m_idx)
@@ -2484,8 +2498,8 @@ bool mutation_power_aux(u32b power)
                                cave_type *c_ptr;
 
                                if (!get_rep_dir2(&dir)) return FALSE;
-                               y = py + ddy[dir];
-                               x = px + ddx[dir];
+                               y = p_ptr->y + ddy[dir];
+                               x = p_ptr->x + ddx[dir];
                                c_ptr = &cave[y][x];
 
                                if (!c_ptr->m_idx)