OSDN Git Service

cave_naked_bold()に関する変更.
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Mon, 24 Nov 2003 18:31:00 +0000 (18:31 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Mon, 24 Nov 2003 18:31:00 +0000 (18:31 +0000)
* 条件に "PROJECTが必要" "DOORでないこと" 追加. これにより, "ドア生
  成", "石の壁" などで木をドア/壁に変えてしまうバグを修正.
* デバッグコマンド ^A H でモンスターの大群を召喚する場所の判定を
  cave_naked_bold()ではなくcave_empty_bold()に変更.
以下の変更を含む.
* project_f()で, GF_LAVA_FLOWとGF_WATER_FLOWの処理でdam--;する部分に
  意味はないので削除.

src/defines.h
src/spells1.c
src/wizard2.c

index 259903b..e190ed1 100644 (file)
 /*
  * Determine if a "legal" grid is an "naked" floor grid
  *
- * Line 1 -- forbid non-placers
+ * Line 1 -- forbid non-projectables
  * Line 2 -- forbid non-droppers
- * Line 3 -- forbid permanent
- * Line 4 -- forbid object terrains
- * Line 5 -- forbid normal objects
- * Line 6 -- forbid monsters
- * Line 7 -- forbid the player
+ * Line 3 -- forbid doors
+ * Line 4 -- forbid permanent
+ * Line 5 -- forbid object terrains
+ * Line 6 -- forbid normal objects
+ * Line 7 -- forbid monsters
+ * Line 8 -- forbid the player
  */
 #define cave_naked_bold(Y,X) \
-       (have_flag(f_flags_bold((Y), (X)), FF_DROP) && \
+       (have_flag(f_flags_bold((Y), (X)), FF_PROJECT) && \
+        have_flag(f_flags_bold((Y), (X)), FF_DROP) && \
+        !have_flag(f_flags_bold((Y), (X)), FF_DOOR) && \
         !have_flag(f_flags_bold((Y), (X)), FF_PERMANENT) && \
         !(cave[Y][X].info & CAVE_OBJECT) && \
         !(cave[Y][X].o_idx) && \
index d9d24bc..c52d46d 100644 (file)
@@ -977,7 +977,7 @@ static bool project_f(int who, int r, int y, int x, int dam, int typ)
                case GF_LAVA_FLOW:
                {
                        /* Shallow Lava */
-                       if(dam == 1)
+                       if (dam == 1)
                        {
                                /* Require a "naked" floor grid */
                                if (!cave_naked_bold(y, x)) break;
@@ -986,16 +986,13 @@ static bool project_f(int who, int r, int y, int x, int dam, int typ)
                                cave_set_feat(y, x, FEAT_SHAL_LAVA);
                        }
                        /* Deep Lava */
-                       else
+                       else if (dam)
                        {
                                /* Require a "naked" floor grid */
-                               if (cave_perma_bold(y, x) || !dam) break;
+                               if (cave_perma_bold(y, x)) break;
 
                                /* Place a deep lava */
                                cave_set_feat(y, x, FEAT_DEEP_LAVA);
-
-                               /* Dam is used as a counter for the number of grid to convert */
-                               dam--;
                        }
                        break;
                }
@@ -1003,7 +1000,7 @@ static bool project_f(int who, int r, int y, int x, int dam, int typ)
                case GF_WATER_FLOW:
                {
                        /* Shallow Water */
-                       if(dam == 1)
+                       if (dam == 1)
                        {
                                /* Require a "naked" floor grid */
                                if (!cave_naked_bold(y, x)) break;
@@ -1012,16 +1009,13 @@ static bool project_f(int who, int r, int y, int x, int dam, int typ)
                                cave_set_feat(y, x, FEAT_SHAL_WATER);
                        }
                        /* Deep Water */
-                       else
+                       else if (dam)
                        {
                                /* Require a "naked" floor grid */
-                               if (cave_perma_bold(y, x) || !dam) break;
+                               if (cave_perma_bold(y, x)) break;
 
                                /* Place a deep lava */
                                cave_set_feat(y, x, FEAT_DEEP_WATER);
-
-                               /* Dam is used as a counter for the number of grid to convert */
-                               dam--;
                        }
                        break;
                }
index 899724b..905269f 100644 (file)
@@ -161,7 +161,7 @@ static void do_cmd_summon_horde(void)
        while (--attempts)
        {
                scatter(&wy, &wx, py, px, 3, 0);
-               if (cave_naked_bold(wy, wx)) break;
+               if (cave_empty_bold(wy, wx)) break;
        }
 
        (void)alloc_horde(wy, wx);