OSDN Git Service

モンスターボールのpvalが劣化して中身のモンスターが変わってしまうバグ修正。
[hengband/hengband.git] / src / mspells1.c
index 7056e52..e8f9e25 100644 (file)
@@ -370,11 +370,10 @@ bool summon_possible(int y1, int x1)
                        if (distance(y1, x1, y, x)>2) continue;
 
                        /* ...nor on the Pattern */
-                       if ((cave[y][x].feat >= FEAT_PATTERN_START)
-                               && (cave[y][x].feat <= FEAT_PATTERN_XTRA2)) continue;
+                       if (pattern_tile(y, x)) continue;
 
-                       /* Require empty floor grid in line of sight */
-                       if ((cave_empty_bold(y, x) || (cave[y][x].feat == FEAT_TREES)) && los(y1, x1, y, x) && los(y, x, y1, x1)) return (TRUE);
+                       /* Require empty floor grid in line of projection */
+                       if (cave_empty_bold(y, x) && projectable(y1, x1, y, x) && projectable(y, x, y1, x1)) return (TRUE);
                }
        }
 
@@ -396,6 +395,7 @@ bool raise_possible(monster_type *m_ptr)
                {
                        if (distance(y, x, yy, xx) > 5) continue;
                        if (!los(y, x, yy, xx)) continue;
+                       if (!projectable(y, x, yy, xx)) continue;
 
                        c_ptr = &cave[yy][xx];
                        /* Scan the pile of objects */
@@ -558,8 +558,8 @@ u32b get_curse(int power, object_type *o_ptr)
                {
                        if (new_curse & TRC_HEAVY_MASK) continue;
                }
-               if (((o_ptr->tval < TV_BOW) || (o_ptr->tval > TV_SWORD)) && (new_curse == TRC_LOW_MELEE)) continue;
-               if (((o_ptr->tval < TV_BOOTS) || (o_ptr->tval > TV_DRAG_ARMOR)) && (new_curse == TRC_LOW_AC)) continue;
+               if (((o_ptr->tval < TV_WEAPON_BEGIN) || (o_ptr->tval > TV_WEAPON_END)) && (new_curse == TRC_LOW_MELEE)) continue;
+               if (((o_ptr->tval < TV_ARMOR_BEGIN) || (o_ptr->tval > TV_ARMOR_END)) && (new_curse == TRC_LOW_AC)) continue;
                break;
        }
        return new_curse;
@@ -580,7 +580,7 @@ void curse_equipment(int chance, int heavy_chance)
 
        object_flags(o_ptr, oflgs);
 
-       object_desc(o_name, o_ptr, FALSE, 0);
+       object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
 
        /* Extra, biased saving throw for blessed items */
        if (have_flag(oflgs, TR_BLESSED) && (randint1(888) > chance))
@@ -1318,7 +1318,7 @@ bool make_attack_spell(int m_idx)
        if (projectable(m_ptr->fy, m_ptr->fx, y, x))
        {
                /* Breath disintegration to the glyph if possible */
-               if ((!cave_floor_bold(y,x)) && (r_ptr->flags4 & RF4_BR_DISI) && one_in_(2)) do_disi = TRUE;
+               if (!have_flag(f_flags_bold(y, x), FF_PROJECT) && (f4 & RF4_BR_DISI) && one_in_(2)) do_disi = TRUE;
        }
 
        /* Check path to next grid */
@@ -1326,7 +1326,7 @@ bool make_attack_spell(int m_idx)
        {
                bool success = FALSE;
 
-               if ((r_ptr->flags4 & RF4_BR_DISI) &&
+               if ((f4 & RF4_BR_DISI) &&
                    (m_ptr->cdis < MAX_RANGE/2) &&
                    in_disintegration_range(m_ptr->fy, m_ptr->fx, y, x) &&
                    (one_in_(10) || (projectable(y, x, m_ptr->fy, m_ptr->fx) && one_in_(2))))
@@ -1361,14 +1361,8 @@ bool make_attack_spell(int m_idx)
                                /* Access the next grid */
                                c_ptr = &cave[next_y][next_x];
 
-                               /* Skip door, rubble, wall */
-                               if ((c_ptr->feat >= FEAT_DOOR_HEAD) && (c_ptr->feat <= FEAT_PERM_SOLID)) continue;
-
-                               /* Skip tree */
-                               if (c_ptr->feat == FEAT_TREES) continue;
-
-                               /* Skip mountain */
-                               if (c_ptr->feat == FEAT_MOUNTAIN) continue;
+                               /* Skip door, rubble, wall, tree, mountain, etc. */
+                               if (!have_flag(f_flags_grid(c_ptr), FF_PROJECT)) continue;
 
                                if (projectable(m_ptr->fy, m_ptr->fx, next_y, next_x))
                                {
@@ -4301,17 +4295,17 @@ else msg_format("%^s
 
                                for (k = 0; k < 30; k++)
                                {
-                                       if (!summon_possible(cy, cx) || !cave_floor_bold(cy, cx))
+                                       if (!summon_possible(cy, cx) || !cave_empty_bold(cy, cx))
                                        {
                                                int j;
                                                for (j = 100; j > 0; j--)
                                                {
                                                        scatter(&cy, &cx, y, x, 2, 0);
-                                                       if (cave_floor_bold(cy, cx)) break;
+                                                       if (cave_empty_bold(cy, cx)) break;
                                                }
                                                if (!j) break;
                                        }
-                                       if (!cave_floor_bold(cy, cx)) continue;
+                                       if (!cave_empty_bold(cy, cx)) continue;
 
                                        if (summon_named_creature(m_idx, cy, cx, MON_NAZGUL, mode))
                                        {