OSDN Git Service

[Refactor] #37353 cave 配列を grid_array に改名。 / Rename cave array to grid_array().
authorDeskull <deskull@users.sourceforge.jp>
Mon, 11 Feb 2019 14:47:14 +0000 (23:47 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Mon, 11 Feb 2019 15:18:19 +0000 (00:18 +0900)
63 files changed:
src/autopick.c
src/birth.c
src/bldg.c
src/cave.c
src/cmd-activate.c
src/cmd-pet.c
src/cmd2.c
src/cmd4.c
src/defines.h
src/dungeon.c
src/effects.c
src/externs.h
src/floor-events.c
src/floor-generate.c
src/floor-save.c
src/floor-streams.c
src/grid.c
src/grid.h
src/init1.c
src/init2.c
src/load.c
src/mane.c
src/melee1.c
src/mind.c
src/monster-process.c
src/monster1.c
src/monster2.c
src/mspells1.c
src/mspells2.c
src/mspells3.c
src/mspells4.c
src/mutation.c
src/object1.c
src/object2.c
src/player-move.c
src/player-status.c
src/projection.c
src/quest.c
src/realm-hex.c
src/realm-hissatsu.c
src/rooms-city.c
src/rooms-fractal.c
src/rooms-normal.c
src/rooms-pitnest.c
src/rooms-special.c
src/rooms-trap.c
src/rooms-vault.c
src/rooms.c
src/rooms.h
src/save.c
src/shoot.c
src/spells-object.c
src/spells1.c
src/spells2.c
src/spells3.c
src/store.c
src/trap.c
src/types.h
src/variable.c
src/view-mainwindow.c
src/wild.c
src/wizard2.c
src/xtra2.c

index 6a9e877..52f5937 100644 (file)
@@ -1657,7 +1657,7 @@ void autopick_delayed_alter(void)
                autopick_delayed_alter_aux(item);
 
        /* Scan the pile of objects */
-       item = cave[p_ptr->y][p_ptr->x].o_idx;
+       item = grid_array[p_ptr->y][p_ptr->x].o_idx;
        while (item)
        {
                OBJECT_IDX next = o_list[item].next_o_idx;
index 2df5679..fe80d84 100644 (file)
@@ -166,9 +166,9 @@ static concptr race_jouhou[MAX_RACES] =
 
 "Kobolds are a weak goblin race.  They love poisoned weapons, and can learn to throw poisoned darts (of which they carry an unlimited supply).  They are also inherently resistant to poison, although they are not one of the more powerful races.",
 
-"The hated and persecuted race of nocturnal dwarves, these cave-dwellers are not much bothered by darkness.  Their natural inclination to magical items has made them immune to effects which could drain away magical energy.",
+"The hated and persecuted race of nocturnal dwarves, these cavedwellers are not much bothered by darkness.  Their natural inclination to magical items has made them immune to effects which could drain away magical energy.",
 
-"Another dark, cave-dwelling race, likewise unhampered by darkness attacks, the Dark Elves have a long tradition and knowledge of magic.  They have an inherent magic missile attack available to them at a low level.  With their keen sight, they also learn to see invisible things as their relatives High-Elves do, but at a higher level.",
+"Another dark, cavedwelling race, likewise unhampered by darkness attacks, the Dark Elves have a long tradition and knowledge of magic.  They have an inherent magic missile attack available to them at a low level.  With their keen sight, they also learn to see invisible things as their relatives High-Elves do, but at a higher level.",
 
 "A humanoid race with dragon-like attributes.  As they advance levels, they gain new elemental resistances (up to Poison Resistance), and they also have a breath weapon, which becomes more powerful with experience.  The exact type of the breath weapon depends on the Draconian's class and level.  With their wings, they can easily escape any pit trap unharmed.",
 
index e701c87..7c52fe4 100644 (file)
@@ -2079,7 +2079,7 @@ static void castle_quest(void)
        clear_bldg(4, 18);
 
        /* Current quest of the building */
-       q_index = cave[p_ptr->y][p_ptr->x].special;
+       q_index = grid_array[p_ptr->y][p_ptr->x].special;
 
        /* Is there a quest available at the building? */
        if (!q_index)
@@ -4214,7 +4214,7 @@ void do_cmd_quest(void)
                leave_quest_check();
 
                if (quest[p_ptr->inside_quest].type != QUEST_TYPE_RANDOM) dun_level = 1;
-               p_ptr->inside_quest = cave[p_ptr->y][p_ptr->x].special;
+               p_ptr->inside_quest = grid_array[p_ptr->y][p_ptr->x].special;
 
                p_ptr->leaving = TRUE;
        }
@@ -4242,7 +4242,7 @@ void do_cmd_bldg(void)
                return;
        }
 
-       which = f_info[cave[p_ptr->y][p_ptr->x].feat].subtype;
+       which = f_info[grid_array[p_ptr->y][p_ptr->x].feat].subtype;
 
        bldg = &building[which];
 
index ad015e5..53f7a6f 100644 (file)
@@ -1,5 +1,5 @@
 /*!
- * @file cave.c
+ * @file grid_array.c
  * @brief ダンジョンの基礎部分実装(主にマスの実装) / low level dungeon routines -BEN-
  * @date 2013/12/30
  * @author
@@ -399,12 +399,12 @@ static bool check_local_illumination(POSITION y, POSITION x)
 #ifdef COMPLEX_WALL_ILLUMINATION /* COMPLEX_WALL_ILLUMINATION */
 
        /* Check for "complex" illumination */
-       if ((feat_supports_los(get_feat_mimic(&cave[yy][xx])) &&
-            (cave[yy][xx].info & CAVE_GLOW)) ||
-           (feat_supports_los(get_feat_mimic(&cave[y][xx])) &&
-            (cave[y][xx].info & CAVE_GLOW)) ||
-           (feat_supports_los(get_feat_mimic(&cave[yy][x])) &&
-            (cave[yy][x].info & CAVE_GLOW)))
+       if ((feat_supports_los(get_feat_mimic(&grid_array[yy][xx])) &&
+            (grid_array[yy][xx].info & CAVE_GLOW)) ||
+           (feat_supports_los(get_feat_mimic(&grid_array[y][xx])) &&
+            (grid_array[y][xx].info & CAVE_GLOW)) ||
+           (feat_supports_los(get_feat_mimic(&grid_array[yy][x])) &&
+            (grid_array[yy][x].info & CAVE_GLOW)))
        {
                return TRUE;
        }
@@ -413,7 +413,7 @@ static bool check_local_illumination(POSITION y, POSITION x)
 #else /* COMPLEX_WALL_ILLUMINATION */
 
        /* Check for "simple" illumination */
-       return (cave[yy][xx].info & CAVE_GLOW) ? TRUE : FALSE;
+       return (grid_array[yy][xx].info & CAVE_GLOW) ? TRUE : FALSE;
 
 #endif /* COMPLEX_WALL_ILLUMINATION */
 }
@@ -425,7 +425,7 @@ static bool check_local_illumination(POSITION y, POSITION x)
        if (player_has_los_bold((Y), (X))) \
        { \
                /* Update the monster */ \
-               if (cave[(Y)][(X)].m_idx) update_monster(cave[(Y)][(X)].m_idx, FALSE); \
+               if (grid_array[(Y)][(X)].m_idx) update_monster(grid_array[(Y)][(X)].m_idx, FALSE); \
 \
                /* Notice and redraw */ \
                note_spot((Y), (X)); \
@@ -574,7 +574,7 @@ bool player_can_see_bold(POSITION y, POSITION x)
        /* Blind players see nothing */
        if (p_ptr->blind) return FALSE;
 
-       c_ptr = &cave[y][x];
+       c_ptr = &grid_array[y][x];
 
        /* Note that "torch-lite" yields "illumination" */
        if (c_ptr->info & (CAVE_LITE | CAVE_MNLT)) return TRUE;
@@ -617,7 +617,7 @@ bool no_lite(void)
  */
 bool cave_valid_bold(POSITION y, POSITION x)
 {
-       grid_type *c_ptr = &cave[y][x];
+       grid_type *c_ptr = &grid_array[y][x];
        OBJECT_IDX this_o_idx, next_o_idx = 0;
 
        /* Forbid perma-grids */
@@ -854,7 +854,7 @@ void apply_default_feat_lighting(TERM_COLOR f_attr[F_LIT_MAX], SYMBOL_CODE f_cha
  * not any.  If there were, they would have to set "shimmer_objects"\n
  * when they were created, and then new "shimmer" code in "dungeon.c"\n
  * would have to be created handle the "shimmer" effect, and the code\n
- * in "cave.c" would have to be updated to create the shimmer effect.\n
+ * in "grid_array.c" would have to be updated to create the shimmer effect.\n
  *\n
  * Note the effects of hallucination.  Objects always appear as random\n
  * "objects", monsters as random "monsters", and normal grids occasionally\n
@@ -943,8 +943,8 @@ void apply_default_feat_lighting(TERM_COLOR f_attr[F_LIT_MAX], SYMBOL_CODE f_cha
  */
 void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap, SYMBOL_CODE *tcp)
 {
-       /* Get the cave */
-       grid_type *c_ptr = &cave[y][x];
+       /* Get the grid_array */
+       grid_type *c_ptr = &grid_array[y][x];
 
        OBJECT_IDX this_o_idx, next_o_idx = 0;
 
@@ -994,7 +994,7 @@ void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap,
                        /* Mega-Hack -- Handle "in-sight" and "darkened" grids */
                        else if (darkened_grid(c_ptr))
                        {
-                               /* Unsafe cave grid -- idea borrowed from Unangband */
+                               /* Unsafe grid -- idea borrowed from Unangband */
                                feat = (view_unsafe_grids && (c_ptr->info & CAVE_UNSAFE)) ? feat_undetected : feat_none;
 
                                /* Access darkness */
@@ -1045,7 +1045,7 @@ void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap,
                /* Unknown */
                else
                {
-                       /* Unsafe cave grid -- idea borrowed from Unangband */
+                       /* Unsafe grid -- idea borrowed from Unangband */
                        feat = (view_unsafe_grids && (c_ptr->info & CAVE_UNSAFE)) ? feat_undetected : feat_none;
 
                        /* Access darkness */
@@ -1084,7 +1084,7 @@ void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap,
                        {
                                if (have_flag(f_ptr->flags, FF_LOS) && have_flag(f_ptr->flags, FF_PROJECT))
                                {
-                                       /* Unsafe cave grid -- idea borrowed from Unangband */
+                                       /* Unsafe grid -- idea borrowed from Unangband */
                                        feat = (view_unsafe_grids && (c_ptr->info & CAVE_UNSAFE)) ? feat_undetected : feat_none;
 
                                        /* Access darkness */
@@ -1158,7 +1158,7 @@ void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap,
                /* Unknown */
                else
                {
-                       /* Unsafe cave grid -- idea borrowed from Unangband */
+                       /* Unsafe grid -- idea borrowed from Unangband */
                        feat = (view_unsafe_grids && (c_ptr->info & CAVE_UNSAFE)) ? feat_undetected : feat_none;
 
                        /* Access feature */
@@ -1458,7 +1458,7 @@ void print_rel(SYMBOL_CODE c, TERM_COLOR a, TERM_LEN y, TERM_LEN x)
  */
 void note_spot(POSITION y, POSITION x)
 {
-       grid_type *c_ptr = &cave[y][x];
+       grid_type *c_ptr = &grid_array[y][x];
        OBJECT_IDX this_o_idx, next_o_idx = 0;
 
        /* Blind players see nothing */
@@ -1743,7 +1743,7 @@ void prt_path(POSITION y, POSITION x)
        {
                POSITION ny = GRID_Y(path_g[i]);
                POSITION nx = GRID_X(path_g[i]);
-               grid_type *c_ptr = &cave[ny][nx];
+               grid_type *c_ptr = &grid_array[ny][nx];
 
                if (panel_contains(ny, nx))
                {
@@ -2249,7 +2249,7 @@ void do_cmd_view_map(void)
 
 
 /*
- * Some comments on the cave grid flags.  -BEN-
+ * Some comments on the grid flags.  -BEN-
  *
  *
  * One of the major bottlenecks in previous versions of Angband was in
@@ -2478,7 +2478,7 @@ void forget_lite(void)
                x = lite_x[i];
 
                /* Forget "LITE" flag */
-               cave[y][x].info &= ~(CAVE_LITE);
+               grid_array[y][x].info &= ~(CAVE_LITE);
 
                /* lite_spot(y, x); Perhaps don't need? */
        }
@@ -2520,9 +2520,9 @@ void forget_lite(void)
  */
 #define cave_lite_hack(Y,X) \
 {\
-       if (!(cave[Y][X].info & (CAVE_LITE))) \
+       if (!(grid_array[Y][X].info & (CAVE_LITE))) \
        { \
-               cave[Y][X].info |= (CAVE_LITE); \
+               grid_array[Y][X].info |= (CAVE_LITE); \
                lite_y[lite_n] = (Y); \
                lite_x[lite_n++] = (X); \
        } \
@@ -2569,7 +2569,7 @@ void update_lite(void)
                /* forget_lite(); Perhaps don't need? */
 
                /* Add it to later visual update */
-               cave_redraw_later(&cave[p_ptr->y][p_ptr->x], p_ptr->y, p_ptr->x);
+               cave_redraw_later(&grid_array[p_ptr->y][p_ptr->x], p_ptr->y, p_ptr->x);
        }
 #endif
 
@@ -2582,10 +2582,10 @@ void update_lite(void)
                x = lite_x[i];
 
                /* Mark the grid as not "lite" */
-               cave[y][x].info &= ~(CAVE_LITE);
+               grid_array[y][x].info &= ~(CAVE_LITE);
 
                /* Mark the grid as "seen" */
-               cave[y][x].info |= (CAVE_TEMP);
+               grid_array[y][x].info |= (CAVE_TEMP);
 
                /* Add it to the "seen" set */
                temp_y[temp_n] = y;
@@ -2720,7 +2720,7 @@ void update_lite(void)
                                if (d > p) continue;
 
                                /* Viewable, nearby, grids get "torch lit" */
-                               if (cave[y][x].info & CAVE_VIEW)
+                               if (grid_array[y][x].info & CAVE_VIEW)
                                {
                                        /* This grid is "torch lit" */
                                        cave_lite_hack(y, x);
@@ -2738,7 +2738,7 @@ void update_lite(void)
                y = lite_y[i];
                x = lite_x[i];
 
-               c_ptr = &cave[y][x];
+               c_ptr = &grid_array[y][x];
 
                /* Update fresh grids */
                if (c_ptr->info & (CAVE_TEMP)) continue;
@@ -2753,7 +2753,7 @@ void update_lite(void)
                y = temp_y[i];
                x = temp_x[i];
 
-               c_ptr = &cave[y][x];
+               c_ptr = &grid_array[y][x];
 
                /* No longer in the array */
                c_ptr->info &= ~(CAVE_TEMP);
@@ -2788,7 +2788,7 @@ static void mon_lite_hack(POSITION y, POSITION x)
        /* We trust this grid is in bounds */
        /* if (!in_bounds2(y, x)) return; */
 
-       c_ptr = &cave[y][x];
+       c_ptr = &grid_array[y][x];
 
        /* Want a unlit square in view of the player */
        if ((c_ptr->info & (CAVE_MNLT | CAVE_VIEW)) != CAVE_VIEW) return;
@@ -2874,7 +2874,7 @@ static void mon_dark_hack(POSITION y, POSITION x)
        /* We trust this grid is in bounds */
        /* if (!in_bounds2(y, x)) return; */
 
-       c_ptr = &cave[y][x];
+       c_ptr = &grid_array[y][x];
 
        /* Want a unlit and undarkened square in view of the player */
        if ((c_ptr->info & (CAVE_LITE | CAVE_MNLT | CAVE_MNDK | CAVE_VIEW)) != CAVE_VIEW) return;
@@ -2967,7 +2967,7 @@ void update_mon_lite(void)
        for (i = 0; i < mon_lite_n; i++)
        {
                /* Point to grid */
-               c_ptr = &cave[mon_lite_y[i]][mon_lite_x[i]];
+               c_ptr = &grid_array[mon_lite_y[i]][mon_lite_x[i]];
 
                /* Set temp or xtra flag */
                c_ptr->info |= (c_ptr->info & CAVE_MNLT) ? CAVE_TEMP : CAVE_XTRA;
@@ -3028,7 +3028,7 @@ void update_mon_lite(void)
                        mon_fy = m_ptr->fy;
 
                        /* Is the monster visible? */
-                       mon_invis = !(cave[mon_fy][mon_fx].info & CAVE_VIEW);
+                       mon_invis = !(grid_array[mon_fy][mon_fx].info & CAVE_VIEW);
 
                        /* The square it is on */
                        add_mon_lite(mon_fy, mon_fx);
@@ -3053,7 +3053,7 @@ void update_mon_lite(void)
                                        add_mon_lite(mon_fy + 2, mon_fx);
                                        add_mon_lite(mon_fy + 2, mon_fx - 1);
 
-                                       c_ptr = &cave[mon_fy + 2][mon_fx];
+                                       c_ptr = &grid_array[mon_fy + 2][mon_fx];
 
                                        /* Radius 3 */
                                        if ((rad == 3) && cave_have_flag_grid(c_ptr, f_flag))
@@ -3071,7 +3071,7 @@ void update_mon_lite(void)
                                        add_mon_lite(mon_fy - 2, mon_fx);
                                        add_mon_lite(mon_fy - 2, mon_fx - 1);
 
-                                       c_ptr = &cave[mon_fy - 2][mon_fx];
+                                       c_ptr = &grid_array[mon_fy - 2][mon_fx];
 
                                        /* Radius 3 */
                                        if ((rad == 3) && cave_have_flag_grid(c_ptr, f_flag))
@@ -3089,7 +3089,7 @@ void update_mon_lite(void)
                                        add_mon_lite(mon_fy, mon_fx + 2);
                                        add_mon_lite(mon_fy - 1, mon_fx + 2);
 
-                                       c_ptr = &cave[mon_fy][mon_fx + 2];
+                                       c_ptr = &grid_array[mon_fy][mon_fx + 2];
 
                                        /* Radius 3 */
                                        if ((rad == 3) && cave_have_flag_grid(c_ptr, f_flag))
@@ -3107,7 +3107,7 @@ void update_mon_lite(void)
                                        add_mon_lite(mon_fy, mon_fx - 2);
                                        add_mon_lite(mon_fy - 1, mon_fx - 2);
 
-                                       c_ptr = &cave[mon_fy][mon_fx - 2];
+                                       c_ptr = &grid_array[mon_fy][mon_fx - 2];
 
                                        /* Radius 3 */
                                        if ((rad == 3) && cave_have_flag_grid(c_ptr, f_flag))
@@ -3163,7 +3163,7 @@ void update_mon_lite(void)
                /* We trust this grid is in bounds */
 
                /* Point to grid */
-               c_ptr = &cave[fy][fx];
+               c_ptr = &grid_array[fy][fx];
 
                if (c_ptr->info & CAVE_TEMP) /* Pervious lit */
                {
@@ -3204,7 +3204,7 @@ void update_mon_lite(void)
                /* We trust this grid is in bounds */
 
                /* Point to grid */
-               c_ptr = &cave[fy][fx];
+               c_ptr = &grid_array[fy][fx];
 
                if (c_ptr->info & CAVE_MNLT) /* Lit */
                {
@@ -3238,7 +3238,7 @@ void update_mon_lite(void)
        {
                /* We trust this grid is in bounds */
 
-               cave[temp_y[i]][temp_x[i]].info &= ~(CAVE_TEMP | CAVE_XTRA);
+               grid_array[temp_y[i]][temp_x[i]].info &= ~(CAVE_TEMP | CAVE_XTRA);
        }
 
        /* Finished with temp_n */
@@ -3247,7 +3247,7 @@ void update_mon_lite(void)
        /* Mega-Hack -- Visual update later */
        p_ptr->update |= (PU_DELAY_VIS);
 
-       p_ptr->monlite = (cave[p_ptr->y][p_ptr->x].info & CAVE_MNLT) ? TRUE : FALSE;
+       p_ptr->monlite = (grid_array[p_ptr->y][p_ptr->x].info & CAVE_MNLT) ? TRUE : FALSE;
 
        if (p_ptr->special_defense & NINJA_S_STEALTH)
        {
@@ -3275,7 +3275,7 @@ void clear_mon_lite(void)
        for (i = 0; i < mon_lite_n; i++)
        {
                /* Point to grid */
-               c_ptr = &cave[mon_lite_y[i]][mon_lite_x[i]];
+               c_ptr = &grid_array[mon_lite_y[i]][mon_lite_x[i]];
 
                /* Clear monster illumination flag */
                c_ptr->info &= ~(CAVE_MNLT | CAVE_MNDK);
@@ -3304,7 +3304,7 @@ void forget_view(void)
        {
                POSITION y = view_y[i];
                POSITION x = view_x[i];
-               c_ptr = &cave[y][x];
+               c_ptr = &grid_array[y][x];
 
                /* Forget that the grid is viewable */
                c_ptr->info &= ~(CAVE_VIEW);
@@ -3365,8 +3365,8 @@ static bool update_view_aux(POSITION y, POSITION x, POSITION y1, POSITION x1, PO
        grid_type *g2_c_ptr;
 
        /* Access the grids */
-       g1_c_ptr = &cave[y1][x1];
-       g2_c_ptr = &cave[y2][x2];
+       g1_c_ptr = &grid_array[y1][x1];
+       g2_c_ptr = &grid_array[y2][x2];
 
 
        /* Check for walls */
@@ -3384,7 +3384,7 @@ static bool update_view_aux(POSITION y, POSITION x, POSITION y1, POSITION x1, PO
        /* Totally blocked by "unviewable neighbors" */
        if (!v1 && !v2) return (TRUE);
 
-       c_ptr = &cave[y][x];
+       c_ptr = &grid_array[y][x];
 
 
        /* Check for walls */
@@ -3522,10 +3522,10 @@ static bool update_view_aux(POSITION y, POSITION x, POSITION y1, POSITION x1, PO
  *
  * Note the use of "inline" macros for efficiency.  The "cave_los_grid()"
  * macro is a replacement for "cave_los_bold()" which takes a pointer to
- * a cave grid instead of its location.  The "cave_view_hack()" macro is a
+ * a grid instead of its location.  The "cave_view_hack()" macro is a
  * chunk of code which adds the given location to the "view" array if it
  * is not already there, using both the actual location and a pointer to
- * the cave grid.  See above.
+ * the grid.  See above.
  *
  * By the way, the purpose of this code is to reduce the dependancy on the
  * "los()" function which is slow, and, in some cases, not very accurate.
@@ -3583,7 +3583,7 @@ void update_view(void)
        {
                y = view_y[n];
                x = view_x[n];
-               c_ptr = &cave[y][x];
+               c_ptr = &grid_array[y][x];
 
                /* Mark the grid as not in "view" */
                c_ptr->info &= ~(CAVE_VIEW);
@@ -3605,7 +3605,7 @@ void update_view(void)
        /* Now start on the player */
        y = p_ptr->y;
        x = p_ptr->x;
-       c_ptr = &cave[y][x];
+       c_ptr = &grid_array[y][x];
 
        /* Assume the player grid is easily viewable */
        c_ptr->info |= (CAVE_XTRA);
@@ -3622,7 +3622,7 @@ void update_view(void)
        /* Scan south-east */
        for (d = 1; d <= z; d++)
        {
-               c_ptr = &cave[y+d][x+d];
+               c_ptr = &grid_array[y+d][x+d];
                c_ptr->info |= (CAVE_XTRA);
                cave_view_hack(c_ptr, y+d, x+d);
                if (!cave_los_grid(c_ptr)) break;
@@ -3631,7 +3631,7 @@ void update_view(void)
        /* Scan south-west */
        for (d = 1; d <= z; d++)
        {
-               c_ptr = &cave[y+d][x-d];
+               c_ptr = &grid_array[y+d][x-d];
                c_ptr->info |= (CAVE_XTRA);
                cave_view_hack(c_ptr, y+d, x-d);
                if (!cave_los_grid(c_ptr)) break;
@@ -3640,7 +3640,7 @@ void update_view(void)
        /* Scan north-east */
        for (d = 1; d <= z; d++)
        {
-               c_ptr = &cave[y-d][x+d];
+               c_ptr = &grid_array[y-d][x+d];
                c_ptr->info |= (CAVE_XTRA);
                cave_view_hack(c_ptr, y-d, x+d);
                if (!cave_los_grid(c_ptr)) break;
@@ -3649,7 +3649,7 @@ void update_view(void)
        /* Scan north-west */
        for (d = 1; d <= z; d++)
        {
-               c_ptr = &cave[y-d][x-d];
+               c_ptr = &grid_array[y-d][x-d];
                c_ptr->info |= (CAVE_XTRA);
                cave_view_hack(c_ptr, y-d, x-d);
                if (!cave_los_grid(c_ptr)) break;
@@ -3661,7 +3661,7 @@ void update_view(void)
        /* Scan south */
        for (d = 1; d <= full; d++)
        {
-               c_ptr = &cave[y+d][x];
+               c_ptr = &grid_array[y+d][x];
                c_ptr->info |= (CAVE_XTRA);
                cave_view_hack(c_ptr, y+d, x);
                if (!cave_los_grid(c_ptr)) break;
@@ -3673,7 +3673,7 @@ void update_view(void)
        /* Scan north */
        for (d = 1; d <= full; d++)
        {
-               c_ptr = &cave[y-d][x];
+               c_ptr = &grid_array[y-d][x];
                c_ptr->info |= (CAVE_XTRA);
                cave_view_hack(c_ptr, y-d, x);
                if (!cave_los_grid(c_ptr)) break;
@@ -3685,7 +3685,7 @@ void update_view(void)
        /* Scan east */
        for (d = 1; d <= full; d++)
        {
-               c_ptr = &cave[y][x+d];
+               c_ptr = &grid_array[y][x+d];
                c_ptr->info |= (CAVE_XTRA);
                cave_view_hack(c_ptr, y, x+d);
                if (!cave_los_grid(c_ptr)) break;
@@ -3697,7 +3697,7 @@ void update_view(void)
        /* Scan west */
        for (d = 1; d <= full; d++)
        {
-               c_ptr = &cave[y][x-d];
+               c_ptr = &grid_array[y][x-d];
                c_ptr->info |= (CAVE_XTRA);
                cave_view_hack(c_ptr, y, x-d);
                if (!cave_los_grid(c_ptr)) break;
@@ -3952,7 +3952,7 @@ void update_view(void)
        {
                y = view_y[n];
                x = view_x[n];
-               c_ptr = &cave[y][x];
+               c_ptr = &grid_array[y][x];
 
                /* Clear the "CAVE_XTRA" flag */
                c_ptr->info &= ~(CAVE_XTRA);
@@ -3969,7 +3969,7 @@ void update_view(void)
        {
                y = temp_y[n];
                x = temp_x[n];
-               c_ptr = &cave[y][x];
+               c_ptr = &grid_array[y][x];
 
                /* No longer in the array */
                c_ptr->info &= ~(CAVE_TEMP);
@@ -4003,7 +4003,7 @@ void delayed_visual_update(void)
        {
                y = redraw_y[i];
                x = redraw_x[i];
-               c_ptr = &cave[y][x];
+               c_ptr = &grid_array[y][x];
 
                /* Update only needed grids (prevent multiple updating) */
                if (!(c_ptr->info & CAVE_REDRAW)) continue;
@@ -4038,9 +4038,9 @@ void forget_flow(void)
                for (x = 0; x < cur_wid; x++)
                {
                        /* Forget the old data */
-                       cave[y][x].dist = 0;
-                       cave[y][x].cost = 0;
-                       cave[y][x].when = 0;
+                       grid_array[y][x].dist = 0;
+                       grid_array[y][x].cost = 0;
+                       grid_array[y][x].when = 0;
                }
        }
 }
@@ -4082,7 +4082,7 @@ void update_flow(void)
        if (running && in_bounds(flow_y, flow_x))
        {
                /* The way point is in sight - do not update.  (Speedup) */
-               if (cave[flow_y][flow_x].info & CAVE_VIEW) return;
+               if (grid_array[flow_y][flow_x].info & CAVE_VIEW) return;
        }
 
        /* Erase all of the current flow information */
@@ -4090,8 +4090,8 @@ void update_flow(void)
        {
                for (x = 0; x < cur_wid; x++)
                {
-                       cave[y][x].cost = 0;
-                       cave[y][x].dist = 0;
+                       grid_array[y][x].cost = 0;
+                       grid_array[y][x].dist = 0;
                }
        }
 
@@ -4119,8 +4119,8 @@ void update_flow(void)
                for (d = 0; d < 8; d++)
                {
                        int old_head = flow_head;
-                       byte_hack m = cave[ty][tx].cost + 1;
-                       byte_hack n = cave[ty][tx].dist + 1;
+                       byte_hack m = grid_array[ty][tx].cost + 1;
+                       byte_hack n = grid_array[ty][tx].dist + 1;
                        grid_type *c_ptr;
 
                        /* Child location */
@@ -4130,7 +4130,7 @@ void update_flow(void)
                        /* Ignore player's grid */
                        if (player_bold(y, x)) continue;
 
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
 
                        if (is_closed_door(c_ptr->feat)) m += 3;
 
@@ -4202,8 +4202,8 @@ void update_smell(void)
                {
                        for (x = 0; x < cur_wid; x++)
                        {
-                               int w = cave[y][x].when;
-                               cave[y][x].when = (w > 128) ? (w - 128) : 0;
+                               int w = grid_array[y][x].when;
+                               grid_array[y][x].when = (w > 128) ? (w - 128) : 0;
                        }
                }
 
@@ -4226,7 +4226,7 @@ void update_smell(void)
                        /* Check Bounds */
                        if (!in_bounds(y, x)) continue;
 
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
 
                        /* Walls, water, and lava cannot hold scent. */
                        if (!cave_have_flag_grid(c_ptr, FF_MOVE) && !is_closed_door(c_ptr->feat)) continue;
@@ -4264,7 +4264,7 @@ void map_area(POSITION range)
                {
                        if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
 
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
 
                        /* Memorize terrain of the grid */
                        c_ptr->info |= (CAVE_KNOWN);
@@ -4286,7 +4286,7 @@ void map_area(POSITION range)
                                /* Memorize known walls */
                                for (i = 0; i < 8; i++)
                                {
-                                       c_ptr = &cave[y + ddy_ddd[i]][x + ddx_ddd[i]];
+                                       c_ptr = &grid_array[y + ddy_ddd[i]][x + ddx_ddd[i]];
 
                                        /* Feature code (applying "mimic" field) */
                                        feat = get_feat_mimic(c_ptr);
@@ -4354,7 +4354,7 @@ void wiz_lite(bool ninja)
                /* Scan all normal grids */
                for (x = 1; x < cur_wid - 1; x++)
                {
-                       grid_type *c_ptr = &cave[y][x];
+                       grid_type *c_ptr = &grid_array[y][x];
 
                        /* Memorize terrain of the grid */
                        c_ptr->info |= (CAVE_KNOWN);
@@ -4373,7 +4373,7 @@ void wiz_lite(bool ninja)
                                        POSITION xx = x + ddx_ddd[i];
 
                                        /* Get the grid */
-                                       c_ptr = &cave[yy][xx];
+                                       c_ptr = &grid_array[yy][xx];
 
                                        /* Feature code (applying "mimic" field) */
                                        f_ptr = &f_info[get_feat_mimic(c_ptr)];
@@ -4412,7 +4412,7 @@ void wiz_lite(bool ninja)
 
        if (p_ptr->special_defense & NINJA_S_STEALTH)
        {
-               if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+               if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
        }
 }
 
@@ -4430,7 +4430,7 @@ void wiz_dark(void)
        {
                for (x = 1; x < cur_wid - 1; x++)
                {
-                       grid_type *c_ptr = &cave[y][x];
+                       grid_type *c_ptr = &grid_array[y][x];
 
                        /* Process the grid */
                        c_ptr->info &= ~(CAVE_MARK | CAVE_IN_DETECT | CAVE_KNOWN);
@@ -4441,15 +4441,15 @@ void wiz_dark(void)
        /* Forget every grid on horizontal edge */
        for (x = 0; x < cur_wid; x++)
        {
-               cave[0][x].info &= ~(CAVE_MARK);
-               cave[cur_hgt - 1][x].info &= ~(CAVE_MARK);
+               grid_array[0][x].info &= ~(CAVE_MARK);
+               grid_array[cur_hgt - 1][x].info &= ~(CAVE_MARK);
        }
 
        /* Forget every grid on vertical edge */
        for (y = 1; y < (cur_hgt - 1); y++)
        {
-               cave[y][0].info &= ~(CAVE_MARK);
-               cave[y][cur_wid - 1].info &= ~(CAVE_MARK);
+               grid_array[y][0].info &= ~(CAVE_MARK);
+               grid_array[y][cur_wid - 1].info &= ~(CAVE_MARK);
        }
 
        /* Forget all objects */
@@ -4482,7 +4482,7 @@ void wiz_dark(void)
  */
 void cave_set_feat(POSITION y, POSITION x, FEAT_IDX feat)
 {
-       grid_type *c_ptr = &cave[y][x];
+       grid_type *c_ptr = &grid_array[y][x];
        feature_type *f_ptr = &f_info[feat];
        bool old_los, old_mirror;
 
@@ -4505,7 +4505,7 @@ void cave_set_feat(POSITION y, POSITION x, FEAT_IDX feat)
                                yy = y + ddy_ddd[i];
                                xx = x + ddx_ddd[i];
                                if (!in_bounds2(yy, xx)) continue;
-                               cave[yy][xx].info |= CAVE_GLOW;
+                               grid_array[yy][xx].info |= CAVE_GLOW;
                        }
                }
 
@@ -4566,7 +4566,7 @@ void cave_set_feat(POSITION y, POSITION x, FEAT_IDX feat)
                        yy = y + ddy_ddd[i];
                        xx = x + ddx_ddd[i];
                        if (!in_bounds2(yy, xx)) continue;
-                       cc_ptr = &cave[yy][xx];
+                       cc_ptr = &grid_array[yy][xx];
                        cc_ptr->info |= CAVE_GLOW;
 
                        if (player_has_los_grid(cc_ptr))
@@ -4583,7 +4583,7 @@ void cave_set_feat(POSITION y, POSITION x, FEAT_IDX feat)
 
                if (p_ptr->special_defense & NINJA_S_STEALTH)
                {
-                       if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+                       if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
                }
        }
 }
@@ -4646,7 +4646,7 @@ FEAT_IDX feat_state(FEAT_IDX feat, int action)
 void cave_alter_feat(POSITION y, POSITION x, int action)
 {
        /* Set old feature */
-       FEAT_IDX oldfeat = cave[y][x].feat;
+       FEAT_IDX oldfeat = grid_array[y][x].feat;
 
        /* Get the new feat */
        FEAT_IDX newfeat = feat_state(oldfeat, action);
@@ -4701,7 +4701,7 @@ void cave_alter_feat(POSITION y, POSITION x, int action)
 /* Remove a mirror */
 void remove_mirror(POSITION y, POSITION x)
 {
-       grid_type *c_ptr = &cave[y][x];
+       grid_type *c_ptr = &grid_array[y][x];
 
        /* Remove the mirror */
        c_ptr->info &= ~(CAVE_OBJECT);
@@ -5022,7 +5022,7 @@ void glow_deep_lava_and_bldg(void)
        {
                for (x = 0; x < cur_wid; x++)
                {
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
 
                        /* Feature code (applying "mimic" field) */
 
@@ -5033,7 +5033,7 @@ void glow_deep_lava_and_bldg(void)
                                        yy = y + ddy_ddd[i];
                                        xx = x + ddx_ddd[i];
                                        if (!in_bounds2(yy, xx)) continue;
-                                       cave[yy][xx].info |= CAVE_GLOW;
+                                       grid_array[yy][xx].info |= CAVE_GLOW;
                                }
                        }
                }
@@ -5056,7 +5056,7 @@ void glow_deep_lava_and_bldg(void)
 bool cave_monster_teleportable_bold(MONSTER_IDX m_idx, POSITION y, POSITION x, BIT_FLAGS mode)
 {
        monster_type *m_ptr = &m_list[m_idx];
-       grid_type    *c_ptr = &cave[y][x];
+       grid_type    *c_ptr = &grid_array[y][x];
        feature_type *f_ptr = &f_info[c_ptr->feat];
 
        /* Require "teleportable" space */
@@ -5086,7 +5086,7 @@ bool cave_monster_teleportable_bold(MONSTER_IDX m_idx, POSITION y, POSITION x, B
 */
 bool cave_player_teleportable_bold(POSITION y, POSITION x, BIT_FLAGS mode)
 {
-       grid_type    *c_ptr = &cave[y][x];
+       grid_type    *c_ptr = &grid_array[y][x];
        feature_type *f_ptr = &f_info[c_ptr->feat];
 
        /* Require "teleportable" space */
index 2debb1a..cf7368e 100644 (file)
@@ -1907,10 +1907,10 @@ bool activate_artifact(object_type *o_ptr)
                        msg_print(_("そこは水辺ではない。", "There is no fishing place."));
                        return FALSE;
                }
-               else if (cave[y][x].m_idx)
+               else if (grid_array[y][x].m_idx)
                {
                        GAME_TEXT m_name[MAX_NLEN];
-                       monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
+                       monster_desc(m_name, &m_list[grid_array[y][x].m_idx], 0);
                        msg_format(_("%sが邪魔だ!", "%^s is stand in your way."), m_name);
                        free_turn(p_ptr);
                        return FALSE;
index a313c3e..5123eb3 100644 (file)
@@ -314,7 +314,7 @@ bool do_riding(bool force)
        if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
        y = p_ptr->y + ddy[dir];
        x = p_ptr->x + ddx[dir];
-       c_ptr = &cave[y][x];
+       c_ptr = &grid_array[y][x];
 
        if (p_ptr->special_defense & KATA_MUSOU) set_action(ACTION_NONE);
 
@@ -441,9 +441,9 @@ static void do_name_pet(void)
        }
        target_pet = old_target_pet;
 
-       if (cave[target_row][target_col].m_idx)
+       if (grid_array[target_row][target_col].m_idx)
        {
-               m_ptr = &m_list[cave[target_row][target_col].m_idx];
+               m_ptr = &m_list[grid_array[target_row][target_col].m_idx];
 
                if (!is_pet(m_ptr))
                {
@@ -876,10 +876,10 @@ void do_cmd_pet(void)
                if (!target_set(TARGET_KILL)) pet_t_m_idx = 0;
                else
                {
-                       grid_type *c_ptr = &cave[target_row][target_col];
+                       grid_type *c_ptr = &grid_array[target_row][target_col];
                        if (c_ptr->m_idx && (m_list[c_ptr->m_idx].ml))
                        {
-                               pet_t_m_idx = cave[target_row][target_col].m_idx;
+                               pet_t_m_idx = grid_array[target_row][target_col].m_idx;
                                p_ptr->pet_follow_distance = PET_DESTROY_DIST;
                        }
                        else pet_t_m_idx = 0;
@@ -1092,7 +1092,7 @@ bool rakuba(HIT_POINT dam, bool force)
                        y = p_ptr->y + ddy_ddd[i];
                        x = p_ptr->x + ddx_ddd[i];
 
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
 
                        if (c_ptr->m_idx) continue;
 
index 7077047..0ac5222 100644 (file)
@@ -136,7 +136,7 @@ void do_cmd_go_up(void)
        bool go_up = FALSE;
 
        /* Player grid */
-       grid_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
+       grid_type *c_ptr = &grid_array[p_ptr->y][p_ptr->x];
        feature_type *f_ptr = &f_info[c_ptr->feat];
 
        int up_num = 0;
@@ -280,7 +280,7 @@ void do_cmd_go_up(void)
 void do_cmd_go_down(void)
 {
        /* Player grid */
-       grid_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
+       grid_type *c_ptr = &grid_array[p_ptr->y][p_ptr->x];
        feature_type *f_ptr = &f_info[c_ptr->feat];
 
        bool fall_trap = FALSE;
@@ -477,7 +477,7 @@ void do_cmd_search(void)
  */
 static OBJECT_IDX chest_check(POSITION y, POSITION x, bool trapped)
 {
-       grid_type *c_ptr = &cave[y][x];
+       grid_type *c_ptr = &grid_array[y][x];
        OBJECT_IDX this_o_idx, next_o_idx = 0;
 
        /* Scan all objects in the grid */
@@ -602,8 +602,8 @@ static int count_dt(POSITION *y, POSITION *x, bool (*test)(IDX feat), bool under
                yy = p_ptr->y + ddy_ddd[d];
                xx = p_ptr->x + ddx_ddd[d];
 
-               /* Get the cave */
-               c_ptr = &cave[yy][xx];
+               /* Get the grid_array */
+               c_ptr = &grid_array[yy][xx];
 
                /* Must have knowledge */
                if (!(c_ptr->info & (CAVE_MARK))) continue;
@@ -717,7 +717,7 @@ static bool do_cmd_open_aux(POSITION y, POSITION x)
        int i, j;
 
        /* Get requested grid */
-       grid_type *c_ptr = &cave[y][x];
+       grid_type *c_ptr = &grid_array[y][x];
        feature_type *f_ptr = &f_info[c_ptr->feat];
        bool more = FALSE;
 
@@ -853,7 +853,7 @@ void do_cmd_open(void)
                x = p_ptr->x + ddx[dir];
 
                /* Get requested grid */
-               c_ptr = &cave[y][x];
+               c_ptr = &grid_array[y][x];
 
                /* Feature code (applying "mimic" field) */
                feat = get_feat_mimic(c_ptr);
@@ -909,7 +909,7 @@ void do_cmd_open(void)
  */
 static bool do_cmd_close_aux(POSITION y, POSITION x)
 {
-       grid_type *c_ptr = &cave[y][x];
+       grid_type *c_ptr = &grid_array[y][x];
        FEAT_IDX old_feat = c_ptr->feat;
        bool more = FALSE;
 
@@ -998,7 +998,7 @@ void do_cmd_close(void)
 
                y = p_ptr->y + ddy[dir];
                x = p_ptr->x + ddx[dir];
-               c_ptr = &cave[y][x];
+               c_ptr = &grid_array[y][x];
 
                /* Feature code (applying "mimic" field) */
                feat = get_feat_mimic(c_ptr);
@@ -1042,7 +1042,7 @@ void do_cmd_close(void)
  */
 static bool do_cmd_tunnel_test(POSITION y, POSITION x)
 {
-       grid_type *c_ptr = &cave[y][x];
+       grid_type *c_ptr = &grid_array[y][x];
 
        /* Must have knowledge */
        if (!(c_ptr->info & CAVE_MARK))
@@ -1089,7 +1089,7 @@ static bool do_cmd_tunnel_aux(POSITION y, POSITION x)
        take_turn(p_ptr, 100);;
 
        /* Get grid */
-       c_ptr = &cave[y][x];
+       c_ptr = &grid_array[y][x];
        f_ptr = &f_info[c_ptr->feat];
        power = f_ptr->power;
 
@@ -1237,7 +1237,7 @@ void do_cmd_tunnel(void)
                x = p_ptr->x + ddx[dir];
 
                /* Get grid */
-               c_ptr = &cave[y][x];
+               c_ptr = &grid_array[y][x];
 
                /* Feature code (applying "mimic" field) */
                feat = get_feat_mimic(c_ptr);
@@ -1295,7 +1295,7 @@ bool easy_open_door(POSITION y, POSITION x)
 {
        int i, j;
 
-       grid_type *c_ptr = &cave[y][x];
+       grid_type *c_ptr = &grid_array[y][x];
        feature_type *f_ptr = &f_info[c_ptr->feat];
 
        /* Must be a closed door */
@@ -1466,7 +1466,7 @@ static bool do_cmd_disarm_chest(POSITION y, POSITION x, OBJECT_IDX o_idx)
 
 bool do_cmd_disarm_aux(POSITION y, POSITION x, DIRECTION dir)
 {
-       grid_type *c_ptr = &cave[y][x];
+       grid_type *c_ptr = &grid_array[y][x];
 
        /* Get feature */
        feature_type *f_ptr = &f_info[c_ptr->feat];
@@ -1591,7 +1591,7 @@ void do_cmd_disarm(void)
 
                y = p_ptr->y + ddy[dir];
                x = p_ptr->x + ddx[dir];
-               c_ptr = &cave[y][x];
+               c_ptr = &grid_array[y][x];
 
                /* Feature code (applying "mimic" field) */
                feat = get_feat_mimic(c_ptr);
@@ -1649,7 +1649,7 @@ void do_cmd_disarm(void)
 static bool do_cmd_bash_aux(POSITION y, POSITION x, DIRECTION dir)
 {
        /* Get grid */
-       grid_type       *c_ptr = &cave[y][x];
+       grid_type       *c_ptr = &grid_array[y][x];
 
        /* Get feature */
        feature_type *f_ptr = &f_info[c_ptr->feat];
@@ -1774,7 +1774,7 @@ void do_cmd_bash(void)
                x = p_ptr->x + ddx[dir];
 
                /* Get grid */
-               c_ptr = &cave[y][x];
+               c_ptr = &grid_array[y][x];
 
                /* Feature code (applying "mimic" field) */
                feat = get_feat_mimic(c_ptr);
@@ -1857,7 +1857,7 @@ void do_cmd_alter(void)
                x = p_ptr->x + ddx[dir];
 
                /* Get grid */
-               c_ptr = &cave[y][x];
+               c_ptr = &grid_array[y][x];
 
                /* Feature code (applying "mimic" field) */
                feat = get_feat_mimic(c_ptr);
@@ -1979,7 +1979,7 @@ void do_cmd_spike(void)
 
                y = p_ptr->y + ddy[dir];
                x = p_ptr->x + ddx[dir];
-               c_ptr = &cave[y][x];
+               c_ptr = &grid_array[y][x];
 
                /* Feature code (applying "mimic" field) */
                feat = get_feat_mimic(c_ptr);
@@ -2562,7 +2562,7 @@ bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken)
                if (!cave_have_flag_bold(ny[cur_dis], nx[cur_dis], FF_PROJECT))
                {
                        hit_wall = TRUE;
-                       if ((q_ptr->tval == TV_FIGURINE) || object_is_potion(q_ptr) || !cave[ny[cur_dis]][nx[cur_dis]].m_idx) break;
+                       if ((q_ptr->tval == TV_FIGURINE) || object_is_potion(q_ptr) || !grid_array[ny[cur_dis]][nx[cur_dis]].m_idx) break;
                }
 
                /* The player can see the (on screen) missile */
@@ -2598,9 +2598,9 @@ bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken)
                cur_dis++;
 
                /* Monster here, Try to hit it */
-               if (cave[y][x].m_idx)
+               if (grid_array[y][x].m_idx)
                {
-                       grid_type *c_ptr = &cave[y][x];
+                       grid_type *c_ptr = &grid_array[y][x];
                        monster_type *m_ptr = &m_list[c_ptr->m_idx];
 
                        /* Check the visibility */
@@ -2734,17 +2734,17 @@ bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken)
 
                        if (potion_smash_effect(0, y, x, q_ptr->k_idx))
                        {
-                               monster_type *m_ptr = &m_list[cave[y][x].m_idx];
+                               monster_type *m_ptr = &m_list[grid_array[y][x].m_idx];
 
                                /* ToDo (Robert): fix the invulnerability */
-                               if (cave[y][x].m_idx &&
-                                   is_friendly(&m_list[cave[y][x].m_idx]) &&
+                               if (grid_array[y][x].m_idx &&
+                                   is_friendly(&m_list[grid_array[y][x].m_idx]) &&
                                    !MON_INVULNER(m_ptr))
                                {
                                        GAME_TEXT m_name[MAX_NLEN];
-                                       monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
+                                       monster_desc(m_name, &m_list[grid_array[y][x].m_idx], 0);
                                        msg_format(_("%sは怒った!", "%^s gets angry!"), m_name);
-                                       set_hostile(&m_list[cave[y][x].m_idx]);
+                                       set_hostile(&m_list[grid_array[y][x].m_idx]);
                                }
                        }
                        do_drop = FALSE;
@@ -2899,7 +2899,7 @@ void forget_travel_flow(void)
  */
 static int travel_flow_cost(POSITION y, POSITION x)
 {
-       feature_type *f_ptr = &f_info[cave[y][x].feat];
+       feature_type *f_ptr = &f_info[grid_array[y][x].feat];
        int cost = 1;
 
        /* Avoid obstacles (ex. trees) */
@@ -2923,7 +2923,7 @@ static int travel_flow_cost(POSITION y, POSITION x)
        }
 
        /* Detected traps and doors */
-       if (cave[y][x].info & (CAVE_MARK))
+       if (grid_array[y][x].info & (CAVE_MARK))
        {
                if (have_flag(f_ptr->flags, FF_DOOR)) cost += 1;
                if (have_flag(f_ptr->flags, FF_TRAP)) cost += 10;
@@ -2942,7 +2942,7 @@ static int travel_flow_cost(POSITION y, POSITION x)
  */
 static void travel_flow_aux(POSITION y, POSITION x, int n, bool wall)
 {
-       grid_type *c_ptr = &cave[y][x];
+       grid_type *c_ptr = &grid_array[y][x];
        feature_type *f_ptr = &f_info[c_ptr->feat];
        int old_head = flow_head;
        int add_cost = 1;
@@ -2959,7 +2959,7 @@ static void travel_flow_aux(POSITION y, POSITION x, int n, bool wall)
        /* Ignore "walls" and "rubble" (include "secret doors") */
        if (have_flag(f_ptr->flags, FF_WALL) ||
                have_flag(f_ptr->flags, FF_CAN_DIG) ||
-               (have_flag(f_ptr->flags, FF_DOOR) && cave[y][x].mimic) ||
+               (have_flag(f_ptr->flags, FF_DOOR) && grid_array[y][x].mimic) ||
                (!have_flag(f_ptr->flags, FF_MOVE) && have_flag(f_ptr->flags, FF_CAN_FLY) && !p_ptr->levitation))
        {
                if (!wall || !from_wall) return;
@@ -3001,7 +3001,7 @@ static void travel_flow(POSITION ty, POSITION tx)
 {
        POSITION x, y, d;
        bool wall = FALSE;
-       feature_type *f_ptr = &f_info[cave[p_ptr->y][p_ptr->x].feat];
+       feature_type *f_ptr = &f_info[grid_array[p_ptr->y][p_ptr->x].feat];
 
        /* Reset the "queue" */
        flow_head = flow_tail = 0;
@@ -3062,12 +3062,12 @@ void do_cmd_travel(void)
                return;
        }
 
-       f_ptr = &f_info[cave[y][x].feat];
+       f_ptr = &f_info[grid_array[y][x].feat];
 
-       if ((cave[y][x].info & CAVE_MARK) &&
+       if ((grid_array[y][x].info & CAVE_MARK) &&
                (have_flag(f_ptr->flags, FF_WALL) ||
                        have_flag(f_ptr->flags, FF_CAN_DIG) ||
-                       (have_flag(f_ptr->flags, FF_DOOR) && cave[y][x].mimic)))
+                       (have_flag(f_ptr->flags, FF_DOOR) && grid_array[y][x].mimic)))
        {
                msg_print(_("そこには行くことができません!", "You cannot travel there!"));
                return;
index 93f1288..24fea9b 100644 (file)
@@ -5273,7 +5273,7 @@ static void do_cmd_knowledge_artifacts(void)
        {
                for (x = 0; x < cur_wid; x++)
                {
-                       grid_type *c_ptr = &cave[y][x];
+                       grid_type *c_ptr = &grid_array[y][x];
 
                        OBJECT_IDX this_o_idx, next_o_idx = 0;
 
index ee010e3..9ba22b4 100644 (file)
 #define MAX_SAVED_FLOORS       20 /*!< 保存フロアの最大数 / Maximum number of saved floors. */
 
 /*!
- * @brief プレイヤー用光源処理配列サイズ / Maximum size of the "lite" array (see "cave.c")
+ * @brief プレイヤー用光源処理配列サイズ / Maximum size of the "lite" array (see "grid_array.c")
  * @details Note that the "lite radius" will NEVER exceed 14, and we would
  * never require more than 581 entries in the array for circular "lite".
  */
 #define LITE_MAX 600
 
 /*!
- * @brief モンスター用光源処理配列サイズ / Maximum size of the "mon_lite" array (see "cave.c")
+ * @brief モンスター用光源処理配列サイズ / Maximum size of the "mon_lite" array (see "grid_array.c")
  * @details Note that the "view radius" will NEVER exceed 20, monster illumination
  * flags are dependent on CAVE_VIEW, and even if the "view" was octagonal,
  * we would never require more than 1520 entries in the array.
 #define MON_LITE_MAX 1536
 
 /*!
- * @brief 視界処理配列サイズ / Maximum size of the "view" array (see "cave.c")
+ * @brief 視界処理配列サイズ / Maximum size of the "view" array (see "grid_array.c")
  * @details Note that the "view radius" will NEVER exceed 20, and even if the "view"
  * was octagonal, we would never require more than 1520 entries in the array.
  */
 #define VIEW_MAX 1536
 
 /*!
- * @brief 視界及び光源の過渡処理配列サイズ / Maximum size of the "temp" array (see "cave.c")
+ * @brief 視界及び光源の過渡処理配列サイズ / Maximum size of the "temp" array (see "grid_array.c")
  * @details We must be as large as "VIEW_MAX" and "LITE_MAX" for proper functioning
  * of "update_view()" and "update_lite()".  We must also be as large as the
  * largest illuminatable room, but no room is larger than 800 grids.  We
 #define TEMP_MAX 2298
 
 /*!
- * @brief 再描画処理用配列サイズ / Maximum size of the "redraw" array (see "cave.c")
+ * @brief 再描画処理用配列サイズ / Maximum size of the "redraw" array (see "grid_array.c")
  * @details We must be large for proper functioning of delayed redrawing.
  * We must also be as large as two times of the largest view area.
  * Note that maximum view grids are 1149 entries.
 
 
 /*
- * 特殊なマス状態フラグ / Special cave grid flags
+ * 特殊なマス状態フラグ / Special grid flags
  */
 #define CAVE_MARK       0x0001    /*!< 現在プレイヤーの記憶に収まっている / memorized feature */
 #define CAVE_GLOW       0x0002    /*!< マス自体が光源を持っている / self-illuminating */
 #define CAVE_MNLT       0x0100    /*!< モンスターの光源によって照らされている / Illuminated by monster */
 #define CAVE_MNDK       0x8000    /*!< モンスターの暗源によって暗闇になっている / Darken by monster */
 
-/* Used only while cave generation */
+/* Used only while grid_array generation */
 #define CAVE_FLOOR      0x0200 /*!< フロア属性のあるマス */
 #define CAVE_EXTRA      0x0400
 #define CAVE_INNER      0x0800
 #define CAVE_VAULT      0x4000
 #define CAVE_MASK (CAVE_FLOOR | CAVE_EXTRA | CAVE_INNER | CAVE_OUTER | CAVE_SOLID | CAVE_VAULT)
 
-/* Used only after cave generation */
+/* Used only after grid_array generation */
 #define CAVE_KNOWN      0x0200    /* Directly viewed or map detected flag */
 #define CAVE_NOTE       0x0400    /* Flag for delayed visual update (needs note_spot()) */
 #define CAVE_REDRAW     0x0800    /* Flag for delayed visual update (needs lite_spot()) */
  * Grid based version of "player_bold()"
  */
 #define player_grid(C) \
-       ((C) == &cave[p_ptr->y][p_ptr->x])
+       ((C) == &grid_array[p_ptr->y][p_ptr->x])
 
 
 #define cave_have_flag_bold(Y,X,INDEX) \
-       (have_flag(f_info[cave[(Y)][(X)].feat].flags, (INDEX)))
+       (have_flag(f_info[grid_array[(Y)][(X)].feat].flags, (INDEX)))
 
 
 #define cave_have_flag_grid(C,INDEX) \
  * Determine if a "legal" grid supports "los"
  */
 #define cave_los_bold(Y,X) \
-       (feat_supports_los(cave[(Y)][(X)].feat))
+       (feat_supports_los(grid_array[(Y)][(X)].feat))
 
 #define cave_los_grid(C) \
        (feat_supports_los((C)->feat))
  */
 #define cave_clean_bold(Y,X) \
        (cave_have_flag_bold((Y), (X), FF_FLOOR) && \
-        !(cave[Y][X].info & CAVE_OBJECT) && \
-         (cave[Y][X].o_idx == 0))
+        !(grid_array[Y][X].info & CAVE_OBJECT) && \
+         (grid_array[Y][X].o_idx == 0))
 
 
 /*
  */
 #define cave_drop_bold(Y,X) \
        (cave_have_flag_bold((Y), (X), FF_DROP) && \
-        !(cave[Y][X].info & CAVE_OBJECT))
+        !(grid_array[Y][X].info & CAVE_OBJECT))
 
 
 /*
  */
 #define cave_empty_bold(Y,X) \
        (cave_have_flag_bold((Y), (X), FF_PLACE) && \
-        !(cave[Y][X].m_idx) && \
+        !(grid_array[Y][X].m_idx) && \
         !player_bold(Y,X))
 
 
  */
 #define cave_naked_bold(Y,X) \
        (cave_clean_bold(Y,X) && \
-        !(cave[Y][X].m_idx) && \
+        !(grid_array[Y][X].m_idx) && \
         !player_bold(Y,X))
 
 
  * Note the use of comparison to zero to force a "boolean" result
  */
 #define player_has_los_bold(Y,X) \
-    (((cave[Y][X].info & (CAVE_VIEW)) != 0) || p_ptr->inside_battle)
+    (((grid_array[Y][X].info & (CAVE_VIEW)) != 0) || p_ptr->inside_battle)
 
 
 /*
index 08fcb6b..40ba4db 100644 (file)
@@ -613,7 +613,7 @@ static void wreck_the_pattern(void)
 {
        int to_ruin = 0;
        POSITION r_y, r_x;
-       int pattern_type = f_info[cave[p_ptr->y][p_ptr->x].feat].subtype;
+       int pattern_type = f_info[grid_array[p_ptr->y][p_ptr->x].feat].subtype;
 
        if (pattern_type == PATTERN_TILE_WRECKED)
        {
@@ -632,7 +632,7 @@ static void wreck_the_pattern(void)
                scatter(&r_y, &r_x, p_ptr->y, p_ptr->x, 4, 0);
 
                if (pattern_tile(r_y, r_x) &&
-                   (f_info[cave[r_y][r_x].feat].subtype != PATTERN_TILE_WRECKED))
+                   (f_info[grid_array[r_y][r_x].feat].subtype != PATTERN_TILE_WRECKED))
                {
                        cave_set_feat(r_y, r_x, feat_pattern_corrupted);
                }
@@ -657,7 +657,7 @@ static bool pattern_effect(void)
                wreck_the_pattern();
        }
 
-       pattern_type = f_info[cave[p_ptr->y][p_ptr->x].feat].subtype;
+       pattern_type = f_info[grid_array[p_ptr->y][p_ptr->x].feat].subtype;
 
        switch (pattern_type)
        {
@@ -1368,7 +1368,7 @@ static void process_world_aux_digestion(void)
  */
 static void process_world_aux_hp_and_sp(void)
 {
-       feature_type *f_ptr = &f_info[cave[p_ptr->y][p_ptr->x].feat];
+       feature_type *f_ptr = &f_info[grid_array[p_ptr->y][p_ptr->x].feat];
        bool cave_no_regen = FALSE;
        int upkeep_factor = 0;
 
@@ -1435,7 +1435,7 @@ static void process_world_aux_hp_and_sp(void)
        {
                if (!dun_level && !p_ptr->resist_lite && !IS_INVULN() && is_daytime())
                {
-                       if ((cave[p_ptr->y][p_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
+                       if ((grid_array[p_ptr->y][p_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
                        {
                                msg_print(_("日光があなたのアンデッドの肉体を焼き焦がした!", "The sun's rays scorch your undead flesh!"));
                                take_hit(DAMAGE_NOESCAPE, 1, _("日光", "sunlight"), -1);
@@ -1490,11 +1490,11 @@ static void process_world_aux_hp_and_sp(void)
                        {
                                msg_print(_("熱で火傷した!", "The heat burns you!"));
                                take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"), 
-                                                               f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name), -1);
+                                                               f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name), -1);
                        }
                        else
                        {
-                               concptr name = f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name;
+                               concptr name = f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name;
                                msg_format(_("%sで火傷した!", "The %s burns you!"), name);
                                take_hit(DAMAGE_NOESCAPE, damage, name, -1);
                        }
@@ -1528,11 +1528,11 @@ static void process_world_aux_hp_and_sp(void)
                        {
                                msg_print(_("冷気に覆われた!", "The cold engulfs you!"));
                                take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
-                                       f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name), -1);
+                                       f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name), -1);
                        }
                        else
                        {
-                               concptr name = f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name;
+                               concptr name = f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name;
                                msg_format(_("%sに凍えた!", "The %s frostbites you!"), name);
                                take_hit(DAMAGE_NOESCAPE, damage, name, -1);
                        }
@@ -1566,11 +1566,11 @@ static void process_world_aux_hp_and_sp(void)
                        {
                                msg_print(_("電撃を受けた!", "The electric shocks you!"));
                                take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
-                                       f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name), -1);
+                                       f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name), -1);
                        }
                        else
                        {
-                               concptr name = f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name;
+                               concptr name = f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name;
                                msg_format(_("%sに感電した!", "The %s shocks you!"), name);
                                take_hit(DAMAGE_NOESCAPE, damage, name, -1);
                        }
@@ -1604,11 +1604,11 @@ static void process_world_aux_hp_and_sp(void)
                        {
                                msg_print(_("酸が飛び散った!", "The acid melt you!"));
                                take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
-                                       f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name), -1);
+                                       f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name), -1);
                        }
                        else
                        {
-                               concptr name = f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name;
+                               concptr name = f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name;
                                msg_format(_("%sに溶かされた!", "The %s melts you!"), name);
                                take_hit(DAMAGE_NOESCAPE, damage, name, -1);
                        }
@@ -1642,12 +1642,12 @@ static void process_world_aux_hp_and_sp(void)
                        {
                                msg_print(_("毒気を吸い込んだ!", "The gas poisons you!"));
                                take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
-                                       f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name), -1);
+                                       f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name), -1);
                                if (p_ptr->resist_pois) (void)set_poisoned(p_ptr->poisoned + 1);
                        }
                        else
                        {
-                               concptr name = f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name;
+                               concptr name = f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name;
                                msg_format(_("%sに毒された!", "The %s poisons you!"), name);
                                take_hit(DAMAGE_NOESCAPE, damage, name, -1);
                                if (p_ptr->resist_pois) (void)set_poisoned(p_ptr->poisoned + 3);
@@ -2364,7 +2364,7 @@ static void process_world_aux_mutation(void)
                msg_print(NULL);
 
                /* Absorb light from the current possition */
-               if ((cave[p_ptr->y][p_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
+               if ((grid_array[p_ptr->y][p_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
                {
                        hp_player(10);
                }
@@ -3159,7 +3159,7 @@ static int get_monster_crowd_number(MONSTER_IDX m_idx)
                if (!in_bounds(ay, ax)) continue;
 
                /* Count number of monsters */
-               if (cave[ay][ax].m_idx > 0) count++;
+               if (grid_array[ay][ax].m_idx > 0) count++;
        }
 
        return count;
@@ -3405,7 +3405,7 @@ static void process_world(void)
                for (i2 = 0; i2 < cur_wid; ++i2)
                        for (j2 = 0; j2 < cur_hgt; j2++)
                        {
-                               grid_type *c_ptr = &cave[j2][i2];
+                               grid_type *c_ptr = &grid_array[j2][i2];
 
                                if ((c_ptr->m_idx > 0) && (c_ptr->m_idx != p_ptr->riding))
                                {
@@ -4814,7 +4814,7 @@ static void process_player(void)
                                if (place_monster_aux(0, y, x, r_idx, PM_NO_KAGE))
                                {
                                        GAME_TEXT m_name[MAX_NLEN];
-                                       monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
+                                       monster_desc(m_name, &m_list[grid_array[y][x].m_idx], 0);
                                        msg_format(_("%sが釣れた!", "You have a good catch!"), m_name);
                                        success = TRUE;
                                }
@@ -6139,7 +6139,7 @@ void play_game(bool new_game)
                /* Handle "quit and save" */
                if (!p_ptr->playing && !p_ptr->is_dead) break;
 
-               /* Erase the old cave */
+               /* Erase the old grid_array */
                wipe_o_list();
                if (!p_ptr->is_dead) wipe_m_list();
 
index 3e5f146..629437c 100644 (file)
@@ -1621,7 +1621,7 @@ bool set_superstealth(bool set)
        {
                if (!(p_ptr->special_defense & NINJA_S_STEALTH))
                {
-                       if (cave[p_ptr->y][p_ptr->x].info & CAVE_MNLT)
+                       if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_MNLT)
                        {
                                msg_print(_("敵の目から薄い影の中に覆い隠された。", "You are mantled in weak shadow from ordinary eyes."));
                                p_ptr->monlite = p_ptr->old_monlite = TRUE;
index 211d71c..e7ebb78 100644 (file)
@@ -264,7 +264,7 @@ extern const char angband_term_name[8][16];
 extern byte angband_color_table[256][4];
 extern const concptr angband_sound_name[SOUND_MAX];
 extern const concptr angband_music_basic_name[MUSIC_BASIC_MAX];
-extern grid_type *cave[MAX_HGT];
+extern grid_type *grid_array[MAX_HGT];
 extern saved_floor_type saved_floors[MAX_SAVED_FLOORS];
 extern FLOOR_IDX max_floor_id;
 extern u32b saved_floor_file_sign;
@@ -466,7 +466,7 @@ extern void get_height_weight(void);
 extern void player_outfit(void);
 extern void dump_yourself(FILE *fff);
 
-/* cave.c */
+/* grid_array.c */
 extern POSITION distance(POSITION y1, POSITION x1, POSITION y2, POSITION x2);
 extern bool is_trap(IDX feat);
 extern bool is_known_trap(grid_type *c_ptr);
index 0fd1a13..a417ac6 100644 (file)
@@ -12,8 +12,8 @@ void day_break()
                {
                        for (x = 0; x < cur_wid; x++)
                        {
-                               /* Get the cave grid */
-                               grid_type *c_ptr = &cave[y][x];
+                               /* Get the grid */
+                               grid_type *c_ptr = &grid_array[y][x];
 
                                /* Assume lit */
                                c_ptr->info |= (CAVE_GLOW);
@@ -33,7 +33,7 @@ void day_break()
 
        if (p_ptr->special_defense & NINJA_S_STEALTH)
        {
-               if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+               if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
        }
 
 }
@@ -50,8 +50,8 @@ void night_falls(void)
                {
                        for (x = 0; x < cur_wid; x++)
                        {
-                               /* Get the cave grid */
-                               grid_type *c_ptr = &cave[y][x];
+                               /* Get the grid */
+                               grid_type *c_ptr = &grid_array[y][x];
 
                                /* Feature code (applying "mimic" field) */
                                feature_type *f_ptr = &f_info[get_feat_mimic(c_ptr)];
@@ -84,7 +84,7 @@ void night_falls(void)
 
        if (p_ptr->special_defense & NINJA_S_STEALTH)
        {
-               if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+               if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
        }
 
 }
@@ -102,7 +102,7 @@ MONSTER_NUMBER count_all_hostile_monsters(void)
        {
                for (y = 0; y < cur_hgt; ++y)
                {
-                       MONSTER_IDX m_idx = cave[y][x].m_idx;
+                       MONSTER_IDX m_idx = grid_array[y][x].m_idx;
 
                        if (m_idx > 0 && is_hostile(&m_list[m_idx]))
                        {
index 9197c21..dfb850b 100644 (file)
@@ -83,7 +83,7 @@
  * demon).  Note that both "nests" and "pits" are now "level dependant",\n
  * and both make 16 "expensive" calls to the "get_mon_num()" function.\n
  *\n
- * Note that the cave grid flags changed in a rather drastic manner\n
+ * Note that the grid flags changed in a rather drastic manner\n
  * for Angband 2.8.0 (and 2.7.9+), in particular, dungeon terrain\n
  * features, such as doors and stairs and traps and rubble and walls,\n
  * are all handled as a set of 64 possible "terrain features", and\n
@@ -147,7 +147,7 @@ static int next_to_walls(POSITION y, POSITION x)
  */
 static bool alloc_stairs_aux(POSITION y, POSITION x, int walls)
 {
-       grid_type *c_ptr = &cave[y][x];
+       grid_type *c_ptr = &grid_array[y][x];
 
        /* Require "naked" floor grid */
        if (!is_floor_grid(c_ptr)) return FALSE;
@@ -260,7 +260,7 @@ static bool alloc_stairs(IDX feat, int num, int walls)
 
                                if (!pick) break;
                        }
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
 
                        /* Clear possible garbage of hidden trap */
                        c_ptr->mimic = 0;
@@ -308,7 +308,7 @@ static void alloc_object(int set, EFFECT_ID typ, int num)
                        y = randint0(cur_hgt);
                        x = randint0(cur_wid);
 
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
 
                        /* Require "naked" floor grid */
                        if (!is_floor_grid(c_ptr) || c_ptr->o_idx || c_ptr->m_idx) continue;
@@ -317,7 +317,7 @@ static void alloc_object(int set, EFFECT_ID typ, int num)
                        if (player_bold(y, x)) continue;
 
                        /* Check for "room" */
-                       room = (cave[y][x].info & CAVE_ROOM) ? TRUE : FALSE;
+                       room = (grid_array[y][x].info & CAVE_ROOM) ? TRUE : FALSE;
 
                        /* Require corridor? */
                        if ((set == ALLOC_SET_CORR) && room) continue;
@@ -342,14 +342,14 @@ static void alloc_object(int set, EFFECT_ID typ, int num)
                        case ALLOC_TYP_RUBBLE:
                        {
                                place_rubble(y, x);
-                               cave[y][x].info &= ~(CAVE_FLOOR);
+                               grid_array[y][x].info &= ~(CAVE_FLOOR);
                                break;
                        }
 
                        case ALLOC_TYP_TRAP:
                        {
                                place_trap(y, x);
-                               cave[y][x].info &= ~(CAVE_FLOOR);
+                               grid_array[y][x].info &= ~(CAVE_FLOOR);
                                break;
                        }
 
@@ -426,7 +426,7 @@ bool place_quest_monsters(void)
                                        y = randint0(cur_hgt);
                                        x = randint0(cur_wid);
 
-                                       c_ptr = &cave[y][x];
+                                       c_ptr = &grid_array[y][x];
                                        f_ptr = &f_info[c_ptr->feat];
 
                                        if (!have_flag(f_ptr->flags, FF_MOVE) && !have_flag(f_ptr->flags, FF_CAN_FLY)) continue;
@@ -566,7 +566,7 @@ static void gen_caverns_and_lakes(void)
        {
                dun->cavern = TRUE;
 
-               /* make a large fractal cave in the middle of the dungeon */
+               /* make a large fractal grid_array in the middle of the dungeon */
 
                msg_print_wizard(CHEAT_DUNGEON, _("洞窟を生成。", "Cavern on level."));
                build_cavern();
@@ -796,7 +796,7 @@ static bool cave_gen(void)
                        /* Connect the room to the previous room */
                        if (randint1(dun_level) > d_info[p_ptr->dungeon_idx].tunnel_percent)
                        {
-                               /* make cave-like tunnel */
+                               /* make cavelike tunnel */
                                (void)build_tunnel2(dun->cent[i].x, dun->cent[i].y, x, y, 2, 2);
                        }
                        else
@@ -814,7 +814,7 @@ static bool cave_gen(void)
                                feature_type *f_ptr;
                                y = dun->tunn[j].y;
                                x = dun->tunn[j].x;
-                               c_ptr = &cave[y][x];
+                               c_ptr = &grid_array[y][x];
                                f_ptr = &f_info[c_ptr->feat];
 
                                /* Clear previous contents (if not a lake), add a floor */
@@ -833,7 +833,7 @@ static bool cave_gen(void)
                                grid_type *c_ptr;
                                y = dun->wall[j].y;
                                x = dun->wall[j].x;
-                               c_ptr = &cave[y][x];
+                               c_ptr = &grid_array[y][x];
 
                                /* Clear mimic type */
                                c_ptr->mimic = 0;
@@ -899,15 +899,15 @@ static bool cave_gen(void)
        /* Special boundary walls -- Top and bottom */
        for (x = 0; x < cur_wid; x++)
        {
-               set_bound_perm_wall(&cave[0][x]);
-               set_bound_perm_wall(&cave[cur_hgt - 1][x]);
+               set_bound_perm_wall(&grid_array[0][x]);
+               set_bound_perm_wall(&grid_array[cur_hgt - 1][x]);
        }
 
        /* Special boundary walls -- Left and right */
        for (y = 1; y < (cur_hgt - 1); y++)
        {
-               set_bound_perm_wall(&cave[y][0]);
-               set_bound_perm_wall(&cave[y][cur_wid - 1]);
+               set_bound_perm_wall(&grid_array[y][0]);
+               set_bound_perm_wall(&grid_array[y][cur_wid - 1]);
        }
 
        /* Determine the character location */
@@ -974,12 +974,12 @@ static bool cave_gen(void)
 
        if (dun->empty_level && (!one_in_(DARK_EMPTY) || (randint1(100) > dun_level)) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
        {
-               /* Lite the cave */
+               /* Lite the grid_array */
                for (y = 0; y < cur_hgt; y++)
                {
                        for (x = 0; x < cur_wid; x++)
                        {
-                               cave[y][x].info |= (CAVE_GLOW);
+                               grid_array[y][x].info |= (CAVE_GLOW);
                        }
                }
        }
@@ -1007,40 +1007,40 @@ static void build_arena(void)
                for (j = x_left; j <= x_right; j++)
                {
                        place_extra_perm_bold(i, j);
-                       cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+                       grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
                }
        for (i = y_depth; i >= y_depth - 5; i--)
                for (j = x_left; j <= x_right; j++)
                {
                        place_extra_perm_bold(i, j);
-                       cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+                       grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
                }
        for (j = x_left; j <= x_left + 17; j++)
                for (i = y_height; i <= y_depth; i++)
                {
                        place_extra_perm_bold(i, j);
-                       cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+                       grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
                }
        for (j = x_right; j >= x_right - 17; j--)
                for (i = y_height; i <= y_depth; i++)
                {
                        place_extra_perm_bold(i, j);
-                       cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+                       grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
                }
 
        place_extra_perm_bold(y_height+6, x_left+18);
-       cave[y_height+6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
+       grid_array[y_height+6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
        place_extra_perm_bold(y_depth-6, x_left+18);
-       cave[y_depth-6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
+       grid_array[y_depth-6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
        place_extra_perm_bold(y_height+6, x_right-18);
-       cave[y_height+6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
+       grid_array[y_height+6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
        place_extra_perm_bold(y_depth-6, x_right-18);
-       cave[y_depth-6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
+       grid_array[y_depth-6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
 
        i = y_height + 5;
        j = xval;
-       cave[i][j].feat = f_tag_to_index("ARENA_GATE");
-       cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+       grid_array[i][j].feat = f_tag_to_index("ARENA_GATE");
+       grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
        player_place(i, j);
 }
 
@@ -1067,7 +1067,7 @@ static void arena_gen(void)
                        place_solid_perm_bold(y, x);
 
                        /* Illuminate and memorize the walls */
-                       cave[y][x].info |= (CAVE_GLOW | CAVE_MARK);
+                       grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
                }
        }
 
@@ -1077,7 +1077,7 @@ static void arena_gen(void)
                for (x = qx + 1; x < qx + SCREEN_WID - 1; x++)
                {
                        /* Create empty floor */
-                       cave[y][x].feat = feat_floor;
+                       grid_array[y][x].feat = feat_floor;
                }
        }
 
@@ -1112,46 +1112,46 @@ static void build_battle(void)
                for (j = x_left; j <= x_right; j++)
                {
                        place_extra_perm_bold(i, j);
-                       cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+                       grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
                }
        for (i = y_depth; i >= y_depth - 3; i--)
                for (j = x_left; j <= x_right; j++)
                {
                        place_extra_perm_bold(i, j);
-                       cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+                       grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
                }
        for (j = x_left; j <= x_left + 17; j++)
                for (i = y_height; i <= y_depth; i++)
                {
                        place_extra_perm_bold(i, j);
-                       cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+                       grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
                }
        for (j = x_right; j >= x_right - 17; j--)
                for (i = y_height; i <= y_depth; i++)
                {
                        place_extra_perm_bold(i, j);
-                       cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+                       grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
                }
 
        place_extra_perm_bold(y_height+6, x_left+18);
-       cave[y_height+6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
+       grid_array[y_height+6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
        place_extra_perm_bold(y_depth-4, x_left+18);
-       cave[y_depth-4][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
+       grid_array[y_depth-4][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
        place_extra_perm_bold(y_height+6, x_right-18);
-       cave[y_height+6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
+       grid_array[y_height+6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
        place_extra_perm_bold(y_depth-4, x_right-18);
-       cave[y_depth-4][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
+       grid_array[y_depth-4][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
 
        for (i = y_height + 1; i <= y_height + 5; i++)
                for (j = x_left + 20 + 2 * (y_height + 5 - i); j <= x_right - 20 - 2 * (y_height + 5 - i); j++)
                {
-                       cave[i][j].feat = feat_permanent_glass_wall;
+                       grid_array[i][j].feat = feat_permanent_glass_wall;
                }
 
        i = y_height + 1;
        j = xval;
-       cave[i][j].feat = f_tag_to_index("BUILDING_3");
-       cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+       grid_array[i][j].feat = f_tag_to_index("BUILDING_3");
+       grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
        player_place(i, j);
 }
 
@@ -1175,7 +1175,7 @@ static void battle_gen(void)
                        place_solid_perm_bold(y, x);
 
                        /* Illuminate and memorize the walls */
-                       cave[y][x].info |= (CAVE_GLOW | CAVE_MARK);
+                       grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
                }
        }
 
@@ -1185,7 +1185,7 @@ static void battle_gen(void)
                for (x = qx + 1; x < qx + SCREEN_WID - 1; x++)
                {
                        /* Create empty floor */
-                       cave[y][x].feat = feat_floor;
+                       grid_array[y][x].feat = feat_floor;
                }
        }
 
@@ -1194,7 +1194,7 @@ static void battle_gen(void)
        for(i = 0; i < 4; i++)
        {
                place_monster_aux(0, p_ptr->y + 8 + (i/2)*4, p_ptr->x - 2 + (i%2)*4, battle_mon[i], (PM_NO_KAGE | PM_NO_PET));
-               set_friendly(&m_list[cave[p_ptr->y+8+(i/2)*4][p_ptr->x-2+(i%2)*4].m_idx]);
+               set_friendly(&m_list[grid_array[p_ptr->y+8+(i/2)*4][p_ptr->x-2+(i%2)*4].m_idx]);
        }
        for(i = 1; i < m_max; i++)
        {
@@ -1304,7 +1304,7 @@ static bool level_gen(concptr *why)
 }
 
 /*!
- * @brief フロアに存在する全マスの記憶状態を初期化する / Wipe all unnecessary flags after cave generation
+ * @brief フロアに存在する全マスの記憶状態を初期化する / Wipe all unnecessary flags after grid_array generation
  * @return なし
  */
 void wipe_generate_cave_flags(void)
@@ -1316,7 +1316,7 @@ void wipe_generate_cave_flags(void)
                for (x = 0; x < cur_wid; x++)
                {
                        /* Wipe unused flags */
-                       cave[y][x].info &= ~(CAVE_MASK);
+                       grid_array[y][x].info &= ~(CAVE_MASK);
                }
        }
 
@@ -1327,14 +1327,14 @@ void wipe_generate_cave_flags(void)
                        for (x = 1; x < cur_wid - 1; x++)
                        {
                                /* There might be trap */
-                               cave[y][x].info |= CAVE_UNSAFE;
+                               grid_array[y][x].info |= CAVE_UNSAFE;
                        }
                }
        }
 }
 
 /*!
- * @brief フロアの全情報を初期化する / Clear and empty the cave
+ * @brief フロアの全情報を初期化する / Clear and empty the grid_array
  * @return なし
  */
 void clear_cave(void)
@@ -1359,12 +1359,12 @@ void clear_cave(void)
        precalc_cur_num_of_pet();
 
 
-       /* Start with a blank cave */
+       /* Start with a blank grid_array */
        for (y = 0; y < MAX_HGT; y++)
        {
                for (x = 0; x < MAX_WID; x++)
                {
-                       grid_type *c_ptr = &cave[y][x];
+                       grid_type *c_ptr = &grid_array[y][x];
                        c_ptr->info = 0;
                        c_ptr->feat = 0;
                        c_ptr->o_idx = 0;
@@ -1410,7 +1410,7 @@ void generate_cave(void)
 
                concptr why = NULL;
 
-               /* Clear and empty the cave */
+               /* Clear and empty the grid_array */
                clear_cave();
 
                /* Build the arena -KMW- */
@@ -1575,7 +1575,7 @@ bool build_tunnel(POSITION row1, POSITION col1, POSITION row2, POSITION col2)
 
 
                /* Access the location */
-               c_ptr = &cave[tmp_row][tmp_col];
+               c_ptr = &grid_array[tmp_row][tmp_col];
 
                /* Avoid "solid" walls */
                if (is_solid_grid(c_ptr)) continue;
@@ -1713,7 +1713,7 @@ static bool set_tunnel(POSITION *x, POSITION *y, bool affectwall)
 {
        int i, j, dx, dy;
 
-       grid_type *c_ptr = &cave[*y][*x];
+       grid_type *c_ptr = &grid_array[*y][*x];
 
        if (!in_bounds(*y, *x)) return TRUE;
 
@@ -1768,7 +1768,7 @@ static bool set_tunnel(POSITION *x, POSITION *y, bool affectwall)
                }
 
                /* Clear mimic type */
-               cave[*y][*x].mimic = 0;
+               grid_array[*y][*x].mimic = 0;
 
                place_floor_bold(*y, *x);
 
@@ -2034,7 +2034,7 @@ bool build_tunnel2(POSITION x1, POSITION y1, POSITION x2, POSITION y2, int type,
                        y3 = (y1 + y2) / 2;
                }
                /* cache c_ptr */
-               c_ptr = &cave[y3][x3];
+               c_ptr = &grid_array[y3][x3];
                if (is_solid_grid(c_ptr))
                {
                        /* move midpoint a bit to avoid problem. */
@@ -2064,14 +2064,14 @@ bool build_tunnel2(POSITION x1, POSITION y1, POSITION x2, POSITION y2, int type,
                        }
                        y3 += dy;
                        x3 += dx;
-                       c_ptr = &cave[y3][x3];
+                       c_ptr = &grid_array[y3][x3];
                }
 
                if (is_floor_grid(c_ptr))
                {
                        if (build_tunnel2(x1, y1, x3, y3, type, cutoff))
                        {
-                               if ((cave[y3][x3].info & CAVE_ROOM) || (randint1(100) > 95))
+                               if ((grid_array[y3][x3].info & CAVE_ROOM) || (randint1(100) > 95))
                                {
                                        /* do second half only if works + if have hit a room */
                                        retval = build_tunnel2(x3, y3, x2, y2, type, cutoff);
index 15f4aa2..02a4a84 100644 (file)
@@ -314,7 +314,7 @@ static void build_dead_end(void)
 {
        POSITION x, y;
 
-       /* Clear and empty the cave */
+       /* Clear and empty the grid_array */
        clear_cave();
 
        /* Fill the arrays of floors and walls in the good proportions */
@@ -550,7 +550,7 @@ static void place_pet(void)
                        monster_type *m_ptr = &m_list[m_idx];
                        monster_race *r_ptr;
 
-                       cave[cy][cx].m_idx = m_idx;
+                       grid_array[cy][cx].m_idx = m_idx;
 
                        m_ptr->r_idx = party_mon[i].r_idx;
 
@@ -675,7 +675,7 @@ static void get_out_monster(void)
        POSITION dis = 1;
        POSITION oy = p_ptr->y;
        POSITION ox = p_ptr->x;
-       MONSTER_IDX m_idx = cave[oy][ox].m_idx;
+       MONSTER_IDX m_idx = grid_array[oy][ox].m_idx;
 
        /* Nothing to do if no monster */
        if (!m_idx) return;
@@ -707,8 +707,8 @@ static void get_out_monster(void)
                if (!cave_empty_bold(ny, nx)) continue;
 
                /* Hack -- no teleport onto glyph of warding */
-               if (is_glyph_grid(&cave[ny][nx])) continue;
-               if (is_explosive_rune_grid(&cave[ny][nx])) continue;
+               if (is_glyph_grid(&grid_array[ny][nx])) continue;
+               if (is_explosive_rune_grid(&grid_array[ny][nx])) continue;
 
                /* ...nor onto the Pattern */
                if (pattern_tile(ny, nx)) continue;
@@ -718,10 +718,10 @@ static void get_out_monster(void)
                m_ptr = &m_list[m_idx];
 
                /* Update the old location */
-               cave[oy][ox].m_idx = 0;
+               grid_array[oy][ox].m_idx = 0;
 
                /* Update the new location */
-               cave[ny][nx].m_idx = m_idx;
+               grid_array[ny][nx].m_idx = m_idx;
 
                /* Move the monster */
                m_ptr->fy = ny;
@@ -758,7 +758,7 @@ static void locate_connected_stairs(saved_floor_type *sf_ptr)
        {
                for (x = 0; x < cur_wid; x++)
                {
-                       grid_type *c_ptr = &cave[y][x];
+                       grid_type *c_ptr = &grid_array[y][x];
                        feature_type *f_ptr = &f_info[c_ptr->feat];
                        bool ok = FALSE;
 
@@ -825,7 +825,7 @@ static void locate_connected_stairs(saved_floor_type *sf_ptr)
                prepare_change_floor_mode(CFM_RAND_PLACE | CFM_NO_RETURN);
 
                /* Mega Hack -- It's not the stairs you enter.  Disable it.  */
-               if (!feat_uses_special(cave[p_ptr->y][p_ptr->x].feat)) cave[p_ptr->y][p_ptr->x].special = 0;
+               if (!feat_uses_special(grid_array[p_ptr->y][p_ptr->x].feat)) grid_array[p_ptr->y][p_ptr->x].special = 0;
        }
        else
        {
@@ -936,7 +936,7 @@ void leave_floor(void)
        if (change_floor_mode & CFM_SAVE_FLOORS)
        {
                /* Extract stair position */
-               c_ptr = &cave[p_ptr->y][p_ptr->x];
+               c_ptr = &grid_array[p_ptr->y][p_ptr->x];
                f_ptr = &f_info[c_ptr->feat];
 
                /* Get back to old saved floor? */
@@ -1075,7 +1075,7 @@ void leave_floor(void)
  * @return なし
  * @details
  * If the floor is an old saved floor, it will be\n
- * restored from the temporal file.  If the floor is new one, new cave\n
+ * restored from the temporal file.  If the floor is new one, new grid_array\n
  * will be generated.\n
  */
 void change_floor(void)
@@ -1102,7 +1102,7 @@ void change_floor(void)
        if (!(change_floor_mode & CFM_SAVE_FLOORS) &&
            !(change_floor_mode & CFM_FIRST_FLOOR))
        {
-               /* Create cave */
+               /* Create grid_array */
                generate_cave();
 
                /* Paranoia -- No new saved floor */
@@ -1133,7 +1133,7 @@ void change_floor(void)
                                /* Forbid return stairs */
                                if (change_floor_mode & CFM_NO_RETURN)
                                {
-                                       grid_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
+                                       grid_type *c_ptr = &grid_array[p_ptr->y][p_ptr->x];
 
                                        if (!feat_uses_special(c_ptr->feat))
                                        {
@@ -1296,7 +1296,7 @@ void change_floor(void)
                        }
                        else
                        {
-                               /* Newly create cave */
+                               /* Newly create grid_array */
                                generate_cave();
                        }
 
@@ -1310,7 +1310,7 @@ void change_floor(void)
                        if (!(change_floor_mode & CFM_NO_RETURN))
                        {
                                /* Extract stair position */
-                               grid_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
+                               grid_type *c_ptr = &grid_array[p_ptr->y][p_ptr->x];
 
                                /*** Create connected stairs ***/
 
@@ -1475,7 +1475,7 @@ void stair_creation(void)
                {
                        for (x = 0; x < cur_wid; x++)
                        {
-                               grid_type *c_ptr = &cave[y][x];
+                               grid_type *c_ptr = &grid_array[y][x];
 
                                if (!c_ptr->special) continue;
                                if (feat_uses_special(c_ptr->feat)) continue;
@@ -1520,5 +1520,5 @@ void stair_creation(void)
 
 
        /* Connect this stairs to the destination */
-       cave[p_ptr->y][p_ptr->x].special = dest_floor_id;
+       grid_array[p_ptr->y][p_ptr->x].special = dest_floor_id;
 }
index d8bd9e6..6df2e71 100644 (file)
@@ -108,7 +108,7 @@ static void recursive_river(POSITION x1, POSITION y1, POSITION x2, POSITION y2,
                                        {
                                                if (!in_bounds2(ty, tx)) continue;
 
-                                               c_ptr = &cave[ty][tx];
+                                               c_ptr = &grid_array[ty][tx];
 
                                                if (c_ptr->feat == feat1) continue;
                                                if (c_ptr->feat == feat2) continue;
@@ -264,7 +264,7 @@ void build_streamer(IDX feat, int chance)
                                if (!in_bounds2(ty, tx)) continue;
                                break;
                        }
-                       c_ptr = &cave[ty][tx];
+                       c_ptr = &grid_array[ty][tx];
                        f_ptr = &f_info[c_ptr->feat];
 
                        if (have_flag(f_ptr->flags, FF_MOVE) && (have_flag(f_ptr->flags, FF_WATER) || have_flag(f_ptr->flags, FF_LAVA)))
@@ -390,7 +390,7 @@ void place_trees(POSITION x, POSITION y)
                for (j = y - 3; j < y + 4; j++)
                {
                        if (!in_bounds(j, i)) continue;
-                       c_ptr = &cave[j][i];
+                       c_ptr = &grid_array[j][i];
 
                        if (c_ptr->info & CAVE_ICKY) continue;
                        if (c_ptr->o_idx) continue;
@@ -405,18 +405,18 @@ void place_trees(POSITION x, POSITION y)
                                if ((distance(j, i, y, x) > 1) || (randint1(100) < 25))
                                {
                                        if (randint1(100) < 75)
-                                               cave[j][i].feat = feat_tree;
+                                               grid_array[j][i].feat = feat_tree;
                                }
                                else
                                {
-                                       cave[j][i].feat = feat_rubble;
+                                       grid_array[j][i].feat = feat_rubble;
                                }
 
                                /* Clear garbage of hidden trap or door */
                                c_ptr->mimic = 0;
 
                                /* Light area since is open above */
-                               if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) cave[j][i].info |= (CAVE_GLOW | CAVE_ROOM);
+                               if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) grid_array[j][i].info |= (CAVE_GLOW | CAVE_ROOM);
                        }
                }
        }
@@ -425,7 +425,7 @@ void place_trees(POSITION x, POSITION y)
        if (!ironman_downward && one_in_(3))
        {
                /* up stair */
-               cave[y][x].feat = feat_up_stair;
+               grid_array[y][x].feat = feat_up_stair;
        }
 }
 
index f3a1b06..e030a59 100644 (file)
@@ -40,7 +40,7 @@ bool new_player_spot(void)
                y = (POSITION)rand_range(1, cur_hgt - 2);
                x = (POSITION)rand_range(1, cur_wid - 2);
 
-               c_ptr = &cave[y][x];
+               c_ptr = &grid_array[y][x];
 
                /* Must be a "naked" floor grid */
                if (c_ptr->m_idx) continue;
@@ -95,7 +95,7 @@ void place_random_stairs(POSITION y, POSITION x)
        grid_type *c_ptr;
 
        /* Paranoia */
-       c_ptr = &cave[y][x];
+       c_ptr = &grid_array[y][x];
        if (!is_floor_grid(c_ptr) || c_ptr->o_idx) return;
 
        /* Town */
@@ -134,7 +134,7 @@ void place_random_door(POSITION y, POSITION x, bool room)
 {
        int tmp, type;
        FEAT_IDX feat = feat_none;
-       grid_type *c_ptr = &cave[y][x];
+       grid_type *c_ptr = &grid_array[y][x];
 
        /* Initialize mimic info */
        c_ptr->mimic = 0;
@@ -254,7 +254,7 @@ void place_closed_door(POSITION y, POSITION x, int type)
                cave_set_feat(y, x, feat);
 
                /* Now it is not floor */
-               cave[y][x].info &= ~(CAVE_MASK);
+               grid_array[y][x].info &= ~(CAVE_MASK);
        }
        else
        {
@@ -277,7 +277,7 @@ void place_locked_door(POSITION y, POSITION x)
        else
        {
                set_cave_feat(y, x, feat_locked_door_random((d_info[p_ptr->dungeon_idx].flags1 & DF1_GLASS_DOOR) ? DOOR_GLASS_DOOR : DOOR_DOOR));
-               cave[y][x].info &= ~(CAVE_FLOOR);
+               grid_array[y][x].info &= ~(CAVE_FLOOR);
                delete_monster(y, x);
        }
 }
@@ -298,7 +298,7 @@ void place_secret_door(POSITION y, POSITION x, int type)
        }
        else
        {
-               grid_type *c_ptr = &cave[y][x];
+               grid_type *c_ptr = &grid_array[y][x];
 
                if (type == DOOR_DEFAULT)
                {
@@ -407,7 +407,7 @@ static int next_to_corr(POSITION y1, POSITION x1)
                /* Extract the location */
                y = y1 + ddy_ddd[i];
                x = x1 + ddx_ddd[i];
-               c_ptr = &cave[y][x];
+               c_ptr = &grid_array[y][x];
 
                /* Skip non floors */
                if (cave_have_flag_grid(c_ptr, FF_WALL)) continue;
@@ -476,7 +476,7 @@ void try_door(POSITION y, POSITION x)
        if (cave_have_flag_bold(y, x, FF_WALL)) return;
 
        /* Ignore room grids */
-       if (cave[y][x].info & (CAVE_ROOM)) return;
+       if (grid_array[y][x].info & (CAVE_ROOM)) return;
 
        /* Occasional door (if allowed) */
        if ((randint0(100) < dun_tun_jct) && possible_doorway(y, x) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_DOORS))
@@ -581,7 +581,7 @@ void vault_objects(POSITION y, POSITION x, int num)
                        }
 
                        /* Require "clean" floor space */
-                       c_ptr = &cave[j][k];
+                       c_ptr = &grid_array[j][k];
                        if (!is_floor_grid(c_ptr) || c_ptr->o_idx) continue;
 
                        if (randint0(100) < 75)
@@ -635,7 +635,7 @@ void vault_trap_aux(POSITION y, POSITION x, POSITION yd, POSITION xd)
                }
 
                /* Require "naked" floor grids */
-               c_ptr = &cave[y1][x1];
+               c_ptr = &grid_array[y1][x1];
                if (!is_floor_grid(c_ptr) || c_ptr->o_idx || c_ptr->m_idx) continue;
 
                /* Place the trap */
@@ -693,7 +693,7 @@ void vault_monsters(POSITION y1, POSITION x1, int num)
                        scatter(&y, &x, y1, x1, d, 0);
 
                        /* Require "empty" floor grids */
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
                        if (!cave_empty_grid(c_ptr)) continue;
 
                        /* Place the monster (allow groups) */
@@ -781,7 +781,7 @@ void set_floor(POSITION x, POSITION y)
                return;
        }
 
-       if (cave[y][x].info & CAVE_ROOM)
+       if (grid_array[y][x].info & CAVE_ROOM)
        {
                /* A room border don't touch. */
                return;
index 01d6efe..8c6e701 100644 (file)
 
 /* Macros */
 
-#define set_cave_feat(Y,X,F)    (cave[(Y)][(X)].feat = (F))
-#define add_cave_info(Y,X,I)    (cave[(Y)][(X)].info |= (I))
+#define set_cave_feat(Y,X,F)    (grid_array[(Y)][(X)].feat = (F))
+#define add_cave_info(Y,X,I)    (grid_array[(Y)][(X)].info |= (I))
 
 /* This should not be used */
-/*#define set_cave_info(Y,X,I)    (cave[(Y)][(X)].info = (I)) */
+/*#define set_cave_info(Y,X,I)    (grid_array[(Y)][(X)].info = (I)) */
 
 /*!
  * @brief 指定座標が瓦礫かどうかを返す
  * @param X 指定X座標
  * @return FLOOR属性を持っているならばTRUE
  */
-#define is_floor_bold(Y,X) (cave[Y][X].info & CAVE_FLOOR)
-#define is_extra_bold(Y,X) (cave[Y][X].info & CAVE_EXTRA)
+#define is_floor_bold(Y,X) (grid_array[Y][X].info & CAVE_FLOOR)
+#define is_extra_bold(Y,X) (grid_array[Y][X].info & CAVE_EXTRA)
 
-#define is_inner_bold(Y,X) (cave[Y][X].info & CAVE_INNER)
-#define is_outer_bold(Y,X) (cave[Y][X].info & CAVE_OUTER)
-#define is_solid_bold(Y,X) (cave[Y][X].info & CAVE_SOLID)
+#define is_inner_bold(Y,X) (grid_array[Y][X].info & CAVE_INNER)
+#define is_outer_bold(Y,X) (grid_array[Y][X].info & CAVE_OUTER)
+#define is_solid_bold(Y,X) (grid_array[Y][X].info & CAVE_SOLID)
 
 #define is_floor_grid(C) ((C)->info & CAVE_FLOOR)
 #define is_extra_grid(C) ((C)->info & CAVE_EXTRA)
@@ -66,7 +66,7 @@
 #define place_floor_bold(Y, X) \
 { \
        set_cave_feat(Y,X,feat_ground_type[randint0(100)]); \
-       cave[Y][X].info &= ~(CAVE_MASK); \
+       grid_array[Y][X].info &= ~(CAVE_MASK); \
        add_cave_info(Y,X,CAVE_FLOOR); \
        delete_monster(Y, X); \
 }
@@ -82,7 +82,7 @@
 #define place_extra_bold(Y, X) \
 { \
        set_cave_feat(Y,X,feat_wall_type[randint0(100)]); \
-       cave[Y][X].info &= ~(CAVE_MASK); \
+       grid_array[Y][X].info &= ~(CAVE_MASK); \
        add_cave_info(Y,X,CAVE_EXTRA); \
        delete_monster(Y, X); \
 }
@@ -98,7 +98,7 @@
 #define place_extra_perm_bold(Y, X) \
 { \
        set_cave_feat(Y,X,feat_permanent); \
-       cave[Y][X].info &= ~(CAVE_MASK); \
+       grid_array[Y][X].info &= ~(CAVE_MASK); \
        add_cave_info(Y,X,CAVE_EXTRA); \
        delete_monster(Y, X); \
 }
 { \
        feature_type *_f_ptr; \
        set_cave_feat(Y,X,feat_wall_type[randint0(100)]); \
-       _f_ptr = &f_info[cave[Y][X].feat]; \
-       if (permanent_wall(_f_ptr)) cave[Y][X].feat = feat_state(cave[Y][X].feat, FF_UNPERM); \
-       cave[Y][X].info &= ~(CAVE_MASK); \
+       _f_ptr = &f_info[grid_array[Y][X].feat]; \
+       if (permanent_wall(_f_ptr)) grid_array[Y][X].feat = feat_state(grid_array[Y][X].feat, FF_UNPERM); \
+       grid_array[Y][X].info &= ~(CAVE_MASK); \
        add_cave_info(Y,X,CAVE_EXTRA); \
        delete_monster(Y, X); \
 }
 #define place_inner_bold(Y, X) \
 { \
        set_cave_feat(Y,X,feat_wall_inner); \
-       cave[Y][X].info &= ~(CAVE_MASK); \
+       grid_array[Y][X].info &= ~(CAVE_MASK); \
        add_cave_info(Y,X,CAVE_INNER); \
        delete_monster(Y, X); \
 }
 #define place_inner_perm_bold(Y, X) \
 { \
        set_cave_feat(Y,X,feat_permanent); \
-       cave[Y][X].info &= ~(CAVE_MASK); \
+       grid_array[Y][X].info &= ~(CAVE_MASK); \
        add_cave_info(Y,X,CAVE_INNER); \
        delete_monster(Y, X); \
 }
 #define place_outer_bold(Y, X) \
 { \
        set_cave_feat(Y,X,feat_wall_outer); \
-       cave[Y][X].info &= ~(CAVE_MASK); \
+       grid_array[Y][X].info &= ~(CAVE_MASK); \
        add_cave_info(Y,X,CAVE_OUTER); \
        delete_monster(Y, X); \
 }
 #define place_outer_perm_bold(Y, X) \
 { \
        set_cave_feat(Y,X,feat_permanent); \
-       cave[Y][X].info &= ~(CAVE_MASK); \
+       grid_array[Y][X].info &= ~(CAVE_MASK); \
        add_cave_info(Y,X,CAVE_OUTER); \
        delete_monster(Y, X); \
 }
        feature_type *_f_ptr = &f_info[feat_wall_outer]; \
        if (permanent_wall(_f_ptr)) set_cave_feat(Y, X, (s16b)feat_state(feat_wall_outer, FF_UNPERM)); \
        else set_cave_feat(Y,X,feat_wall_outer); \
-       cave[Y][X].info &= ~(CAVE_MASK); \
+       grid_array[Y][X].info &= ~(CAVE_MASK); \
        add_cave_info(Y,X,(CAVE_OUTER | CAVE_VAULT)); \
        delete_monster(Y, X); \
 }
 #define place_solid_bold(Y, X) \
 { \
        set_cave_feat(Y,X,feat_wall_solid); \
-       cave[Y][X].info &= ~(CAVE_MASK); \
+       grid_array[Y][X].info &= ~(CAVE_MASK); \
        add_cave_info(Y,X,CAVE_SOLID); \
        delete_monster(Y, X); \
 }
 #define place_solid_perm_bold(Y, X) \
 { \
        set_cave_feat(Y,X,feat_permanent); \
-       cave[Y][X].info &= ~(CAVE_MASK); \
+       grid_array[Y][X].info &= ~(CAVE_MASK); \
        add_cave_info(Y,X,CAVE_SOLID); \
        delete_monster(Y, X); \
 }
 #define place_solid_noperm_bold(Y, X) \
 { \
        feature_type *_f_ptr = &f_info[feat_wall_solid]; \
-       if ((cave[Y][X].info & CAVE_VAULT) && permanent_wall(_f_ptr)) \
+       if ((grid_array[Y][X].info & CAVE_VAULT) && permanent_wall(_f_ptr)) \
                set_cave_feat(Y, X, feat_state(feat_wall_solid, FF_UNPERM)); \
        else set_cave_feat(Y,X,feat_wall_solid); \
-       cave[Y][X].info &= ~(CAVE_MASK); \
+       grid_array[Y][X].info &= ~(CAVE_MASK); \
        add_cave_info(Y,X,CAVE_SOLID); \
        delete_monster(Y, X); \
 }
index f370b7d..818e136 100644 (file)
@@ -3900,7 +3900,7 @@ static errr parse_line_building(char *buf)
  */
 static void drop_here(object_type *j_ptr, POSITION y, POSITION x)
 {
-       grid_type *c_ptr = &cave[y][x];
+       grid_type *c_ptr = &grid_array[y][x];
        object_type *o_ptr;
 
        OBJECT_IDX o_idx = o_pop();
@@ -3969,7 +3969,7 @@ static errr process_dungeon_file_aux(char *buf, int ymin, int xmin, int ymax, in
                return parse_line_feature(buf);
        }
 
-       /* Process "D:<dungeon>" -- info for the cave grids */
+       /* Process "D:<dungeon>" -- info for the grid_array grids */
        else if (buf[0] == 'D')
        {
                object_type object_type_body;
@@ -3984,7 +3984,7 @@ static errr process_dungeon_file_aux(char *buf, int ymin, int xmin, int ymax, in
 
                for (*x = xmin, i = 0; ((*x < xmax) && (i < len)); (*x)++, s++, i++)
                {
-                       grid_type *c_ptr = &cave[*y][*x];
+                       grid_type *c_ptr = &grid_array[*y][*x];
 
                        int idx = s[0];
 
index 4427839..b3d5a94 100644 (file)
@@ -1234,11 +1234,11 @@ static errr init_other(void)
        /* Allocate and Wipe the max dungeon level */
        C_MAKE(max_dlv, max_d_idx, DEPTH);
 
-       /* Allocate and wipe each line of the cave */
+       /* Allocate and wipe each line of the grid_array */
        for (i = 0; i < MAX_HGT; i++)
        {
-               /* Allocate one row of the cave */
-               C_MAKE(cave[i], MAX_WID, grid_type);
+               /* Allocate one row of the grid_array */
+               C_MAKE(grid_array[i], MAX_WID, grid_type);
        }
 
 
index 44770ae..2deaa35 100644 (file)
@@ -2618,8 +2618,8 @@ static errr rd_dungeon_old(void)
                /* Apply the RLE info */
                for (i = count; i > 0; i--)
                {
-                       /* Access the cave */
-                       c_ptr = &cave[y][x];
+                       /* Access the grid_array */
+                       c_ptr = &grid_array[y][x];
 
                        /* Extract "info" */
                        c_ptr->info = info;
@@ -2649,8 +2649,8 @@ static errr rd_dungeon_old(void)
                /* Apply the RLE info */
                for (i = count; i > 0; i--)
                {
-                       /* Access the cave */
-                       c_ptr = &cave[y][x];
+                       /* Access the grid_array */
+                       c_ptr = &grid_array[y][x];
 
                        /* Extract "feat" */
                        c_ptr->feat = (s16b)tmp8u;
@@ -2679,8 +2679,8 @@ static errr rd_dungeon_old(void)
                /* Apply the RLE info */
                for (i = count; i > 0; i--)
                {
-                       /* Access the cave */
-                       c_ptr = &cave[y][x];
+                       /* Access the grid_array */
+                       c_ptr = &grid_array[y][x];
 
                        /* Extract "mimic" */
                        c_ptr->mimic = (s16b)tmp8u;
@@ -2709,8 +2709,8 @@ static errr rd_dungeon_old(void)
                /* Apply the RLE info */
                for (i = count; i > 0; i--)
                {
-                       /* Access the cave */
-                       c_ptr = &cave[y][x];
+                       /* Access the grid_array */
+                       c_ptr = &grid_array[y][x];
 
                        /* Extract "feat" */
                        c_ptr->special = tmp16s;
@@ -2727,13 +2727,13 @@ static errr rd_dungeon_old(void)
                }
        }
 
-       /* Convert cave data */
+       /* Convert grid_array data */
        if (z_older_than(11, 0, 99))
        {
                for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++)
                {
                        /* Wipe old unused flags */
-                       cave[y][x].info &= ~(CAVE_MASK);
+                       grid_array[y][x].info &= ~(CAVE_MASK);
                }
        }
 
@@ -2741,8 +2741,8 @@ static errr rd_dungeon_old(void)
        {
                for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++)
                {
-                       /* Access the cave */
-                       c_ptr = &cave[y][x];
+                       /* Access the grid_array */
+                       c_ptr = &grid_array[y][x];
 
                        /* Very old */
                        if (c_ptr->feat == OLD_FEAT_INVIS)
@@ -2764,8 +2764,8 @@ static errr rd_dungeon_old(void)
        {
                for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++)
                {
-                       /* Access the cave */
-                       c_ptr = &cave[y][x];
+                       /* Access the grid_array */
+                       c_ptr = &grid_array[y][x];
 
                        /* Old CAVE_IN_MIRROR flag */
                        if (c_ptr->info & CAVE_OBJECT)
@@ -2804,8 +2804,8 @@ static errr rd_dungeon_old(void)
        {
                for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++)
                {
-                       /* Access the cave */
-                       c_ptr = &cave[y][x];
+                       /* Access the grid_array */
+                       c_ptr = &grid_array[y][x];
 
                        if ((c_ptr->special == OLD_QUEST_WATER_CAVE) && !dun_level)
                        {
@@ -2886,7 +2886,7 @@ static errr rd_dungeon_old(void)
                else
                {
                        /* Access the item location */
-                       c_ptr = &cave[o_ptr->iy][o_ptr->ix];
+                       c_ptr = &grid_array[o_ptr->iy][o_ptr->ix];
 
                        /* Build a stack */
                        o_ptr->next_o_idx = c_ptr->o_idx;
@@ -2933,7 +2933,7 @@ static errr rd_dungeon_old(void)
 
 
                /* Access grid */
-               c_ptr = &cave[m_ptr->fy][m_ptr->fx];
+               c_ptr = &grid_array[m_ptr->fy][m_ptr->fx];
 
                /* Mark the location */
                c_ptr->m_idx = m_idx;
@@ -2984,7 +2984,7 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
        cave_template_type *templates;
 
 
-       /*** Wipe all cave ***/
+       /*** Wipe all grid_array ***/
        clear_cave();
 
 
@@ -3103,10 +3103,10 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
                /* Apply the RLE info */
                for (i = count; i > 0; i--)
                {
-                       /* Access the cave */
-                       grid_type *c_ptr = &cave[y][x];
+                       /* Access the grid_array */
+                       grid_type *c_ptr = &grid_array[y][x];
 
-                       /* Extract cave data */
+                       /* Extract grid_array data */
                        c_ptr->info = templates[id].info;
                        c_ptr->feat = templates[id].feat;
                        c_ptr->mimic = templates[id].mimic;
@@ -3129,8 +3129,8 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
        {
                for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++)
                {
-                       /* Access the cave */
-                       grid_type *c_ptr = &cave[y][x];
+                       /* Access the grid_array */
+                       grid_type *c_ptr = &grid_array[y][x];
 
                        if ((c_ptr->special == OLD_QUEST_WATER_CAVE) && !dun_level)
                        {
@@ -3204,7 +3204,7 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
                else
                {
                        /* Access the item location */
-                       grid_type *c_ptr = &cave[o_ptr->iy][o_ptr->ix];
+                       grid_type *c_ptr = &grid_array[o_ptr->iy][o_ptr->ix];
 
                        /* Build a stack */
                        o_ptr->next_o_idx = c_ptr->o_idx;
@@ -3244,7 +3244,7 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
 
 
                /* Access grid */
-               c_ptr = &cave[m_ptr->fy][m_ptr->fx];
+               c_ptr = &grid_array[m_ptr->fy][m_ptr->fx];
 
                /* Mark the location */
                c_ptr->m_idx = m_idx;
index 6500c0e..2059a7e 100644 (file)
@@ -285,7 +285,7 @@ static bool use_mane(int spell)
                MONSTER_IDX m_idx;
 
                if (!target_set(TARGET_KILL)) return FALSE;
-               m_idx = cave[target_row][target_col].m_idx;
+               m_idx = grid_array[target_row][target_col].m_idx;
                if (!m_idx) break;
                if (!player_has_los_bold(target_row, target_col)) break;
                if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
@@ -689,10 +689,10 @@ static bool use_mane(int spell)
                GAME_TEXT m_name[MAX_NLEN];
 
                if (!target_set(TARGET_KILL)) return FALSE;
-               if (!cave[target_row][target_col].m_idx) break;
+               if (!grid_array[target_row][target_col].m_idx) break;
                if (!player_has_los_bold(target_row, target_col)) break;
                if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
-               m_ptr = &m_list[cave[target_row][target_col].m_idx];
+               m_ptr = &m_list[grid_array[target_row][target_col].m_idx];
                r_ptr = &r_info[m_ptr->r_idx];
                monster_desc(m_name, m_ptr, 0);
                if (r_ptr->flagsr & RFR_RES_TELE)
@@ -714,7 +714,7 @@ static bool use_mane(int spell)
                }
                msg_format(_("%sを引き戻した。", "You command %s to return."), m_name);
 
-               teleport_monster_to(cave[target_row][target_col].m_idx, p_ptr->y, p_ptr->x, 100, TELEPORT_PASSIVE);
+               teleport_monster_to(grid_array[target_row][target_col].m_idx, p_ptr->y, p_ptr->x, 100, TELEPORT_PASSIVE);
                break;
        }
        case MS_TELE_AWAY:
index 5f65914..4cbdfd5 100644 (file)
@@ -434,7 +434,7 @@ static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b
        int num = 0, bonus, chance, vir;
        HIT_POINT k;
 
-       grid_type       *c_ptr = &cave[y][x];
+       grid_type       *c_ptr = &grid_array[y][x];
 
        monster_type    *m_ptr = &m_list[c_ptr->m_idx];
        monster_race    *r_ptr = &r_info[m_ptr->r_idx];
@@ -1305,7 +1305,7 @@ static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b
        if (do_quake)
        {
                earthquake(p_ptr->y, p_ptr->x, 10);
-               if (!cave[y][x].m_idx) *mdeath = TRUE;
+               if (!grid_array[y][x].m_idx) *mdeath = TRUE;
        }
 }
 
@@ -1324,7 +1324,7 @@ bool py_attack(POSITION y, POSITION x, BIT_FLAGS mode)
        bool            mdeath = FALSE;
        bool            stormbringer = FALSE;
 
-       grid_type       *c_ptr = &cave[y][x];
+       grid_type       *c_ptr = &grid_array[y][x];
        monster_type    *m_ptr = &m_list[c_ptr->m_idx];
        monster_race    *r_ptr = &r_info[m_ptr->r_idx];
        GAME_TEXT m_name[MAX_NLEN];
@@ -3038,7 +3038,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
                                                        r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_RES_SHAR_MASK);
                                        }
 
-                                       if (is_mirror_grid(&cave[p_ptr->y][p_ptr->x]))
+                                       if (is_mirror_grid(&grid_array[p_ptr->y][p_ptr->x]))
                                        {
                                                teleport_player(10, 0L);
                                        }
index 2b9c874..ce179fc 100644 (file)
@@ -1230,7 +1230,7 @@ static bool cast_force_spell(int spell)
                MONSTER_IDX m_idx;
 
                if (!target_set(TARGET_KILL)) return FALSE;
-               m_idx = cave[target_row][target_col].m_idx;
+               m_idx = grid_array[target_row][target_col].m_idx;
                if (!m_idx) break;
                if (!player_has_los_bold(target_row, target_col)) break;
                if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
@@ -1286,7 +1286,7 @@ static int number_of_mirrors(void)
        int val = 0;
        for (x = 0; x < cur_wid; x++) {
                for (y = 0; y < cur_hgt; y++) {
-                       if (is_mirror_grid(&cave[y][x])) val++;
+                       if (is_mirror_grid(&grid_array[y][x])) val++;
                }
        }
        return val;
@@ -1311,7 +1311,7 @@ static bool cast_mirror_spell(int spell)
        {
                /* mirror of seeing */
        case 0:
-               tmp = is_mirror_grid(&cave[p_ptr->y][p_ptr->x]) ? 4 : 0;
+               tmp = is_mirror_grid(&grid_array[p_ptr->y][p_ptr->x]) ? 4 : 0;
                if (plev + tmp > 4)detect_monsters_normal(DETECT_RAD_DEFAULT);
                if (plev + tmp > 18)detect_monsters_invis(DETECT_RAD_DEFAULT);
                if (plev + tmp > 28)set_tim_esp((TIME_EFFECT)plev, FALSE);
@@ -1331,7 +1331,7 @@ static bool cast_mirror_spell(int spell)
                break;
        case 2:
                if (!get_aim_dir(&dir)) return FALSE;
-               if (plev > 9 && is_mirror_grid(&cave[p_ptr->y][p_ptr->x])) {
+               if (plev > 9 && is_mirror_grid(&grid_array[p_ptr->y][p_ptr->x])) {
                        fire_beam(GF_LITE, dir, damroll(3 + ((plev - 1) / 5), 4));
                }
                else {
@@ -1369,7 +1369,7 @@ static bool cast_mirror_spell(int spell)
        case 9:
                for (x = 0; x < cur_wid; x++) {
                        for (y = 0; y < cur_hgt; y++) {
-                               if (is_mirror_grid(&cave[y][x])) {
+                               if (is_mirror_grid(&grid_array[y][x])) {
                                        project(0, 2, y, x, (HIT_POINT)plev, GF_OLD_SLEEP, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
                                }
                        }
@@ -1398,7 +1398,7 @@ static bool cast_mirror_spell(int spell)
                break;
                /* illusion light */
        case 14:
-               tmp = is_mirror_grid(&cave[p_ptr->y][p_ptr->x]) ? 4 : 3;
+               tmp = is_mirror_grid(&grid_array[p_ptr->y][p_ptr->x]) ? 4 : 3;
                slow_monsters(plev);
                stun_monsters(plev*tmp);
                confuse_monsters(plev*tmp);
@@ -1408,7 +1408,7 @@ static bool cast_mirror_spell(int spell)
                break;
                /* mirror shift */
        case 15:
-               if (!is_mirror_grid(&cave[p_ptr->y][p_ptr->x])) {
+               if (!is_mirror_grid(&grid_array[p_ptr->y][p_ptr->x])) {
                        msg_print(_("鏡の国の場所がわからない!", "You cannot find out where is the world of mirror!"));
                        break;
                }
@@ -1474,7 +1474,7 @@ static bool cast_berserk_spell(int spell)
                y = p_ptr->y + ddy[dir];
                x = p_ptr->x + ddx[dir];
 
-               if (!cave[y][x].m_idx)
+               if (!grid_array[y][x].m_idx)
                {
                        msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
                        return FALSE;
@@ -1482,13 +1482,13 @@ static bool cast_berserk_spell(int spell)
 
                py_attack(y, x, 0);
 
-               if (!player_can_enter(cave[y][x].feat, 0) || is_trap(cave[y][x].feat))
+               if (!player_can_enter(grid_array[y][x].feat, 0) || is_trap(grid_array[y][x].feat))
                        break;
 
                y += ddy[dir];
                x += ddx[dir];
 
-               if (player_can_enter(cave[y][x].feat, 0) && !is_trap(cave[y][x].feat) && !cave[y][x].m_idx)
+               if (player_can_enter(grid_array[y][x].feat, 0) && !is_trap(grid_array[y][x].feat) && !grid_array[y][x].m_idx)
                {
                        msg_print(NULL);
                        (void)move_player_effect(y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
@@ -1630,7 +1630,7 @@ static bool cast_ninja_spell(int spell)
                POSITION ty, tx;
 
                if (!target_set(TARGET_KILL)) return FALSE;
-               m_idx = cave[target_row][target_col].m_idx;
+               m_idx = grid_array[target_row][target_col].m_idx;
                if (!m_idx) break;
                if (m_idx == p_ptr->riding) break;
                if (!player_has_los_bold(target_row, target_col)) break;
@@ -1644,7 +1644,7 @@ static bool cast_ninja_spell(int spell)
                {
                        POSITION ny = GRID_Y(path_g[i]);
                        POSITION nx = GRID_X(path_g[i]);
-                       grid_type *c_ptr = &cave[ny][nx];
+                       grid_type *c_ptr = &grid_array[ny][nx];
 
                        if (in_bounds(ny, nx) && cave_empty_bold(ny, nx) &&
                            !(c_ptr->info & CAVE_OBJECT) &&
@@ -1655,10 +1655,10 @@ static bool cast_ninja_spell(int spell)
                        }
                }
                /* Update the old location */
-               cave[target_row][target_col].m_idx = 0;
+               grid_array[target_row][target_col].m_idx = 0;
 
                /* Update the new location */
-               cave[ty][tx].m_idx = (s16b)m_idx;
+               grid_array[ty][tx].m_idx = (s16b)m_idx;
 
                /* Move the monster */
                m_ptr->fy = (byte_hack)ty;
@@ -1966,7 +1966,7 @@ void do_cmd_mind(void)
                        break;
                case MIND_MIRROR_MASTER:
                        /* Cast the spell */
-                       if( is_mirror_grid(&cave[p_ptr->y][p_ptr->x]) )on_mirror = TRUE;
+                       if( is_mirror_grid(&grid_array[p_ptr->y][p_ptr->x]) )on_mirror = TRUE;
                        cast = cast_mirror_spell(n);
                        break;
                case MIND_NINJUTSU:
index fdc473b..5df69c2 100644 (file)
@@ -487,7 +487,7 @@ static bool get_moves_aux2(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
        if (projectable(y1, x1, p_ptr->y, p_ptr->x)) return (FALSE);
 
        /* Set current grid cost */
-       now_cost = cave[y1][x1].cost;
+       now_cost = grid_array[y1][x1].cost;
        if (now_cost == 0) now_cost = 999;
 
        /* Can monster bash or open doors? */
@@ -510,7 +510,7 @@ static bool get_moves_aux2(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
                /* Simply move to player */
                if (player_bold(y, x)) return (FALSE);
 
-               c_ptr = &cave[y][x];
+               c_ptr = &grid_array[y][x];
 
                cost = c_ptr->cost;
 
@@ -607,7 +607,7 @@ static bool get_moves_aux(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp, bool no
        if (player_has_los_bold(y1, x1) && projectable(p_ptr->y, p_ptr->x, y1, x1)) return (FALSE);
 
        /* Monster grid */
-       c_ptr = &cave[y1][x1];
+       c_ptr = &grid_array[y1][x1];
 
        /* If we can hear noises, advance towards them */
        if (c_ptr->cost)
@@ -619,7 +619,7 @@ static bool get_moves_aux(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp, bool no
        else if (c_ptr->when)
        {
                /* Too old smell */
-               if (cave[p_ptr->y][p_ptr->x].when - c_ptr->when > 127) return (FALSE);
+               if (grid_array[p_ptr->y][p_ptr->x].when - c_ptr->when > 127) return (FALSE);
 
                use_scent = TRUE;
                best = 0;
@@ -640,7 +640,7 @@ static bool get_moves_aux(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp, bool no
                /* Ignore locations off of edge */
                if (!in_bounds2(y, x)) continue;
 
-               c_ptr = &cave[y][x];
+               c_ptr = &grid_array[y][x];
 
                /* We're following a scent trail */
                if (use_scent)
@@ -719,13 +719,13 @@ static bool get_fear_moves_aux(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
                if (!in_bounds2(y, x)) continue;
 
                /* Don't move toward player */
-               /* if (cave[y][x].dist < 3) continue; */ /* Hmm.. Need it? */
+               /* if (grid_array[y][x].dist < 3) continue; */ /* Hmm.. Need it? */
 
                /* Calculate distance of this grid from our destination */
                dis = distance(y, x, y1, x1);
 
                /* Score this grid */
-               s = 5000 / (dis + 3) - 500 / (cave[y][x].dist + 1);
+               s = 5000 / (dis + 3) - 500 / (grid_array[y][x].dist + 1);
 
                /* No negative scores */
                if (s < 0) s = 0;
@@ -915,7 +915,7 @@ static bool find_safety(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
                        /* Skip illegal locations */
                        if (!in_bounds(y, x)) continue;
 
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
 
                        /* Skip locations in a wall */
                        if (!monster_can_cross_terrain(c_ptr->feat, &r_info[m_ptr->r_idx], (m_idx == p_ptr->riding) ? CEM_RIDING : 0)) continue;
@@ -927,7 +927,7 @@ static bool find_safety(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
                                if (c_ptr->dist == 0) continue;
 
                                /* Ignore too-distant grids */
-                               if (c_ptr->dist > cave[fy][fx].dist + 2 * d) continue;
+                               if (c_ptr->dist > grid_array[fy][fx].dist + 2 * d) continue;
                        }
 
                        /* Check for absence of shot (more or less) */
@@ -1061,13 +1061,13 @@ static bool get_moves(MONSTER_IDX m_idx, DIRECTION *mm)
        bool         done = FALSE;
        bool         will_run = mon_will_run(m_idx);
        grid_type    *c_ptr;
-       bool         no_flow = ((m_ptr->mflag2 & MFLAG2_NOFLOW) && (cave[m_ptr->fy][m_ptr->fx].cost > 2));
+       bool         no_flow = ((m_ptr->mflag2 & MFLAG2_NOFLOW) && (grid_array[m_ptr->fy][m_ptr->fx].cost > 2));
        bool         can_pass_wall = ((r_ptr->flags2 & RF2_PASS_WALL) && ((m_idx != p_ptr->riding) || p_ptr->pass_wall));
 
        /* Counter attack to an enemy monster */
        if (!will_run && m_ptr->target_y)
        {
-               int t_m_idx = cave[m_ptr->target_y][m_ptr->target_x].m_idx;
+               int t_m_idx = grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
 
                /* The monster must be an enemy, and in LOS */
                if (t_m_idx &&
@@ -1085,7 +1085,7 @@ static bool get_moves(MONSTER_IDX m_idx, DIRECTION *mm)
        if (!done && !will_run && is_hostile(m_ptr) &&
            (r_ptr->flags1 & RF1_FRIENDS) &&
            ((los(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x) && projectable(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)) ||
-           (cave[m_ptr->fy][m_ptr->fx].dist < MAX_SIGHT / 2)))
+           (grid_array[m_ptr->fy][m_ptr->fx].dist < MAX_SIGHT / 2)))
        {
        /*
         * Animal packs try to get the player out of corridors
@@ -1104,7 +1104,7 @@ static bool get_moves(MONSTER_IDX m_idx, DIRECTION *mm)
 
                                if (!in_bounds2(yy, xx)) continue;
 
-                               c_ptr = &cave[yy][xx];
+                               c_ptr = &grid_array[yy][xx];
 
                                /* Check grid */
                                if (monster_can_cross_terrain(c_ptr->feat, r_ptr, 0))
@@ -1113,7 +1113,7 @@ static bool get_moves(MONSTER_IDX m_idx, DIRECTION *mm)
                                        room++;
                                }
                        }
-                       if (cave[p_ptr->y][p_ptr->x].info & CAVE_ROOM) room -= 2;
+                       if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_ROOM) room -= 2;
                        if (!r_ptr->flags4 && !r_ptr->a_ability_flags1 && !r_ptr->a_ability_flags2) room -= 2;
 
                        /* Not in a room and strong player */
@@ -1126,7 +1126,7 @@ static bool get_moves(MONSTER_IDX m_idx, DIRECTION *mm)
                }
 
                /* Monster groups try to surround the player */
-               if (!done && (cave[m_ptr->fy][m_ptr->fx].dist < 3))
+               if (!done && (grid_array[m_ptr->fy][m_ptr->fx].dist < 3))
                {
                        int i;
 
@@ -2341,7 +2341,7 @@ void process_monster(MONSTER_IDX m_idx)
                        {
                                /* Ignore locations off of edge */
                                if (!in_bounds2(y, x)) continue;
-                               if (cave[y][x].m_idx) k++;
+                               if (grid_array[y][x].m_idx) k++;
                        }
                }
 
@@ -2446,7 +2446,7 @@ void process_monster(MONSTER_IDX m_idx)
                /* Give priority to counter attack? */
                if (m_ptr->target_y)
                {
-                       MONSTER_IDX t_m_idx = cave[m_ptr->target_y][m_ptr->target_x].m_idx;
+                       MONSTER_IDX t_m_idx = grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
 
                        /* The monster must be an enemy, and projectable */
                        if (t_m_idx && are_enemies(m_ptr, &m_list[t_m_idx]) &&
@@ -2619,12 +2619,12 @@ void process_monster(MONSTER_IDX m_idx)
                /* Ignore locations off of edge */
                if (!in_bounds2(ny, nx)) continue;
 
-               /* Access that cave grid */
-               c_ptr = &cave[ny][nx];
+               /* Access that grid */
+               c_ptr = &grid_array[ny][nx];
                f_ptr = &f_info[c_ptr->feat];
                can_cross = monster_can_cross_terrain(c_ptr->feat, r_ptr, is_riding_mon ? CEM_RIDING : 0);
 
-               /* Access that cave grid's contents */
+               /* Access that grid's contents */
                y_ptr = &m_list[c_ptr->m_idx];
 
                /* Hack -- player 'in' wall */
@@ -2922,7 +2922,7 @@ void process_monster(MONSTER_IDX m_idx)
                        else if ((r_ptr->flags2 & RF2_MOVE_BODY) && !(r_ptr->flags1 & RF1_NEVER_MOVE) &&
                                (r_ptr->mexp > z_ptr->mexp) &&
                                can_cross && (c_ptr->m_idx != p_ptr->riding) &&
-                               monster_can_cross_terrain(cave[m_ptr->fy][m_ptr->fx].feat, z_ptr, 0))
+                               monster_can_cross_terrain(grid_array[m_ptr->fy][m_ptr->fx].feat, z_ptr, 0))
                        {
                                /* Allow movement */
                                do_move = TRUE;
@@ -3018,7 +3018,7 @@ void process_monster(MONSTER_IDX m_idx)
                        if (!is_riding_mon)
                        {
                                /* Hack -- Update the old location */
-                               cave[oy][ox].m_idx = c_ptr->m_idx;
+                               grid_array[oy][ox].m_idx = c_ptr->m_idx;
 
                                /* Mega-Hack -- move the old monster, if any */
                                if (c_ptr->m_idx)
@@ -3421,14 +3421,14 @@ void process_monsters(void)
                        test = TRUE;
                }
 
-#if 0 /* (cave[p_ptr->y][p_ptr->x].when == cave[fy][fx].when) is always FALSE... */
+#if 0 /* (grid_array[p_ptr->y][p_ptr->x].when == grid_array[fy][fx].when) is always FALSE... */
                /* Hack -- Monsters can "smell" the player from far away */
                /* Note that most monsters have "aaf" of "20" or so */
                else if (!(m_ptr->mflag2 & MFLAG2_NOFLOW) &&
                        cave_have_flag_bold(p_ptr->y, p_ptr->x, FF_MOVE) &&
-                       (cave[p_ptr->y][p_ptr->x].when == cave[fy][fx].when) &&
-                       (cave[fy][fx].dist < MONSTER_FLOW_DEPTH) &&
-                       (cave[fy][fx].dist < r_ptr->aaf))
+                       (grid_array[p_ptr->y][p_ptr->x].when == grid_array[fy][fx].when) &&
+                       (grid_array[fy][fx].dist < MONSTER_FLOW_DEPTH) &&
+                       (grid_array[fy][fx].dist < r_ptr->aaf))
                {
                        /* We can "smell" the player */
                        test = TRUE;
index ff6acf2..ed95e8f 100644 (file)
@@ -2173,7 +2173,7 @@ monsterrace_hook_type get_monster_hook(void)
  */
 monsterrace_hook_type get_monster_hook2(POSITION y, POSITION x)
 {
-       feature_type *f_ptr = &f_info[cave[y][x].feat];
+       feature_type *f_ptr = &f_info[grid_array[y][x].feat];
 
        /* Set the monster list */
 
@@ -2370,7 +2370,7 @@ bool monster_can_cross_terrain(FEAT_IDX feat, monster_race *r_ptr, BIT_FLAGS16 m
  */
 bool monster_can_enter(POSITION y, POSITION x, monster_race *r_ptr, BIT_FLAGS16 mode)
 {
-       grid_type *c_ptr = &cave[y][x];
+       grid_type *c_ptr = &grid_array[y][x];
 
        /* Player or other monster */
        if (player_bold(y, x)) return FALSE;
index 5c7f806..bcd99ea 100644 (file)
@@ -266,7 +266,7 @@ void delete_monster_idx(MONSTER_IDX i)
        if (p_ptr->riding == i) p_ptr->riding = 0;
 
        /* Monster is gone */
-       cave[y][x].m_idx = 0;
+       grid_array[y][x].m_idx = 0;
 
        for (this_o_idx = m_ptr->hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
        {
@@ -317,7 +317,7 @@ void delete_monster(POSITION y, POSITION x)
        if (!in_bounds(y, x)) return;
 
        /* Check the grid */
-       c_ptr = &cave[y][x];
+       c_ptr = &grid_array[y][x];
 
        /* Delete the monster (if any) */
        if (c_ptr->m_idx) delete_monster_idx(c_ptr->m_idx);
@@ -348,9 +348,9 @@ static void compact_monsters_aux(IDX i1, IDX i2)
        x = m_ptr->fx;
 
        /* Cave grid */
-       c_ptr = &cave[y][x];
+       c_ptr = &grid_array[y][x];
 
-       /* Update the cave */
+       /* Update the grid_array */
        c_ptr->m_idx = i2;
 
        /* Repair objects being carried by monster */
@@ -540,7 +540,7 @@ void wipe_m_list(void)
                if (!m_ptr->r_idx) continue;
 
                /* Monster is gone */
-               cave[m_ptr->fy][m_ptr->fx].m_idx = 0;
+               grid_array[m_ptr->fy][m_ptr->fx].m_idx = 0;
 
                /* Wipe the Monster */
                (void)WIPE(m_ptr, monster_type);
@@ -2667,7 +2667,7 @@ static bool monster_hook_chameleon_lord(MONRACE_IDX r_idx)
        if ((r_ptr->blow[0].method == RBM_EXPLODE) || (r_ptr->blow[1].method == RBM_EXPLODE) || (r_ptr->blow[2].method == RBM_EXPLODE) || (r_ptr->blow[3].method == RBM_EXPLODE))
                return FALSE;
 
-       if (!monster_can_cross_terrain(cave[m_ptr->fy][m_ptr->fx].feat, r_ptr, 0)) return FALSE;
+       if (!monster_can_cross_terrain(grid_array[m_ptr->fy][m_ptr->fx].feat, r_ptr, 0)) return FALSE;
 
        /* Not born */
        if (!(old_r_ptr->flags7 & RF7_CHAMELEON))
@@ -2702,7 +2702,7 @@ static bool monster_hook_chameleon(MONRACE_IDX r_idx)
        if ((r_ptr->blow[0].method == RBM_EXPLODE) || (r_ptr->blow[1].method == RBM_EXPLODE) || (r_ptr->blow[2].method == RBM_EXPLODE) || (r_ptr->blow[3].method == RBM_EXPLODE))
                return FALSE;
 
-       if (!monster_can_cross_terrain(cave[m_ptr->fy][m_ptr->fx].feat, r_ptr, 0)) return FALSE;
+       if (!monster_can_cross_terrain(grid_array[m_ptr->fy][m_ptr->fx].feat, r_ptr, 0)) return FALSE;
 
        /* Not born */
        if (!(old_r_ptr->flags7 & RF7_CHAMELEON))
@@ -2940,7 +2940,7 @@ byte get_mspeed(monster_race *r_ptr)
 static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode)
 {
        /* Access the location */
-       grid_type               *c_ptr = &cave[y][x];
+       grid_type               *c_ptr = &grid_array[y][x];
        monster_type    *m_ptr;
        monster_race    *r_ptr = &r_info[r_idx];
        concptr         name = (r_name + r_ptr->name);
@@ -3013,8 +3013,8 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I
                                /* Count all quest monsters */
                                for (i2 = 0; i2 < cur_wid; ++i2)
                                        for (j2 = 0; j2 < cur_hgt; j2++)
-                                               if (cave[j2][i2].m_idx > 0)
-                                                       if (m_list[cave[j2][i2].m_idx].r_idx == quest[hoge].r_idx)
+                                               if (grid_array[j2][i2].m_idx > 0)
+                                                       if (m_list[grid_array[j2][i2].m_idx].r_idx == quest[hoge].r_idx)
                                                                number_mon++;
                                if(number_mon + quest[hoge].cur_num >= quest[hoge].max_num)
                                        return FALSE;
@@ -3715,7 +3715,7 @@ bool alloc_horde(POSITION y, POSITION x)
 
        if (attempts < 1) return FALSE;
 
-       m_idx = cave[y][x].m_idx;
+       m_idx = grid_array[y][x].m_idx;
 
        if (m_list[m_idx].mflag2 & MFLAG2_CHAMELEON) r_ptr = &r_info[m_list[m_idx].r_idx];
 
@@ -3756,7 +3756,7 @@ bool alloc_guardian(bool def_val)
                        ox = randint1(cur_wid - 4) + 2;
 
                        /* Is it a good spot ? */
-                       if (cave_empty_bold2(oy, ox) && monster_can_cross_terrain(cave[oy][ox].feat, &r_info[guardian], 0))
+                       if (cave_empty_bold2(oy, ox) && monster_can_cross_terrain(grid_array[oy][ox].feat, &r_info[guardian], 0))
                        {
                                /* Place the guardian */
                                if (place_monster_aux(0, oy, ox, guardian, (PM_ALLOW_GROUP | PM_NO_KAGE | PM_NO_PET))) return TRUE;
@@ -4480,7 +4480,7 @@ void update_smart_learn(MONSTER_IDX m_idx, int what)
 bool player_place(POSITION y, POSITION x)
 {
        /* Paranoia XXX XXX */
-       if (cave[y][x].m_idx != 0) return FALSE;
+       if (grid_array[y][x].m_idx != 0) return FALSE;
 
        /* Save player location */
        p_ptr->y = y;
index bc5a6f7..87dce4e 100644 (file)
@@ -414,7 +414,7 @@ bool raise_possible(monster_type *m_ptr)
                        if (!los(y, x, yy, xx)) continue;
                        if (!projectable(y, x, yy, xx)) continue;
 
-                       c_ptr = &cave[yy][xx];
+                       c_ptr = &grid_array[yy][xx];
                        /* Scan the pile of objects */
                        for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
                        {
@@ -483,9 +483,9 @@ bool clean_shot(POSITION y1, POSITION x1, POSITION y2, POSITION x2, bool is_frie
                y = GRID_Y(grid_g[i]);
                x = GRID_X(grid_g[i]);
 
-               if ((cave[y][x].m_idx > 0) && !((y == y2) && (x == x2)))
+               if ((grid_array[y][x].m_idx > 0) && !((y == y2) && (x == x2)))
                {
-                       monster_type *m_ptr = &m_list[cave[y][x].m_idx];
+                       monster_type *m_ptr = &m_list[grid_array[y][x].m_idx];
                        if (is_friend == is_pet(m_ptr))
                        {
                                return (FALSE);
@@ -1260,7 +1260,7 @@ static bool adjacent_grid_check(monster_type *m_ptr, POSITION *yp, POSITION *xp,
                grid_type *c_ptr;
 
                /* Access the next grid */
-               c_ptr = &cave[next_y][next_x];
+               c_ptr = &grid_array[next_y][next_x];
 
                /* Skip this feature */
                if (!cave_have_flag_grid(c_ptr, f_flag)) continue;
@@ -1414,7 +1414,7 @@ bool make_attack_spell(MONSTER_IDX m_idx)
 
                if (los(m_ptr->fy, m_ptr->fx, y_br_lite, x_br_lite))
                {
-                       feature_type *f_ptr = &f_info[cave[y_br_lite][x_br_lite].feat];
+                       feature_type *f_ptr = &f_info[grid_array[y_br_lite][x_br_lite].feat];
 
                        if (!have_flag(f_ptr->flags, FF_LOS))
                        {
@@ -1436,7 +1436,7 @@ bool make_attack_spell(MONSTER_IDX m_idx)
        /* Check path */
        if (projectable(m_ptr->fy, m_ptr->fx, y, x))
        {
-               feature_type *f_ptr = &f_info[cave[y][x].feat];
+               feature_type *f_ptr = &f_info[grid_array[y][x].feat];
 
                if (!have_flag(f_ptr->flags, FF_PROJECT))
                {
index 000d63c..f860f07 100644 (file)
@@ -49,8 +49,8 @@ static bool direct_beam(int y1, int x1, int y2, int x2, monster_type *m_ptr)
 
                if (y == y2 && x == x2)
                        hit2 = TRUE;
-               else if (is_friend && cave[y][x].m_idx > 0 &&
-                        !are_enemies(m_ptr, &m_list[cave[y][x].m_idx]))
+               else if (is_friend && grid_array[y][x].m_idx > 0 &&
+                        !are_enemies(m_ptr, &m_list[grid_array[y][x].m_idx]))
                {
                        /* Friends don't shoot friends */
                        return FALSE;
@@ -316,7 +316,7 @@ bool monst_spell_monst(MONSTER_IDX m_idx)
        /* Is there counter attack target? */
        if (!target_idx && m_ptr->target_y)
        {
-               target_idx = cave[m_ptr->target_y][m_ptr->target_x].m_idx;
+               target_idx = grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
 
                if (target_idx)
                {
index c41456b..dbe6408 100644 (file)
@@ -609,7 +609,7 @@ static bool cast_learned_spell(int spell, bool success)
                MONSTER_IDX m_idx;
 
                if (!target_set(TARGET_KILL)) return FALSE;
-               m_idx = cave[target_row][target_col].m_idx;
+               m_idx = grid_array[target_row][target_col].m_idx;
                if (!m_idx) break;
                if (!player_has_los_bold(target_row, target_col)) break;
                if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
@@ -1051,10 +1051,10 @@ static bool cast_learned_spell(int spell, bool success)
                GAME_TEXT m_name[MAX_NLEN];
 
                if (!target_set(TARGET_KILL)) return FALSE;
-               if (!cave[target_row][target_col].m_idx) break;
+               if (!grid_array[target_row][target_col].m_idx) break;
                if (!player_has_los_bold(target_row, target_col)) break;
                if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
-               m_ptr = &m_list[cave[target_row][target_col].m_idx];
+               m_ptr = &m_list[grid_array[target_row][target_col].m_idx];
                r_ptr = &r_info[m_ptr->r_idx];
                monster_desc(m_name, m_ptr, 0);
                if (r_ptr->flagsr & RFR_RES_TELE)
@@ -1073,7 +1073,7 @@ static bool cast_learned_spell(int spell, bool success)
                        }
                }
         msg_format(_("%sを引き戻した。", "You command %s to return."), m_name);
-               teleport_monster_to(cave[target_row][target_col].m_idx, p_ptr->y, p_ptr->x, 100, TELEPORT_PASSIVE);
+               teleport_monster_to(grid_array[target_row][target_col].m_idx, p_ptr->y, p_ptr->x, 100, TELEPORT_PASSIVE);
                break;
        }
        case MS_TELE_AWAY:
index 3ab3416..05ae76c 100644 (file)
@@ -1980,7 +1980,7 @@ HIT_POINT spell_RF6_SPECIAL_BANORLUPART(MONSTER_IDX m_idx)
                        if (p_ptr->inside_arena || p_ptr->inside_battle || !summon_possible(m_ptr->fy, m_ptr->fx)) 
                                return -1;
 
-                       delete_monster_idx(cave[m_ptr->fy][m_ptr->fx].m_idx);
+                       delete_monster_idx(grid_array[m_ptr->fy][m_ptr->fx].m_idx);
                        summon_named_creature(0, dummy_y, dummy_x, MON_BANOR, mode);
                        m_list[hack_m_idx_ii].hp = dummy_hp;
                        m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
index 17b8545..02fefc8 100644 (file)
@@ -2287,7 +2287,7 @@ bool mutation_power_aux(int power)
                                if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
                                y = p_ptr->y + ddy[dir];
                                x = p_ptr->x + ddx[dir];
-                               c_ptr = &cave[y][x];
+                               c_ptr = &grid_array[y][x];
 
                                if (!c_ptr->m_idx)
                                {
@@ -2332,7 +2332,7 @@ bool mutation_power_aux(int power)
                                if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
                                y = p_ptr->y + ddy[dir];
                                x = p_ptr->x + ddx[dir];
-                               c_ptr = &cave[y][x];
+                               c_ptr = &grid_array[y][x];
                                if (!c_ptr->m_idx)
                                {
                                        msg_print(_("あなたは何もない場所で手を振った。", "You wave your hands in the air."));
index fd194d1..0ea7d08 100644 (file)
@@ -2838,7 +2838,7 @@ bool get_item(OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode)
        if (floor)
        {
                /* Scan all objects in the grid */
-               for (this_o_idx = cave[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+               for (this_o_idx = grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
                {
                        object_type *o_ptr;
                        o_ptr = &o_list[this_o_idx];
@@ -3188,7 +3188,7 @@ bool get_item(OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode)
                                if (allow_floor)
                                {
                                        /* Scan all objects in the grid */
-                                       for (this_o_idx = cave[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+                                       for (this_o_idx = grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
                                        {
                                                object_type *o_ptr;
                                                o_ptr = &o_list[this_o_idx];
@@ -3465,7 +3465,7 @@ object_type *choose_object(OBJECT_IDX *idx, concptr q, concptr s, BIT_FLAGS opti
  * @param mode オプションフラグ
  * @return 対象のマスに落ちているアイテム数
  * @details
- * Return a list of o_list[] indexes of items at the given cave
+ * Return a list of o_list[] indexes of items at the given grid_array
  * location. Valid flags are:
  *
  *             mode & 0x01 -- Item tester
@@ -3482,7 +3482,7 @@ ITEM_NUMBER scan_floor(OBJECT_IDX *items, POSITION y, POSITION x, BIT_FLAGS mode
        if (!in_bounds(y, x)) return 0;
 
        /* Scan all objects in the grid */
-       for (this_o_idx = cave[y][x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+       for (this_o_idx = grid_array[y][x].o_idx; this_o_idx; this_o_idx = next_o_idx)
        {
                object_type *o_ptr;
                o_ptr = &o_list[this_o_idx];
@@ -4368,7 +4368,7 @@ bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode)
                        {
                                int i;
                                OBJECT_IDX o_idx;
-                               grid_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
+                               grid_type *c_ptr = &grid_array[p_ptr->y][p_ptr->x];
 
                                if (command_wrk != (USE_FLOOR)) break;
 
@@ -4842,7 +4842,7 @@ void py_pickup_floor(bool pickup)
        int can_pickup = 0;
 
        /* Scan the pile of objects */
-       for (this_o_idx = cave[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+       for (this_o_idx = grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
        {
                /* Access the object */
                o_ptr = &o_list[this_o_idx];
index 4da5d60..f724a57 100644 (file)
@@ -128,7 +128,7 @@ void excise_object_idx(OBJECT_IDX o_idx)
                POSITION y = j_ptr->iy;
                POSITION x = j_ptr->ix;
 
-               c_ptr = &cave[y][x];
+               c_ptr = &grid_array[y][x];
 
                /* Scan all objects in the grid */
                for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
@@ -223,7 +223,7 @@ void delete_object(POSITION y, POSITION x)
        /* Refuse "illegal" locations */
        if (!in_bounds(y, x)) return;
 
-       c_ptr = &cave[y][x];
+       c_ptr = &grid_array[y][x];
 
        /* Scan all objects in the grid */
        for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
@@ -306,7 +306,7 @@ static void compact_objects_aux(OBJECT_IDX i1, OBJECT_IDX i2)
                x = o_ptr->ix;
 
                /* Acquire grid */
-               c_ptr = &cave[y][x];
+               c_ptr = &grid_array[y][x];
 
                /* Repair grid */
                if (c_ptr->o_idx == i1)
@@ -494,7 +494,7 @@ void wipe_o_list(void)
                        POSITION x = o_ptr->ix;
 
                        /* Access grid */
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
 
                        /* Hack -- see above */
                        c_ptr->o_idx = 0;
@@ -4868,7 +4868,7 @@ void place_object(POSITION y, POSITION x, BIT_FLAGS mode)
        OBJECT_IDX o_idx;
 
        /* Acquire grid */
-       grid_type *c_ptr = &cave[y][x];
+       grid_type *c_ptr = &grid_array[y][x];
 
        object_type forge;
        object_type *q_ptr;
@@ -4982,7 +4982,7 @@ void place_gold(POSITION y, POSITION x)
        OBJECT_IDX o_idx;
 
        /* Acquire grid */
-       grid_type *c_ptr = &cave[y][x];
+       grid_type *c_ptr = &grid_array[y][x];
 
        object_type forge;
        object_type *q_ptr;
@@ -5132,7 +5132,7 @@ OBJECT_IDX drop_near(object_type *j_ptr, PERCENTAGE chance, POSITION y, POSITION
                        if (!projectable(y, x, ty, tx)) continue;
 
                        /* Obtain grid */
-                       c_ptr = &cave[ty][tx];
+                       c_ptr = &grid_array[ty][tx];
 
                        /* Require floor space */
                        if (!cave_drop_bold(ty, tx)) continue;
@@ -5289,7 +5289,7 @@ OBJECT_IDX drop_near(object_type *j_ptr, PERCENTAGE chance, POSITION y, POSITION
        }
 
 
-       c_ptr = &cave[by][bx];
+       c_ptr = &grid_array[by][bx];
 
        /* Scan objects in that grid for combination */
        for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
@@ -6716,7 +6716,7 @@ bool process_warning(POSITION xx, POSITION yy)
 
                        if (!in_bounds(my, mx) || (distance(my, mx, yy, xx) > WARNING_AWARE_RANGE)) continue;
 
-                       c_ptr = &cave[my][mx];
+                       c_ptr = &grid_array[my][mx];
 
                        if (!c_ptr->m_idx) continue;
 
@@ -6814,7 +6814,7 @@ bool process_warning(POSITION xx, POSITION yy)
        }
        else old_damage = old_damage / 2;
 
-       c_ptr = &cave[yy][xx];
+       c_ptr = &grid_array[yy][xx];
        if (((!easy_disarm && is_trap(c_ptr->feat))
            || (c_ptr->mimic && is_trap(c_ptr->feat))) && !one_in_(13))
        {
index 4ff3ba0..7cd8477 100644 (file)
@@ -361,7 +361,7 @@ static void discover_hidden_things(POSITION y, POSITION x)
 {
        OBJECT_IDX this_o_idx, next_o_idx = 0;
        grid_type *c_ptr;
-       c_ptr = &cave[y][x];
+       c_ptr = &grid_array[y][x];
 
        /* Invisible trap */
        if (c_ptr->mimic && is_trap(c_ptr->feat))
@@ -545,7 +545,7 @@ void py_pickup_aux(OBJECT_IDX o_idx)
  */
 void carry(bool pickup)
 {
-       grid_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
+       grid_type *c_ptr = &grid_array[p_ptr->y][p_ptr->x];
 
        OBJECT_IDX this_o_idx, next_o_idx = 0;
 
@@ -669,8 +669,8 @@ void carry(bool pickup)
  */
 bool pattern_seq(POSITION c_y, POSITION c_x, POSITION n_y, POSITION n_x)
 {
-       feature_type *cur_f_ptr = &f_info[cave[c_y][c_x].feat];
-       feature_type *new_f_ptr = &f_info[cave[n_y][n_x].feat];
+       feature_type *cur_f_ptr = &f_info[grid_array[c_y][c_x].feat];
+       feature_type *new_f_ptr = &f_info[grid_array[n_y][n_x].feat];
        bool is_pattern_tile_cur = have_flag(cur_f_ptr->flags, FF_PATTERN);
        bool is_pattern_tile_new = have_flag(new_f_ptr->flags, FF_PATTERN);
        int pattern_type_cur, pattern_type_new;
@@ -825,8 +825,8 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode)
 {
        POSITION oy = p_ptr->y;
        POSITION ox = p_ptr->x;
-       grid_type *c_ptr = &cave[ny][nx];
-       grid_type *oc_ptr = &cave[oy][ox];
+       grid_type *c_ptr = &grid_array[ny][nx];
+       grid_type *oc_ptr = &grid_array[oy][ox];
        feature_type *f_ptr = &f_info[c_ptr->feat];
        feature_type *of_ptr = &f_info[oc_ptr->feat];
 
@@ -1104,7 +1104,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
        POSITION x = p_ptr->x + ddx[dir];
 
        /* Examine the destination */
-       grid_type *c_ptr = &cave[y][x];
+       grid_type *c_ptr = &grid_array[y][x];
 
        feature_type *f_ptr = &f_info[c_ptr->feat];
 
@@ -1253,7 +1253,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
                                py_attack(y, x, 0);
                                oktomove = FALSE;
                        }
-                       else if (monster_can_cross_terrain(cave[p_ptr->y][p_ptr->x].feat, r_ptr, 0))
+                       else if (monster_can_cross_terrain(grid_array[p_ptr->y][p_ptr->x].feat, r_ptr, 0))
                        {
                                do_past = TRUE;
                        }
@@ -1314,7 +1314,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
                }
                else if (!have_flag(f_ptr->flags, FF_WATER) && (riding_r_ptr->flags7 & RF7_AQUATIC))
                {
-                       msg_format(_("%sから上がれない。", "Can't land."), f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name);
+                       msg_format(_("%sから上がれない。", "Can't land."), f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name);
                        free_turn(p_ptr);
                        oktomove = FALSE;
                        disturb(FALSE, TRUE);
@@ -1528,7 +1528,7 @@ static bool see_wall(DIRECTION dir, POSITION y, POSITION x)
        if (!in_bounds2(y, x)) return (FALSE);
 
        /* Access grid */
-       c_ptr = &cave[y][x];
+       c_ptr = &grid_array[y][x];
 
        /* Must be known to the player */
        if (c_ptr->info & (CAVE_MARK))
@@ -1571,7 +1571,7 @@ static bool see_nothing(DIRECTION dir, POSITION y, POSITION x)
        if (!in_bounds2(y, x)) return (TRUE);
 
        /* Memorized grids are always known */
-       if (cave[y][x].info & (CAVE_MARK)) return (FALSE);
+       if (grid_array[y][x].info & (CAVE_MARK)) return (FALSE);
 
        /* Viewable door/wall grids are known */
        if (player_can_see_bold(y, x)) return (FALSE);
@@ -1746,13 +1746,13 @@ static bool run_test(void)
 
        /* break run when leaving trap detected region */
        if ((disturb_trap_detect || alert_trap_detect)
-           && p_ptr->dtrap && !(cave[p_ptr->y][p_ptr->x].info & CAVE_IN_DETECT))
+           && p_ptr->dtrap && !(grid_array[p_ptr->y][p_ptr->x].info & CAVE_IN_DETECT))
        {
                /* No duplicate warning */
                p_ptr->dtrap = FALSE;
 
                /* You are just on the edge */
-               if (!(cave[p_ptr->y][p_ptr->x].info & CAVE_UNSAFE))
+               if (!(grid_array[p_ptr->y][p_ptr->x].info & CAVE_UNSAFE))
                {
                        if (alert_trap_detect)
                        {
@@ -1780,7 +1780,7 @@ static bool run_test(void)
                col = p_ptr->x + ddx[new_dir];
 
                /* Access grid */
-               c_ptr = &cave[row][col];
+               c_ptr = &grid_array[row][col];
 
                /* Feature code (applying "mimic" field) */
                feat = get_feat_mimic(c_ptr);
@@ -2139,13 +2139,13 @@ static DIRECTION travel_test(DIRECTION prev_dir)
 
        /* break run when leaving trap detected region */
        if ((disturb_trap_detect || alert_trap_detect)
-           && p_ptr->dtrap && !(cave[p_ptr->y][p_ptr->x].info & CAVE_IN_DETECT))
+           && p_ptr->dtrap && !(grid_array[p_ptr->y][p_ptr->x].info & CAVE_IN_DETECT))
        {
                /* No duplicate warning */
                p_ptr->dtrap = FALSE;
 
                /* You are just on the edge */
-               if (!(cave[p_ptr->y][p_ptr->x].info & CAVE_UNSAFE))
+               if (!(grid_array[p_ptr->y][p_ptr->x].info & CAVE_UNSAFE))
                {
                        if (alert_trap_detect)
                        {
@@ -2174,7 +2174,7 @@ static DIRECTION travel_test(DIRECTION prev_dir)
                POSITION col = p_ptr->x + ddx[dir];
 
                /* Access grid */
-               c_ptr = &cave[row][col];
+               c_ptr = &grid_array[row][col];
 
                /* Visible monsters abort running */
                if (c_ptr->m_idx)
@@ -2204,7 +2204,7 @@ static DIRECTION travel_test(DIRECTION prev_dir)
        if (!new_dir) return (0);
 
        /* Access newly move grid */
-       c_ptr = &cave[p_ptr->y+ddy[new_dir]][p_ptr->x+ddx[new_dir]];
+       c_ptr = &grid_array[p_ptr->y+ddy[new_dir]][p_ptr->x+ddx[new_dir]];
 
        /* Close door abort traveling */
        if (!easy_open && is_closed_door(c_ptr->feat)) return (0);
index 7064df5..33530c4 100644 (file)
@@ -121,7 +121,7 @@ void calc_bonuses(void)
        bool old_mighty_throw = p_ptr->mighty_throw;
 
        /* Current feature under player. */
-       feature_type *f_ptr = &f_info[cave[p_ptr->y][p_ptr->x].feat];
+       feature_type *f_ptr = &f_info[grid_array[p_ptr->y][p_ptr->x].feat];
 
        /* Save the old armor class */
        ARMOUR_CLASS old_dis_ac = p_ptr->dis_ac;
@@ -2639,7 +2639,7 @@ void calc_bonuses(void)
                if ((inventory[i].tval == TV_CRAFT_BOOK) && (inventory[i].sval == 2)) have_kabe = TRUE;
        }
 
-       for (this_o_idx = cave[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+       for (this_o_idx = grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
        {
                o_ptr = &o_list[this_o_idx];
 
@@ -2812,7 +2812,7 @@ static void calc_torch(void)
        }
 
        /* max radius is 14 (was 5) without rewriting other code -- */
-       /* see cave.c:update_lite() and defines.h:LITE_MAX */
+       /* see grid_array.c:update_lite() and defines.h:LITE_MAX */
        if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS && p_ptr->cur_lite > 1)
                p_ptr->cur_lite = 1;
 
@@ -3804,7 +3804,7 @@ bool player_has_no_spellbooks(void)
                if (o_ptr->k_idx && check_book_realm(o_ptr->tval, o_ptr->sval)) return FALSE;
        }
 
-       for (i = cave[p_ptr->y][p_ptr->x].o_idx; i; i = o_ptr->next_o_idx)
+       for (i = grid_array[p_ptr->y][p_ptr->x].o_idx; i; i = o_ptr->next_o_idx)
        {
                o_ptr = &o_list[i];
                if (o_ptr->k_idx && (o_ptr->marked & OM_FOUND) && check_book_realm(o_ptr->tval, o_ptr->sval)) return FALSE;
index ea71c47..6744cbf 100644 (file)
@@ -166,7 +166,7 @@ sint project_path(u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y
                        if (flg & (PROJECT_STOP))
                        {
                                if ((n > 0) &&
-                                       (player_bold(y, x) || cave[y][x].m_idx != 0))
+                                       (player_bold(y, x) || grid_array[y][x].m_idx != 0))
                                        break;
                        }
 
@@ -255,7 +255,7 @@ sint project_path(u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y
                        if (flg & (PROJECT_STOP))
                        {
                                if ((n > 0) &&
-                                       (player_bold(y, x) || cave[y][x].m_idx != 0))
+                                       (player_bold(y, x) || grid_array[y][x].m_idx != 0))
                                        break;
                        }
 
@@ -326,7 +326,7 @@ sint project_path(u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y
                        if (flg & (PROJECT_STOP))
                        {
                                if ((n > 0) &&
-                                       (player_bold(y, x) || cave[y][x].m_idx != 0))
+                                       (player_bold(y, x) || grid_array[y][x].m_idx != 0))
                                        break;
                        }
 
index 034ce48..88de5af 100644 (file)
@@ -263,7 +263,7 @@ void check_quest_completion(monster_type *m_ptr)
                POSITION ny, nx;
 
                /* Stagger around */
-               while (cave_perma_bold(y, x) || cave[y][x].o_idx || (cave[y][x].info & CAVE_OBJECT))
+               while (cave_perma_bold(y, x) || grid_array[y][x].o_idx || (grid_array[y][x].info & CAVE_OBJECT))
                {
                        /* Pick a location */
                        scatter(&ny, &nx, y, x, 1, 0);
index 60951d6..2f9ca82 100644 (file)
@@ -1008,10 +1008,10 @@ concptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode)
                                        int dy = y + ddy_ddd[dir];
                                        int dx = x + ddx_ddd[dir];
                                        if (dir == 5) continue;
-                                       if (cave[dy][dx].m_idx) flag = TRUE;
+                                       if (grid_array[dy][dx].m_idx) flag = TRUE;
                                }
 
-                               if (!cave_empty_bold(y, x) || (cave[y][x].info & CAVE_ICKY) ||
+                               if (!cave_empty_bold(y, x) || (grid_array[y][x].info & CAVE_ICKY) ||
                                        (distance(y, x, p_ptr->y, p_ptr->x) > plev + 2))
                                {
                                        msg_print(_("そこには移動できない。", "Can not teleport to there."));
index 4b3f843..aa4421b 100644 (file)
@@ -57,21 +57,21 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                        y = p_ptr->y + ddy_cdd[cdir];
                        x = p_ptr->x + ddx_cdd[cdir];
-                       if (cave[y][x].m_idx)
+                       if (grid_array[y][x].m_idx)
                                py_attack(y, x, 0);
                        else
                                msg_print(_("攻撃は空を切った。", "You attack the empty air."));
 
                        y = p_ptr->y + ddy_cdd[(cdir + 7) % 8];
                        x = p_ptr->x + ddx_cdd[(cdir + 7) % 8];
-                       if (cave[y][x].m_idx)
+                       if (grid_array[y][x].m_idx)
                                py_attack(y, x, 0);
                        else
                                msg_print(_("攻撃は空を切った。", "You attack the empty air."));
 
                        y = p_ptr->y + ddy_cdd[(cdir + 1) % 8];
                        x = p_ptr->x + ddx_cdd[(cdir + 1) % 8];
-                       if (cave[y][x].m_idx)
+                       if (grid_array[y][x].m_idx)
                                py_attack(y, x, 0);
                        else
                                msg_print(_("攻撃は空を切った。", "You attack the empty air."));
@@ -103,7 +103,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        y = p_ptr->y + ddy[dir];
                        x = p_ptr->x + ddx[dir];
 
-                       if (cave[y][x].m_idx)
+                       if (grid_array[y][x].m_idx)
                                py_attack(y, x, HISSATSU_FIRE);
                        else
                        {
@@ -137,7 +137,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        y = p_ptr->y + ddy[dir];
                        x = p_ptr->x + ddx[dir];
 
-                       if (cave[y][x].m_idx)
+                       if (grid_array[y][x].m_idx)
                                py_attack(y, x, HISSATSU_MINEUCHI);
                        else
                        {
@@ -185,7 +185,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        y = p_ptr->y + ddy[dir];
                        x = p_ptr->x + ddx[dir];
 
-                       if (!cave[y][x].m_idx)
+                       if (!grid_array[y][x].m_idx)
                        {
                                msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
                                return NULL;
@@ -193,13 +193,13 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                        py_attack(y, x, 0);
 
-                       if (!player_can_enter(cave[y][x].feat, 0) || is_trap(cave[y][x].feat))
+                       if (!player_can_enter(grid_array[y][x].feat, 0) || is_trap(grid_array[y][x].feat))
                                break;
 
                        y += ddy[dir];
                        x += ddx[dir];
 
-                       if (player_can_enter(cave[y][x].feat, 0) && !is_trap(cave[y][x].feat) && !cave[y][x].m_idx)
+                       if (player_can_enter(grid_array[y][x].feat, 0) && !is_trap(grid_array[y][x].feat) && !grid_array[y][x].m_idx)
                        {
                                msg_print(NULL);
                                (void)move_player_effect(y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
@@ -221,7 +221,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        y = p_ptr->y + ddy[dir];
                        x = p_ptr->x + ddx[dir];
 
-                       if (cave[y][x].m_idx)
+                       if (grid_array[y][x].m_idx)
                                py_attack(y, x, HISSATSU_POISON);
                        else
                        {
@@ -246,7 +246,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        y = p_ptr->y + ddy[dir];
                        x = p_ptr->x + ddx[dir];
 
-                       if (cave[y][x].m_idx)
+                       if (grid_array[y][x].m_idx)
                                py_attack(y, x, HISSATSU_ZANMA);
                        else
                        {
@@ -270,7 +270,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        y = p_ptr->y + ddy[dir];
                        x = p_ptr->x + ddx[dir];
 
-                       if (cave[y][x].m_idx)
+                       if (grid_array[y][x].m_idx)
                                py_attack(y, x, 0);
                        else
                        {
@@ -281,12 +281,12 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        {
                                return "";
                        }
-                       if (cave[y][x].m_idx)
+                       if (grid_array[y][x].m_idx)
                        {
                                int i;
                                POSITION ty = y, tx = x;
                                POSITION oy = y, ox = x;
-                               MONSTER_IDX m_idx = cave[y][x].m_idx;
+                               MONSTER_IDX m_idx = grid_array[y][x].m_idx;
                                monster_type *m_ptr = &m_list[m_idx];
                                GAME_TEXT m_name[MAX_NLEN];
 
@@ -306,8 +306,8 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                                if ((ty != oy) || (tx != ox))
                                {
                                        msg_format(_("%sを吹き飛ばした!", "You blow %s away!"), m_name);
-                                       cave[oy][ox].m_idx = 0;
-                                       cave[ty][tx].m_idx = m_idx;
+                                       grid_array[oy][ox].m_idx = 0;
+                                       grid_array[ty][tx].m_idx = m_idx;
                                        m_ptr->fy = ty;
                                        m_ptr->fx = tx;
 
@@ -354,7 +354,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        y = p_ptr->y + ddy[dir];
                        x = p_ptr->x + ddx[dir];
 
-                       if (cave[y][x].m_idx)
+                       if (grid_array[y][x].m_idx)
                                py_attack(y, x, HISSATSU_HAGAN);
 
                        if (!cave_have_flag_bold(y, x, FF_HURT_ROCK)) break;
@@ -382,7 +382,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        y = p_ptr->y + ddy[dir];
                        x = p_ptr->x + ddx[dir];
 
-                       if (cave[y][x].m_idx)
+                       if (grid_array[y][x].m_idx)
                                py_attack(y, x, HISSATSU_COLD);
                        else
                        {
@@ -407,7 +407,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        y = p_ptr->y + ddy[dir];
                        x = p_ptr->x + ddx[dir];
 
-                       if (cave[y][x].m_idx)
+                       if (grid_array[y][x].m_idx)
                                py_attack(y, x, HISSATSU_KYUSHO);
                        else
                        {
@@ -432,7 +432,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        y = p_ptr->y + ddy[dir];
                        x = p_ptr->x + ddx[dir];
 
-                       if (cave[y][x].m_idx)
+                       if (grid_array[y][x].m_idx)
                                py_attack(y, x, HISSATSU_MAJIN);
                        else
                        {
@@ -457,7 +457,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        y = p_ptr->y + ddy[dir];
                        x = p_ptr->x + ddx[dir];
 
-                       if (cave[y][x].m_idx)
+                       if (grid_array[y][x].m_idx)
                                py_attack(y, x, HISSATSU_SUTEMI);
                        else
                        {
@@ -483,7 +483,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        y = p_ptr->y + ddy[dir];
                        x = p_ptr->x + ddx[dir];
 
-                       if (cave[y][x].m_idx)
+                       if (grid_array[y][x].m_idx)
                                py_attack(y, x, HISSATSU_ELEC);
                        else
                        {
@@ -524,7 +524,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        {
                                y = p_ptr->y + ddy_ddd[dir];
                                x = p_ptr->x + ddx_ddd[dir];
-                               c_ptr = &cave[y][x];
+                               c_ptr = &grid_array[y][x];
                                m_ptr = &m_list[c_ptr->m_idx];
 
                                /* Hack -- attack monsters */
@@ -557,7 +557,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        y = p_ptr->y + ddy[dir];
                        x = p_ptr->x + ddx[dir];
 
-                       if (cave[y][x].m_idx)
+                       if (grid_array[y][x].m_idx)
                                py_attack(y, x, HISSATSU_QUAKE);
                        else
                                earthquake(p_ptr->y, p_ptr->x, 10);
@@ -639,7 +639,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                                y = p_ptr->y + ddy[dir];
                                x = p_ptr->x + ddx[dir];
-                               c_ptr = &cave[y][x];
+                               c_ptr = &grid_array[y][x];
 
                                if (c_ptr->m_idx)
                                        py_attack(y, x, HISSATSU_3DAN);
@@ -671,7 +671,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                                }
 
                                c_ptr->m_idx = 0;
-                               cave[ny][nx].m_idx = m_idx;
+                               grid_array[ny][nx].m_idx = m_idx;
                                m_ptr->fy = ny;
                                m_ptr->fx = nx;
 
@@ -714,7 +714,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        y = p_ptr->y + ddy[dir];
                        x = p_ptr->x + ddx[dir];
 
-                       if (cave[y][x].m_idx)
+                       if (grid_array[y][x].m_idx)
                                py_attack(y, x, HISSATSU_DRAIN);
                        else
                        {
@@ -815,10 +815,10 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        y = p_ptr->y + ddy[dir];
                        x = p_ptr->x + ddx[dir];
 
-                       if (cave[y][x].m_idx)
+                       if (grid_array[y][x].m_idx)
                        {
                                py_attack(y, x, 0);
-                               if (cave[y][x].m_idx)
+                               if (grid_array[y][x].m_idx)
                                {
                                        handle_stuff();
                                        py_attack(y, x, 0);
@@ -899,7 +899,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        y = p_ptr->y + ddy[dir];
                        x = p_ptr->x + ddx[dir];
 
-                       if (cave[y][x].m_idx)
+                       if (grid_array[y][x].m_idx)
                                py_attack(y, x, HISSATSU_UNDEAD);
                        else
                        {
index 58b1ab0..953c2a1 100644 (file)
@@ -180,7 +180,7 @@ static void build_stores(POSITION ltcy, POSITION ltcx, int stores[], int n)
 * Town logic flow for generation of new town\n
 * Originally from Vanilla 3.0.3\n
 *\n
-* We start with a fully wiped cave of normal floors.\n
+* We start with a fully wiped grid_array of normal floors.\n
 *\n
 * Note that town_gen_hack() plays games with the R.N.G.\n
 *\n
@@ -205,9 +205,9 @@ bool build_type16(void)
        {
                for (x = 0; x < cur_wid; x++)
                {
-                       if (cave[y][x].feat == FF_STORE)
+                       if (grid_array[y][x].feat == FF_STORE)
                        {
-                               prevent_bm = (f_info[cave[y][x].feat].subtype == STORE_BLACK);
+                               prevent_bm = (f_info[grid_array[y][x].feat].subtype == STORE_BLACK);
                                break;
                        }
                }
index de05477..ecb8f18 100644 (file)
@@ -5,7 +5,7 @@
 #include "rooms-normal.h"
 
 /*!
-* @brief タイプ9の部屋…フラクタルカーブによる洞窟生成 / Type 9 -- Driver routine to create fractal cave system
+* @brief タイプ9の部屋…フラクタルカーブによる洞窟生成 / Type 9 -- Driver routine to create fractal grid_array system
 * @return なし
 */
 bool build_type9(void)
index 5c7ad41..d550ce3 100644 (file)
@@ -62,7 +62,7 @@ bool build_type1(void)
        {
                for (x = x1 - 1; x <= x2 + 1; x++)
                {
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
                        place_floor_grid(c_ptr);
                        c_ptr->info |= (CAVE_ROOM);
                        if (light) c_ptr->info |= (CAVE_GLOW);
@@ -72,16 +72,16 @@ bool build_type1(void)
        /* Walls around the room */
        for (y = y1 - 1; y <= y2 + 1; y++)
        {
-               c_ptr = &cave[y][x1 - 1];
+               c_ptr = &grid_array[y][x1 - 1];
                place_outer_grid(c_ptr);
-               c_ptr = &cave[y][x2 + 1];
+               c_ptr = &grid_array[y][x2 + 1];
                place_outer_grid(c_ptr);
        }
        for (x = x1 - 1; x <= x2 + 1; x++)
        {
-               c_ptr = &cave[y1 - 1][x];
+               c_ptr = &grid_array[y1 - 1][x];
                place_outer_grid(c_ptr);
-               c_ptr = &cave[y2 + 1][x];
+               c_ptr = &grid_array[y2 + 1][x];
                place_outer_grid(c_ptr);
        }
 
@@ -91,19 +91,19 @@ bool build_type1(void)
        {
                for (y = y1; y <= y2; y++)
                {
-                       c_ptr = &cave[y][x1];
+                       c_ptr = &grid_array[y][x1];
                        c_ptr->feat = feat_door[DOOR_CURTAIN].closed;
                        c_ptr->info &= ~(CAVE_MASK);
-                       c_ptr = &cave[y][x2];
+                       c_ptr = &grid_array[y][x2];
                        c_ptr->feat = feat_door[DOOR_CURTAIN].closed;
                        c_ptr->info &= ~(CAVE_MASK);
                }
                for (x = x1; x <= x2; x++)
                {
-                       c_ptr = &cave[y1][x];
+                       c_ptr = &grid_array[y1][x];
                        c_ptr->feat = feat_door[DOOR_CURTAIN].closed;
                        c_ptr->info &= ~(CAVE_MASK);
-                       c_ptr = &cave[y2][x];
+                       c_ptr = &grid_array[y2][x];
                        c_ptr->feat = feat_door[DOOR_CURTAIN].closed;
                        c_ptr->info &= ~(CAVE_MASK);
                }
@@ -117,7 +117,7 @@ bool build_type1(void)
                {
                        for (x = x1; x <= x2; x += 2)
                        {
-                               c_ptr = &cave[y][x];
+                               c_ptr = &grid_array[y][x];
                                place_inner_grid(c_ptr);
                        }
                }
@@ -128,16 +128,16 @@ bool build_type1(void)
        {
                if ((y1 + 4 < y2) && (x1 + 4 < x2))
                {
-                       c_ptr = &cave[y1 + 1][x1 + 1];
+                       c_ptr = &grid_array[y1 + 1][x1 + 1];
                        place_inner_grid(c_ptr);
 
-                       c_ptr = &cave[y1 + 1][x2 - 1];
+                       c_ptr = &grid_array[y1 + 1][x2 - 1];
                        place_inner_grid(c_ptr);
 
-                       c_ptr = &cave[y2 - 1][x1 + 1];
+                       c_ptr = &grid_array[y2 - 1][x1 + 1];
                        place_inner_grid(c_ptr);
 
-                       c_ptr = &cave[y2 - 1][x2 - 1];
+                       c_ptr = &grid_array[y2 - 1][x2 - 1];
                        place_inner_grid(c_ptr);
                }
        }
@@ -147,16 +147,16 @@ bool build_type1(void)
        {
                for (y = y1 + 2; y <= y2 - 2; y += 2)
                {
-                       c_ptr = &cave[y][x1];
+                       c_ptr = &grid_array[y][x1];
                        place_inner_grid(c_ptr);
-                       c_ptr = &cave[y][x2];
+                       c_ptr = &grid_array[y][x2];
                        place_inner_grid(c_ptr);
                }
                for (x = x1 + 2; x <= x2 - 2; x += 2)
                {
-                       c_ptr = &cave[y1][x];
+                       c_ptr = &grid_array[y1][x];
                        place_inner_grid(c_ptr);
-                       c_ptr = &cave[y2][x];
+                       c_ptr = &grid_array[y2][x];
                        place_inner_grid(c_ptr);
                }
        }
@@ -172,7 +172,7 @@ bool build_type1(void)
                        for (x = x1; x <= x2; x++)
                        {
                                place_inner_bold(yval, x);
-                               if (curtain2) cave[yval][x].feat = feat_door[DOOR_CURTAIN].closed;
+                               if (curtain2) grid_array[yval][x].feat = feat_door[DOOR_CURTAIN].closed;
                        }
 
                        /* Prevent edge of wall from being tunneled */
@@ -185,7 +185,7 @@ bool build_type1(void)
                        for (y = y1; y <= y2; y++)
                        {
                                place_inner_bold(y, xval);
-                               if (curtain2) cave[y][xval].feat = feat_door[DOOR_CURTAIN].closed;
+                               if (curtain2) grid_array[y][xval].feat = feat_door[DOOR_CURTAIN].closed;
                        }
 
                        /* Prevent edge of wall from being tunneled */
@@ -194,7 +194,7 @@ bool build_type1(void)
                }
 
                place_random_door(yval, xval, TRUE);
-               if (curtain2) cave[yval][xval].feat = feat_door[DOOR_CURTAIN].closed;
+               if (curtain2) grid_array[yval][xval].feat = feat_door[DOOR_CURTAIN].closed;
        }
 
        return TRUE;
@@ -236,7 +236,7 @@ bool build_type2(void)
        {
                for (x = x1a - 1; x <= x2a + 1; x++)
                {
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
                        place_floor_grid(c_ptr);
                        c_ptr->info |= (CAVE_ROOM);
                        if (light) c_ptr->info |= (CAVE_GLOW);
@@ -248,7 +248,7 @@ bool build_type2(void)
        {
                for (x = x1b - 1; x <= x2b + 1; x++)
                {
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
                        place_floor_grid(c_ptr);
                        c_ptr->info |= (CAVE_ROOM);
                        if (light) c_ptr->info |= (CAVE_GLOW);
@@ -259,32 +259,32 @@ bool build_type2(void)
        /* Place the walls around room "a" */
        for (y = y1a - 1; y <= y2a + 1; y++)
        {
-               c_ptr = &cave[y][x1a - 1];
+               c_ptr = &grid_array[y][x1a - 1];
                place_outer_grid(c_ptr);
-               c_ptr = &cave[y][x2a + 1];
+               c_ptr = &grid_array[y][x2a + 1];
                place_outer_grid(c_ptr);
        }
        for (x = x1a - 1; x <= x2a + 1; x++)
        {
-               c_ptr = &cave[y1a - 1][x];
+               c_ptr = &grid_array[y1a - 1][x];
                place_outer_grid(c_ptr);
-               c_ptr = &cave[y2a + 1][x];
+               c_ptr = &grid_array[y2a + 1][x];
                place_outer_grid(c_ptr);
        }
 
        /* Place the walls around room "b" */
        for (y = y1b - 1; y <= y2b + 1; y++)
        {
-               c_ptr = &cave[y][x1b - 1];
+               c_ptr = &grid_array[y][x1b - 1];
                place_outer_grid(c_ptr);
-               c_ptr = &cave[y][x2b + 1];
+               c_ptr = &grid_array[y][x2b + 1];
                place_outer_grid(c_ptr);
        }
        for (x = x1b - 1; x <= x2b + 1; x++)
        {
-               c_ptr = &cave[y1b - 1][x];
+               c_ptr = &grid_array[y1b - 1][x];
                place_outer_grid(c_ptr);
-               c_ptr = &cave[y2b + 1][x];
+               c_ptr = &grid_array[y2b + 1][x];
                place_outer_grid(c_ptr);
        }
 
@@ -295,7 +295,7 @@ bool build_type2(void)
        {
                for (x = x1a; x <= x2a; x++)
                {
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
                        place_floor_grid(c_ptr);
                }
        }
@@ -305,7 +305,7 @@ bool build_type2(void)
        {
                for (x = x1b; x <= x2b; x++)
                {
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
                        place_floor_grid(c_ptr);
                }
        }
@@ -371,7 +371,7 @@ bool build_type3(void)
        {
                for (x = x1a - 1; x <= x2a + 1; x++)
                {
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
                        place_floor_grid(c_ptr);
                        c_ptr->info |= (CAVE_ROOM);
                        if (light) c_ptr->info |= (CAVE_GLOW);
@@ -383,7 +383,7 @@ bool build_type3(void)
        {
                for (x = x1b - 1; x <= x2b + 1; x++)
                {
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
                        place_floor_grid(c_ptr);
                        c_ptr->info |= (CAVE_ROOM);
                        if (light) c_ptr->info |= (CAVE_GLOW);
@@ -394,32 +394,32 @@ bool build_type3(void)
        /* Place the walls around room "a" */
        for (y = y1a - 1; y <= y2a + 1; y++)
        {
-               c_ptr = &cave[y][x1a - 1];
+               c_ptr = &grid_array[y][x1a - 1];
                place_outer_grid(c_ptr);
-               c_ptr = &cave[y][x2a + 1];
+               c_ptr = &grid_array[y][x2a + 1];
                place_outer_grid(c_ptr);
        }
        for (x = x1a - 1; x <= x2a + 1; x++)
        {
-               c_ptr = &cave[y1a - 1][x];
+               c_ptr = &grid_array[y1a - 1][x];
                place_outer_grid(c_ptr);
-               c_ptr = &cave[y2a + 1][x];
+               c_ptr = &grid_array[y2a + 1][x];
                place_outer_grid(c_ptr);
        }
 
        /* Place the walls around room "b" */
        for (y = y1b - 1; y <= y2b + 1; y++)
        {
-               c_ptr = &cave[y][x1b - 1];
+               c_ptr = &grid_array[y][x1b - 1];
                place_outer_grid(c_ptr);
-               c_ptr = &cave[y][x2b + 1];
+               c_ptr = &grid_array[y][x2b + 1];
                place_outer_grid(c_ptr);
        }
        for (x = x1b - 1; x <= x2b + 1; x++)
        {
-               c_ptr = &cave[y1b - 1][x];
+               c_ptr = &grid_array[y1b - 1][x];
                place_outer_grid(c_ptr);
-               c_ptr = &cave[y2b + 1][x];
+               c_ptr = &grid_array[y2b + 1][x];
                place_outer_grid(c_ptr);
        }
 
@@ -429,7 +429,7 @@ bool build_type3(void)
        {
                for (x = x1a; x <= x2a; x++)
                {
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
                        place_floor_grid(c_ptr);
                }
        }
@@ -439,7 +439,7 @@ bool build_type3(void)
        {
                for (x = x1b; x <= x2b; x++)
                {
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
                        place_floor_grid(c_ptr);
                }
        }
@@ -456,7 +456,7 @@ bool build_type3(void)
                {
                        for (x = x1a; x <= x2a; x++)
                        {
-                               c_ptr = &cave[y][x];
+                               c_ptr = &grid_array[y][x];
                                place_inner_grid(c_ptr);
                        }
                }
@@ -469,16 +469,16 @@ bool build_type3(void)
                /* Build the vault */
                for (y = y1b; y <= y2b; y++)
                {
-                       c_ptr = &cave[y][x1a];
+                       c_ptr = &grid_array[y][x1a];
                        place_inner_grid(c_ptr);
-                       c_ptr = &cave[y][x2a];
+                       c_ptr = &grid_array[y][x2a];
                        place_inner_grid(c_ptr);
                }
                for (x = x1a; x <= x2a; x++)
                {
-                       c_ptr = &cave[y1b][x];
+                       c_ptr = &grid_array[y1b][x];
                        place_inner_grid(c_ptr);
-                       c_ptr = &cave[y2b][x];
+                       c_ptr = &grid_array[y2b][x];
                        place_inner_grid(c_ptr);
                }
 
@@ -513,9 +513,9 @@ bool build_type3(void)
                        for (y = y1b; y <= y2b; y++)
                        {
                                if (y == yval) continue;
-                               c_ptr = &cave[y][x1a - 1];
+                               c_ptr = &grid_array[y][x1a - 1];
                                place_inner_grid(c_ptr);
-                               c_ptr = &cave[y][x2a + 1];
+                               c_ptr = &grid_array[y][x2a + 1];
                                place_inner_grid(c_ptr);
                        }
 
@@ -523,9 +523,9 @@ bool build_type3(void)
                        for (x = x1a; x <= x2a; x++)
                        {
                                if (x == xval) continue;
-                               c_ptr = &cave[y1b - 1][x];
+                               c_ptr = &grid_array[y1b - 1][x];
                                place_inner_grid(c_ptr);
-                               c_ptr = &cave[y2b + 1][x];
+                               c_ptr = &grid_array[y2b + 1][x];
                                place_inner_grid(c_ptr);
                        }
 
@@ -546,22 +546,22 @@ bool build_type3(void)
                /* Occasionally put a "plus" in the center */
                else if (one_in_(3))
                {
-                       c_ptr = &cave[yval][xval];
+                       c_ptr = &grid_array[yval][xval];
                        place_inner_grid(c_ptr);
-                       c_ptr = &cave[y1b][xval];
+                       c_ptr = &grid_array[y1b][xval];
                        place_inner_grid(c_ptr);
-                       c_ptr = &cave[y2b][xval];
+                       c_ptr = &grid_array[y2b][xval];
                        place_inner_grid(c_ptr);
-                       c_ptr = &cave[yval][x1a];
+                       c_ptr = &grid_array[yval][x1a];
                        place_inner_grid(c_ptr);
-                       c_ptr = &cave[yval][x2a];
+                       c_ptr = &grid_array[yval][x2a];
                        place_inner_grid(c_ptr);
                }
 
                /* Occasionally put a pillar in the center */
                else if (one_in_(3))
                {
-                       c_ptr = &cave[yval][xval];
+                       c_ptr = &grid_array[yval][xval];
                        place_inner_grid(c_ptr);
                }
 
@@ -608,7 +608,7 @@ bool build_type4(void)
        {
                for (x = x1 - 1; x <= x2 + 1; x++)
                {
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
                        place_floor_grid(c_ptr);
                        c_ptr->info |= (CAVE_ROOM);
                        if (light) c_ptr->info |= (CAVE_GLOW);
@@ -618,16 +618,16 @@ bool build_type4(void)
        /* Outer Walls */
        for (y = y1 - 1; y <= y2 + 1; y++)
        {
-               c_ptr = &cave[y][x1 - 1];
+               c_ptr = &grid_array[y][x1 - 1];
                place_outer_grid(c_ptr);
-               c_ptr = &cave[y][x2 + 1];
+               c_ptr = &grid_array[y][x2 + 1];
                place_outer_grid(c_ptr);
        }
        for (x = x1 - 1; x <= x2 + 1; x++)
        {
-               c_ptr = &cave[y1 - 1][x];
+               c_ptr = &grid_array[y1 - 1][x];
                place_outer_grid(c_ptr);
-               c_ptr = &cave[y2 + 1][x];
+               c_ptr = &grid_array[y2 + 1][x];
                place_outer_grid(c_ptr);
        }
 
@@ -641,16 +641,16 @@ bool build_type4(void)
        /* The inner walls */
        for (y = y1 - 1; y <= y2 + 1; y++)
        {
-               c_ptr = &cave[y][x1 - 1];
+               c_ptr = &grid_array[y][x1 - 1];
                place_inner_grid(c_ptr);
-               c_ptr = &cave[y][x2 + 1];
+               c_ptr = &grid_array[y][x2 + 1];
                place_inner_grid(c_ptr);
        }
        for (x = x1 - 1; x <= x2 + 1; x++)
        {
-               c_ptr = &cave[y1 - 1][x];
+               c_ptr = &grid_array[y1 - 1][x];
                place_inner_grid(c_ptr);
-               c_ptr = &cave[y2 + 1][x];
+               c_ptr = &grid_array[y2 + 1][x];
                place_inner_grid(c_ptr);
        }
 
@@ -694,7 +694,7 @@ bool build_type4(void)
                                for (x = xval - 1; x <= xval + 1; x++)
                                {
                                        if ((x == xval) && (y == yval)) continue;
-                                       c_ptr = &cave[y][x];
+                                       c_ptr = &grid_array[y][x];
                                        place_inner_grid(c_ptr);
                                }
                        }
@@ -746,7 +746,7 @@ bool build_type4(void)
                        {
                                for (x = xval - 1; x <= xval + 1; x++)
                                {
-                                       c_ptr = &cave[y][x];
+                                       c_ptr = &grid_array[y][x];
                                        place_inner_grid(c_ptr);
                                }
                        }
@@ -759,12 +759,12 @@ bool build_type4(void)
                                {
                                        for (x = xval - 5 - tmp; x <= xval - 3 - tmp; x++)
                                        {
-                                               c_ptr = &cave[y][x];
+                                               c_ptr = &grid_array[y][x];
                                                place_inner_grid(c_ptr);
                                        }
                                        for (x = xval + 3 + tmp; x <= xval + 5 + tmp; x++)
                                        {
-                                               c_ptr = &cave[y][x];
+                                               c_ptr = &grid_array[y][x];
                                                place_inner_grid(c_ptr);
                                        }
                                }
@@ -780,16 +780,16 @@ bool build_type4(void)
                                /* Long horizontal walls */
                                for (x = xval - 5; x <= xval + 5; x++)
                                {
-                                       c_ptr = &cave[yval - 1][x];
+                                       c_ptr = &grid_array[yval - 1][x];
                                        place_inner_grid(c_ptr);
-                                       c_ptr = &cave[yval + 1][x];
+                                       c_ptr = &grid_array[yval + 1][x];
                                        place_inner_grid(c_ptr);
                                }
 
                                /* Close off the left/right edges */
-                               c_ptr = &cave[yval][xval - 5];
+                               c_ptr = &grid_array[yval][xval - 5];
                                place_inner_grid(c_ptr);
-                               c_ptr = &cave[yval][xval + 5];
+                               c_ptr = &grid_array[yval][xval + 5];
                                place_inner_grid(c_ptr);
 
                                /* Secret doors (random top/bottom) */
@@ -827,7 +827,7 @@ bool build_type4(void)
                                {
                                        if (0x1 & (x + y))
                                        {
-                                               c_ptr = &cave[y][x];
+                                               c_ptr = &grid_array[y][x];
                                                place_inner_grid(c_ptr);
                                        }
                                }
@@ -857,12 +857,12 @@ bool build_type4(void)
                        /* Inner "cross" */
                        for (y = y1; y <= y2; y++)
                        {
-                               c_ptr = &cave[y][xval];
+                               c_ptr = &grid_array[y][xval];
                                place_inner_grid(c_ptr);
                        }
                        for (x = x1; x <= x2; x++)
                        {
-                               c_ptr = &cave[yval][x];
+                               c_ptr = &grid_array[yval][x];
                                place_inner_grid(c_ptr);
                        }
 
@@ -984,7 +984,7 @@ bool build_type12(void)
                for (y = y0 - rad; y <= y0 + rad; y++)
                {
                        /* clear room flag */
-                       cave[y][x].info &= ~(CAVE_ROOM);
+                       grid_array[y][x].info &= ~(CAVE_ROOM);
 
                        if (dist2(y0, x0, y, x, h1, h2, h3, h4) <= rad - 1)
                        {
index 94502a7..d80ceef 100644 (file)
@@ -345,7 +345,7 @@ bool build_type5(void)
        {
                for (x = x1 - 1; x <= x2 + 1; x++)
                {
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
                        place_floor_grid(c_ptr);
                        c_ptr->info |= (CAVE_ROOM);
                }
@@ -354,16 +354,16 @@ bool build_type5(void)
        /* Place the outer walls */
        for (y = y1 - 1; y <= y2 + 1; y++)
        {
-               c_ptr = &cave[y][x1 - 1];
+               c_ptr = &grid_array[y][x1 - 1];
                place_outer_grid(c_ptr);
-               c_ptr = &cave[y][x2 + 1];
+               c_ptr = &grid_array[y][x2 + 1];
                place_outer_grid(c_ptr);
        }
        for (x = x1 - 1; x <= x2 + 1; x++)
        {
-               c_ptr = &cave[y1 - 1][x];
+               c_ptr = &grid_array[y1 - 1][x];
                place_outer_grid(c_ptr);
-               c_ptr = &cave[y2 + 1][x];
+               c_ptr = &grid_array[y2 + 1][x];
                place_outer_grid(c_ptr);
        }
 
@@ -377,17 +377,17 @@ bool build_type5(void)
        /* The inner walls */
        for (y = y1 - 1; y <= y2 + 1; y++)
        {
-               c_ptr = &cave[y][x1 - 1];
+               c_ptr = &grid_array[y][x1 - 1];
                place_inner_grid(c_ptr);
-               c_ptr = &cave[y][x2 + 1];
+               c_ptr = &grid_array[y][x2 + 1];
                place_inner_grid(c_ptr);
        }
 
        for (x = x1 - 1; x <= x2 + 1; x++)
        {
-               c_ptr = &cave[y1 - 1][x];
+               c_ptr = &grid_array[y1 - 1][x];
                place_inner_grid(c_ptr);
-               c_ptr = &cave[y2 + 1][x];
+               c_ptr = &grid_array[y2 + 1][x];
                place_inner_grid(c_ptr);
        }
        for (y = y1; y <= y2; y++)
@@ -555,7 +555,7 @@ bool build_type6(void)
        {
                for (x = x1 - 1; x <= x2 + 1; x++)
                {
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
                        place_floor_grid(c_ptr);
                        c_ptr->info |= (CAVE_ROOM);
                }
@@ -564,16 +564,16 @@ bool build_type6(void)
        /* Place the outer walls */
        for (y = y1 - 1; y <= y2 + 1; y++)
        {
-               c_ptr = &cave[y][x1 - 1];
+               c_ptr = &grid_array[y][x1 - 1];
                place_outer_grid(c_ptr);
-               c_ptr = &cave[y][x2 + 1];
+               c_ptr = &grid_array[y][x2 + 1];
                place_outer_grid(c_ptr);
        }
        for (x = x1 - 1; x <= x2 + 1; x++)
        {
-               c_ptr = &cave[y1 - 1][x];
+               c_ptr = &grid_array[y1 - 1][x];
                place_outer_grid(c_ptr);
-               c_ptr = &cave[y2 + 1][x];
+               c_ptr = &grid_array[y2 + 1][x];
                place_outer_grid(c_ptr);
        }
 
@@ -586,16 +586,16 @@ bool build_type6(void)
        /* The inner walls */
        for (y = y1 - 1; y <= y2 + 1; y++)
        {
-               c_ptr = &cave[y][x1 - 1];
+               c_ptr = &grid_array[y][x1 - 1];
                place_inner_grid(c_ptr);
-               c_ptr = &cave[y][x2 + 1];
+               c_ptr = &grid_array[y][x2 + 1];
                place_inner_grid(c_ptr);
        }
        for (x = x1 - 1; x <= x2 + 1; x++)
        {
-               c_ptr = &cave[y1 - 1][x];
+               c_ptr = &grid_array[y1 - 1][x];
                place_inner_grid(c_ptr);
-               c_ptr = &cave[y2 + 1][x];
+               c_ptr = &grid_array[y2 + 1][x];
                place_inner_grid(c_ptr);
        }
        for (y = y1; y <= y2; y++)
@@ -863,7 +863,7 @@ bool build_type13(void)
        {
                for (x = x1 - 1; x <= x2 + 1; x++)
                {
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
                        place_inner_grid(c_ptr);
                        c_ptr->info |= (CAVE_ROOM);
                }
@@ -872,11 +872,11 @@ bool build_type13(void)
        /* Place the floor area 1 */
        for (x = x1 + 3; x <= x2 - 3; x++)
        {
-               c_ptr = &cave[yval - 2][x];
+               c_ptr = &grid_array[yval - 2][x];
                place_floor_grid(c_ptr);
                add_cave_info(yval - 2, x, CAVE_ICKY);
 
-               c_ptr = &cave[yval + 2][x];
+               c_ptr = &grid_array[yval + 2][x];
                place_floor_grid(c_ptr);
                add_cave_info(yval + 2, x, CAVE_ICKY);
        }
@@ -884,11 +884,11 @@ bool build_type13(void)
        /* Place the floor area 2 */
        for (x = x1 + 5; x <= x2 - 5; x++)
        {
-               c_ptr = &cave[yval - 3][x];
+               c_ptr = &grid_array[yval - 3][x];
                place_floor_grid(c_ptr);
                add_cave_info(yval - 3, x, CAVE_ICKY);
 
-               c_ptr = &cave[yval + 3][x];
+               c_ptr = &grid_array[yval + 3][x];
                place_floor_grid(c_ptr);
                add_cave_info(yval + 3, x, CAVE_ICKY);
        }
@@ -896,27 +896,27 @@ bool build_type13(void)
        /* Corridor */
        for (x = x1; x <= x2; x++)
        {
-               c_ptr = &cave[yval][x];
+               c_ptr = &grid_array[yval][x];
                place_floor_grid(c_ptr);
-               c_ptr = &cave[y1][x];
+               c_ptr = &grid_array[y1][x];
                place_floor_grid(c_ptr);
-               c_ptr = &cave[y2][x];
+               c_ptr = &grid_array[y2][x];
                place_floor_grid(c_ptr);
        }
 
        /* Place the outer walls */
        for (y = y1 - 1; y <= y2 + 1; y++)
        {
-               c_ptr = &cave[y][x1 - 1];
+               c_ptr = &grid_array[y][x1 - 1];
                place_outer_grid(c_ptr);
-               c_ptr = &cave[y][x2 + 1];
+               c_ptr = &grid_array[y][x2 + 1];
                place_outer_grid(c_ptr);
        }
        for (x = x1 - 1; x <= x2 + 1; x++)
        {
-               c_ptr = &cave[y1 - 1][x];
+               c_ptr = &grid_array[y1 - 1][x];
                place_outer_grid(c_ptr);
-               c_ptr = &cave[y2 + 1][x];
+               c_ptr = &grid_array[y2 + 1][x];
                place_outer_grid(c_ptr);
        }
 
@@ -949,8 +949,8 @@ bool build_type13(void)
        }
 
        /* Place the wall open trap */
-       cave[yval][xval].mimic = cave[yval][xval].feat;
-       cave[yval][xval].feat = feat_trap_open;
+       grid_array[yval][xval].mimic = grid_array[yval][xval].feat;
+       grid_array[yval][xval].feat = feat_trap_open;
 
        /* Sort the entries */
        for (i = 0; i < 16 - 1; i++)
index a7e4784..159ac9b 100644 (file)
@@ -40,7 +40,7 @@ bool build_type15(void)
        {
                for (x = x1 - 1; x <= x2 + 1; x++)
                {
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
                        place_floor_grid(c_ptr);
                        c_ptr->feat = feat_glass_floor;
                        c_ptr->info |= (CAVE_ROOM);
@@ -51,19 +51,19 @@ bool build_type15(void)
        /* Walls around the room */
        for (y = y1 - 1; y <= y2 + 1; y++)
        {
-               c_ptr = &cave[y][x1 - 1];
+               c_ptr = &grid_array[y][x1 - 1];
                place_outer_grid(c_ptr);
                c_ptr->feat = feat_glass_wall;
-               c_ptr = &cave[y][x2 + 1];
+               c_ptr = &grid_array[y][x2 + 1];
                place_outer_grid(c_ptr);
                c_ptr->feat = feat_glass_wall;
        }
        for (x = x1 - 1; x <= x2 + 1; x++)
        {
-               c_ptr = &cave[y1 - 1][x];
+               c_ptr = &grid_array[y1 - 1][x];
                place_outer_grid(c_ptr);
                c_ptr->feat = feat_glass_wall;
-               c_ptr = &cave[y2 + 1][x];
+               c_ptr = &grid_array[y2 + 1][x];
                place_outer_grid(c_ptr);
                c_ptr->feat = feat_glass_wall;
        }
@@ -87,7 +87,7 @@ bool build_type15(void)
                        /* Walls around the breather */
                        for (dir2 = 0; dir2 < 8; dir2++)
                        {
-                               c_ptr = &cave[y + ddy_ddd[dir2]][x + ddx_ddd[dir2]];
+                               c_ptr = &grid_array[y + ddy_ddd[dir2]][x + ddx_ddd[dir2]];
                                place_inner_grid(c_ptr);
                                c_ptr->feat = feat_glass_wall;
                        }
@@ -98,10 +98,10 @@ bool build_type15(void)
                {
                        y = yval + 2 * ddy_ddd[dir1];
                        x = xval + 2 * ddx_ddd[dir1];
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
                        place_inner_perm_grid(c_ptr);
                        c_ptr->feat = feat_permanent_glass_wall;
-                       cave[yval + ddy_ddd[dir1]][xval + ddx_ddd[dir1]].info |= (CAVE_ICKY);
+                       grid_array[yval + ddy_ddd[dir1]][xval + ddx_ddd[dir1]].info |= (CAVE_ICKY);
                }
 
                /* Glass door */
@@ -109,13 +109,13 @@ bool build_type15(void)
                y = yval + 2 * ddy_ddd[dir1];
                x = xval + 2 * ddx_ddd[dir1];
                place_secret_door(y, x, DOOR_GLASS_DOOR);
-               c_ptr = &cave[y][x];
+               c_ptr = &grid_array[y][x];
                if (is_closed_door(c_ptr->feat)) c_ptr->mimic = feat_glass_wall;
 
                /* Place a potion */
                get_obj_num_hook = kind_is_potion;
                place_object(yval, xval, AM_NO_FIXED_ART);
-               cave[yval][xval].info |= (CAVE_ICKY);
+               grid_array[yval][xval].info |= (CAVE_ICKY);
        }
        break;
 
@@ -125,19 +125,19 @@ bool build_type15(void)
                DIRECTION dir1;
 
                /* Pillars */
-               c_ptr = &cave[y1 + 1][x1 + 1];
+               c_ptr = &grid_array[y1 + 1][x1 + 1];
                place_inner_grid(c_ptr);
                c_ptr->feat = feat_glass_wall;
 
-               c_ptr = &cave[y1 + 1][x2 - 1];
+               c_ptr = &grid_array[y1 + 1][x2 - 1];
                place_inner_grid(c_ptr);
                c_ptr->feat = feat_glass_wall;
 
-               c_ptr = &cave[y2 - 1][x1 + 1];
+               c_ptr = &grid_array[y2 - 1][x1 + 1];
                place_inner_grid(c_ptr);
                c_ptr->feat = feat_glass_wall;
 
-               c_ptr = &cave[y2 - 1][x2 - 1];
+               c_ptr = &grid_array[y2 - 1][x2 - 1];
                place_inner_grid(c_ptr);
                c_ptr->feat = feat_glass_wall;
                get_mon_num_prep(vault_aux_lite, NULL);
@@ -148,7 +148,7 @@ bool build_type15(void)
                /* Walls around the breather */
                for (dir1 = 0; dir1 < 8; dir1++)
                {
-                       c_ptr = &cave[yval + ddy_ddd[dir1]][xval + ddx_ddd[dir1]];
+                       c_ptr = &grid_array[yval + ddy_ddd[dir1]][xval + ddx_ddd[dir1]];
                        place_inner_grid(c_ptr);
                        c_ptr->feat = feat_glass_wall;
                }
@@ -167,7 +167,7 @@ bool build_type15(void)
 
                /* Place an object */
                place_object(yval, xval, AM_NO_FIXED_ART);
-               cave[yval][xval].info |= (CAVE_ICKY);
+               grid_array[yval][xval].info |= (CAVE_ICKY);
        }
        break;
 
@@ -178,25 +178,25 @@ bool build_type15(void)
                /* Walls around the potion */
                for (y = yval - 2; y <= yval + 2; y++)
                {
-                       c_ptr = &cave[y][xval - 3];
+                       c_ptr = &grid_array[y][xval - 3];
                        place_inner_grid(c_ptr);
                        c_ptr->feat = feat_glass_wall;
-                       c_ptr = &cave[y][xval + 3];
+                       c_ptr = &grid_array[y][xval + 3];
                        place_inner_grid(c_ptr);
                        c_ptr->feat = feat_glass_wall;
                }
                for (x = xval - 2; x <= xval + 2; x++)
                {
-                       c_ptr = &cave[yval - 3][x];
+                       c_ptr = &grid_array[yval - 3][x];
                        place_inner_grid(c_ptr);
                        c_ptr->feat = feat_glass_wall;
-                       c_ptr = &cave[yval + 3][x];
+                       c_ptr = &grid_array[yval + 3][x];
                        place_inner_grid(c_ptr);
                        c_ptr->feat = feat_glass_wall;
                }
                for (dir1 = 4; dir1 < 8; dir1++)
                {
-                       c_ptr = &cave[yval + 2 * ddy_ddd[dir1]][xval + 2 * ddx_ddd[dir1]];
+                       c_ptr = &grid_array[yval + 2 * ddy_ddd[dir1]][xval + 2 * ddx_ddd[dir1]];
                        place_inner_grid(c_ptr);
                        c_ptr->feat = feat_glass_wall;
                }
@@ -230,7 +230,7 @@ bool build_type15(void)
 
                for (y = yval - 2; y <= yval + 2; y++)
                        for (x = xval - 2; x <= xval + 2; x++)
-                               cave[y][x].info |= (CAVE_ICKY);
+                               grid_array[y][x].info |= (CAVE_ICKY);
 
        }
        break;
index 5243011..f64b041 100644 (file)
@@ -48,7 +48,7 @@ bool build_type14(void)
        {
                for (x = x1 - 1; x <= x2 + 1; x++)
                {
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
                        place_floor_grid(c_ptr);
                        c_ptr->info |= (CAVE_ROOM);
                        if (light) c_ptr->info |= (CAVE_GLOW);
@@ -58,16 +58,16 @@ bool build_type14(void)
        /* Walls around the room */
        for (y = y1 - 1; y <= y2 + 1; y++)
        {
-               c_ptr = &cave[y][x1 - 1];
+               c_ptr = &grid_array[y][x1 - 1];
                place_outer_grid(c_ptr);
-               c_ptr = &cave[y][x2 + 1];
+               c_ptr = &grid_array[y][x2 + 1];
                place_outer_grid(c_ptr);
        }
        for (x = x1 - 1; x <= x2 + 1; x++)
        {
-               c_ptr = &cave[y1 - 1][x];
+               c_ptr = &grid_array[y1 - 1][x];
                place_outer_grid(c_ptr);
-               c_ptr = &cave[y2 + 1][x];
+               c_ptr = &grid_array[y2 + 1][x];
                place_outer_grid(c_ptr);
        }
 
@@ -77,7 +77,7 @@ bool build_type14(void)
                trap = feat_trap_armageddon;
 
        /* Place a special trap */
-       c_ptr = &cave[rand_spread(yval, ysize / 4)][rand_spread(xval, xsize / 4)];
+       c_ptr = &grid_array[rand_spread(yval, ysize / 4)][rand_spread(xval, xsize / 4)];
        c_ptr->mimic = c_ptr->feat;
        c_ptr->feat = trap;
 
index 4d3180b..917d63c 100644 (file)
@@ -69,9 +69,9 @@ static void build_bubble_vault(POSITION x0, POSITION y0, POSITION xsize, POSITIO
                int side_x = x0 - xhsize + i;
 
                place_outer_noperm_bold(y0 - yhsize + 0, side_x);
-               cave[y0 - yhsize + 0][side_x].info |= (CAVE_ROOM | CAVE_ICKY);
+               grid_array[y0 - yhsize + 0][side_x].info |= (CAVE_ROOM | CAVE_ICKY);
                place_outer_noperm_bold(y0 - yhsize + ysize - 1, side_x);
-               cave[y0 - yhsize + ysize - 1][side_x].info |= (CAVE_ROOM | CAVE_ICKY);
+               grid_array[y0 - yhsize + ysize - 1][side_x].info |= (CAVE_ROOM | CAVE_ICKY);
        }
 
        /* Left and right boundaries */
@@ -80,9 +80,9 @@ static void build_bubble_vault(POSITION x0, POSITION y0, POSITION xsize, POSITIO
                int side_y = y0 - yhsize + i;
 
                place_outer_noperm_bold(side_y, x0 - xhsize + 0);
-               cave[side_y][x0 - xhsize + 0].info |= (CAVE_ROOM | CAVE_ICKY);
+               grid_array[side_y][x0 - xhsize + 0].info |= (CAVE_ROOM | CAVE_ICKY);
                place_outer_noperm_bold(side_y, x0 - xhsize + xsize - 1);
-               cave[side_y][x0 - xhsize + xsize - 1].info |= (CAVE_ROOM | CAVE_ICKY);
+               grid_array[side_y][x0 - xhsize + xsize - 1].info |= (CAVE_ROOM | CAVE_ICKY);
        }
 
        /* Fill in middle with bubbles */
@@ -132,7 +132,7 @@ static void build_bubble_vault(POSITION x0, POSITION y0, POSITION xsize, POSITIO
                        }
 
                        /* clean up rest of flags */
-                       cave[y0 - yhsize + y][x0 - xhsize + x].info |= (CAVE_ROOM | CAVE_ICKY);
+                       grid_array[y0 - yhsize + y][x0 - xhsize + x].info |= (CAVE_ROOM | CAVE_ICKY);
                }
        }
 
@@ -170,7 +170,7 @@ static void build_room_vault(POSITION x0, POSITION y0, POSITION xsize, POSITION
                        POSITION y = y0 - yhsize + y1;
 
                        place_extra_bold(y, x);
-                       cave[y][x].info &= (~CAVE_ICKY);
+                       grid_array[y][x].info &= (~CAVE_ICKY);
                }
        }
 
@@ -197,7 +197,7 @@ static void build_room_vault(POSITION x0, POSITION y0, POSITION xsize, POSITION
 }
 
 
-/* Create a random vault out of a fractal cave */
+/* Create a random vault out of a fractal grid_array */
 static void build_cave_vault(POSITION x0, POSITION y0, POSITION xsiz, POSITION ysiz)
 {
        int grd, roug, cutoff;
@@ -239,7 +239,7 @@ static void build_cave_vault(POSITION x0, POSITION y0, POSITION xsiz, POSITION y
        {
                for (y = 0; y <= ysize; y++)
                {
-                       cave[y0 - yhsize + y][x0 - xhsize + x].info |= CAVE_ICKY;
+                       grid_array[y0 - yhsize + y][x0 - xhsize + x].info |= CAVE_ICKY;
                }
        }
 
@@ -339,7 +339,7 @@ static void build_vault(POSITION yval, POSITION xval, POSITION ymax, POSITION xm
 
                        /* Hack -- skip "non-grids" */
                        if (*t == ' ') continue;
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
 
                        /* Lay down a floor */
                        place_floor_grid(c_ptr);
@@ -818,10 +818,10 @@ static void build_target_vault(POSITION x0, POSITION y0, POSITION xsize, POSITIO
                for (y = y0 - rad; y <= y0 + rad; y++)
                {
                        /* clear room flag */
-                       cave[y][x].info &= ~(CAVE_ROOM);
+                       grid_array[y][x].info &= ~(CAVE_ROOM);
 
                        /* Vault - so is "icky" */
-                       cave[y][x].info |= CAVE_ICKY;
+                       grid_array[y][x].info |= CAVE_ICKY;
 
                        if (dist2(y0, x0, y, x, h1, h2, h3, h4) <= rad - 1)
                        {
@@ -981,7 +981,7 @@ static void build_elemental_vault(POSITION x0, POSITION y0, POSITION xsiz, POSIT
        {
                for (y = 0; y <= ysize; y++)
                {
-                       cave[y0 - yhsize + y][x0 - xhsize + x].info |= CAVE_ICKY;
+                       grid_array[y0 - yhsize + y][x0 - xhsize + x].info |= CAVE_ICKY;
                }
        }
 
@@ -1030,7 +1030,7 @@ static void build_mini_c_vault(POSITION x0, POSITION y0, POSITION xsize, POSITIO
        {
                if (!in_bounds(y1 - 2, x)) break;
 
-               cave[y1 - 2][x].info |= (CAVE_ROOM | CAVE_ICKY);
+               grid_array[y1 - 2][x].info |= (CAVE_ROOM | CAVE_ICKY);
 
                place_outer_noperm_bold(y1 - 2, x);
        }
@@ -1039,7 +1039,7 @@ static void build_mini_c_vault(POSITION x0, POSITION y0, POSITION xsize, POSITIO
        {
                if (!in_bounds(y2 + 2, x)) break;
 
-               cave[y2 + 2][x].info |= (CAVE_ROOM | CAVE_ICKY);
+               grid_array[y2 + 2][x].info |= (CAVE_ROOM | CAVE_ICKY);
 
                place_outer_noperm_bold(y2 + 2, x);
        }
@@ -1048,7 +1048,7 @@ static void build_mini_c_vault(POSITION x0, POSITION y0, POSITION xsize, POSITIO
        {
                if (!in_bounds(y, x1 - 2)) break;
 
-               cave[y][x1 - 2].info |= (CAVE_ROOM | CAVE_ICKY);
+               grid_array[y][x1 - 2].info |= (CAVE_ROOM | CAVE_ICKY);
 
                place_outer_noperm_bold(y, x1 - 2);
        }
@@ -1057,7 +1057,7 @@ static void build_mini_c_vault(POSITION x0, POSITION y0, POSITION xsize, POSITIO
        {
                if (!in_bounds(y, x2 + 2)) break;
 
-               cave[y][x2 + 2].info |= (CAVE_ROOM | CAVE_ICKY);
+               grid_array[y][x2 + 2].info |= (CAVE_ROOM | CAVE_ICKY);
 
                place_outer_noperm_bold(y, x2 + 2);
        }
@@ -1066,7 +1066,7 @@ static void build_mini_c_vault(POSITION x0, POSITION y0, POSITION xsize, POSITIO
        {
                for (x = x1 - 1; x <= x2 + 1; x++)
                {
-                       grid_type *c_ptr = &cave[y][x];
+                       grid_type *c_ptr = &grid_array[y][x];
 
                        c_ptr->info |= (CAVE_ROOM | CAVE_ICKY);
 
@@ -1151,7 +1151,7 @@ static void build_castle_vault(POSITION x0, POSITION y0, POSITION xsize, POSITIO
        {
                for (x = x1 - 1; x <= x2 + 1; x++)
                {
-                       cave[y][x].info |= (CAVE_ROOM | CAVE_ICKY);
+                       grid_array[y][x].info |= (CAVE_ROOM | CAVE_ICKY);
                        /* Make everything a floor */
                        place_floor_bold(y, x);
                }
index 1c5e534..bb393e2 100644 (file)
@@ -183,7 +183,7 @@ void build_small_room(POSITION x0, POSITION y0)
        }
 
        /* Clear mimic type */
-       cave[y0][x0].mimic = 0;
+       grid_array[y0][x0].mimic = 0;
 
        /* Add inner open space */
        place_floor_bold(y0, x0);
@@ -192,7 +192,7 @@ void build_small_room(POSITION x0, POSITION y0)
 /*!
  * @brief
  * 指定範囲に通路が通っていることを確認した上で床で埋める
- * This function tunnels around a room if it will cut off part of a cave system.
+ * This function tunnels around a room if it will cut off part of a grid_array system.
  * @param x1 範囲の左端
  * @param y1 範囲の上端
  * @param x2 範囲の右端
@@ -521,7 +521,7 @@ struct fill_data_type
 static fill_data_type fill_data;
 
 
-/* Store routine for the fractal cave generator */
+/* Store routine for the fractal grid_array generator */
 /* this routine probably should be an inline function or a macro. */
 static void store_height(POSITION x, POSITION y, FEAT_IDX val)
 {
@@ -531,7 +531,7 @@ static void store_height(POSITION x, POSITION y, FEAT_IDX val)
                (val <= fill_data.c1)) val = fill_data.c1 + 1;
 
        /* store the value in height-map format */
-       cave[y][x].feat = val;
+       grid_array[y][x].feat = val;
 
        return;
 }
@@ -564,7 +564,7 @@ static void store_height(POSITION x, POSITION y, FEAT_IDX val)
 *
 * How fractal caves are made:
 *
-* When the map is complete, a cut-off value is used to create a cave.
+* When the map is complete, a cut-off value is used to create a grid_array.
 * Heights below this value are "floor", and heights above are "wall".
 * This also can be used to create lakes, by adding more height levels
 * representing shallow and deep water/ lava etc.
@@ -572,7 +572,7 @@ static void store_height(POSITION x, POSITION y, FEAT_IDX val)
 * The grd variable affects the width of passages.
 * The roug variable affects the roughness of those passages
 *
-* The tricky part is making sure the created cave is connected.  This
+* The tricky part is making sure the created grid_array is connected.  This
 * is done by 'filling' from the inside and only keeping the 'filled'
 * floor.  Walls bounding the 'filled' floor are also kept.  Everything
 * else is converted to the normal _extra_.
@@ -580,7 +580,7 @@ static void store_height(POSITION x, POSITION y, FEAT_IDX val)
 
 
 /*
- *  Note that this uses the cave.feat array in a very hackish way
+ *  Note that this uses the grid_array.feat array in a very hackish way
  *  the values are first set to zero, and then each array location
  *  is used as a "heightmap"
  *  The heightmap then needs to be converted back into the "feat" format.
@@ -588,7 +588,7 @@ static void store_height(POSITION x, POSITION y, FEAT_IDX val)
  *  grd=level at which fractal turns on.  smaller gives more mazelike caves
  *  roug=roughness level.  16=normal.  higher values make things more convoluted
  *    small values are good for smooth walls.
- *  size=length of the side of the square cave system.
+ *  size=length of the side of the square grid_array system.
  */
 void generate_hmap(POSITION y0, POSITION x0, POSITION xsiz, POSITION ysiz, int grd, int roug, int cutoff)
 {
@@ -649,20 +649,20 @@ void generate_hmap(POSITION y0, POSITION x0, POSITION xsiz, POSITION ysiz, int g
                for (j = 0; j <= ysize; j++)
                {
                        /* -1 is a flag for "not done yet" */
-                       cave[(int)(fill_data.ymin + j)][(int)(fill_data.xmin + i)].feat = -1;
-                       /* Clear icky flag because may be redoing the cave */
-                       cave[(int)(fill_data.ymin + j)][(int)(fill_data.xmin + i)].info &= ~(CAVE_ICKY);
+                       grid_array[(int)(fill_data.ymin + j)][(int)(fill_data.xmin + i)].feat = -1;
+                       /* Clear icky flag because may be redoing the grid_array */
+                       grid_array[(int)(fill_data.ymin + j)][(int)(fill_data.xmin + i)].info &= ~(CAVE_ICKY);
                }
        }
 
        /* Boundaries are walls */
-       cave[fill_data.ymin][fill_data.xmin].feat = (s16b)maxsize;
-       cave[fill_data.ymax][fill_data.xmin].feat = (s16b)maxsize;
-       cave[fill_data.ymin][fill_data.xmax].feat = (s16b)maxsize;
-       cave[fill_data.ymax][fill_data.xmax].feat = (s16b)maxsize;
+       grid_array[fill_data.ymin][fill_data.xmin].feat = (s16b)maxsize;
+       grid_array[fill_data.ymax][fill_data.xmin].feat = (s16b)maxsize;
+       grid_array[fill_data.ymin][fill_data.xmax].feat = (s16b)maxsize;
+       grid_array[fill_data.ymax][fill_data.xmax].feat = (s16b)maxsize;
 
        /* Set the middle square to be an open area. */
-       cave[y0][x0].feat = 0;
+       grid_array[y0][x0].feat = 0;
 
        /* Initialize the step sizes */
        xstep = xhstep = xsize * 256;
@@ -699,7 +699,7 @@ void generate_hmap(POSITION y0, POSITION x0, POSITION xsiz, POSITION ysiz, int g
                                jj = j / 256 + fill_data.ymin;
 
                                /* Test square */
-                               if (cave[jj][ii].feat == -1)
+                               if (grid_array[jj][ii].feat == -1)
                                {
                                        if (xhstep2 > grd)
                                        {
@@ -710,8 +710,8 @@ void generate_hmap(POSITION y0, POSITION x0, POSITION xsiz, POSITION ysiz, int g
                                        {
                                                /* Average of left and right points +random bit */
                                                store_height(ii, jj,
-                                                       (cave[jj][fill_data.xmin + (i - xhstep) / 256].feat
-                                                        + cave[jj][fill_data.xmin + (i + xhstep) / 256].feat) / 2
+                                                       (grid_array[jj][fill_data.xmin + (i - xhstep) / 256].feat
+                                                        + grid_array[jj][fill_data.xmin + (i + xhstep) / 256].feat) / 2
                                                         + (randint1(xstep2) - xhstep2) * roug / 16);
                                        }
                                }
@@ -729,7 +729,7 @@ void generate_hmap(POSITION y0, POSITION x0, POSITION xsiz, POSITION ysiz, int g
                                jj = j / 256 + fill_data.ymin;
 
                                /* Test square */
-                               if (cave[jj][ii].feat == -1)
+                               if (grid_array[jj][ii].feat == -1)
                                {
                                        if (xhstep2 > grd)
                                        {
@@ -740,8 +740,8 @@ void generate_hmap(POSITION y0, POSITION x0, POSITION xsiz, POSITION ysiz, int g
                                        {
                                                /* Average of up and down points +random bit */
                                                store_height(ii, jj,
-                                                       (cave[fill_data.ymin + (j - yhstep) / 256][ii].feat
-                                                       + cave[fill_data.ymin + (j + yhstep) / 256][ii].feat) / 2
+                                                       (grid_array[fill_data.ymin + (j - yhstep) / 256][ii].feat
+                                                       + grid_array[fill_data.ymin + (j + yhstep) / 256][ii].feat) / 2
                                                        + (randint1(ystep2) - yhstep2) * roug / 16);
                                        }
                                }
@@ -758,7 +758,7 @@ void generate_hmap(POSITION y0, POSITION x0, POSITION xsiz, POSITION ysiz, int g
                                jj = j / 256 + fill_data.ymin;
 
                                /* Test square */
-                               if (cave[jj][ii].feat == -1)
+                               if (grid_array[jj][ii].feat == -1)
                                {
                                        if (xhstep2 > grd)
                                        {
@@ -778,8 +778,8 @@ void generate_hmap(POSITION y0, POSITION x0, POSITION xsiz, POSITION ysiz, int g
                                                 * reduce the effect of the square grid on the shape of the fractal
                                                 */
                                                store_height(ii, jj,
-                                                       (cave[ym][xm].feat + cave[yp][xm].feat
-                                                       + cave[ym][xp].feat + cave[yp][xp].feat) / 4
+                                                       (grid_array[ym][xm].feat + grid_array[yp][xm].feat
+                                                       + grid_array[ym][xp].feat + grid_array[yp][xp].feat) / 4
                                                        + (randint1(xstep2) - xhstep2) * (diagsize / 16) / 256 * roug);
                                        }
                                }
@@ -793,9 +793,9 @@ static bool hack_isnt_wall(POSITION y, POSITION x, int c1, int c2, int c3, FEAT_
 {
        /*
         * function used to convert from height-map back to the
-        *  normal angband cave format
+        *  normal angband grid_array format
         */
-       if (cave[y][x].info & CAVE_ICKY)
+       if (grid_array[y][x].info & CAVE_ICKY)
        {
                /* already done */
                return FALSE;
@@ -803,50 +803,50 @@ static bool hack_isnt_wall(POSITION y, POSITION x, int c1, int c2, int c3, FEAT_
        else
        {
                /* Show that have looked at this square */
-               cave[y][x].info|= (CAVE_ICKY);
+               grid_array[y][x].info|= (CAVE_ICKY);
 
                /* Use cutoffs c1-c3 to allocate regions of floor /water/ lava etc. */
-               if (cave[y][x].feat <= c1)
+               if (grid_array[y][x].feat <= c1)
                {
                        /* 25% of the time use the other tile : it looks better this way */
                        if (randint1(100) < 75)
                        {
-                               cave[y][x].feat = feat1;
-                               cave[y][x].info &= ~(CAVE_MASK);
-                               cave[y][x].info |= info1;
+                               grid_array[y][x].feat = feat1;
+                               grid_array[y][x].info &= ~(CAVE_MASK);
+                               grid_array[y][x].info |= info1;
                                return TRUE;
                        }
                        else
                        {
-                               cave[y][x].feat = feat2;
-                               cave[y][x].info &= ~(CAVE_MASK);
-                               cave[y][x].info |= info2;
+                               grid_array[y][x].feat = feat2;
+                               grid_array[y][x].info &= ~(CAVE_MASK);
+                               grid_array[y][x].info |= info2;
                                return TRUE;
                        }
                }
-               else if (cave[y][x].feat <= c2)
+               else if (grid_array[y][x].feat <= c2)
                {
                        /* 25% of the time use the other tile : it looks better this way */
                        if (randint1(100) < 75)
                        {
-                               cave[y][x].feat = feat2;
-                               cave[y][x].info &= ~(CAVE_MASK);
-                               cave[y][x].info |= info2;
+                               grid_array[y][x].feat = feat2;
+                               grid_array[y][x].info &= ~(CAVE_MASK);
+                               grid_array[y][x].info |= info2;
                                return TRUE;
                        }
                        else
                        {
-                               cave[y][x].feat = feat1;
-                               cave[y][x].info &= ~(CAVE_MASK);
-                               cave[y][x].info |= info1;
+                               grid_array[y][x].feat = feat1;
+                               grid_array[y][x].info &= ~(CAVE_MASK);
+                               grid_array[y][x].info |= info1;
                                return TRUE;
                        }
                }
-               else if (cave[y][x].feat <= c3)
+               else if (grid_array[y][x].feat <= c3)
                {
-                       cave[y][x].feat = feat3;
-                       cave[y][x].info &= ~(CAVE_MASK);
-                       cave[y][x].info |= info3;
+                       grid_array[y][x].feat = feat3;
+                       grid_array[y][x].info &= ~(CAVE_MASK);
+                       grid_array[y][x].info |= info3;
                        return TRUE;
                }
                /* if greater than cutoff then is a wall */
@@ -863,7 +863,7 @@ static bool hack_isnt_wall(POSITION y, POSITION x, int c1, int c2, int c3, FEAT_
 
 /*
  * Quick and nasty fill routine used to find the connected region
- * of floor in the middle of the cave
+ * of floor in the middle of the grid_array
  */
 static void cave_fill(POSITION y, POSITION x)
 {
@@ -899,11 +899,11 @@ static void cave_fill(POSITION y, POSITION x)
                        j = ty + ddy_ddd[d];
                        i = tx + ddx_ddd[d];
 
-                       /* Paranoia Don't leave the cave */
+                       /* Paranoia Don't leave the grid_array */
                        if (!in_bounds(j, i))
                        {
                                /* affect boundary */
-                               cave[j][i].info |= CAVE_ICKY;
+                               grid_array[j][i].info |= CAVE_ICKY;
 /*                             return; */
                        }
 
@@ -931,7 +931,7 @@ static void cave_fill(POSITION y, POSITION x)
                                        }
                                        else
                                        {
-                                               /* keep tally of size of cave system */
+                                               /* keep tally of size of grid_array system */
                                                (fill_data.amount)++;
                                        }
                                }
@@ -939,7 +939,7 @@ static void cave_fill(POSITION y, POSITION x)
                        else
                        {
                                /* affect boundary */
-                               cave[j][i].info |= CAVE_ICKY;
+                               grid_array[j][i].info |= CAVE_ICKY;
                        }
                }
        }
@@ -957,7 +957,7 @@ bool generate_fracave(POSITION y0, POSITION x0, POSITION xsize, POSITION ysize,
 
 
        /*
-        * select region connected to center of cave system
+        * select region connected to center of grid_array system
         * this gets rid of alot of isolated one-sqaures that
         * can make teleport traps instadeaths...
         */
@@ -990,7 +990,7 @@ bool generate_fracave(POSITION y0, POSITION x0, POSITION xsize, POSITION ysize,
                        for (y = 0; y <= ysize; ++y)
                        {
                                place_extra_bold(y0 + y - yhsize, x0 + x - xhsize);
-                               cave[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
+                               grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
                        }
                }
                return FALSE;
@@ -1004,12 +1004,12 @@ bool generate_fracave(POSITION y0, POSITION x0, POSITION xsize, POSITION ysize,
        for (i = 0; i <= xsize; ++i)
        {
                /* top boundary */
-               if ((cave[0 + y0 - yhsize][i + x0 - xhsize].info & CAVE_ICKY) && (room))
+               if ((grid_array[0 + y0 - yhsize][i + x0 - xhsize].info & CAVE_ICKY) && (room))
                {
                        /* Next to a 'filled' region? - set to be room walls */
                        place_outer_bold(y0 + 0 - yhsize, x0 + i - xhsize);
-                       if (light) cave[y0 + 0 - yhsize][x0 + i - xhsize].info |= (CAVE_GLOW);
-                       cave[y0 + 0 - yhsize][x0 + i - xhsize].info |= (CAVE_ROOM);
+                       if (light) grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info |= (CAVE_GLOW);
+                       grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info |= (CAVE_ROOM);
                        place_outer_bold(y0 + 0 - yhsize, x0 + i - xhsize);
                }
                else
@@ -1019,12 +1019,12 @@ bool generate_fracave(POSITION y0, POSITION x0, POSITION xsize, POSITION ysize,
                }
 
                /* bottom boundary */
-               if ((cave[ysize + y0 - yhsize][i + x0 - xhsize].info & CAVE_ICKY) && (room))
+               if ((grid_array[ysize + y0 - yhsize][i + x0 - xhsize].info & CAVE_ICKY) && (room))
                {
                        /* Next to a 'filled' region? - set to be room walls */
                        place_outer_bold(y0 + ysize - yhsize, x0 + i - xhsize);
-                       if (light) cave[y0 + ysize - yhsize][x0 + i - xhsize].info|=(CAVE_GLOW);
-                       cave[y0 + ysize - yhsize][x0 + i - xhsize].info|=(CAVE_ROOM);
+                       if (light) grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info|=(CAVE_GLOW);
+                       grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info|=(CAVE_ROOM);
                        place_outer_bold(y0 + ysize - yhsize, x0 + i - xhsize);
                }
                else
@@ -1034,20 +1034,20 @@ bool generate_fracave(POSITION y0, POSITION x0, POSITION xsize, POSITION ysize,
                }
 
                /* clear the icky flag-don't need it any more */
-               cave[y0 + 0 - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
-               cave[y0 + ysize - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
+               grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
+               grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
        }
 
        /* Do the left and right boundaries minus the corners (done above) */
        for (i = 1; i < ysize; ++i)
        {
                /* left boundary */
-               if ((cave[i + y0 - yhsize][0 + x0 - xhsize].info & CAVE_ICKY) && room)
+               if ((grid_array[i + y0 - yhsize][0 + x0 - xhsize].info & CAVE_ICKY) && room)
                {
                        /* room boundary */
                        place_outer_bold(y0 + i - yhsize, x0 + 0 - xhsize);
-                       if (light) cave[y0 + i - yhsize][x0 + 0 - xhsize].info |= (CAVE_GLOW);
-                       cave[y0 + i - yhsize][x0 + 0 - xhsize].info |= (CAVE_ROOM);
+                       if (light) grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info |= (CAVE_GLOW);
+                       grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info |= (CAVE_ROOM);
                        place_outer_bold(y0 + i - yhsize, x0 + 0 - xhsize);
                }
                else
@@ -1056,12 +1056,12 @@ bool generate_fracave(POSITION y0, POSITION x0, POSITION xsize, POSITION ysize,
                        place_extra_bold(y0 + i - yhsize, x0 + 0 - xhsize);
                }
                /* right boundary */
-               if ((cave[i + y0 - yhsize][xsize + x0 - xhsize].info & CAVE_ICKY) && room)
+               if ((grid_array[i + y0 - yhsize][xsize + x0 - xhsize].info & CAVE_ICKY) && room)
                {
                        /* room boundary */
                        place_outer_bold(y0 + i - yhsize, x0 + xsize - xhsize);
-                       if (light) cave[y0 + i - yhsize][x0 + xsize - xhsize].info |= (CAVE_GLOW);
-                       cave[y0 + i - yhsize][x0 + xsize - xhsize].info |= (CAVE_ROOM);
+                       if (light) grid_array[y0 + i - yhsize][x0 + xsize - xhsize].info |= (CAVE_GLOW);
+                       grid_array[y0 + i - yhsize][x0 + xsize - xhsize].info |= (CAVE_ROOM);
                        place_outer_bold(y0 + i - yhsize, x0 + xsize - xhsize);
                }
                else
@@ -1071,8 +1071,8 @@ bool generate_fracave(POSITION y0, POSITION x0, POSITION xsize, POSITION ysize,
                }
 
                /* clear icky flag -done with it */
-               cave[y0 + i - yhsize][x0 + 0 - xhsize].info &= ~(CAVE_ICKY);
-               cave[y0 + i - yhsize][x0 + xsize - xhsize].info &= ~(CAVE_ICKY);
+               grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info &= ~(CAVE_ICKY);
+               grid_array[y0 + i - yhsize][x0 + xsize - xhsize].info &= ~(CAVE_ICKY);
        }
 
 
@@ -1082,37 +1082,37 @@ bool generate_fracave(POSITION y0, POSITION x0, POSITION xsize, POSITION ysize,
                for (y = 1; y < ysize; ++y)
                {
                        if (is_floor_bold(y0 + y - yhsize, x0 + x - xhsize) &&
-                           (cave[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY))
+                           (grid_array[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY))
                        {
                                /* Clear the icky flag in the filled region */
-                               cave[y0 + y - yhsize][x0 + x - xhsize].info &= ~CAVE_ICKY;
+                               grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~CAVE_ICKY;
 
                                /* Set appropriate flags */
-                               if (light) cave[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_GLOW);
-                               if (room) cave[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_ROOM);
+                               if (light) grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_GLOW);
+                               if (room) grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_ROOM);
                        }
                        else if (is_outer_bold(y0 + y - yhsize, x0 + x - xhsize) &&
-                                (cave[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY))
+                                (grid_array[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY))
                        {
                                /* Walls */
-                               cave[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY);
-                               if (light) cave[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_GLOW);
+                               grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY);
+                               if (light) grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_GLOW);
                                if (room)
                                {
-                                       cave[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_ROOM);
+                                       grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_ROOM);
                                }
                                else
                                {
 
                                        place_extra_bold(y0 + y - yhsize, x0 + x - xhsize);
-                                       cave[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ROOM);
+                                       grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ROOM);
                                }
                        }
                        else
                        {
                                /* Clear the unconnected regions */
                                place_extra_bold(y0 + y - yhsize, x0 + x - xhsize);
-                               cave[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
+                               grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
                        }
                }
        }
@@ -1133,7 +1133,7 @@ bool generate_fracave(POSITION y0, POSITION x0, POSITION xsize, POSITION ysize,
 
 #ifdef ALLOW_CAVERNS_AND_LAKES
 /*
- * Builds a cave system in the center of the dungeon.
+ * Builds a grid_array system in the center of the dungeon.
  */
 void build_cavern(void)
 {
@@ -1144,7 +1144,7 @@ void build_cavern(void)
        light = done = FALSE;
        if ((dun_level <= randint1(50)) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) light = TRUE;
 
-       /* Make a cave the size of the dungeon */
+       /* Make a grid_array the size of the dungeon */
        xsize = cur_wid - 1;
        ysize = cur_hgt - 1;
        x0 = xsize / 2;
@@ -1196,7 +1196,7 @@ bool generate_lake(POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int
                feat2 = feat_shallow_water;
                feat3 = feat_ground_type[randint0(100)];
                break;
-       case LAKE_T_CAVE: /* Collapsed cave */
+       case LAKE_T_CAVE: /* Collapsed grid_array */
                feat1 = feat_ground_type[randint0(100)];
                feat2 = feat_ground_type[randint0(100)];
                feat3 = feat_rubble;
@@ -1227,7 +1227,7 @@ bool generate_lake(POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int
        }
 
        /*
-        * select region connected to center of cave system
+        * select region connected to center of grid_array system
         * this gets rid of alot of isolated one-sqaures that
         * can make teleport traps instadeaths...
         */
@@ -1249,7 +1249,7 @@ bool generate_lake(POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int
        /* number of filled squares */
        fill_data.amount = 0;
 
-       /* select region connected to center of cave system
+       /* select region connected to center of grid_array system
        * this gets rid of alot of isolated one-sqaures that
        * can make teleport traps instadeaths... */
        cave_fill((byte)y0, (byte)x0);
@@ -1263,7 +1263,7 @@ bool generate_lake(POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int
                        for (y = 0; y <= ysize; ++y)
                        {
                                place_floor_bold(y0 + y - yhsize, x0 + x - xhsize);
-                               cave[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY);
+                               grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY);
                        }
                }
                return FALSE;
@@ -1276,8 +1276,8 @@ bool generate_lake(POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int
                place_extra_bold(y0 + ysize - yhsize, x0 + i - xhsize);
 
                /* clear the icky flag-don't need it any more */
-               cave[y0 + 0 - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
-               cave[y0 + ysize - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
+               grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
+               grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
        }
 
        /* Do the left and right boundaries minus the corners (done above) */
@@ -1288,8 +1288,8 @@ bool generate_lake(POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int
                place_extra_bold(y0 + i - yhsize, x0 + xsize - xhsize);
 
                /* clear icky flag -done with it */
-               cave[y0 + i - yhsize][x0 + 0 - xhsize].info &= ~(CAVE_ICKY);
-               cave[y0 + i - yhsize][x0 + xsize - xhsize].info &= ~(CAVE_ICKY);
+               grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info &= ~(CAVE_ICKY);
+               grid_array[y0 + i - yhsize][x0 + xsize - xhsize].info &= ~(CAVE_ICKY);
        }
 
 
@@ -1299,17 +1299,17 @@ bool generate_lake(POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int
                for (y = 1; y < ysize; ++y)
                {
                        /* Fill unconnected regions with granite */
-                       if ((!(cave[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY)) ||
+                       if ((!(grid_array[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY)) ||
                                is_outer_bold(y0 + y - yhsize, x0 + x - xhsize))
                                place_extra_bold(y0 + y - yhsize, x0 + x - xhsize);
 
                        /* turn off icky flag (no longer needed.) */
-                       cave[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
+                       grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
 
                        /* Light lava */
                        if (cave_have_flag_bold(y0 + y - yhsize, x0 + x - xhsize, FF_LAVA))
                        {
-                               if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) cave[y0 + y - yhsize][x0 + x - xhsize].info |= CAVE_GLOW;
+                               if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= CAVE_GLOW;
                        }
                }
        }
@@ -1319,7 +1319,7 @@ bool generate_lake(POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int
 
 
 /*
- * makes a lake/collapsed cave system in the center of the dungeon
+ * makes a lake/collapsed grid_array system in the center of the dungeon
  */
 void build_lake(int type)
 {
@@ -1548,18 +1548,18 @@ void build_room(POSITION x1, POSITION x2, POSITION y1, POSITION y2)
        for (i = 0; i <= xsize; i++)
        {
                place_outer_noperm_bold(y1, x1 + i);
-               cave[y1][x1 + i].info |= (CAVE_ROOM | CAVE_ICKY);
+               grid_array[y1][x1 + i].info |= (CAVE_ROOM | CAVE_ICKY);
                place_outer_noperm_bold(y2, x1 + i);
-               cave[y2][x1 + i].info |= (CAVE_ROOM | CAVE_ICKY);
+               grid_array[y2][x1 + i].info |= (CAVE_ROOM | CAVE_ICKY);
        }
 
        /* Left and right boundaries */
        for (i = 1; i < ysize; i++)
        {
                place_outer_noperm_bold(y1 + i, x1);
-               cave[y1 + i][x1].info|=(CAVE_ROOM | CAVE_ICKY);
+               grid_array[y1 + i][x1].info|=(CAVE_ROOM | CAVE_ICKY);
                place_outer_noperm_bold(y1 + i, x2);
-               cave[y1 + i][x2].info|=(CAVE_ROOM | CAVE_ICKY);
+               grid_array[y1 + i][x2].info|=(CAVE_ROOM | CAVE_ICKY);
        }
 
        /* Middle */
@@ -1571,12 +1571,12 @@ void build_room(POSITION x1, POSITION x2, POSITION y1, POSITION y2)
                        {
                                /* clear the untouched region */
                                place_floor_bold(y1 + y, x1 + x);
-                               cave[y1 + y][x1 + x].info |= (CAVE_ROOM | CAVE_ICKY);
+                               grid_array[y1 + y][x1 + x].info |= (CAVE_ROOM | CAVE_ICKY);
                        }
                        else
                        {
                                /* make it a room- but don't touch */
-                               cave[y1 + y][x1 + x].info |= (CAVE_ROOM | CAVE_ICKY);
+                               grid_array[y1 + y][x1 + x].info |= (CAVE_ROOM | CAVE_ICKY);
                        }
                }
        }
@@ -1713,7 +1713,7 @@ void build_maze_vault(POSITION x0, POSITION y0, POSITION xsize, POSITION ysize,
        {
                for (x = x1 - 1; x <= x2 + 1; x++)
                {
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
                        c_ptr->info |= CAVE_ROOM;
                        if (is_vault) c_ptr->info |= CAVE_ICKY;
                        if ((x == x1 - 1) || (x == x2 + 1) || (y == y1 - 1) || (y == y2 + 1))
@@ -1969,7 +1969,7 @@ void add_outer_wall(POSITION x, POSITION y, int light, POSITION x1, POSITION y1,
 
        if (!in_bounds(y, x)) return;
 
-       c_ptr = &cave[y][x];
+       c_ptr = &grid_array[y][x];
 
        /* hack- check to see if square has been visited before
        * if so, then exit (use room flag to do this) */
@@ -2049,7 +2049,7 @@ void generate_room_floor(POSITION y1, POSITION x1, POSITION y2, POSITION x2, int
                for (x = x1; x <= x2; x++)
                {
                        /* Point to grid */
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
                        place_floor_grid(c_ptr);
                        c_ptr->info |= (CAVE_ROOM);
                        if (light) c_ptr->info |= (CAVE_GLOW);
@@ -2135,7 +2135,7 @@ bool generate_rooms(void)
        /* Limit number of rooms */
        int dun_rooms = DUN_ROOMS_MAX * area_size / 100;
 
-       /* Assume normal cave */
+       /* Assume normal grid_array */
        room_info_type *room_info_ptr = room_info_normal;
 
        /*
@@ -2192,7 +2192,7 @@ bool generate_rooms(void)
                MOVE_PLIST(ROOM_T_INNER_FEAT, ROOM_T_OVAL);
        }
 
-       /*! @details ダンジョンにCAVEフラグがある場合、NORMALの生成枠がFRACAVEに与えられる。/ CAVE dungeon (Orc cave etc.) */
+       /*! @details ダンジョンにCAVEフラグがある場合、NORMALの生成枠がFRACAVEに与えられる。/ CAVE dungeon (Orc grid_array etc.) */
        else if (d_info[p_ptr->dungeon_idx].flags1 & DF1_CAVE)
        {
                MOVE_PLIST(ROOM_T_FRACAVE, ROOM_T_NORMAL);
index 444a160..ef166ad 100644 (file)
@@ -31,7 +31,7 @@
 #define ROOM_T_PIT            5         /*!<部屋型ID:モンスターPIT / Monster pit (33x11) */
 #define ROOM_T_LESSER_VAULT   6         /*!<部屋型ID:小型VAULT / Lesser vault (33x22) */
 #define ROOM_T_GREATER_VAULT  7         /*!<部屋型ID:大型VAULT / Greater vault (66x44) */
-#define ROOM_T_FRACAVE        8         /*!<部屋型ID:フラクタル地形 / Fractal cave (42x24) */
+#define ROOM_T_FRACAVE        8         /*!<部屋型ID:フラクタル地形 / Fractal grid_array (42x24) */
 #define ROOM_T_RANDOM_VAULT   9         /*!<部屋型ID:ランダムVAULT / Random vault (44x22) */
 #define ROOM_T_OVAL          10         /*!<部屋型ID:円形部屋 / Circular rooms (22x22) */
 #define ROOM_T_CRYPT         11         /*!<部屋型ID:聖堂 / Crypts (22x22) */
index 5a14299..51ce711 100644 (file)
@@ -851,8 +851,8 @@ static void wr_extra(void)
 
 
 /*!
- * @brief フロア保存時のcave情報テンプレートをソートするための比較処理
- * @param u caveテンプレートの参照ポインタ
+ * @brief フロア保存時のgrid_array情報テンプレートをソートするための比較処理
+ * @param u grid_arrayテンプレートの参照ポインタ
  * @param v 未使用
  * @param a スワップするモンスター種族のID1
  * @param b スワップするモンスター種族のID2
@@ -873,8 +873,8 @@ static bool ang_sort_comp_cave_temp(vptr u, vptr v, int a, int b)
 
 
 /*!
- * @brief フロア保存時のcave情報テンプレートをソートするためのスワップ処理 / Sorting hook -- Swap function
- * @param u caveテンプレートの参照ポインタ
+ * @brief フロア保存時のgrid_array情報テンプレートをソートするためのスワップ処理 / Sorting hook -- Swap function
+ * @param u grid_arrayテンプレートの参照ポインタ
  * @param v 未使用
  * @param a スワップするモンスター種族のID1
  * @param b スワップするモンスター種族のID2
@@ -973,7 +973,7 @@ static void wr_saved_floor(saved_floor_type *sf_ptr)
        {
                for (x = 0; x < cur_wid; x++)
                {
-                       grid_type *c_ptr = &cave[y][x];
+                       grid_type *c_ptr = &grid_array[y][x];
 
                        for (i = 0; i < num_temp; i++)
                        {
@@ -1042,18 +1042,18 @@ static void wr_saved_floor(saved_floor_type *sf_ptr)
 
 
 
-       /*** "Run-Length-Encoding" of cave ***/
+       /*** "Run-Length-Encoding" of grid_array ***/
 
        /* Note that this will induce two wasted bytes */
        count = 0;
        prev_u16b = 0;
 
-       /* Dump the cave */
+       /* Dump the grid_array */
        for (y = 0; y < cur_hgt; y++)
        {
                for (x = 0; x < cur_wid; x++)
                {
-                       grid_type *c_ptr = &cave[y][x];
+                       grid_type *c_ptr = &grid_array[y][x];
 
                        for (i = 0; i < num_temp; i++)
                        {
index 4dceee9..55109b1 100644 (file)
@@ -519,7 +519,7 @@ void exe_fire(INVENTORY_IDX item, object_type *j_ptr)
                        /* Shatter Arrow */
                        if (snipe_type == SP_KILL_WALL)
                        {
-                               c_ptr = &cave[ny][nx];
+                               c_ptr = &grid_array[ny][nx];
 
                                if (cave_have_flag_grid(c_ptr, FF_HURT_ROCK) && !c_ptr->m_idx)
                                {
@@ -537,7 +537,7 @@ void exe_fire(INVENTORY_IDX item, object_type *j_ptr)
                        }
 
                        /* Stopped by walls/doors */
-                       if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && !cave[ny][nx].m_idx) break;
+                       if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && !grid_array[ny][nx].m_idx) break;
 
                        /* Advance the distance */
                        cur_dis++;
@@ -545,7 +545,7 @@ void exe_fire(INVENTORY_IDX item, object_type *j_ptr)
                        /* Sniper */
                        if (snipe_type == SP_LITE)
                        {
-                               cave[ny][nx].info |= (CAVE_GLOW);
+                               grid_array[ny][nx].info |= (CAVE_GLOW);
                                note_spot(ny, nx);
                                lite_spot(ny, nx);
                        }
@@ -582,7 +582,7 @@ void exe_fire(INVENTORY_IDX item, object_type *j_ptr)
                        /* Sniper */
                        if (snipe_type == SP_EVILNESS)
                        {
-                               cave[ny][nx].info &= ~(CAVE_GLOW | CAVE_MARK);
+                               grid_array[ny][nx].info &= ~(CAVE_GLOW | CAVE_MARK);
                                note_spot(ny, nx);
                                lite_spot(ny, nx);
                        }
@@ -595,9 +595,9 @@ void exe_fire(INVENTORY_IDX item, object_type *j_ptr)
                        y = ny;
 
                        /* Monster here, Try to hit it */
-                       if (cave[y][x].m_idx)
+                       if (grid_array[y][x].m_idx)
                        {
-                               grid_type *c_mon_ptr = &cave[y][x];
+                               grid_type *c_mon_ptr = &grid_array[y][x];
 
                                monster_type *m_ptr = &m_list[c_mon_ptr->m_idx];
                                monster_race *r_ptr = &r_info[m_ptr->r_idx];
@@ -718,7 +718,7 @@ void exe_fire(INVENTORY_IDX item, object_type *j_ptr)
                                        /* Sniper */
                                        if (snipe_type == SP_HOLYNESS)
                                        {
-                                               cave[ny][nx].info |= (CAVE_GLOW);
+                                               grid_array[ny][nx].info |= (CAVE_GLOW);
                                                note_spot(ny, nx);
                                                lite_spot(ny, nx);
                                        }
@@ -779,13 +779,13 @@ void exe_fire(INVENTORY_IDX item, object_type *j_ptr)
                                                                if (!in_bounds2(ny, nx)) break;
 
                                                                /* Stopped by walls/doors */
-                                                               if (!player_can_enter(cave[ny][nx].feat, 0)) break;
+                                                               if (!player_can_enter(grid_array[ny][nx].feat, 0)) break;
 
                                                                /* Stopped by monsters */
                                                                if (!cave_empty_bold(ny, nx)) break;
 
-                                                               cave[ny][nx].m_idx = m_idx;
-                                                               cave[oy][ox].m_idx = 0;
+                                                               grid_array[ny][nx].m_idx = m_idx;
+                                                               grid_array[oy][ox].m_idx = 0;
 
                                                                m_ptr->fx = nx;
                                                                m_ptr->fy = ny;
@@ -825,7 +825,7 @@ void exe_fire(INVENTORY_IDX item, object_type *j_ptr)
 
                if (stick_to)
                {
-                       MONSTER_IDX m_idx = cave[y][x].m_idx;
+                       MONSTER_IDX m_idx = grid_array[y][x].m_idx;
                        monster_type *m_ptr = &m_list[m_idx];
                        OBJECT_IDX o_idx = o_pop();
 
index ba9065b..f4ecc3d 100644 (file)
@@ -112,7 +112,7 @@ bool create_ammo(void)
                if (!get_rep_dir(&dir, FALSE)) return FALSE;
                y = p_ptr->y + ddy[dir];
                x = p_ptr->x + ddx[dir];
-               c_ptr = &cave[y][x];
+               c_ptr = &grid_array[y][x];
 
                if (!have_flag(f_info[get_feat_mimic(c_ptr)].flags, FF_CAN_DIG))
                {
index 401f331..3949c7c 100644 (file)
@@ -60,7 +60,7 @@ static void next_mirror(POSITION* next_y, POSITION* next_x, POSITION cury, POSIT
        {
                for (y = 0; y < cur_hgt; y++)
                {
-                       if (is_mirror_grid(&cave[y][x])) {
+                       if (is_mirror_grid(&grid_array[y][x])) {
                                mirror_y[mirror_num] = y;
                                mirror_x[mirror_num] = x;
                                mirror_num++;
@@ -304,7 +304,7 @@ static POSITION monster_target_y; /*!< モンスターの攻撃目標Y座標 */
  */
 static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
 {
-       grid_type *c_ptr = &cave[y][x];
+       grid_type *c_ptr = &grid_array[y][x];
        feature_type *f_ptr = &f_info[c_ptr->feat];
 
        bool obvious = FALSE;
@@ -648,7 +648,7 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
 
                                                if (in_bounds2(by, bx))
                                                {
-                                                       grid_type *cc_ptr = &cave[by][bx];
+                                                       grid_type *cc_ptr = &grid_array[by][bx];
 
                                                        if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
                                                        {
@@ -797,7 +797,7 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
  */
 static bool project_o(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
 {
-       grid_type *c_ptr = &cave[y][x];
+       grid_type *c_ptr = &grid_array[y][x];
 
        OBJECT_IDX this_o_idx, next_o_idx = 0;
 
@@ -1177,7 +1177,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
 {
        int tmp;
 
-       grid_type *c_ptr = &cave[y][x];
+       grid_type *c_ptr = &grid_array[y][x];
 
        monster_type *m_ptr = &m_list[c_ptr->m_idx];
        monster_type *caster_ptr = (who > 0) ? &m_list[who] : NULL;
@@ -4307,7 +4307,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
                        x = m_ptr->fx;
 
                        /* Hack -- get new grid */
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
                }
 
                /* Fear */
@@ -6437,7 +6437,7 @@ bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT da
                                }
                        }
                        if (project_o(0, 0, y, x, dam, GF_SEEKER))notice = TRUE;
-                       if (is_mirror_grid(&cave[y][x]))
+                       if (is_mirror_grid(&grid_array[y][x]))
                        {
                                /* The target of monsterspell becomes tha mirror(broken) */
                                monster_target_y = y;
@@ -6453,8 +6453,8 @@ bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT da
                                        x = GRID_X(path_g[j]);
                                        if (project_m(0, 0, y, x, dam, GF_SEEKER, flg, TRUE)) notice = TRUE;
                                        if (!who && (project_m_n == 1) && !jump) {
-                                               if (cave[project_m_y][project_m_x].m_idx > 0) {
-                                                       monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
+                                               if (grid_array[project_m_y][project_m_x].m_idx > 0) {
+                                                       monster_type *m_ptr = &m_list[grid_array[project_m_y][project_m_x].m_idx];
 
                                                        if (m_ptr->ml)
                                                        {
@@ -6462,7 +6462,7 @@ bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT da
                                                                if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
 
                                                                /* Hack - auto-track */
-                                                               health_track(cave[project_m_y][project_m_x].m_idx);
+                                                               health_track(grid_array[project_m_y][project_m_x].m_idx);
                                                        }
                                                }
                                        }
@@ -6479,9 +6479,9 @@ bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT da
                        if (project_m(0, 0, py, px, dam, GF_SEEKER, flg, TRUE))
                                notice = TRUE;
                        if (!who && (project_m_n == 1) && !jump) {
-                               if (cave[project_m_y][project_m_x].m_idx > 0)
+                               if (grid_array[project_m_y][project_m_x].m_idx > 0)
                                {
-                                       monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
+                                       monster_type *m_ptr = &m_list[grid_array[project_m_y][project_m_x].m_idx];
 
                                        if (m_ptr->ml)
                                        {
@@ -6489,7 +6489,7 @@ bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT da
                                                if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
 
                                                /* Hack - auto-track */
-                                               health_track(cave[project_m_y][project_m_x].m_idx);
+                                               health_track(grid_array[project_m_y][project_m_x].m_idx);
                                        }
                                }
                        }
@@ -6580,7 +6580,7 @@ bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT da
                                if( second_step )continue;
                                break;
                        }
-                       if( is_mirror_grid(&cave[y][x]) && !second_step )
+                       if( is_mirror_grid(&grid_array[y][x]) && !second_step )
                        {
                          /* The target of monsterspell becomes tha mirror(broken) */
                                monster_target_y=(s16b)y;
@@ -6612,8 +6612,8 @@ bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT da
                        px = GRID_X(path_g[i]);
                        (void)project_m(0, 0, py, px, dam, GF_SUPER_RAY, flg, TRUE);
                        if(!who && (project_m_n == 1) && !jump){
-                               if(cave[project_m_y][project_m_x].m_idx >0 ){
-                                       monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
+                               if(grid_array[project_m_y][project_m_x].m_idx >0 ){
+                                       monster_type *m_ptr = &m_list[grid_array[project_m_y][project_m_x].m_idx];
 
                                        if (m_ptr->ml)
                                        {
@@ -6621,7 +6621,7 @@ bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT da
                                                if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
 
                                                /* Hack - auto-track */
-                                               health_track(cave[project_m_y][project_m_x].m_idx);
+                                               health_track(grid_array[project_m_y][project_m_x].m_idx);
                                        }
                                }
                        }
@@ -6994,11 +6994,11 @@ bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT da
                        /* A single bolt may be reflected */
                        if (grids <= 1)
                        {
-                               monster_type *m_ptr = &m_list[cave[y][x].m_idx];
+                               monster_type *m_ptr = &m_list[grid_array[y][x].m_idx];
                                monster_race *ref_ptr = &r_info[m_ptr->r_idx];
 
-                               if ((flg & PROJECT_REFLECTABLE) && cave[y][x].m_idx && (ref_ptr->flags2 & RF2_REFLECTING) &&
-                                       ((cave[y][x].m_idx != p_ptr->riding) || !(flg & PROJECT_PLAYER)) &&
+                               if ((flg & PROJECT_REFLECTABLE) && grid_array[y][x].m_idx && (ref_ptr->flags2 & RF2_REFLECTING) &&
+                                       ((grid_array[y][x].m_idx != p_ptr->riding) || !(flg & PROJECT_PLAYER)) &&
                                        (!who || dist_hack > 1) && !one_in_(10))
                                {
                                        POSITION t_y, t_x;
@@ -7036,7 +7036,7 @@ bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT da
                                        else flg |= PROJECT_PLAYER;
 
                                        /* The bolt is reflected */
-                                       project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
+                                       project(grid_array[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
 
                                        /* Don't affect the monster any longer */
                                        continue;
@@ -7138,9 +7138,9 @@ bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT da
                        y = project_m_y;
 
                        /* Track if possible */
-                       if (cave[y][x].m_idx > 0)
+                       if (grid_array[y][x].m_idx > 0)
                        {
-                               monster_type *m_ptr = &m_list[cave[y][x].m_idx];
+                               monster_type *m_ptr = &m_list[grid_array[y][x].m_idx];
 
                                if (m_ptr->ml)
                                {
@@ -7148,7 +7148,7 @@ bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT da
                                        if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
 
                                        /* Hack - auto-track */
-                                       if (m_ptr->ml) health_track(cave[y][x].m_idx);
+                                       if (m_ptr->ml) health_track(grid_array[y][x].m_idx);
                                }
                        }
                }
@@ -7283,7 +7283,7 @@ bool binding_field(HIT_POINT dam)
        {
                for (y = 0; y < cur_hgt; y++)
                {
-                       if (is_mirror_grid(&cave[y][x]) &&
+                       if (is_mirror_grid(&grid_array[y][x]) &&
                                distance(p_ptr->y, p_ptr->x, y, x) <= MAX_RANGE &&
                                distance(p_ptr->y, p_ptr->x, y, x) != 0 &&
                                player_has_los_bold(y, x) &&
@@ -7417,12 +7417,12 @@ void seal_of_mirror(HIT_POINT dam)
        {
                for (y = 0; y < cur_hgt; y++)
                {
-                       if (is_mirror_grid(&cave[y][x]))
+                       if (is_mirror_grid(&grid_array[y][x]))
                        {
                                if (project_m(0, 0, y, x, dam, GF_GENOCIDE,
                                        (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), TRUE))
                                {
-                                       if (!cave[y][x].m_idx)
+                                       if (!grid_array[y][x].m_idx)
                                        {
                                                remove_mirror(y, x);
                                        }
index bf77bcb..9d63a7a 100644 (file)
@@ -49,7 +49,7 @@ static bool detect_feat_flag(POSITION range, int flag, bool known)
                {
                        int dist = distance(p_ptr->y, p_ptr->x, y, x);
                        if (dist > range) continue;
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
 
                        /* Hack -- Safe */
                        if (flag == FF_TRAP)
@@ -1419,7 +1419,7 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
 
                        /* Stay in the circle of death */
                        if (k > r) continue;
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
 
                        /* Lose room and vault */
                        c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
@@ -1590,7 +1590,7 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
 
                                /* Stay in the circle of death */
                                if (k > r) continue;
-                               c_ptr = &cave[y][x];
+                               c_ptr = &grid_array[y][x];
 
                                if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW;
                                else if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
@@ -1604,7 +1604,7 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
                                                yy = y + ddy_ddd[i];
                                                xx = x + ddx_ddd[i];
                                                if (!in_bounds2(yy, xx)) continue;
-                                               cc_ptr = &cave[yy][xx];
+                                               cc_ptr = &grid_array[yy][xx];
                                                if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
                                                {
                                                        c_ptr->info |= CAVE_GLOW;
@@ -1637,7 +1637,7 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
 
                if (p_ptr->special_defense & NINJA_S_STEALTH)
                {
-                       if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+                       if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
                }
        }
 
@@ -1717,7 +1717,7 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
 
                        /* Skip distant grids */
                        if (distance(cy, cx, yy, xx) > r) continue;
-                       c_ptr = &cave[yy][xx];
+                       c_ptr = &grid_array[yy][xx];
 
                        /* Lose room and vault / Lose light and knowledge */
                        c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY | CAVE_UNSAFE);
@@ -1753,7 +1753,7 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                        /* Important -- Skip "quake" grids */
                        if (map[16+y-cy][16+x-cx]) continue;
 
-                       if (cave[y][x].m_idx) continue;
+                       if (grid_array[y][x].m_idx) continue;
 
                        /* Count "safe" grids */
                        sn++;
@@ -1770,17 +1770,17 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                {
                        case 1:
                        {
-                               msg_print(_("ダンジョンの壁が崩れた!", "The cave ceiling collapses!"));
+                               msg_print(_("ダンジョンの壁が崩れた!", "The grid_array ceiling collapses!"));
                                break;
                        }
                        case 2:
                        {
-                               msg_print(_("ダンジョンの床が不自然にねじ曲がった!", "The cave floor twists in an unnatural way!"));
+                               msg_print(_("ダンジョンの床が不自然にねじ曲がった!", "The grid_array floor twists in an unnatural way!"));
                                break;
                        }
                        default:
                        {
-                               msg_print(_("ダンジョンが揺れた!崩れた岩が頭に降ってきた!", "The cave quakes!  You are pummeled with debris!"));
+                               msg_print(_("ダンジョンが揺れた!崩れた岩が頭に降ってきた!", "The grid_array quakes!  You are pummeled with debris!"));
                                break;
                        }
                }
@@ -1862,7 +1862,7 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
 
                        /* Skip unaffected grids */
                        if (!map[16+yy-cy][16+xx-cx]) continue;
-                       c_ptr = &cave[yy][xx];
+                       c_ptr = &grid_array[yy][xx];
 
                        if (c_ptr->m_idx == p_ptr->riding) continue;
 
@@ -1903,8 +1903,8 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                                                        if (!cave_empty_bold(y, x)) continue;
 
                                                        /* Hack -- no safety on glyph of warding */
-                                                       if (is_glyph_grid(&cave[y][x])) continue;
-                                                       if (is_explosive_rune_grid(&cave[y][x])) continue;
+                                                       if (is_glyph_grid(&grid_array[y][x])) continue;
+                                                       if (is_explosive_rune_grid(&grid_array[y][x])) continue;
 
                                                        /* ... nor on the Pattern */
                                                        if (pattern_tile(y, x)) continue;
@@ -1912,7 +1912,7 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                                                        /* Important -- Skip "quake" grids */
                                                        if (map[16+y-cy][16+x-cx]) continue;
 
-                                                       if (cave[y][x].m_idx) continue;
+                                                       if (grid_array[y][x].m_idx) continue;
                                                        if (player_bold(y, x)) continue;
 
                                                        /* Count "safe" grids */
@@ -1966,13 +1966,13 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                                        /* Hack -- Escape from the rock */
                                        if (sn)
                                        {
-                                               IDX m_idx_aux = cave[yy][xx].m_idx;
+                                               IDX m_idx_aux = grid_array[yy][xx].m_idx;
 
                                                /* Update the old location */
-                                               cave[yy][xx].m_idx = 0;
+                                               grid_array[yy][xx].m_idx = 0;
 
                                                /* Update the new location */
-                                               cave[sy][sx].m_idx = m_idx_aux;
+                                               grid_array[sy][sx].m_idx = m_idx_aux;
 
                                                /* Move the monster */
                                                m_ptr->fy = sy;
@@ -2002,7 +2002,7 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                        /* Skip unaffected grids */
                        if (!map[16+yy-cy][16+xx-cx]) continue;
 
-                       c_ptr = &cave[yy][xx];
+                       c_ptr = &grid_array[yy][xx];
 
                        /* Paranoia -- never affect player */
 /*                     if (player_bold(yy, xx)) continue; */
@@ -2060,7 +2060,7 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
 
                        /* Skip distant grids */
                        if (distance(cy, cx, yy, xx) > r) continue;
-                       c_ptr = &cave[yy][xx];
+                       c_ptr = &grid_array[yy][xx];
 
                        if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW;
                        else if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
@@ -2074,7 +2074,7 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                                        yyy = yy + ddy_ddd[ii];
                                        xxx = xx + ddx_ddd[ii];
                                        if (!in_bounds2(yyy, xxx)) continue;
-                                       cc_ptr = &cave[yyy][xxx];
+                                       cc_ptr = &grid_array[yyy][xxx];
                                        if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
                                        {
                                                c_ptr->info |= CAVE_GLOW;
@@ -2092,7 +2092,7 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
 
        if (p_ptr->special_defense & NINJA_S_STEALTH)
        {
-               if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+               if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
        }
 
        /* Success */
@@ -2196,7 +2196,7 @@ static void cave_temp_room_lite(void)
                POSITION y = temp_y[i];
                POSITION x = temp_x[i];
 
-               grid_type *c_ptr = &cave[y][x];
+               grid_type *c_ptr = &grid_array[y][x];
 
                /* No longer in the array */
                c_ptr->info &= ~(CAVE_TEMP);
@@ -2271,7 +2271,7 @@ static void cave_temp_room_unlite(void)
                POSITION x = temp_x[i];
                int j;
 
-               grid_type *c_ptr = &cave[y][x];
+               grid_type *c_ptr = &grid_array[y][x];
                bool do_dark = !is_mirror_grid(c_ptr);
 
                /* No longer in the array */
@@ -2289,7 +2289,7 @@ static void cave_temp_room_unlite(void)
 
                                        if (in_bounds2(by, bx))
                                        {
-                                               grid_type *cc_ptr = &cave[by][bx];
+                                               grid_type *cc_ptr = &grid_array[by][bx];
 
                                                if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
                                                {
@@ -2405,7 +2405,7 @@ static void cave_temp_room_aux(POSITION y, POSITION x, bool only_room, bool (*pa
        grid_type *c_ptr;
 
        /* Get the grid */
-       c_ptr = &cave[y][x];
+       c_ptr = &grid_array[y][x];
 
        /* Avoid infinite recursion */
        if (c_ptr->info & (CAVE_TEMP)) return;
@@ -2532,7 +2532,7 @@ void lite_room(POSITION y1, POSITION x1)
 
        if (p_ptr->special_defense & NINJA_S_STEALTH)
        {
-               if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+               if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
        }
 }
 
@@ -2905,7 +2905,7 @@ bool teleport_swap(DIRECTION dir)
                tx = p_ptr->x + ddx[dir];
                ty = p_ptr->y + ddy[dir];
        }
-       c_ptr = &cave[ty][tx];
+       c_ptr = &grid_array[ty][tx];
 
        if (p_ptr->anti_tele)
        {
@@ -3772,7 +3772,7 @@ bool rush_attack(bool *mdeath)
                ty = target_row;
        }
 
-       if (in_bounds(ty, tx)) tm_idx = cave[ty][tx].m_idx;
+       if (in_bounds(ty, tx)) tm_idx = grid_array[ty][tx].m_idx;
 
        path_n = project_path(path_g, project_length, p_ptr->y, p_ptr->x, ty, tx, PROJECT_STOP | PROJECT_KILL);
        project_length = 0;
@@ -3792,7 +3792,7 @@ bool rush_attack(bool *mdeath)
                int ny = GRID_Y(path_g[i]);
                int nx = GRID_X(path_g[i]);
 
-               if (cave_empty_bold(ny, nx) && player_can_enter(cave[ny][nx].feat, 0))
+               if (cave_empty_bold(ny, nx) && player_can_enter(grid_array[ny][nx].feat, 0))
                {
                        ty = ny;
                        tx = nx;
@@ -3801,7 +3801,7 @@ bool rush_attack(bool *mdeath)
                        continue;
                }
 
-               if (!cave[ny][nx].m_idx)
+               if (!grid_array[ny][nx].m_idx)
                {
                        if (tm_idx)
                        {
@@ -3818,12 +3818,12 @@ bool rush_attack(bool *mdeath)
 
                /* Move player before updating the monster */
                if (!player_bold(ty, tx)) teleport_player_to(ty, tx, TELEPORT_NONMAGICAL);
-               update_monster(cave[ny][nx].m_idx, TRUE);
+               update_monster(grid_array[ny][nx].m_idx, TRUE);
 
                /* Found a monster */
-               m_ptr = &m_list[cave[ny][nx].m_idx];
+               m_ptr = &m_list[grid_array[ny][nx].m_idx];
 
-               if (tm_idx != cave[ny][nx].m_idx)
+               if (tm_idx != grid_array[ny][nx].m_idx)
                {
 #ifdef JP
                        msg_format("%s%sが立ちふさがっている!", tm_idx ? "別の" : "", m_ptr->ml ? "モンスター" : "何か");
@@ -3868,7 +3868,7 @@ void remove_all_mirrors(bool explode)
        {
                for (y = 0; y < cur_hgt; y++)
                {
-                       if (is_mirror_grid(&cave[y][x]))
+                       if (is_mirror_grid(&grid_array[y][x]))
                        {
                                remove_mirror(y, x);
                                if (explode)
@@ -4135,7 +4135,7 @@ bool cast_wrath_of_the_god(HIT_POINT dam, POSITION rad)
                if (!cave_have_flag_bold(ny, nx, FF_PROJECT)) break;
 
                /* Stopped by monsters */
-               if ((dir != 5) && cave[ny][nx].m_idx != 0) break;
+               if ((dir != 5) && grid_array[ny][nx].m_idx != 0) break;
 
                /* Save the new location */
                x = nx;
@@ -4619,7 +4619,7 @@ bool_hack vampirism(void)
        if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
        y = p_ptr->y + ddy[dir];
        x = p_ptr->x + ddx[dir];
-       c_ptr = &cave[y][x];
+       c_ptr = &grid_array[y][x];
 
        stop_mouth();
 
@@ -4662,7 +4662,7 @@ bool panic_hit(void)
        if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
        y = p_ptr->y + ddy[dir];
        x = p_ptr->x + ddx[dir];
-       if (cave[y][x].m_idx)
+       if (grid_array[y][x].m_idx)
        {
                py_attack(y, x, 0);
                if (randint0(p_ptr->skill_dis) < 7)
@@ -4969,7 +4969,7 @@ void hayagake(player_type *creature_ptr)
        }
        else
        {
-               grid_type *c_ptr = &cave[creature_ptr->y][creature_ptr->x];
+               grid_type *c_ptr = &grid_array[creature_ptr->y][creature_ptr->x];
                feature_type *f_ptr = &f_info[c_ptr->feat];
 
                if (!have_flag(f_ptr->flags, FF_PROJECT) ||
@@ -4993,7 +4993,7 @@ bool double_attack(player_type *creature_ptr)
        if (!get_rep_dir(&dir, FALSE)) return FALSE;
        y = creature_ptr->y + ddy[dir];
        x = creature_ptr->x + ddx[dir];
-       if (cave[y][x].m_idx)
+       if (grid_array[y][x].m_idx)
        {
                if (one_in_(3))
                        msg_print(_("あーたたたたたたたたたたたたたたたたたたたたたた!!!",
@@ -5006,7 +5006,7 @@ bool double_attack(player_type *creature_ptr)
                                "Oraoraoraoraoraoraoraoraoraoraoraoraoraoraoraoraora!!!!"));
 
                py_attack(y, x, 0);
-               if (cave[y][x].m_idx)
+               if (grid_array[y][x].m_idx)
                {
                        handle_stuff();
                        py_attack(y, x, 0);
@@ -5074,7 +5074,7 @@ bool mirror_concentration(player_type *creature_ptr)
                msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
                return FALSE;
        }
-       if (is_mirror_grid(&cave[creature_ptr->y][creature_ptr->x]))
+       if (is_mirror_grid(&grid_array[creature_ptr->y][creature_ptr->x]))
        {
                msg_print(_("少し頭がハッキリした。", "You feel your head clear a little."));
 
@@ -5105,7 +5105,7 @@ bool sword_dancing(player_type *creature_ptr)
                dir = randint0(8);
                y = creature_ptr->y + ddy_ddd[dir];
                x = creature_ptr->x + ddx_ddd[dir];
-               c_ptr = &cave[y][x];
+               c_ptr = &grid_array[y][x];
 
                /* Hack -- attack monsters */
                if (c_ptr->m_idx)
index 436951f..c759792 100644 (file)
@@ -91,7 +91,7 @@ bool teleport_away(MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode)
 
                        /* No teleporting into vaults and such */
                        if (!(p_ptr->inside_quest || p_ptr->inside_arena))
-                               if (cave[ny][nx].info & CAVE_ICKY) continue;
+                               if (grid_array[ny][nx].info & CAVE_ICKY) continue;
 
                        /* This grid looks good */
                        look = FALSE;
@@ -113,10 +113,10 @@ bool teleport_away(MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode)
        sound(SOUND_TPOTHER);
 
        /* Update the old location */
-       cave[oy][ox].m_idx = 0;
+       grid_array[oy][ox].m_idx = 0;
 
        /* Update the new location */
-       cave[ny][nx].m_idx = m_idx;
+       grid_array[ny][nx].m_idx = m_idx;
 
        /* Move the monster */
        m_ptr->fy = ny;
@@ -193,7 +193,7 @@ void teleport_monster_to(MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power,
                        if (!cave_monster_teleportable_bold(m_idx, ny, nx, mode)) continue;
 
                        /* No teleporting into vaults and such */
-                       /* if (cave[ny][nx].info & (CAVE_ICKY)) continue; */
+                       /* if (grid_array[ny][nx].info & (CAVE_ICKY)) continue; */
 
                        /* This grid looks good */
                        look = FALSE;
@@ -214,10 +214,10 @@ void teleport_monster_to(MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power,
        sound(SOUND_TPOTHER);
 
        /* Update the old location */
-       cave[oy][ox].m_idx = 0;
+       grid_array[oy][ox].m_idx = 0;
 
        /* Update the new location */
-       cave[ny][nx].m_idx = m_idx;
+       grid_array[ny][nx].m_idx = m_idx;
 
        /* Move the monster */
        m_ptr->fy = ny;
@@ -381,7 +381,7 @@ void teleport_player(POSITION dis, BIT_FLAGS mode)
        {
                for (yy = -1; yy < 2; yy++)
                {
-                       MONSTER_IDX tmp_m_idx = cave[oy+yy][ox+xx].m_idx;
+                       MONSTER_IDX tmp_m_idx = grid_array[oy+yy][ox+xx].m_idx;
 
                        /* A monster except your mount may follow */
                        if (tmp_m_idx && (p_ptr->riding != tmp_m_idx))
@@ -423,7 +423,7 @@ void teleport_player_away(MONSTER_IDX m_idx, POSITION dis)
        {
                for (yy = -1; yy < 2; yy++)
                {
-                       MONSTER_IDX tmp_m_idx = cave[oy+yy][ox+xx].m_idx;
+                       MONSTER_IDX tmp_m_idx = grid_array[oy+yy][ox+xx].m_idx;
 
                        /* A monster except your mount or caster may follow */
                        if (tmp_m_idx && (p_ptr->riding != tmp_m_idx) && (m_idx != tmp_m_idx))
@@ -482,7 +482,7 @@ void teleport_player_to(POSITION ny, POSITION nx, BIT_FLAGS mode)
                }
 
                /* Accept any grid when wizard mode */
-               if (p_ptr->wizard && !(mode & TELEPORT_PASSIVE) && (!cave[y][x].m_idx || (cave[y][x].m_idx == p_ptr->riding))) break;
+               if (p_ptr->wizard && !(mode & TELEPORT_PASSIVE) && (!grid_array[y][x].m_idx || (grid_array[y][x].m_idx == p_ptr->riding))) break;
 
                /* Accept teleportable floor grids */
                if (cave_player_teleportable_bold(y, x, mode)) break;
@@ -561,7 +561,7 @@ bool teleport_level_other(player_type *creature_ptr)
        GAME_TEXT m_name[MAX_NLEN];
 
        if (!target_set(TARGET_KILL)) return FALSE;
-       target_m_idx = cave[target_row][target_col].m_idx;
+       target_m_idx = grid_array[target_row][target_col].m_idx;
        if (!target_m_idx) return TRUE;
        if (!player_has_los_bold(target_row, target_col)) return TRUE;
        if (!projectable(creature_ptr->y, creature_ptr->x, target_row, target_col)) return TRUE;
@@ -1393,7 +1393,7 @@ static bool vanish_dungeon(void)
        {
                for (x = 1; x < cur_wid - 1; x++)
                {
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
 
                        /* Seeing true feature code (ignore mimic) */
                        f_ptr = &f_info[c_ptr->feat];
@@ -1425,7 +1425,7 @@ static bool vanish_dungeon(void)
        /* Special boundary walls -- Top and bottom */
        for (x = 0; x < cur_wid; x++)
        {
-               c_ptr = &cave[0][x];
+               c_ptr = &grid_array[0][x];
                f_ptr = &f_info[c_ptr->mimic];
 
                /* Lose room and vault */
@@ -1440,7 +1440,7 @@ static bool vanish_dungeon(void)
                        if (!have_flag(f_info[c_ptr->mimic].flags, FF_REMEMBER)) c_ptr->info &= ~(CAVE_MARK);
                }
 
-               c_ptr = &cave[cur_hgt - 1][x];
+               c_ptr = &grid_array[cur_hgt - 1][x];
                f_ptr = &f_info[c_ptr->mimic];
 
                /* Lose room and vault */
@@ -1459,7 +1459,7 @@ static bool vanish_dungeon(void)
        /* Special boundary walls -- Left and right */
        for (y = 1; y < (cur_hgt - 1); y++)
        {
-               c_ptr = &cave[y][0];
+               c_ptr = &grid_array[y][0];
                f_ptr = &f_info[c_ptr->mimic];
 
                /* Lose room and vault */
@@ -1474,7 +1474,7 @@ static bool vanish_dungeon(void)
                        if (!have_flag(f_info[c_ptr->mimic].flags, FF_REMEMBER)) c_ptr->info &= ~(CAVE_MARK);
                }
 
-               c_ptr = &cave[y][cur_wid - 1];
+               c_ptr = &grid_array[y][cur_wid - 1];
                f_ptr = &f_info[c_ptr->mimic];
 
                /* Lose room and vault */
@@ -1510,7 +1510,7 @@ void call_the_(void)
 
        for (i = 0; i < 9; i++)
        {
-               c_ptr = &cave[p_ptr->y + ddy_ddd[i]][p_ptr->x + ddx_ddd[i]];
+               c_ptr = &grid_array[p_ptr->y + ddy_ddd[i]][p_ptr->x + ddx_ddd[i]];
 
                if (!cave_have_flag_grid(c_ptr, FF_PROJECT))
                {
@@ -1593,7 +1593,7 @@ void fetch(DIRECTION dir, WEIGHT wgt, bool require_los)
        GAME_TEXT o_name[MAX_NLEN];
 
        /* Check to see if an object is already there */
-       if (cave[p_ptr->y][p_ptr->x].o_idx)
+       if (grid_array[p_ptr->y][p_ptr->x].o_idx)
        {
                msg_print(_("自分の足の下にある物は取れません。", "You can't fetch when you're already standing on something."));
                return;
@@ -1611,7 +1611,7 @@ void fetch(DIRECTION dir, WEIGHT wgt, bool require_los)
                        return;
                }
 
-               c_ptr = &cave[ty][tx];
+               c_ptr = &grid_array[ty][tx];
 
                /* We need an item to fetch */
                if (!c_ptr->o_idx)
@@ -1650,7 +1650,7 @@ void fetch(DIRECTION dir, WEIGHT wgt, bool require_los)
                {
                        ty += ddy[dir];
                        tx += ddx[dir];
-                       c_ptr = &cave[ty][tx];
+                       c_ptr = &grid_array[ty][tx];
 
                        if ((distance(p_ptr->y, p_ptr->x, ty, tx) > MAX_RANGE) ||
                                !cave_have_flag_bold(ty, tx, FF_PROJECT)) return;
@@ -1669,7 +1669,7 @@ void fetch(DIRECTION dir, WEIGHT wgt, bool require_los)
 
        i = c_ptr->o_idx;
        c_ptr->o_idx = o_ptr->next_o_idx;
-       cave[p_ptr->y][p_ptr->x].o_idx = i; /* 'move' it */
+       grid_array[p_ptr->y][p_ptr->x].o_idx = i; /* 'move' it */
 
        o_ptr->next_o_idx = 0;
        o_ptr->iy = p_ptr->y;
@@ -1728,8 +1728,8 @@ bool warding_glyph(void)
        }
 
        /* Create a glyph */
-       cave[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
-       cave[p_ptr->y][p_ptr->x].mimic = feat_glyph;
+       grid_array[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
+       grid_array[p_ptr->y][p_ptr->x].mimic = feat_glyph;
 
        note_spot(p_ptr->y, p_ptr->x);
        lite_spot(p_ptr->y, p_ptr->x);
@@ -1750,11 +1750,11 @@ bool place_mirror(void)
        }
 
        /* Create a mirror */
-       cave[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
-       cave[p_ptr->y][p_ptr->x].mimic = feat_mirror;
+       grid_array[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
+       grid_array[p_ptr->y][p_ptr->x].mimic = feat_mirror;
 
        /* Turn on the light */
-       cave[p_ptr->y][p_ptr->x].info |= CAVE_GLOW;
+       grid_array[p_ptr->y][p_ptr->x].info |= CAVE_GLOW;
 
        note_spot(p_ptr->y, p_ptr->x);
        lite_spot(p_ptr->y, p_ptr->x);
@@ -1778,8 +1778,8 @@ bool explosive_rune(void)
        }
 
        /* Create a glyph */
-       cave[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
-       cave[p_ptr->y][p_ptr->x].mimic = feat_explosive_rune;
+       grid_array[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
+       grid_array[p_ptr->y][p_ptr->x].mimic = feat_explosive_rune;
 
        note_spot(p_ptr->y, p_ptr->x);  
        lite_spot(p_ptr->y, p_ptr->x);
@@ -4141,7 +4141,7 @@ static MONRACE_IDX poly_r_idx(MONRACE_IDX r_idx)
  */
 bool polymorph_monster(POSITION y, POSITION x)
 {
-       grid_type *c_ptr = &cave[y][x];
+       grid_type *c_ptr = &grid_array[y][x];
        monster_type *m_ptr = &m_list[c_ptr->m_idx];
        bool polymorphed = FALSE;
        MONRACE_IDX new_r_idx;
@@ -4587,7 +4587,7 @@ void massacre(void)
        {
                y = p_ptr->y + ddy_ddd[dir];
                x = p_ptr->x + ddx_ddd[dir];
-               c_ptr = &cave[y][x];
+               c_ptr = &grid_array[y][x];
                m_ptr = &m_list[c_ptr->m_idx];
 
                /* Hack -- attack monsters */
@@ -4606,7 +4606,7 @@ bool eat_lock(void)
        if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
        y = p_ptr->y + ddy[dir];
        x = p_ptr->x + ddx[dir];
-       c_ptr = &cave[y][x];
+       c_ptr = &grid_array[y][x];
        f_ptr = &f_info[c_ptr->feat];
        mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)];
 
@@ -4673,12 +4673,12 @@ bool shock_power(void)
        x = p_ptr->x + ddx[dir];
        dam = damroll(8 + ((plev - 5) / 4) + boost / 12, 8);
        fire_beam(GF_MISSILE, dir, dam);
-       if (cave[y][x].m_idx)
+       if (grid_array[y][x].m_idx)
        {
                int i;
                POSITION ty = y, tx = x;
                POSITION oy = y, ox = x;
-               MONSTER_IDX m_idx = cave[y][x].m_idx;
+               MONSTER_IDX m_idx = grid_array[y][x].m_idx;
                monster_type *m_ptr = &m_list[m_idx];
                monster_race *r_ptr = &r_info[m_ptr->r_idx];
                GAME_TEXT m_name[MAX_NLEN];
@@ -4705,8 +4705,8 @@ bool shock_power(void)
                        if ((ty != oy) || (tx != ox))
                        {
                                msg_format(_("%sを吹き飛ばした!", "You blow %s away!"), m_name);
-                               cave[oy][ox].m_idx = 0;
-                               cave[ty][tx].m_idx = m_idx;
+                               grid_array[oy][ox].m_idx = 0;
+                               grid_array[ty][tx].m_idx = m_idx;
                                m_ptr->fy = ty;
                                m_ptr->fx = tx;
 
index 147adc8..ef30ed0 100644 (file)
@@ -5761,7 +5761,7 @@ void do_cmd_store(void)
        store_bottom = MIN_STOCK + xtra_stock;
 
        /* Access the player grid */
-       c_ptr = &cave[p_ptr->y][p_ptr->x];
+       c_ptr = &grid_array[p_ptr->y][p_ptr->x];
 
        /* Verify a store */
        if (!cave_have_flag_grid(c_ptr, FF_STORE))
index 39c488c..8a9f418 100644 (file)
@@ -82,7 +82,7 @@ FEAT_IDX choose_random_trap(void)
 */
 void disclose_grid(POSITION y, POSITION x)
 {
-       grid_type *c_ptr = &cave[y][x];
+       grid_type *c_ptr = &grid_array[y][x];
 
        if (cave_have_flag_grid(c_ptr, FF_SECRET))
        {
@@ -111,7 +111,7 @@ void disclose_grid(POSITION y, POSITION x)
 */
 void place_trap(POSITION y, POSITION x)
 {
-       grid_type *c_ptr = &cave[y][x];
+       grid_type *c_ptr = &grid_array[y][x];
 
        /* Paranoia -- verify location */
        if (!in_bounds(y, x)) return;
@@ -302,8 +302,8 @@ void hit_trap(bool break_trap)
        int i, num, dam;
        POSITION x = p_ptr->x, y = p_ptr->y;
 
-       /* Get the cave grid */
-       grid_type *c_ptr = &cave[y][x];
+       /* Get the grid */
+       grid_type *c_ptr = &grid_array[y][x];
        feature_type *f_ptr = &f_info[c_ptr->feat];
        int trap_feat_type = have_flag(f_ptr->flags, FF_TRAP) ? f_ptr->subtype : NOT_TRAP;
        concptr name = _("トラップ", "a trap");
index d1285a3..98ba273 100644 (file)
@@ -427,13 +427,13 @@ struct skill_table
 /*
  * A single "grid" in a Cave
  *
- * Note that several aspects of the code restrict the actual cave
+ * Note that several aspects of the code restrict the actual grid_array
  * to a max size of 256 by 256.  In partcular, locations are often
  * saved as bytes, limiting each coordinate to the 0-255 range.
  *
  * The "o_idx" and "m_idx" fields are very interesting.  There are
  * many places in the code where we need quick access to the actual
- * monster or object(s) in a given cave grid.  The easiest way to
+ * monster or object(s) in a given grid.  The easiest way to
  * do this is to simply keep the index of the monster and object
  * (if any) with the grid, but this takes 198*66*4 bytes of memory.
  * Several other methods come to mind, which require only half this
@@ -454,13 +454,13 @@ typedef struct grid_type grid_type;
 
 struct grid_type
 {
-       BIT_FLAGS info;         /* Hack -- cave flags */
+       BIT_FLAGS info;         /* Hack -- grid_array flags */
 
        FEAT_IDX feat;          /* Hack -- feature type */
        OBJECT_IDX o_idx;               /* Object in this grid */
        MONSTER_IDX m_idx;              /* Monster in this grid */
 
-       /*! 地形の特別な情報を保存する / Special cave info
+       /*! 地形の特別な情報を保存する / Special grid_array info
         * 具体的な使用一覧はクエスト行き階段の移行先クエストID、
         * 各ダンジョン入口の移行先ダンジョンID、
         * 
@@ -503,7 +503,7 @@ struct coord
  * Note that "object flags" must now be derived from the object kind,
  * the artifact and ego-item indexes, and the two "xtra" fields.
  *
- * Each cave grid points to one (or zero) objects via the "o_idx"
+ * Each grid points to one (or zero) objects via the "o_idx"
  * field (above).  Each object then points to one (or zero) objects
  * via the "next_o_idx" field, forming a singly linked list, which
  * in game terms, represents a "stack" of objects in the same grid.
index a9a7a64..8f69236 100644 (file)
@@ -219,23 +219,23 @@ char player_base[32];
 char savefile[1024];
 char savefile_base[40];
 
-POSITION_IDX lite_n; //!< Array of grids lit by player lite (see "cave.c")
+POSITION_IDX lite_n; //!< Array of grids lit by player lite (see "grid_array.c")
 POSITION lite_y[LITE_MAX];
 POSITION lite_x[LITE_MAX];
 
-POSITION_IDX mon_lite_n; //!< Array of grids lit by player lite (see "cave.c")
+POSITION_IDX mon_lite_n; //!< Array of grids lit by player lite (see "grid_array.c")
 POSITION mon_lite_y[MON_LITE_MAX];
 POSITION mon_lite_x[MON_LITE_MAX];
 
-POSITION_IDX view_n; //!< Array of grids viewable to the player (see "cave.c")
+POSITION_IDX view_n; //!< Array of grids viewable to the player (see "grid_array.c")
 POSITION view_y[VIEW_MAX];
 POSITION view_x[VIEW_MAX];
 
-POSITION_IDX temp_n; //!< Array of grids for use by various functions (see "cave.c")
+POSITION_IDX temp_n; //!< Array of grids for use by various functions (see "grid_array.c")
 POSITION temp_y[TEMP_MAX];
 POSITION temp_x[TEMP_MAX];
 
-POSITION_IDX redraw_n = 0; //!< Array of grids for delayed visual updating (see "cave.c")
+POSITION_IDX redraw_n = 0; //!< Array of grids for delayed visual updating (see "grid_array.c")
 POSITION redraw_y[REDRAW_MAX];
 POSITION redraw_x[REDRAW_MAX];
 
@@ -461,11 +461,11 @@ const concptr angband_music_basic_name[MUSIC_BASIC_MAX] =
 
 
 /*
- * The array of "cave grids" [MAX_WID][MAX_HGT].
+ * The array of "grid_array grids" [MAX_WID][MAX_HGT].
  * Not completely allocated, that would be inefficient
  * Not completely hardcoded, that would overflow memory
  */
-grid_type *cave[MAX_HGT];
+grid_type *grid_array[MAX_HGT];
 
 
 /*
index 87ee7ff..c09c436 100644 (file)
@@ -1695,7 +1695,7 @@ void print_monster_list(TERM_LEN x, TERM_LEN y, TERM_LEN max_lines){
        int i;
 
        for(i=0;i<temp_n;i++){
-               grid_type* c_ptr = &cave[temp_y[i]][temp_x[i]];
+               grid_type* c_ptr = &grid_array[temp_y[i]][temp_x[i]];
                if(!c_ptr->m_idx || !m_list[c_ptr->m_idx].ml)continue;//no mons or cannot look
                m_ptr = &m_list[c_ptr->m_idx];
                if(is_pet(m_ptr))continue;//pet
index b55ac64..f253a5e 100644 (file)
@@ -98,7 +98,7 @@ static void perturb_point_mid(FEAT_IDX x1, FEAT_IDX x2, FEAT_IDX x3, FEAT_IDX x4
        if (avg > depth_max) avg = depth_max;
 
        /* Set the new value. */
-       cave[ymid][xmid].feat = (FEAT_IDX)avg;
+       grid_array[ymid][xmid].feat = (FEAT_IDX)avg;
 }
 
 
@@ -133,7 +133,7 @@ static void perturb_point_end(FEAT_IDX x1, FEAT_IDX x2, FEAT_IDX x3, POSITION xm
        if (avg > depth_max) avg = depth_max;
 
        /* Set the new value. */
-       cave[ymid][xmid].feat = (FEAT_IDX)avg;
+       grid_array[ymid][xmid].feat = (FEAT_IDX)avg;
 }
 
 
@@ -165,19 +165,19 @@ static void plasma_recursive(POSITION x1, POSITION y1, POSITION x2, POSITION y2,
        /* Are we done? */
        if (x1 + 1 == x2) return;
 
-       perturb_point_mid(cave[y1][x1].feat, cave[y2][x1].feat, cave[y1][x2].feat,
-               cave[y2][x2].feat, xmid, ymid, rough, depth_max);
+       perturb_point_mid(grid_array[y1][x1].feat, grid_array[y2][x1].feat, grid_array[y1][x2].feat,
+               grid_array[y2][x2].feat, xmid, ymid, rough, depth_max);
 
-       perturb_point_end(cave[y1][x1].feat, cave[y1][x2].feat, cave[ymid][xmid].feat,
+       perturb_point_end(grid_array[y1][x1].feat, grid_array[y1][x2].feat, grid_array[ymid][xmid].feat,
                xmid, y1, rough, depth_max);
 
-       perturb_point_end(cave[y1][x2].feat, cave[y2][x2].feat, cave[ymid][xmid].feat,
+       perturb_point_end(grid_array[y1][x2].feat, grid_array[y2][x2].feat, grid_array[ymid][xmid].feat,
                x2, ymid, rough, depth_max);
 
-       perturb_point_end(cave[y2][x2].feat, cave[y2][x1].feat, cave[ymid][xmid].feat,
+       perturb_point_end(grid_array[y2][x2].feat, grid_array[y2][x1].feat, grid_array[ymid][xmid].feat,
                xmid, y2, rough, depth_max);
 
-       perturb_point_end(cave[y2][x1].feat, cave[y1][x1].feat, cave[ymid][xmid].feat,
+       perturb_point_end(grid_array[y2][x1].feat, grid_array[y1][x1].feat, grid_array[ymid][xmid].feat,
                x1, ymid, rough, depth_max);
 
 
@@ -222,7 +222,7 @@ static void generate_wilderness_area(int terrain, u32b seed, bool border, bool c
                {
                        for (x1 = 0; x1 < MAX_WID; x1++)
                        {
-                               cave[y1][x1].feat = feat_permanent;
+                               grid_array[y1][x1].feat = feat_permanent;
                        }
                }
 
@@ -244,7 +244,7 @@ static void generate_wilderness_area(int terrain, u32b seed, bool border, bool c
                {
                        for (x1 = 0; x1 < MAX_WID; x1++)
                        {
-                               cave[y1][x1].feat = table_size / 2;
+                               grid_array[y1][x1].feat = table_size / 2;
                        }
                }
        }
@@ -254,42 +254,42 @@ static void generate_wilderness_area(int terrain, u32b seed, bool border, bool c
         * ToDo: calculate the medium height of the adjacent
         * terrains for every corner.
         */
-       cave[1][1].feat = (s16b)randint0(table_size);
-       cave[MAX_HGT-2][1].feat = (s16b)randint0(table_size);
-       cave[1][MAX_WID-2].feat = (s16b)randint0(table_size);
-       cave[MAX_HGT-2][MAX_WID-2].feat = (s16b)randint0(table_size);
+       grid_array[1][1].feat = (s16b)randint0(table_size);
+       grid_array[MAX_HGT-2][1].feat = (s16b)randint0(table_size);
+       grid_array[1][MAX_WID-2].feat = (s16b)randint0(table_size);
+       grid_array[MAX_HGT-2][MAX_WID-2].feat = (s16b)randint0(table_size);
 
        if (!corner)
        {
                /* Hack -- preserve four corners */
-               s16b north_west = cave[1][1].feat;
-               s16b south_west = cave[MAX_HGT - 2][1].feat;
-               s16b north_east = cave[1][MAX_WID - 2].feat;
-               s16b south_east = cave[MAX_HGT - 2][MAX_WID - 2].feat;
+               s16b north_west = grid_array[1][1].feat;
+               s16b south_west = grid_array[MAX_HGT - 2][1].feat;
+               s16b north_east = grid_array[1][MAX_WID - 2].feat;
+               s16b south_east = grid_array[MAX_HGT - 2][MAX_WID - 2].feat;
 
                /* x1, y1, x2, y2, num_depths, roughness */
                plasma_recursive(1, 1, MAX_WID-2, MAX_HGT-2, table_size-1, roughness);
 
                /* Hack -- copyback four corners */
-               cave[1][1].feat = north_west;
-               cave[MAX_HGT - 2][1].feat = south_west;
-               cave[1][MAX_WID - 2].feat = north_east;
-               cave[MAX_HGT - 2][MAX_WID - 2].feat = south_east;
+               grid_array[1][1].feat = north_west;
+               grid_array[MAX_HGT - 2][1].feat = south_west;
+               grid_array[1][MAX_WID - 2].feat = north_east;
+               grid_array[MAX_HGT - 2][MAX_WID - 2].feat = south_east;
 
                for (y1 = 1; y1 < MAX_HGT - 1; y1++)
                {
                        for (x1 = 1; x1 < MAX_WID - 1; x1++)
                        {
-                               cave[y1][x1].feat = terrain_table[terrain][cave[y1][x1].feat];
+                               grid_array[y1][x1].feat = terrain_table[terrain][grid_array[y1][x1].feat];
                        }
                }
        }
        else /* Hack -- only four corners */
        {
-               cave[1][1].feat = terrain_table[terrain][cave[1][1].feat];
-               cave[MAX_HGT - 2][1].feat = terrain_table[terrain][cave[MAX_HGT - 2][1].feat];
-               cave[1][MAX_WID - 2].feat = terrain_table[terrain][cave[1][MAX_WID - 2].feat];
-               cave[MAX_HGT - 2][MAX_WID - 2].feat = terrain_table[terrain][cave[MAX_HGT - 2][MAX_WID - 2].feat];
+               grid_array[1][1].feat = terrain_table[terrain][grid_array[1][1].feat];
+               grid_array[MAX_HGT - 2][1].feat = terrain_table[terrain][grid_array[MAX_HGT - 2][1].feat];
+               grid_array[1][MAX_WID - 2].feat = terrain_table[terrain][grid_array[1][MAX_WID - 2].feat];
+               grid_array[MAX_HGT - 2][MAX_WID - 2].feat = terrain_table[terrain][grid_array[MAX_HGT - 2][MAX_WID - 2].feat];
        }
 
        /* Hack -- Restore the RNG state */
@@ -368,7 +368,7 @@ static void generate_area(POSITION y, POSITION x, bool border, bool corner)
                 */
                if (wilderness[y][x].road)
                {
-                       cave[MAX_HGT/2][MAX_WID/2].feat = feat_floor;
+                       grid_array[MAX_HGT/2][MAX_WID/2].feat = feat_floor;
 
                        if (wilderness[y-1][x].road)
                        {
@@ -376,7 +376,7 @@ static void generate_area(POSITION y, POSITION x, bool border, bool corner)
                                for (y1 = 1; y1 < MAX_HGT/2; y1++)
                                {
                                        x1 = MAX_WID/2;
-                                       cave[y1][x1].feat = feat_floor;
+                                       grid_array[y1][x1].feat = feat_floor;
                                }
                        }
 
@@ -386,7 +386,7 @@ static void generate_area(POSITION y, POSITION x, bool border, bool corner)
                                for (y1 = MAX_HGT/2; y1 < MAX_HGT - 1; y1++)
                                {
                                        x1 = MAX_WID/2;
-                                       cave[y1][x1].feat = feat_floor;
+                                       grid_array[y1][x1].feat = feat_floor;
                                }
                        }
 
@@ -396,7 +396,7 @@ static void generate_area(POSITION y, POSITION x, bool border, bool corner)
                                for (x1 = MAX_WID/2; x1 < MAX_WID - 1; x1++)
                                {
                                        y1 = MAX_HGT/2;
-                                       cave[y1][x1].feat = feat_floor;
+                                       grid_array[y1][x1].feat = feat_floor;
                                }
                        }
 
@@ -406,7 +406,7 @@ static void generate_area(POSITION y, POSITION x, bool border, bool corner)
                                for (x1 = 1; x1 < MAX_WID/2; x1++)
                                {
                                        y1 = MAX_HGT/2;
-                                       cave[y1][x1].feat = feat_floor;
+                                       grid_array[y1][x1].feat = feat_floor;
                                }
                        }
                }
@@ -426,8 +426,8 @@ static void generate_area(POSITION y, POSITION x, bool border, bool corner)
                dy = rand_range(6, cur_hgt - 6);
                dx = rand_range(6, cur_wid - 6);
 
-               cave[dy][dx].feat = feat_entrance;
-               cave[dy][dx].special = wilderness[y][x].entrance;
+               grid_array[dy][dx].feat = feat_entrance;
+               grid_array[dy][dx].special = wilderness[y][x].entrance;
 
                /* Hack -- Restore the RNG state */
                Rand_state_restore(state_backup);
@@ -473,7 +473,7 @@ void wilderness_gen(void)
 
        for (i = 1; i < MAX_WID - 1; i++)
        {
-               border.north[i] = cave[MAX_HGT - 2][i].feat;
+               border.north[i] = grid_array[MAX_HGT - 2][i].feat;
        }
 
        /* South border */
@@ -481,7 +481,7 @@ void wilderness_gen(void)
 
        for (i = 1; i < MAX_WID - 1; i++)
        {
-               border.south[i] = cave[1][i].feat;
+               border.south[i] = grid_array[1][i].feat;
        }
 
        /* West border */
@@ -489,7 +489,7 @@ void wilderness_gen(void)
 
        for (i = 1; i < MAX_HGT - 1; i++)
        {
-               border.west[i] = cave[i][MAX_WID - 2].feat;
+               border.west[i] = grid_array[i][MAX_WID - 2].feat;
        }
 
        /* East border */
@@ -497,24 +497,24 @@ void wilderness_gen(void)
 
        for (i = 1; i < MAX_HGT - 1; i++)
        {
-               border.east[i] = cave[i][1].feat;
+               border.east[i] = grid_array[i][1].feat;
        }
 
        /* North west corner */
        generate_area(y - 1, x - 1, FALSE, TRUE);
-       border.north_west = cave[MAX_HGT - 2][MAX_WID - 2].feat;
+       border.north_west = grid_array[MAX_HGT - 2][MAX_WID - 2].feat;
 
        /* North east corner */
        generate_area(y - 1, x + 1, FALSE, TRUE);
-       border.north_east = cave[MAX_HGT - 2][1].feat;
+       border.north_east = grid_array[MAX_HGT - 2][1].feat;
 
        /* South west corner */
        generate_area(y + 1, x - 1, FALSE, TRUE);
-       border.south_west = cave[1][MAX_WID - 2].feat;
+       border.south_west = grid_array[1][MAX_WID - 2].feat;
 
        /* South east corner */
        generate_area(y + 1, x + 1, FALSE, TRUE);
-       border.south_east = cave[1][1].feat;
+       border.south_east = grid_array[1][1].feat;
 
 
        /* Create terrain of the current area */
@@ -524,50 +524,50 @@ void wilderness_gen(void)
        /* Special boundary walls -- North */
        for (i = 0; i < MAX_WID; i++)
        {
-               cave[0][i].feat = feat_permanent;
-               cave[0][i].mimic = border.north[i];
+               grid_array[0][i].feat = feat_permanent;
+               grid_array[0][i].mimic = border.north[i];
        }
 
        /* Special boundary walls -- South */
        for (i = 0; i < MAX_WID; i++)
        {
-               cave[MAX_HGT - 1][i].feat = feat_permanent;
-               cave[MAX_HGT - 1][i].mimic = border.south[i];
+               grid_array[MAX_HGT - 1][i].feat = feat_permanent;
+               grid_array[MAX_HGT - 1][i].mimic = border.south[i];
        }
 
        /* Special boundary walls -- West */
        for (i = 0; i < MAX_HGT; i++)
        {
-               cave[i][0].feat = feat_permanent;
-               cave[i][0].mimic = border.west[i];
+               grid_array[i][0].feat = feat_permanent;
+               grid_array[i][0].mimic = border.west[i];
        }
 
        /* Special boundary walls -- East */
        for (i = 0; i < MAX_HGT; i++)
        {
-               cave[i][MAX_WID - 1].feat = feat_permanent;
-               cave[i][MAX_WID - 1].mimic = border.east[i];
+               grid_array[i][MAX_WID - 1].feat = feat_permanent;
+               grid_array[i][MAX_WID - 1].mimic = border.east[i];
        }
 
        /* North west corner */
-       cave[0][0].mimic = border.north_west;
+       grid_array[0][0].mimic = border.north_west;
 
        /* North east corner */
-       cave[0][MAX_WID - 1].mimic = border.north_east;
+       grid_array[0][MAX_WID - 1].mimic = border.north_east;
 
        /* South west corner */
-       cave[MAX_HGT - 1][0].mimic = border.south_west;
+       grid_array[MAX_HGT - 1][0].mimic = border.south_west;
 
        /* South east corner */
-       cave[MAX_HGT - 1][MAX_WID - 1].mimic = border.south_east;
+       grid_array[MAX_HGT - 1][MAX_WID - 1].mimic = border.south_east;
 
        /* Light up or darken the area */
        for (y = 0; y < cur_hgt; y++)
        {
                for (x = 0; x < cur_wid; x++)
                {
-                       /* Get the cave grid */
-                       c_ptr = &cave[y][x];
+                       /* Get the grid */
+                       c_ptr = &grid_array[y][x];
 
                        if (is_daytime())
                        {
@@ -613,8 +613,8 @@ void wilderness_gen(void)
                {
                        for (x = 0; x < cur_wid; x++)
                        {
-                               /* Get the cave grid */
-                               c_ptr = &cave[y][x];
+                               /* Get the grid */
+                               c_ptr = &grid_array[y][x];
 
                                /* Seeing true feature code (ignore mimic) */
                                f_ptr = &f_info[c_ptr->feat];
@@ -639,8 +639,8 @@ void wilderness_gen(void)
                {
                        for (x = 0; x < cur_wid; x++)
                        {
-                               /* Get the cave grid */
-                               c_ptr = &cave[y][x];
+                               /* Get the grid */
+                               c_ptr = &grid_array[y][x];
 
                                if (cave_have_flag_grid(c_ptr, FF_ENTRANCE))
                                {
@@ -700,7 +700,7 @@ void wilderness_gen_small(void)
        for (i = 0; i < MAX_WID; i++)
        for (j = 0; j < MAX_HGT; j++)
        {
-               cave[j][i].feat = feat_permanent;
+               grid_array[j][i].feat = feat_permanent;
        }
 
        /* Init the wilderness */
@@ -712,18 +712,18 @@ void wilderness_gen_small(void)
        {
                if (wilderness[j][i].town && (wilderness[j][i].town != NO_TOWN))
                {
-                       cave[j][i].feat = (s16b)feat_town;
-                       cave[j][i].special = (s16b)wilderness[j][i].town;
+                       grid_array[j][i].feat = (s16b)feat_town;
+                       grid_array[j][i].special = (s16b)wilderness[j][i].town;
                }
-               else if (wilderness[j][i].road) cave[j][i].feat = feat_floor;
+               else if (wilderness[j][i].road) grid_array[j][i].feat = feat_floor;
                else if (wilderness[j][i].entrance && (p_ptr->total_winner || !(d_info[wilderness[j][i].entrance].flags1 & DF1_WINNER)))
                {
-                       cave[j][i].feat = feat_entrance;
-                       cave[j][i].special = (byte)wilderness[j][i].entrance;
+                       grid_array[j][i].feat = feat_entrance;
+                       grid_array[j][i].special = (byte)wilderness[j][i].entrance;
                }
-               else cave[j][i].feat = conv_terrain2feat[wilderness[j][i].terrain];
+               else grid_array[j][i].feat = conv_terrain2feat[wilderness[j][i].terrain];
 
-               cave[j][i].info |= (CAVE_GLOW | CAVE_MARK);
+               grid_array[j][i].info |= (CAVE_GLOW | CAVE_MARK);
        }
 
        cur_hgt = (s16b) max_wild_y;
index 03dda76..72e26e4 100644 (file)
@@ -1581,7 +1581,7 @@ static void do_cmd_wiz_create_feature(void)
 
        if (!tgt_pt(&x, &y)) return;
 
-       c_ptr = &cave[y][x];
+       c_ptr = &grid_array[y][x];
 
        /* Default */
        sprintf(tmp_val, "%d", prev_feat);
@@ -1948,7 +1948,7 @@ void do_cmd_debug(void)
                {
                        for (x = 0; x < cur_wid; x++)
                        {
-                               cave[y][x].info |= (CAVE_GLOW | CAVE_MARK);
+                               grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
                        }
                }
                wiz_lite(FALSE);
index beb8c9a..6fd0def 100644 (file)
@@ -590,8 +590,8 @@ static bool ang_sort_comp_importance(vptr u, vptr v, int a, int b)
 {
        POSITION *x = (POSITION*)(u);
        POSITION *y = (POSITION*)(v);
-       grid_type *ca_ptr = &cave[y[a]][x[a]];
-       grid_type *cb_ptr = &cave[y[b]][x[b]];
+       grid_type *ca_ptr = &grid_array[y[a]][x[a]];
+       grid_type *cb_ptr = &grid_array[y[b]][x[b]];
        monster_type *ma_ptr = &m_list[ca_ptr->m_idx];
        monster_type *mb_ptr = &m_list[cb_ptr->m_idx];
        monster_race *ap_ra_ptr, *ap_rb_ptr;
@@ -637,8 +637,8 @@ static bool ang_sort_comp_importance(vptr u, vptr v, int a, int b)
        }
 
        /* An object get higher priority */
-       if (cave[y[a]][x[a]].o_idx && !cave[y[b]][x[b]].o_idx) return TRUE;
-       if (!cave[y[a]][x[a]].o_idx && cave[y[b]][x[b]].o_idx) return FALSE;
+       if (grid_array[y[a]][x[a]].o_idx && !grid_array[y[b]][x[b]].o_idx) return TRUE;
+       if (!grid_array[y[a]][x[a]].o_idx && grid_array[y[b]][x[b]].o_idx) return FALSE;
 
        /* Priority from the terrain */
        if (f_info[ca_ptr->feat].priority > f_info[cb_ptr->feat].priority) return TRUE;
@@ -741,7 +741,7 @@ static bool target_set_accept(POSITION y, POSITION x)
        if (p_ptr->image) return (FALSE);
 
        /* Examine the grid */
-       c_ptr = &cave[y][x];
+       c_ptr = &grid_array[y][x];
 
        /* Visible monsters */
        if (c_ptr->m_idx)
@@ -819,7 +819,7 @@ static void target_set_prepare(BIT_FLAGS mode)
                        /* Require "interesting" contents */
                        if (!target_set_accept(y, x)) continue;
 
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
 
                        /* Require target_able monsters for "TARGET_KILL" */
                        if ((mode & (TARGET_KILL)) && !target_able(c_ptr->m_idx)) continue;
@@ -948,7 +948,7 @@ bool show_gold_on_floor = FALSE;
  */
 static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, concptr info)
 {
-       grid_type *c_ptr = &cave[y][x];
+       grid_type *c_ptr = &grid_array[y][x];
        OBJECT_IDX this_o_idx, next_o_idx = 0;
        concptr s1 = "", s2 = "", s3 = "", x_info = "";
        bool boring = TRUE;
@@ -1531,7 +1531,7 @@ bool target_set(BIT_FLAGS mode)
                        if (!(mode & TARGET_LOOK)) prt_path(y, x);
 
                        /* Access */
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
 
                        /* Allow target */
                        if (target_able(c_ptr->m_idx))
@@ -1768,7 +1768,7 @@ bool target_set(BIT_FLAGS mode)
                        if (!(mode & TARGET_LOOK)) prt_path(y, x);
 
                        /* Access */
-                       c_ptr = &cave[y][x];
+                       c_ptr = &grid_array[y][x];
 
                        /* Default prompt */
                        strcpy(info, _("q止 t決 p自 m近 +次 -前", "q,t,p,m,+,-,<dir>"));
@@ -2378,7 +2378,7 @@ static bool tgt_pt_accept(POSITION y, POSITION x)
        if (p_ptr->image) return (FALSE);
 
        /* Examine the grid */
-       c_ptr = &cave[y][x];
+       c_ptr = &grid_array[y][x];
 
        /* Interesting memorized features */
        if (c_ptr->info & (CAVE_MARK))
@@ -2494,7 +2494,7 @@ bool tgt_pt(POSITION *x_ptr, POSITION *y_ptr)
                                /* Skip stairs which have defferent distance */
                                for (; n < temp_n; ++ n)
                                {
-                                       grid_type *c_ptr = &cave[temp_y[n]][temp_x[n]];
+                                       grid_type *c_ptr = &grid_array[temp_y[n]][temp_x[n]];
 
                                        if (cave_have_flag_grid(c_ptr, FF_STAIRS) &&
                                            cave_have_flag_grid(c_ptr, ch == '>' ? FF_MORE : FF_LESS))