OSDN Git Service

#37324 (2.2.0.28) obj-desc.spo の出力内容に、にアイテム生成chance値を追加。 / Add chance values to info...
[hengband/hengband.git] / src / mspells2.c
index e094c63..aac9f08 100644 (file)
@@ -147,17 +147,17 @@ static bool breath_direct(int y1, int x1, int y2, int x2, int rad, int typ, bool
                if (flg & PROJECT_DISI)
                {
                        if (in_disintegration_range(y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
-                       if (in_disintegration_range(y1, x1, py, px) && (distance(y1, x1, py, px) <= rad)) hityou = TRUE;
+                       if (in_disintegration_range(y1, x1, p_ptr->y, p_ptr->x) && (distance(y1, x1, p_ptr->y, p_ptr->x) <= rad)) hityou = TRUE;
                }
                else if (flg & PROJECT_LOS)
                {
                        if (los(y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
-                       if (los(y1, x1, py, px) && (distance(y1, x1, py, px) <= rad)) hityou = TRUE;
+                       if (los(y1, x1, p_ptr->y, p_ptr->x) && (distance(y1, x1, p_ptr->y, p_ptr->x) <= rad)) hityou = TRUE;
                }
                else
                {
                        if (projectable(y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
-                       if (projectable(y1, x1, py, px) && (distance(y1, x1, py, px) <= rad)) hityou = TRUE;
+                       if (projectable(y1, x1, p_ptr->y, p_ptr->x) && (distance(y1, x1, p_ptr->y, p_ptr->x) <= rad)) hityou = TRUE;
                }
        }
        else
@@ -257,11 +257,10 @@ bool monst_spell_monst(int m_idx)
 {
        int y = 0, x = 0;
        int i, k, t_idx = 0;
-       int thrown_spell, count = 0;
+       int thrown_spell;
        int dam = 0;
        int start;
        int plus = 1;
-       int rad = 0; //For elemental balls
 
        byte spell[96], num = 0;
 
@@ -290,18 +289,15 @@ bool monst_spell_monst(int m_idx)
                && (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest));
 
        bool can_use_lite_area = FALSE;
-
        bool can_remember;
 
-       bool resists_tele = FALSE;
-
        /* Cannot cast spells when confused */
        if (MON_CONFUSED(m_ptr)) return (FALSE);
 
        /* Extract the racial spell flags */
        f4 = r_ptr->flags4;
-       f5 = r_ptr->flags5;
-       f6 = r_ptr->flags6;
+       f5 = r_ptr->a_ability_flags1;
+       f6 = r_ptr->a_ability_flags2;
 
        /* Target is given for pet? */
        if (pet_t_m_idx && pet)
@@ -486,9 +482,9 @@ bool monst_spell_monst(int m_idx)
 
                                get_project_point(m_ptr->fy, m_ptr->fx, &real_y, &real_x, 0L);
 
-                               if (projectable(real_y, real_x, py, px))
+                               if (projectable(real_y, real_x, p_ptr->y, p_ptr->x))
                                {
-                                       int dist = distance(real_y, real_x, py, px);
+                                       int dist = distance(real_y, real_x, p_ptr->y, p_ptr->x);
 
                                        if (dist <= 2)
                                        {
@@ -505,7 +501,7 @@ bool monst_spell_monst(int m_idx)
                                }
                                else if (f5 & RF5_BA_LITE)
                                {
-                                       if ((distance(real_y, real_x, py, px) <= 4) && los(real_y, real_x, py, px))
+                                       if ((distance(real_y, real_x, p_ptr->y, p_ptr->x) <= 4) && los(real_y, real_x, p_ptr->y, p_ptr->x))
                                                f5 &= ~(RF5_BA_LITE);
                                }
                        }
@@ -516,7 +512,7 @@ bool monst_spell_monst(int m_idx)
                                int real_x = x;
 
                                get_project_point(m_ptr->fy, m_ptr->fx, &real_y, &real_x, PROJECT_STOP);
-                               if (projectable(real_y, real_x, py, px) && (distance(real_y, real_x, py, px) <= 2))
+                               if (projectable(real_y, real_x, p_ptr->y, p_ptr->x) && (distance(real_y, real_x, p_ptr->y, p_ptr->x) <= 2))
                                        f4 &= ~(RF4_ROCKET);
                        }