From 00f341adda94315aae0c3543ec4f713473d02186 Mon Sep 17 00:00:00 2001 From: Deskull Date: Mon, 11 Feb 2019 23:50:59 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#37353=20=E6=B1=8E=E7=94=A8?= =?utf8?q?=E7=9A=84=E3=81=AA=E3=83=9D=E3=82=A4=E3=83=B3=E3=82=BF=E5=91=BD?= =?utf8?q?=E5=90=8D=20c=5Fptr=20=E3=82=92=20g=5Fptr=20=E3=81=AB=E6=94=B9?= =?utf8?q?=E5=90=8D=E3=80=82=20/=20Rename=20c=5Fptr,=20common=20pointer=20?= =?utf8?q?naming=20to=20g=5Fptr.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/autopick.c | 4 +- src/cave.c | 476 +++++++++++++++++++++++++------------------------- src/cmd-pet.c | 44 ++--- src/cmd-pet.h | 2 +- src/cmd2.c | 150 ++++++++-------- src/cmd4.c | 4 +- src/dungeon.c | 6 +- src/externs.h | 12 +- src/floor-events.c | 16 +- src/floor-generate.c | 116 ++++++------ src/floor-save.c | 56 +++--- src/floor-streams.c | 52 +++--- src/grid.c | 74 ++++---- src/init1.c | 18 +- src/load.c | 134 +++++++------- src/melee1.c | 40 ++--- src/mind.c | 4 +- src/monster-process.c | 106 +++++------ src/monster1.c | 6 +- src/monster2.c | 52 +++--- src/mspells1.c | 12 +- src/mutation.c | 16 +- src/object1.c | 6 +- src/object2.c | 134 +++++++------- src/player-move.c | 110 ++++++------ src/realm-hissatsu.c | 22 +-- src/rooms-normal.c | 348 ++++++++++++++++++------------------ src/rooms-pitnest.c | 132 +++++++------- src/rooms-special.c | 112 ++++++------ src/rooms-trap.c | 32 ++-- src/rooms-vault.c | 34 ++-- src/rooms.c | 42 ++--- src/save.c | 28 +-- src/shoot.c | 10 +- src/spells-object.c | 8 +- src/spells1.c | 174 +++++++++--------- src/spells2.c | 148 ++++++++-------- src/spells3.c | 122 ++++++------- src/store.c | 10 +- src/trap.c | 20 +-- src/view-mainwindow.c | 6 +- src/wild.c | 32 ++-- src/wizard2.c | 12 +- src/xtra2.c | 92 +++++----- src/z-term.c | 10 +- 45 files changed, 1522 insertions(+), 1522 deletions(-) diff --git a/src/autopick.c b/src/autopick.c index 52f59375b..21f72f954 100644 --- a/src/autopick.c +++ b/src/autopick.c @@ -1699,12 +1699,12 @@ void autopick_alter_item(INVENTORY_IDX item, bool destroy) /* * Automatically pickup/destroy items in this grid. */ -void autopick_pickup_items(grid_type *c_ptr) +void autopick_pickup_items(grid_type *g_ptr) { OBJECT_IDX this_o_idx, next_o_idx = 0; /* Scan the pile of objects */ - for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) + for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) { int idx; object_type *o_ptr = &o_list[this_o_idx]; diff --git a/src/cave.c b/src/cave.c index 53f7a6f20..13cdbd239 100644 --- a/src/cave.c +++ b/src/cave.c @@ -76,13 +76,13 @@ bool is_trap(FEAT_IDX feat) /*! * @brief マスに看破済みの罠があるかの判定を行う。 / Return TRUE if the given grid is a known trap - * @param c_ptr マス構造体の参照ポインタ + * @param g_ptr マス構造体の参照ポインタ * @return 看破済みの罠があるならTRUEを返す。 */ -bool is_known_trap(grid_type *c_ptr) +bool is_known_trap(grid_type *g_ptr) { - if (!c_ptr->mimic && !cave_have_flag_grid(c_ptr, FF_SECRET) && - is_trap(c_ptr->feat)) return TRUE; + if (!g_ptr->mimic && !cave_have_flag_grid(g_ptr, FF_SECRET) && + is_trap(g_ptr->feat)) return TRUE; else return FALSE; } @@ -102,13 +102,13 @@ bool is_closed_door(FEAT_IDX feat) /*! * @brief マスに隠されたドアがあるかの判定を行う。 / Return TRUE if the given grid is a hidden closed door - * @param c_ptr マス構造体の参照ポインタ + * @param g_ptr マス構造体の参照ポインタ * @return 隠されたドアがあるならTRUEを返す。 */ -bool is_hidden_door(grid_type *c_ptr) +bool is_hidden_door(grid_type *g_ptr) { - if ((c_ptr->mimic || cave_have_flag_grid(c_ptr, FF_SECRET)) && - is_closed_door(c_ptr->feat)) + if ((g_ptr->mimic || cave_have_flag_grid(g_ptr, FF_SECRET)) && + is_closed_door(g_ptr->feat)) return TRUE; else return FALSE; @@ -569,15 +569,15 @@ void update_local_illumination(POSITION y, POSITION x) */ bool player_can_see_bold(POSITION y, POSITION x) { - grid_type *c_ptr; + grid_type *g_ptr; /* Blind players see nothing */ if (p_ptr->blind) return FALSE; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Note that "torch-lite" yields "illumination" */ - if (c_ptr->info & (CAVE_LITE | CAVE_MNLT)) return TRUE; + if (g_ptr->info & (CAVE_LITE | CAVE_MNLT)) return TRUE; /* Require line of sight to the grid */ if (!player_has_los_bold(y, x)) return FALSE; @@ -586,11 +586,11 @@ bool player_can_see_bold(POSITION y, POSITION x) if (p_ptr->see_nocto) return TRUE; /* Require "perma-lite" of the grid */ - if ((c_ptr->info & (CAVE_GLOW | CAVE_MNDK)) != CAVE_GLOW) return FALSE; + if ((g_ptr->info & (CAVE_GLOW | CAVE_MNDK)) != CAVE_GLOW) return FALSE; /* Feature code (applying "mimic" field) */ /* Floors are simple */ - if (feat_supports_los(get_feat_mimic(c_ptr))) return TRUE; + if (feat_supports_los(get_feat_mimic(g_ptr))) return TRUE; /* Check for "local" illumination */ return check_local_illumination(y, x); @@ -617,14 +617,14 @@ bool no_lite(void) */ bool cave_valid_bold(POSITION y, POSITION x) { - grid_type *c_ptr = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; OBJECT_IDX this_o_idx, next_o_idx = 0; /* Forbid perma-grids */ - if (cave_perma_grid(c_ptr)) return (FALSE); + if (cave_perma_grid(g_ptr)) return (FALSE); /* Check objects */ - for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) + for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) { object_type *o_ptr; o_ptr = &o_list[this_o_idx]; @@ -944,12 +944,12 @@ 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 grid_array */ - grid_type *c_ptr = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; OBJECT_IDX this_o_idx, next_o_idx = 0; /* Feature code (applying "mimic" field) */ - FEAT_IDX feat = get_feat_mimic(c_ptr); + FEAT_IDX feat = get_feat_mimic(g_ptr); /* Access floor */ feature_type *f_ptr = &f_info[feat]; @@ -972,8 +972,8 @@ void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap, * - Can see grids with CAVE_VIEW unless darkened by monsters. */ if (!p_ptr->blind && - ((c_ptr->info & (CAVE_MARK | CAVE_LITE | CAVE_MNLT)) || - ((c_ptr->info & CAVE_VIEW) && (((c_ptr->info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW) || p_ptr->see_nocto)))) + ((g_ptr->info & (CAVE_MARK | CAVE_LITE | CAVE_MNLT)) || + ((g_ptr->info & CAVE_VIEW) && (((g_ptr->info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW) || p_ptr->see_nocto)))) { /* Normal attr/char */ a = f_ptr->x_attr[F_LIT_STANDARD]; @@ -992,10 +992,10 @@ 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)) + else if (darkened_grid(g_ptr)) { /* Unsafe grid -- idea borrowed from Unangband */ - feat = (view_unsafe_grids && (c_ptr->info & CAVE_UNSAFE)) ? feat_undetected : feat_none; + feat = (view_unsafe_grids && (g_ptr->info & CAVE_UNSAFE)) ? feat_undetected : feat_none; /* Access darkness */ f_ptr = &f_info[feat]; @@ -1009,7 +1009,7 @@ void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap, else if (view_special_lite) { /* Handle "torch-lit" grids */ - if (c_ptr->info & (CAVE_LITE | CAVE_MNLT)) + if (g_ptr->info & (CAVE_LITE | CAVE_MNLT)) { /* Torch lite */ if (view_yellow_lite) @@ -1021,7 +1021,7 @@ void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap, } /* Handle "dark" grids */ - else if ((c_ptr->info & (CAVE_GLOW | CAVE_MNDK)) != CAVE_GLOW) + else if ((g_ptr->info & (CAVE_GLOW | CAVE_MNDK)) != CAVE_GLOW) { /* Use a darkened colour/tile */ a = f_ptr->x_attr[F_LIT_DARK]; @@ -1029,7 +1029,7 @@ void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap, } /* Handle "out-of-sight" grids */ - else if (!(c_ptr->info & CAVE_VIEW)) + else if (!(g_ptr->info & CAVE_VIEW)) { /* Special flag */ if (view_bright_lite) @@ -1046,7 +1046,7 @@ void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap, else { /* Unsafe grid -- idea borrowed from Unangband */ - feat = (view_unsafe_grids && (c_ptr->info & CAVE_UNSAFE)) ? feat_undetected : feat_none; + feat = (view_unsafe_grids && (g_ptr->info & CAVE_UNSAFE)) ? feat_undetected : feat_none; /* Access darkness */ f_ptr = &f_info[feat]; @@ -1061,7 +1061,7 @@ void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap, else { /* Memorized grids */ - if (c_ptr->info & CAVE_MARK) + if (g_ptr->info & CAVE_MARK) { /* Normal attr/char */ a = f_ptr->x_attr[F_LIT_STANDARD]; @@ -1080,12 +1080,12 @@ 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) && !p_ptr->blind) + else if (darkened_grid(g_ptr) && !p_ptr->blind) { if (have_flag(f_ptr->flags, FF_LOS) && have_flag(f_ptr->flags, FF_PROJECT)) { /* Unsafe grid -- idea borrowed from Unangband */ - feat = (view_unsafe_grids && (c_ptr->info & CAVE_UNSAFE)) ? feat_undetected : feat_none; + feat = (view_unsafe_grids && (g_ptr->info & CAVE_UNSAFE)) ? feat_undetected : feat_none; /* Access darkness */ f_ptr = &f_info[feat]; @@ -1114,7 +1114,7 @@ void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap, } /* Handle "torch-lit" grids */ - else if (c_ptr->info & (CAVE_LITE | CAVE_MNLT)) + else if (g_ptr->info & (CAVE_LITE | CAVE_MNLT)) { /* Torch lite */ if (view_yellow_lite) @@ -1129,7 +1129,7 @@ void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap, else if (view_bright_lite) { /* Not viewable */ - if (!(c_ptr->info & CAVE_VIEW)) + if (!(g_ptr->info & CAVE_VIEW)) { /* Use a darkened colour/tile */ a = f_ptr->x_attr[F_LIT_DARK]; @@ -1137,7 +1137,7 @@ void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap, } /* Not glowing */ - else if ((c_ptr->info & (CAVE_GLOW | CAVE_MNDK)) != CAVE_GLOW) + else if ((g_ptr->info & (CAVE_GLOW | CAVE_MNDK)) != CAVE_GLOW) { /* Use a darkened colour/tile */ a = f_ptr->x_attr[F_LIT_DARK]; @@ -1159,7 +1159,7 @@ void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap, else { /* Unsafe grid -- idea borrowed from Unangband */ - feat = (view_unsafe_grids && (c_ptr->info & CAVE_UNSAFE)) ? feat_undetected : feat_none; + feat = (view_unsafe_grids && (g_ptr->info & CAVE_UNSAFE)) ? feat_undetected : feat_none; /* Access feature */ f_ptr = &f_info[feat]; @@ -1191,7 +1191,7 @@ void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap, } /* Objects */ - for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) + for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) { object_type *o_ptr; o_ptr = &o_list[this_o_idx]; @@ -1239,9 +1239,9 @@ void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap, /* Handle monsters */ - if (c_ptr->m_idx && display_autopick == 0 ) + if (g_ptr->m_idx && display_autopick == 0 ) { - monster_type *m_ptr = &m_list[c_ptr->m_idx]; + monster_type *m_ptr = &m_list[g_ptr->m_idx]; /* Visible monster */ if (m_ptr->ml) @@ -1317,7 +1317,7 @@ void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap, else if ((r_ptr->flags1 & RF1_ATTR_SEMIRAND) && !use_graphics) { /* Use semi-random attr (usually mimics' colors vary) */ - *ap = c_ptr->m_idx % 15 + 1; + *ap = g_ptr->m_idx % 15 + 1; } else { @@ -1458,20 +1458,20 @@ 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 = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; OBJECT_IDX this_o_idx, next_o_idx = 0; /* Blind players see nothing */ if (p_ptr->blind) return; /* Analyze non-torch-lit grids */ - if (!(c_ptr->info & (CAVE_LITE | CAVE_MNLT))) + if (!(g_ptr->info & (CAVE_LITE | CAVE_MNLT))) { /* Require line of sight to the grid */ - if (!(c_ptr->info & (CAVE_VIEW))) return; + if (!(g_ptr->info & (CAVE_VIEW))) return; /* Require "perma-lite" of the grid */ - if ((c_ptr->info & (CAVE_GLOW | CAVE_MNDK)) != CAVE_GLOW) + if ((g_ptr->info & (CAVE_GLOW | CAVE_MNDK)) != CAVE_GLOW) { /* Not Ninja */ if (!p_ptr->see_nocto) return; @@ -1480,7 +1480,7 @@ void note_spot(POSITION y, POSITION x) /* Hack -- memorize objects */ - for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) + for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) { object_type *o_ptr = &o_list[this_o_idx]; @@ -1493,55 +1493,55 @@ void note_spot(POSITION y, POSITION x) /* Hack -- memorize grids */ - if (!(c_ptr->info & (CAVE_MARK))) + if (!(g_ptr->info & (CAVE_MARK))) { /* Feature code (applying "mimic" field) */ - feature_type *f_ptr = &f_info[get_feat_mimic(c_ptr)]; + feature_type *f_ptr = &f_info[get_feat_mimic(g_ptr)]; /* Memorize some "boring" grids */ if (!have_flag(f_ptr->flags, FF_REMEMBER)) { /* Option -- memorize all torch-lit floors */ if (view_torch_grids && - ((c_ptr->info & (CAVE_LITE | CAVE_MNLT)) || p_ptr->see_nocto)) + ((g_ptr->info & (CAVE_LITE | CAVE_MNLT)) || p_ptr->see_nocto)) { - c_ptr->info |= (CAVE_MARK); + g_ptr->info |= (CAVE_MARK); } /* Option -- memorize all perma-lit floors */ - else if (view_perma_grids && ((c_ptr->info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)) + else if (view_perma_grids && ((g_ptr->info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)) { - c_ptr->info |= (CAVE_MARK); + g_ptr->info |= (CAVE_MARK); } } /* Memorize normal grids */ else if (have_flag(f_ptr->flags, FF_LOS)) { - c_ptr->info |= (CAVE_MARK); + g_ptr->info |= (CAVE_MARK); } /* Memorize torch-lit walls */ - else if (c_ptr->info & (CAVE_LITE | CAVE_MNLT)) + else if (g_ptr->info & (CAVE_LITE | CAVE_MNLT)) { - c_ptr->info |= (CAVE_MARK); + g_ptr->info |= (CAVE_MARK); } /* Memorize walls seen by noctovision of Ninja */ else if (p_ptr->see_nocto) { - c_ptr->info |= (CAVE_MARK); + g_ptr->info |= (CAVE_MARK); } /* Memorize certain non-torch-lit wall grids */ else if (check_local_illumination(y, x)) { - c_ptr->info |= (CAVE_MARK); + g_ptr->info |= (CAVE_MARK); } } /* Memorize terrain of the grid */ - c_ptr->info |= (CAVE_KNOWN); + g_ptr->info |= (CAVE_KNOWN); } @@ -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 = &grid_array[ny][nx]; + grid_type *g_ptr = &grid_array[ny][nx]; if (panel_contains(ny, nx)) { @@ -1753,7 +1753,7 @@ void prt_path(POSITION y, POSITION x) TERM_COLOR ta = default_color; char tc = '*'; - if (c_ptr->m_idx && m_list[c_ptr->m_idx].ml) + if (g_ptr->m_idx && m_list[g_ptr->m_idx].ml) { /* Determine what is there */ map_info(ny, nx, &a, &c, &ta, &tc); @@ -1780,7 +1780,7 @@ void prt_path(POSITION y, POSITION x) } /* Known Wall */ - if ((c_ptr->info & CAVE_MARK) && !cave_have_flag_grid(c_ptr, FF_PROJECT)) break; + if ((g_ptr->info & CAVE_MARK) && !cave_have_flag_grid(g_ptr, FF_PROJECT)) break; /* Change color */ if (nx == x && ny == y) default_color = TERM_L_DARK; @@ -2557,7 +2557,7 @@ void update_lite(void) { int i, x, y, min_x, max_x, min_y, max_y; int p = p_ptr->cur_lite; - grid_type *c_ptr; + grid_type *g_ptr; /*** Special case ***/ @@ -2738,13 +2738,13 @@ void update_lite(void) y = lite_y[i]; x = lite_x[i]; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Update fresh grids */ - if (c_ptr->info & (CAVE_TEMP)) continue; + if (g_ptr->info & (CAVE_TEMP)) continue; /* Add it to later visual update */ - cave_note_and_redraw_later(c_ptr, y, x); + cave_note_and_redraw_later(g_ptr, y, x); } /* Clear them all */ @@ -2753,16 +2753,16 @@ void update_lite(void) y = temp_y[i]; x = temp_x[i]; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* No longer in the array */ - c_ptr->info &= ~(CAVE_TEMP); + g_ptr->info &= ~(CAVE_TEMP); /* Update stale grids */ - if (c_ptr->info & (CAVE_LITE)) continue; + if (g_ptr->info & (CAVE_LITE)) continue; /* Add it to later visual update */ - cave_redraw_later(c_ptr, y, x); + cave_redraw_later(g_ptr, y, x); } /* None left */ @@ -2781,19 +2781,19 @@ static POSITION mon_fy, mon_fx; */ static void mon_lite_hack(POSITION y, POSITION x) { - grid_type *c_ptr; + grid_type *g_ptr; int dpf, d; POSITION midpoint; /* We trust this grid is in bounds */ /* if (!in_bounds2(y, x)) return; */ - c_ptr = &grid_array[y][x]; + g_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; + if ((g_ptr->info & (CAVE_MNLT | CAVE_VIEW)) != CAVE_VIEW) return; - if (!cave_los_grid(c_ptr)) + if (!cave_los_grid(g_ptr)) { /* Hack -- Prevent monster lite leakage in walls */ @@ -2843,7 +2843,7 @@ static void mon_lite_hack(POSITION y, POSITION x) /* We trust temp_n does not exceed TEMP_MAX */ /* New grid */ - if (!(c_ptr->info & CAVE_MNDK)) + if (!(g_ptr->info & CAVE_MNDK)) { /* Save this square */ temp_x[temp_n] = x; @@ -2855,11 +2855,11 @@ static void mon_lite_hack(POSITION y, POSITION x) else { /* No longer dark */ - c_ptr->info &= ~(CAVE_MNDK); + g_ptr->info &= ~(CAVE_MNDK); } /* Light it */ - c_ptr->info |= CAVE_MNLT; + g_ptr->info |= CAVE_MNLT; } @@ -2868,18 +2868,18 @@ static void mon_lite_hack(POSITION y, POSITION x) */ static void mon_dark_hack(POSITION y, POSITION x) { - grid_type *c_ptr; + grid_type *g_ptr; int midpoint, dpf, d; /* We trust this grid is in bounds */ /* if (!in_bounds2(y, x)) return; */ - c_ptr = &grid_array[y][x]; + g_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; + if ((g_ptr->info & (CAVE_LITE | CAVE_MNLT | CAVE_MNDK | CAVE_VIEW)) != CAVE_VIEW) return; - if (!cave_los_grid(c_ptr) && !cave_have_flag_grid(c_ptr, FF_PROJECT)) + if (!cave_los_grid(g_ptr) && !cave_have_flag_grid(g_ptr, FF_PROJECT)) { /* Hack -- Prevent monster dark lite leakage in walls */ @@ -2934,7 +2934,7 @@ static void mon_dark_hack(POSITION y, POSITION x) temp_n++; /* Darken it */ - c_ptr->info |= CAVE_MNDK; + g_ptr->info |= CAVE_MNDK; } @@ -2951,7 +2951,7 @@ static void mon_dark_hack(POSITION y, POSITION x) void update_mon_lite(void) { int i, rad; - grid_type *c_ptr; + grid_type *g_ptr; POSITION fx, fy; void (*add_mon_lite)(POSITION, POSITION); @@ -2967,13 +2967,13 @@ void update_mon_lite(void) for (i = 0; i < mon_lite_n; i++) { /* Point to grid */ - c_ptr = &grid_array[mon_lite_y[i]][mon_lite_x[i]]; + g_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; + g_ptr->info |= (g_ptr->info & CAVE_MNLT) ? CAVE_TEMP : CAVE_XTRA; /* Clear monster illumination flag */ - c_ptr->info &= ~(CAVE_MNLT | CAVE_MNDK); + g_ptr->info &= ~(CAVE_MNLT | CAVE_MNDK); } /* Empty temp list of new squares to lite up */ @@ -3053,10 +3053,10 @@ void update_mon_lite(void) add_mon_lite(mon_fy + 2, mon_fx); add_mon_lite(mon_fy + 2, mon_fx - 1); - c_ptr = &grid_array[mon_fy + 2][mon_fx]; + g_ptr = &grid_array[mon_fy + 2][mon_fx]; /* Radius 3 */ - if ((rad == 3) && cave_have_flag_grid(c_ptr, f_flag)) + if ((rad == 3) && cave_have_flag_grid(g_ptr, f_flag)) { add_mon_lite(mon_fy + 3, mon_fx + 1); add_mon_lite(mon_fy + 3, mon_fx); @@ -3071,10 +3071,10 @@ void update_mon_lite(void) add_mon_lite(mon_fy - 2, mon_fx); add_mon_lite(mon_fy - 2, mon_fx - 1); - c_ptr = &grid_array[mon_fy - 2][mon_fx]; + g_ptr = &grid_array[mon_fy - 2][mon_fx]; /* Radius 3 */ - if ((rad == 3) && cave_have_flag_grid(c_ptr, f_flag)) + if ((rad == 3) && cave_have_flag_grid(g_ptr, f_flag)) { add_mon_lite(mon_fy - 3, mon_fx + 1); add_mon_lite(mon_fy - 3, mon_fx); @@ -3089,10 +3089,10 @@ void update_mon_lite(void) add_mon_lite(mon_fy, mon_fx + 2); add_mon_lite(mon_fy - 1, mon_fx + 2); - c_ptr = &grid_array[mon_fy][mon_fx + 2]; + g_ptr = &grid_array[mon_fy][mon_fx + 2]; /* Radius 3 */ - if ((rad == 3) && cave_have_flag_grid(c_ptr, f_flag)) + if ((rad == 3) && cave_have_flag_grid(g_ptr, f_flag)) { add_mon_lite(mon_fy + 1, mon_fx + 3); add_mon_lite(mon_fy, mon_fx + 3); @@ -3107,10 +3107,10 @@ void update_mon_lite(void) add_mon_lite(mon_fy, mon_fx - 2); add_mon_lite(mon_fy - 1, mon_fx - 2); - c_ptr = &grid_array[mon_fy][mon_fx - 2]; + g_ptr = &grid_array[mon_fy][mon_fx - 2]; /* Radius 3 */ - if ((rad == 3) && cave_have_flag_grid(c_ptr, f_flag)) + if ((rad == 3) && cave_have_flag_grid(g_ptr, f_flag)) { add_mon_lite(mon_fy + 1, mon_fx - 3); add_mon_lite(mon_fy, mon_fx - 3); @@ -3163,26 +3163,26 @@ void update_mon_lite(void) /* We trust this grid is in bounds */ /* Point to grid */ - c_ptr = &grid_array[fy][fx]; + g_ptr = &grid_array[fy][fx]; - if (c_ptr->info & CAVE_TEMP) /* Pervious lit */ + if (g_ptr->info & CAVE_TEMP) /* Pervious lit */ { /* It it no longer lit? */ - if ((c_ptr->info & (CAVE_VIEW | CAVE_MNLT)) == CAVE_VIEW) + if ((g_ptr->info & (CAVE_VIEW | CAVE_MNLT)) == CAVE_VIEW) { /* It is now unlit */ /* Add it to later visual update */ - cave_note_and_redraw_later(c_ptr, fy, fx); + cave_note_and_redraw_later(g_ptr, fy, fx); } } else /* Pervious darkened */ { /* It it no longer darken? */ - if ((c_ptr->info & (CAVE_VIEW | CAVE_MNDK)) == CAVE_VIEW) + if ((g_ptr->info & (CAVE_VIEW | CAVE_MNDK)) == CAVE_VIEW) { /* It is now undarken */ /* Add it to later visual update */ - cave_note_and_redraw_later(c_ptr, fy, fx); + cave_note_and_redraw_later(g_ptr, fy, fx); } } @@ -3204,26 +3204,26 @@ void update_mon_lite(void) /* We trust this grid is in bounds */ /* Point to grid */ - c_ptr = &grid_array[fy][fx]; + g_ptr = &grid_array[fy][fx]; - if (c_ptr->info & CAVE_MNLT) /* Lit */ + if (g_ptr->info & CAVE_MNLT) /* Lit */ { /* The is the square newly lit and visible? */ - if ((c_ptr->info & (CAVE_VIEW | CAVE_TEMP)) == CAVE_VIEW) + if ((g_ptr->info & (CAVE_VIEW | CAVE_TEMP)) == CAVE_VIEW) { /* It is now lit */ /* Add it to later visual update */ - cave_note_and_redraw_later(c_ptr, fy, fx); + cave_note_and_redraw_later(g_ptr, fy, fx); } } else /* Darkened */ { /* The is the square newly darkened and visible? */ - if ((c_ptr->info & (CAVE_VIEW | CAVE_XTRA)) == CAVE_VIEW) + if ((g_ptr->info & (CAVE_VIEW | CAVE_XTRA)) == CAVE_VIEW) { /* It is now darkened */ /* Add it to later visual update */ - cave_note_and_redraw_later(c_ptr, fy, fx); + cave_note_and_redraw_later(g_ptr, fy, fx); } } @@ -3269,16 +3269,16 @@ void update_mon_lite(void) void clear_mon_lite(void) { int i; - grid_type *c_ptr; + grid_type *g_ptr; /* Clear all monster lit squares */ for (i = 0; i < mon_lite_n; i++) { /* Point to grid */ - c_ptr = &grid_array[mon_lite_y[i]][mon_lite_x[i]]; + g_ptr = &grid_array[mon_lite_y[i]][mon_lite_x[i]]; /* Clear monster illumination flag */ - c_ptr->info &= ~(CAVE_MNLT | CAVE_MNDK); + g_ptr->info &= ~(CAVE_MNLT | CAVE_MNDK); } /* Empty the array */ @@ -3294,7 +3294,7 @@ void forget_view(void) { int i; - grid_type *c_ptr; + grid_type *g_ptr; /* None to forget */ if (!view_n) return; @@ -3304,10 +3304,10 @@ void forget_view(void) { POSITION y = view_y[i]; POSITION x = view_x[i]; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Forget that the grid is viewable */ - c_ptr->info &= ~(CAVE_VIEW); + g_ptr->info &= ~(CAVE_VIEW); /* if (!panel_contains(y, x)) continue; */ @@ -3359,7 +3359,7 @@ static bool update_view_aux(POSITION y, POSITION x, POSITION y1, POSITION x1, PO { bool f1, f2, v1, v2, z1, z2, wall; - grid_type *c_ptr; + grid_type *g_ptr; grid_type *g1_c_ptr; grid_type *g2_c_ptr; @@ -3384,11 +3384,11 @@ 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 = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Check for walls */ - wall = (!cave_los_grid(c_ptr)); + wall = (!cave_los_grid(g_ptr)); /* Check the "ease" of visibility */ @@ -3398,9 +3398,9 @@ static bool update_view_aux(POSITION y, POSITION x, POSITION y1, POSITION x1, PO /* Hack -- "easy" plus "easy" yields "easy" */ if (z1 && z2) { - c_ptr->info |= (CAVE_XTRA); + g_ptr->info |= (CAVE_XTRA); - cave_view_hack(c_ptr, y, x); + cave_view_hack(g_ptr, y, x); return (wall); } @@ -3408,7 +3408,7 @@ static bool update_view_aux(POSITION y, POSITION x, POSITION y1, POSITION x1, PO /* Hack -- primary "easy" yields "viewed" */ if (z1) { - cave_view_hack(c_ptr, y, x); + cave_view_hack(g_ptr, y, x); return (wall); } @@ -3416,9 +3416,9 @@ static bool update_view_aux(POSITION y, POSITION x, POSITION y1, POSITION x1, PO /* Hack -- "view" plus "view" yields "view" */ if (v1 && v2) { - /* c_ptr->info |= (CAVE_XTRA); */ + /* g_ptr->info |= (CAVE_XTRA); */ - cave_view_hack(c_ptr, y, x); + cave_view_hack(g_ptr, y, x); return (wall); } @@ -3427,7 +3427,7 @@ static bool update_view_aux(POSITION y, POSITION x, POSITION y1, POSITION x1, PO /* Mega-Hack -- the "los()" function works poorly on walls */ if (wall) { - cave_view_hack(c_ptr, y, x); + cave_view_hack(g_ptr, y, x); return (wall); } @@ -3436,7 +3436,7 @@ static bool update_view_aux(POSITION y, POSITION x, POSITION y1, POSITION x1, PO /* Hack -- check line of sight */ if (los(p_ptr->y, p_ptr->x, y, x)) { - cave_view_hack(c_ptr, y, x); + cave_view_hack(g_ptr, y, x); return (wall); } @@ -3551,7 +3551,7 @@ void update_view(void) POSITION y_max = cur_hgt - 1; POSITION x_max = cur_wid - 1; - grid_type *c_ptr; + grid_type *g_ptr; /*** Initialize ***/ @@ -3583,13 +3583,13 @@ void update_view(void) { y = view_y[n]; x = view_x[n]; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Mark the grid as not in "view" */ - c_ptr->info &= ~(CAVE_VIEW); + g_ptr->info &= ~(CAVE_VIEW); /* Mark the grid as "seen" */ - c_ptr->info |= (CAVE_TEMP); + g_ptr->info |= (CAVE_TEMP); /* Add it to the "seen" set */ temp_y[temp_n] = y; @@ -3605,13 +3605,13 @@ void update_view(void) /* Now start on the player */ y = p_ptr->y; x = p_ptr->x; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Assume the player grid is easily viewable */ - c_ptr->info |= (CAVE_XTRA); + g_ptr->info |= (CAVE_XTRA); /* Assume the player grid is viewable */ - cave_view_hack(c_ptr, y, x); + cave_view_hack(g_ptr, y, x); /*** Step 2 -- Major Diagonals ***/ @@ -3622,37 +3622,37 @@ void update_view(void) /* Scan south-east */ for (d = 1; d <= z; 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; + g_ptr = &grid_array[y+d][x+d]; + g_ptr->info |= (CAVE_XTRA); + cave_view_hack(g_ptr, y+d, x+d); + if (!cave_los_grid(g_ptr)) break; } /* Scan south-west */ for (d = 1; d <= z; 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; + g_ptr = &grid_array[y+d][x-d]; + g_ptr->info |= (CAVE_XTRA); + cave_view_hack(g_ptr, y+d, x-d); + if (!cave_los_grid(g_ptr)) break; } /* Scan north-east */ for (d = 1; d <= z; 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; + g_ptr = &grid_array[y-d][x+d]; + g_ptr->info |= (CAVE_XTRA); + cave_view_hack(g_ptr, y-d, x+d); + if (!cave_los_grid(g_ptr)) break; } /* Scan north-west */ for (d = 1; d <= z; 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; + g_ptr = &grid_array[y-d][x-d]; + g_ptr->info |= (CAVE_XTRA); + cave_view_hack(g_ptr, y-d, x-d); + if (!cave_los_grid(g_ptr)) break; } @@ -3661,10 +3661,10 @@ void update_view(void) /* Scan south */ for (d = 1; d <= full; d++) { - 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; + g_ptr = &grid_array[y+d][x]; + g_ptr->info |= (CAVE_XTRA); + cave_view_hack(g_ptr, y+d, x); + if (!cave_los_grid(g_ptr)) break; } /* Initialize the "south strips" */ @@ -3673,10 +3673,10 @@ void update_view(void) /* Scan north */ for (d = 1; d <= full; d++) { - 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; + g_ptr = &grid_array[y-d][x]; + g_ptr->info |= (CAVE_XTRA); + cave_view_hack(g_ptr, y-d, x); + if (!cave_los_grid(g_ptr)) break; } /* Initialize the "north strips" */ @@ -3685,10 +3685,10 @@ void update_view(void) /* Scan east */ for (d = 1; d <= full; 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; + g_ptr = &grid_array[y][x+d]; + g_ptr->info |= (CAVE_XTRA); + cave_view_hack(g_ptr, y, x+d); + if (!cave_los_grid(g_ptr)) break; } /* Initialize the "east strips" */ @@ -3697,10 +3697,10 @@ void update_view(void) /* Scan west */ for (d = 1; d <= full; 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; + g_ptr = &grid_array[y][x-d]; + g_ptr->info |= (CAVE_XTRA); + cave_view_hack(g_ptr, y, x-d); + if (!cave_los_grid(g_ptr)) break; } /* Initialize the "west strips" */ @@ -3952,16 +3952,16 @@ void update_view(void) { y = view_y[n]; x = view_x[n]; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Clear the "CAVE_XTRA" flag */ - c_ptr->info &= ~(CAVE_XTRA); + g_ptr->info &= ~(CAVE_XTRA); /* Update only newly viewed grids */ - if (c_ptr->info & (CAVE_TEMP)) continue; + if (g_ptr->info & (CAVE_TEMP)) continue; /* Add it to later visual update */ - cave_note_and_redraw_later(c_ptr, y, x); + cave_note_and_redraw_later(g_ptr, y, x); } /* Wipe the old grids, update as needed */ @@ -3969,16 +3969,16 @@ void update_view(void) { y = temp_y[n]; x = temp_x[n]; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* No longer in the array */ - c_ptr->info &= ~(CAVE_TEMP); + g_ptr->info &= ~(CAVE_TEMP); /* Update only non-viewable grids */ - if (c_ptr->info & (CAVE_VIEW)) continue; + if (g_ptr->info & (CAVE_VIEW)) continue; /* Add it to later visual update */ - cave_redraw_later(c_ptr, y, x); + cave_redraw_later(g_ptr, y, x); } /* None left */ @@ -3996,28 +3996,28 @@ void update_view(void) void delayed_visual_update(void) { int i, y, x; - grid_type *c_ptr; + grid_type *g_ptr; /* Update needed grids */ for (i = 0; i < redraw_n; i++) { y = redraw_y[i]; x = redraw_x[i]; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Update only needed grids (prevent multiple updating) */ - if (!(c_ptr->info & CAVE_REDRAW)) continue; + if (!(g_ptr->info & CAVE_REDRAW)) continue; /* If required, note */ - if (c_ptr->info & CAVE_NOTE) note_spot(y, x); + if (g_ptr->info & CAVE_NOTE) note_spot(y, x); lite_spot(y, x); /* Hack -- Visual update of monster on this grid */ - if (c_ptr->m_idx) update_monster(c_ptr->m_idx, FALSE); + if (g_ptr->m_idx) update_monster(g_ptr->m_idx, FALSE); /* No longer in the array */ - c_ptr->info &= ~(CAVE_NOTE | CAVE_REDRAW); + g_ptr->info &= ~(CAVE_NOTE | CAVE_REDRAW); } /* None left */ @@ -4121,7 +4121,7 @@ void update_flow(void) int old_head = flow_head; byte_hack m = grid_array[ty][tx].cost + 1; byte_hack n = grid_array[ty][tx].dist + 1; - grid_type *c_ptr; + grid_type *g_ptr; /* Child location */ y = ty + ddy_ddd[d]; @@ -4130,19 +4130,19 @@ void update_flow(void) /* Ignore player's grid */ if (player_bold(y, x)) continue; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; - if (is_closed_door(c_ptr->feat)) m += 3; + if (is_closed_door(g_ptr->feat)) m += 3; /* Ignore "pre-stamped" entries */ - if (c_ptr->dist != 0 && c_ptr->dist <= n && c_ptr->cost <= m) continue; + if (g_ptr->dist != 0 && g_ptr->dist <= n && g_ptr->cost <= m) continue; /* Ignore "walls" and "rubble" */ - if (!cave_have_flag_grid(c_ptr, FF_MOVE) && !is_closed_door(c_ptr->feat)) continue; + if (!cave_have_flag_grid(g_ptr, FF_MOVE) && !is_closed_door(g_ptr->feat)) continue; /* Save the flow cost */ - if (c_ptr->cost == 0 || c_ptr->cost > m) c_ptr->cost = m; - if (c_ptr->dist == 0 || c_ptr->dist > n) c_ptr->dist = n; + if (g_ptr->cost == 0 || g_ptr->cost > m) g_ptr->cost = m; + if (g_ptr->dist == 0 || g_ptr->dist > n) g_ptr->dist = n; /* Hack -- limit flow depth */ if (n == MONSTER_FLOW_DEPTH) continue; @@ -4217,7 +4217,7 @@ void update_smell(void) { for (j = 0; j < 5; j++) { - grid_type *c_ptr; + grid_type *g_ptr; /* Translate table to map grids */ y = i + p_ptr->y - 2; @@ -4226,10 +4226,10 @@ void update_smell(void) /* Check Bounds */ if (!in_bounds(y, x)) continue; - c_ptr = &grid_array[y][x]; + g_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; + if (!cave_have_flag_grid(g_ptr, FF_MOVE) && !is_closed_door(g_ptr->feat)) continue; /* Grid must not be blocked by walls from the character */ if (!player_has_los_bold(y, x)) continue; @@ -4238,7 +4238,7 @@ void update_smell(void) if (scent_adjust[i][j] == -1) continue; /* Mark the grid with new scent */ - c_ptr->when = scent_when + scent_adjust[i][j]; + g_ptr->when = scent_when + scent_adjust[i][j]; } } } @@ -4251,7 +4251,7 @@ void map_area(POSITION range) { int i; POSITION x, y; - grid_type *c_ptr; + grid_type *g_ptr; FEAT_IDX feat; feature_type *f_ptr; @@ -4264,13 +4264,13 @@ void map_area(POSITION range) { if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Memorize terrain of the grid */ - c_ptr->info |= (CAVE_KNOWN); + g_ptr->info |= (CAVE_KNOWN); /* Feature code (applying "mimic" field) */ - feat = get_feat_mimic(c_ptr); + feat = get_feat_mimic(g_ptr); f_ptr = &f_info[feat]; /* All non-walls are "checked" */ @@ -4280,23 +4280,23 @@ void map_area(POSITION range) if (have_flag(f_ptr->flags, FF_REMEMBER)) { /* Memorize the object */ - c_ptr->info |= (CAVE_MARK); + g_ptr->info |= (CAVE_MARK); } /* Memorize known walls */ for (i = 0; i < 8; i++) { - c_ptr = &grid_array[y + ddy_ddd[i]][x + ddx_ddd[i]]; + g_ptr = &grid_array[y + ddy_ddd[i]][x + ddx_ddd[i]]; /* Feature code (applying "mimic" field) */ - feat = get_feat_mimic(c_ptr); + feat = get_feat_mimic(g_ptr); f_ptr = &f_info[feat]; /* Memorize walls (etc) */ if (have_flag(f_ptr->flags, FF_REMEMBER)) { /* Memorize the walls */ - c_ptr->info |= (CAVE_MARK); + g_ptr->info |= (CAVE_MARK); } } } @@ -4354,13 +4354,13 @@ void wiz_lite(bool ninja) /* Scan all normal grids */ for (x = 1; x < cur_wid - 1; x++) { - grid_type *c_ptr = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; /* Memorize terrain of the grid */ - c_ptr->info |= (CAVE_KNOWN); + g_ptr->info |= (CAVE_KNOWN); /* Feature code (applying "mimic" field) */ - feat = get_feat_mimic(c_ptr); + feat = get_feat_mimic(g_ptr); f_ptr = &f_info[feat]; /* Process all non-walls */ @@ -4373,32 +4373,32 @@ void wiz_lite(bool ninja) POSITION xx = x + ddx_ddd[i]; /* Get the grid */ - c_ptr = &grid_array[yy][xx]; + g_ptr = &grid_array[yy][xx]; /* Feature code (applying "mimic" field) */ - f_ptr = &f_info[get_feat_mimic(c_ptr)]; + f_ptr = &f_info[get_feat_mimic(g_ptr)]; /* Perma-lite the grid */ if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) && !ninja) { - c_ptr->info |= (CAVE_GLOW); + g_ptr->info |= (CAVE_GLOW); } /* Memorize normal features */ if (have_flag(f_ptr->flags, FF_REMEMBER)) { /* Memorize the grid */ - c_ptr->info |= (CAVE_MARK); + g_ptr->info |= (CAVE_MARK); } /* Perma-lit grids (newly and previously) */ - else if (c_ptr->info & CAVE_GLOW) + else if (g_ptr->info & CAVE_GLOW) { /* Normally, memorize floors (see above) */ if (view_perma_grids && !view_torch_grids) { /* Memorize the grid */ - c_ptr->info |= (CAVE_MARK); + g_ptr->info |= (CAVE_MARK); } } } @@ -4430,11 +4430,11 @@ void wiz_dark(void) { for (x = 1; x < cur_wid - 1; x++) { - grid_type *c_ptr = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; /* Process the grid */ - c_ptr->info &= ~(CAVE_MARK | CAVE_IN_DETECT | CAVE_KNOWN); - c_ptr->info |= (CAVE_UNSAFE); + g_ptr->info &= ~(CAVE_MARK | CAVE_IN_DETECT | CAVE_KNOWN); + g_ptr->info |= (CAVE_UNSAFE); } } @@ -4482,17 +4482,17 @@ void wiz_dark(void) */ void cave_set_feat(POSITION y, POSITION x, FEAT_IDX feat) { - grid_type *c_ptr = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; feature_type *f_ptr = &f_info[feat]; bool old_los, old_mirror; if (!character_dungeon) { /* Clear mimic type */ - c_ptr->mimic = 0; + g_ptr->mimic = 0; /* Change the feature */ - c_ptr->feat = feat; + g_ptr->feat = feat; /* Hack -- glow the GLOW terrain */ if (have_flag(f_ptr->flags, FF_GLOW) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) @@ -4513,28 +4513,28 @@ void cave_set_feat(POSITION y, POSITION x, FEAT_IDX feat) } old_los = cave_have_flag_bold(y, x, FF_LOS); - old_mirror = is_mirror_grid(c_ptr); + old_mirror = is_mirror_grid(g_ptr); /* Clear mimic type */ - c_ptr->mimic = 0; + g_ptr->mimic = 0; /* Change the feature */ - c_ptr->feat = feat; + g_ptr->feat = feat; /* Remove flag for mirror/glyph */ - c_ptr->info &= ~(CAVE_OBJECT); + g_ptr->info &= ~(CAVE_OBJECT); if (old_mirror && (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) { - c_ptr->info &= ~(CAVE_GLOW); - if (!view_torch_grids) c_ptr->info &= ~(CAVE_MARK); + g_ptr->info &= ~(CAVE_GLOW); + if (!view_torch_grids) g_ptr->info &= ~(CAVE_MARK); update_local_illumination(y, x); } /* Check for change to boring grid */ - if (!have_flag(f_ptr->flags, FF_REMEMBER)) c_ptr->info &= ~(CAVE_MARK); - if (c_ptr->m_idx) update_monster(c_ptr->m_idx, FALSE); + if (!have_flag(f_ptr->flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK); + if (g_ptr->m_idx) update_monster(g_ptr->m_idx, FALSE); note_spot(y, x); @@ -4701,17 +4701,17 @@ void cave_alter_feat(POSITION y, POSITION x, int action) /* Remove a mirror */ void remove_mirror(POSITION y, POSITION x) { - grid_type *c_ptr = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; /* Remove the mirror */ - c_ptr->info &= ~(CAVE_OBJECT); - c_ptr->mimic = 0; + g_ptr->info &= ~(CAVE_OBJECT); + g_ptr->mimic = 0; if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) { - c_ptr->info &= ~(CAVE_GLOW); - if (!view_torch_grids) c_ptr->info &= ~(CAVE_MARK); - if (c_ptr->m_idx) update_monster(c_ptr->m_idx, FALSE); + g_ptr->info &= ~(CAVE_GLOW); + if (!view_torch_grids) g_ptr->info &= ~(CAVE_MARK); + if (g_ptr->m_idx) update_monster(g_ptr->m_idx, FALSE); update_local_illumination(y, x); } @@ -4725,9 +4725,9 @@ void remove_mirror(POSITION y, POSITION x) /* * Return TRUE if there is a mirror on the grid. */ -bool is_mirror_grid(grid_type *c_ptr) +bool is_mirror_grid(grid_type *g_ptr) { - if ((c_ptr->info & CAVE_OBJECT) && have_flag(f_info[c_ptr->mimic].flags, FF_MIRROR)) + if ((g_ptr->info & CAVE_OBJECT) && have_flag(f_info[g_ptr->mimic].flags, FF_MIRROR)) return TRUE; else return FALSE; @@ -4737,9 +4737,9 @@ bool is_mirror_grid(grid_type *c_ptr) /* * Return TRUE if there is a mirror on the grid. */ -bool is_glyph_grid(grid_type *c_ptr) +bool is_glyph_grid(grid_type *g_ptr) { - if ((c_ptr->info & CAVE_OBJECT) && have_flag(f_info[c_ptr->mimic].flags, FF_GLYPH)) + if ((g_ptr->info & CAVE_OBJECT) && have_flag(f_info[g_ptr->mimic].flags, FF_GLYPH)) return TRUE; else return FALSE; @@ -4749,9 +4749,9 @@ bool is_glyph_grid(grid_type *c_ptr) /* * Return TRUE if there is a mirror on the grid. */ -bool is_explosive_rune_grid(grid_type *c_ptr) +bool is_explosive_rune_grid(grid_type *g_ptr) { - if ((c_ptr->info & CAVE_OBJECT) && have_flag(f_info[c_ptr->mimic].flags, FF_MINOR_GLYPH)) + if ((g_ptr->info & CAVE_OBJECT) && have_flag(f_info[g_ptr->mimic].flags, FF_MINOR_GLYPH)) return TRUE; else return FALSE; @@ -5013,7 +5013,7 @@ void glow_deep_lava_and_bldg(void) { POSITION y, x, yy, xx; DIRECTION i; - grid_type *c_ptr; + grid_type *g_ptr; /* Not in the darkness dungeon */ if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) return; @@ -5022,11 +5022,11 @@ void glow_deep_lava_and_bldg(void) { for (x = 0; x < cur_wid; x++) { - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Feature code (applying "mimic" field) */ - if (have_flag(f_info[get_feat_mimic(c_ptr)].flags, FF_GLOW)) + if (have_flag(f_info[get_feat_mimic(g_ptr)].flags, FF_GLOW)) { for (i = 0; i < 9; i++) { @@ -5056,22 +5056,22 @@ 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 = &grid_array[y][x]; - feature_type *f_ptr = &f_info[c_ptr->feat]; + grid_type *g_ptr = &grid_array[y][x]; + feature_type *f_ptr = &f_info[g_ptr->feat]; /* Require "teleportable" space */ if (!have_flag(f_ptr->flags, FF_TELEPORTABLE)) return FALSE; - if (c_ptr->m_idx && (c_ptr->m_idx != m_idx)) return FALSE; + if (g_ptr->m_idx && (g_ptr->m_idx != m_idx)) return FALSE; if (player_bold(y, x)) return FALSE; /* Hack -- no teleport onto glyph of warding */ - if (is_glyph_grid(c_ptr)) return FALSE; - if (is_explosive_rune_grid(c_ptr)) return FALSE; + if (is_glyph_grid(g_ptr)) return FALSE; + if (is_explosive_rune_grid(g_ptr)) return FALSE; if (!(mode & TELEPORT_PASSIVE)) { - if (!monster_can_cross_terrain(c_ptr->feat, &r_info[m_ptr->r_idx], 0)) return FALSE; + if (!monster_can_cross_terrain(g_ptr->feat, &r_info[m_ptr->r_idx], 0)) return FALSE; } return TRUE; @@ -5086,23 +5086,23 @@ 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 = &grid_array[y][x]; - feature_type *f_ptr = &f_info[c_ptr->feat]; + grid_type *g_ptr = &grid_array[y][x]; + feature_type *f_ptr = &f_info[g_ptr->feat]; /* Require "teleportable" space */ if (!have_flag(f_ptr->flags, FF_TELEPORTABLE)) return FALSE; /* No magical teleporting into vaults and such */ - if (!(mode & TELEPORT_NONMAGICAL) && (c_ptr->info & CAVE_ICKY)) return FALSE; + if (!(mode & TELEPORT_NONMAGICAL) && (g_ptr->info & CAVE_ICKY)) return FALSE; - if (c_ptr->m_idx && (c_ptr->m_idx != p_ptr->riding)) return FALSE; + if (g_ptr->m_idx && (g_ptr->m_idx != p_ptr->riding)) return FALSE; /* don't teleport on a trap. */ if (have_flag(f_ptr->flags, FF_HIT_TRAP)) return FALSE; if (!(mode & TELEPORT_PASSIVE)) { - if (!player_can_enter(c_ptr->feat, 0)) return FALSE; + if (!player_can_enter(g_ptr->feat, 0)) return FALSE; if (have_flag(f_ptr->flags, FF_WATER) && have_flag(f_ptr->flags, FF_DEEP)) { diff --git a/src/cmd-pet.c b/src/cmd-pet.c index 5123eb33f..1b3cf7fb2 100644 --- a/src/cmd-pet.c +++ b/src/cmd-pet.c @@ -5,11 +5,11 @@ /*! * @brief プレイヤーの騎乗/下馬処理判定 -* @param c_ptr プレイヤーの移動先マスの構造体参照ポインタ +* @param g_ptr プレイヤーの移動先マスの構造体参照ポインタ * @param now_riding TRUEなら下馬処理、FALSEならば騎乗処理 * @return 可能ならばTRUEを返す */ -bool player_can_ride_aux(grid_type *c_ptr, bool now_riding) +bool player_can_ride_aux(grid_type *g_ptr, bool now_riding) { bool p_can_enter; bool old_character_xtra = character_xtra; @@ -21,7 +21,7 @@ bool player_can_ride_aux(grid_type *c_ptr, bool now_riding) /* Hack -- prevent "icky" message */ character_xtra = TRUE; - if (now_riding) p_ptr->riding = c_ptr->m_idx; + if (now_riding) p_ptr->riding = g_ptr->m_idx; else { p_ptr->riding = 0; @@ -32,7 +32,7 @@ bool player_can_ride_aux(grid_type *c_ptr, bool now_riding) p_ptr->update |= PU_BONUS; handle_stuff(); - p_can_enter = player_can_enter(c_ptr->feat, CEM_P_CAN_ENTER_PATTERN); + p_can_enter = player_can_enter(g_ptr->feat, CEM_P_CAN_ENTER_PATTERN); p_ptr->riding = old_riding; if (old_pf_ryoute) p_ptr->pet_extra_flags |= (PF_RYOUTE); @@ -308,20 +308,20 @@ bool do_riding(bool force) { POSITION x, y; DIRECTION dir = 0; - grid_type *c_ptr; + grid_type *g_ptr; monster_type *m_ptr; if (!get_direction(&dir, FALSE, FALSE)) return FALSE; y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; if (p_ptr->special_defense & KATA_MUSOU) set_action(ACTION_NONE); if (p_ptr->riding) { /* Skip non-empty grids */ - if (!player_can_ride_aux(c_ptr, FALSE)) + if (!player_can_ride_aux(g_ptr, FALSE)) { msg_print(_("そちらには降りられません。", "You cannot go to that direction.")); return FALSE; @@ -329,7 +329,7 @@ bool do_riding(bool force) if (!pattern_seq(p_ptr->y, p_ptr->x, y, x)) return FALSE; - if (c_ptr->m_idx) + if (g_ptr->m_idx) { take_turn(p_ptr, 100);; @@ -347,9 +347,9 @@ bool do_riding(bool force) { if (cmd_limit_confused(p_ptr)) return FALSE; - m_ptr = &m_list[c_ptr->m_idx]; + m_ptr = &m_list[g_ptr->m_idx]; - if (!c_ptr->m_idx || !m_ptr->ml) + if (!g_ptr->m_idx || !m_ptr->ml) { msg_print(_("その場所にはモンスターはいません。", "Here is no monster.")); return FALSE; @@ -367,10 +367,10 @@ bool do_riding(bool force) if (!pattern_seq(p_ptr->y, p_ptr->x, y, x)) return FALSE; - if (!player_can_ride_aux(c_ptr, TRUE)) + if (!player_can_ride_aux(g_ptr, TRUE)) { /* Feature code (applying "mimic" field) */ - feature_type *f_ptr = &f_info[get_feat_mimic(c_ptr)]; + feature_type *f_ptr = &f_info[get_feat_mimic(g_ptr)]; #ifdef JP msg_format("そのモンスターは%sの%sにいる。", f_name + f_ptr->name, ((!have_flag(f_ptr->flags, FF_MOVE) && !have_flag(f_ptr->flags, FF_CAN_FLY)) || @@ -396,13 +396,13 @@ bool do_riding(bool force) { GAME_TEXT m_name[MAX_NLEN]; monster_desc(m_name, m_ptr, 0); - (void)set_monster_csleep(c_ptr->m_idx, 0); + (void)set_monster_csleep(g_ptr->m_idx, 0); msg_format(_("%sを起こした。", "You have waked %s up."), m_name); } if (p_ptr->action == ACTION_KAMAE) set_action(ACTION_NONE); - p_ptr->riding = c_ptr->m_idx; + p_ptr->riding = g_ptr->m_idx; /* Hack -- remove tracked monster */ if (p_ptr->riding == p_ptr->health_who) health_track(0); @@ -876,8 +876,8 @@ void do_cmd_pet(void) if (!target_set(TARGET_KILL)) pet_t_m_idx = 0; else { - grid_type *c_ptr = &grid_array[target_row][target_col]; - if (c_ptr->m_idx && (m_list[c_ptr->m_idx].ml)) + grid_type *g_ptr = &grid_array[target_row][target_col]; + if (g_ptr->m_idx && (m_list[g_ptr->m_idx].ml)) { pet_t_m_idx = grid_array[target_row][target_col].m_idx; p_ptr->pet_follow_distance = PET_DESTROY_DIST; @@ -1086,23 +1086,23 @@ bool rakuba(HIT_POINT dam, bool force) /* Check around the player */ for (i = 0; i < 8; i++) { - grid_type *c_ptr; + grid_type *g_ptr; /* Access the location */ y = p_ptr->y + ddy_ddd[i]; x = p_ptr->x + ddx_ddd[i]; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; - if (c_ptr->m_idx) continue; + if (g_ptr->m_idx) continue; /* Skip non-empty grids */ - if (!cave_have_flag_grid(c_ptr, FF_MOVE) && !cave_have_flag_grid(c_ptr, FF_CAN_FLY)) + if (!cave_have_flag_grid(g_ptr, FF_MOVE) && !cave_have_flag_grid(g_ptr, FF_CAN_FLY)) { - if (!player_can_ride_aux(c_ptr, FALSE)) continue; + if (!player_can_ride_aux(g_ptr, FALSE)) continue; } - if (cave_have_flag_grid(c_ptr, FF_PATTERN)) continue; + if (cave_have_flag_grid(g_ptr, FF_PATTERN)) continue; /* Count "safe" grids */ sn++; diff --git a/src/cmd-pet.h b/src/cmd-pet.h index 112c36e3d..f967ab043 100644 --- a/src/cmd-pet.h +++ b/src/cmd-pet.h @@ -3,7 +3,7 @@ extern void check_pets_num_and_align(monster_type *m_ptr, bool inc); extern int calculate_upkeep(void); extern void do_cmd_pet_dismiss(void); extern void do_cmd_pet(void); -extern bool player_can_ride_aux(grid_type *c_ptr, bool now_riding); +extern bool player_can_ride_aux(grid_type *g_ptr, bool now_riding); extern bool rakuba(HIT_POINT dam, bool force); diff --git a/src/cmd2.c b/src/cmd2.c index 0ac5222b9..f201daec5 100644 --- a/src/cmd2.c +++ b/src/cmd2.c @@ -136,8 +136,8 @@ void do_cmd_go_up(void) bool go_up = FALSE; /* Player grid */ - grid_type *c_ptr = &grid_array[p_ptr->y][p_ptr->x]; - feature_type *f_ptr = &f_info[c_ptr->feat]; + grid_type *g_ptr = &grid_array[p_ptr->y][p_ptr->x]; + feature_type *f_ptr = &f_info[g_ptr->feat]; int up_num = 0; @@ -168,7 +168,7 @@ void do_cmd_go_up(void) leave_quest_check(); - p_ptr->inside_quest = c_ptr->special; + p_ptr->inside_quest = g_ptr->special; /* Activate the quest */ if (!quest[p_ptr->inside_quest].status) @@ -230,7 +230,7 @@ void do_cmd_go_up(void) { leave_quest_check(); - p_ptr->inside_quest = c_ptr->special; + p_ptr->inside_quest = g_ptr->special; dun_level = 0; up_num = 0; } @@ -280,8 +280,8 @@ void do_cmd_go_up(void) void do_cmd_go_down(void) { /* Player grid */ - grid_type *c_ptr = &grid_array[p_ptr->y][p_ptr->x]; - feature_type *f_ptr = &f_info[c_ptr->feat]; + grid_type *g_ptr = &grid_array[p_ptr->y][p_ptr->x]; + feature_type *f_ptr = &f_info[g_ptr->feat]; bool fall_trap = FALSE; int down_num = 0; @@ -320,7 +320,7 @@ void do_cmd_go_down(void) leave_quest_check(); leave_tower_check(); - p_ptr->inside_quest = c_ptr->special; + p_ptr->inside_quest = g_ptr->special; /* Activate the quest */ if (!quest[p_ptr->inside_quest].status) @@ -353,7 +353,7 @@ void do_cmd_go_down(void) if (!dun_level) { - target_dungeon = have_flag(f_ptr->flags, FF_ENTRANCE) ? c_ptr->special : DUNGEON_ANGBAND; + target_dungeon = have_flag(f_ptr->flags, FF_ENTRANCE) ? g_ptr->special : DUNGEON_ANGBAND; if (ironman_downward && (target_dungeon != DUNGEON_ANGBAND)) { @@ -477,11 +477,11 @@ void do_cmd_search(void) */ static OBJECT_IDX chest_check(POSITION y, POSITION x, bool trapped) { - grid_type *c_ptr = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; OBJECT_IDX this_o_idx, next_o_idx = 0; /* Scan all objects in the grid */ - for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) + for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) { object_type *o_ptr; @@ -592,7 +592,7 @@ static int count_dt(POSITION *y, POSITION *x, bool (*test)(IDX feat), bool under /* Check around (and under) the character */ for (d = 0; d < 9; d++) { - grid_type *c_ptr; + grid_type *g_ptr; FEAT_IDX feat; /* if not searching under player continue */ @@ -603,13 +603,13 @@ static int count_dt(POSITION *y, POSITION *x, bool (*test)(IDX feat), bool under xx = p_ptr->x + ddx_ddd[d]; /* Get the grid_array */ - c_ptr = &grid_array[yy][xx]; + g_ptr = &grid_array[yy][xx]; /* Must have knowledge */ - if (!(c_ptr->info & (CAVE_MARK))) continue; + if (!(g_ptr->info & (CAVE_MARK))) continue; /* Feature code (applying "mimic" field) */ - feat = get_feat_mimic(c_ptr); + feat = get_feat_mimic(g_ptr); /* Not looking for this feature */ if (!((*test)(feat))) continue; @@ -717,8 +717,8 @@ static bool do_cmd_open_aux(POSITION y, POSITION x) int i, j; /* Get requested grid */ - grid_type *c_ptr = &grid_array[y][x]; - feature_type *f_ptr = &f_info[c_ptr->feat]; + grid_type *g_ptr = &grid_array[y][x]; + feature_type *f_ptr = &f_info[g_ptr->feat]; bool more = FALSE; take_turn(p_ptr, 100);; @@ -729,7 +729,7 @@ static bool do_cmd_open_aux(POSITION y, POSITION x) if (!have_flag(f_ptr->flags, FF_OPEN)) { /* Stuck */ - msg_format(_("%sはがっちりと閉じられているようだ。", "The %s appears to be stuck."), f_name + f_info[get_feat_mimic(c_ptr)].name); + msg_format(_("%sはがっちりと閉じられているようだ。", "The %s appears to be stuck."), f_name + f_info[get_feat_mimic(g_ptr)].name); } /* Locked door */ @@ -846,17 +846,17 @@ void do_cmd_open(void) if (get_rep_dir(&dir, TRUE)) { FEAT_IDX feat; - grid_type *c_ptr; + grid_type *g_ptr; /* Get requested location */ y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; /* Get requested grid */ - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Feature code (applying "mimic" field) */ - feat = get_feat_mimic(c_ptr); + feat = get_feat_mimic(g_ptr); /* Check for chest */ o_idx = chest_check(y, x, FALSE); @@ -868,7 +868,7 @@ void do_cmd_open(void) } /* Monster in the way */ - else if (c_ptr->m_idx && p_ptr->riding != c_ptr->m_idx) + else if (g_ptr->m_idx && p_ptr->riding != g_ptr->m_idx) { take_turn(p_ptr, 100);; msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!")); @@ -909,8 +909,8 @@ void do_cmd_open(void) */ static bool do_cmd_close_aux(POSITION y, POSITION x) { - grid_type *c_ptr = &grid_array[y][x]; - FEAT_IDX old_feat = c_ptr->feat; + grid_type *g_ptr = &grid_array[y][x]; + FEAT_IDX old_feat = g_ptr->feat; bool more = FALSE; take_turn(p_ptr, 100);; @@ -923,7 +923,7 @@ static bool do_cmd_close_aux(POSITION y, POSITION x) s16b closed_feat = feat_state(old_feat, FF_CLOSE); /* Hack -- object in the way */ - if ((c_ptr->o_idx || (c_ptr->info & CAVE_OBJECT)) && + if ((g_ptr->o_idx || (g_ptr->info & CAVE_OBJECT)) && (closed_feat != old_feat) && !have_flag(f_info[closed_feat].flags, FF_DROP)) { msg_print(_("何かがつっかえて閉まらない。", "There seems stuck.")); @@ -934,7 +934,7 @@ static bool do_cmd_close_aux(POSITION y, POSITION x) cave_alter_feat(y, x, FF_CLOSE); /* Broken door */ - if (old_feat == c_ptr->feat) + if (old_feat == g_ptr->feat) { msg_print(_("ドアは壊れてしまっている。", "The door appears to be broken.")); } @@ -993,15 +993,15 @@ void do_cmd_close(void) /* Get a "repeated" direction */ if (get_rep_dir(&dir, FALSE)) { - grid_type *c_ptr; + grid_type *g_ptr; FEAT_IDX feat; y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Feature code (applying "mimic" field) */ - feat = get_feat_mimic(c_ptr); + feat = get_feat_mimic(g_ptr); /* Require open/broken door */ if (!have_flag(f_info[feat].flags, FF_CLOSE)) @@ -1010,7 +1010,7 @@ void do_cmd_close(void) } /* Monster in the way */ - else if (c_ptr->m_idx) + else if (g_ptr->m_idx) { take_turn(p_ptr, 100);; @@ -1042,10 +1042,10 @@ void do_cmd_close(void) */ static bool do_cmd_tunnel_test(POSITION y, POSITION x) { - grid_type *c_ptr = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; /* Must have knowledge */ - if (!(c_ptr->info & CAVE_MARK)) + if (!(g_ptr->info & CAVE_MARK)) { msg_print(_("そこには何も見当たらない。", "You see nothing there.")); @@ -1053,7 +1053,7 @@ static bool do_cmd_tunnel_test(POSITION y, POSITION x) } /* Must be a wall/door/etc */ - if (!cave_have_flag_grid(c_ptr, FF_TUNNEL)) + if (!cave_have_flag_grid(g_ptr, FF_TUNNEL)) { msg_print(_("そこには掘るものが見当たらない。", "You see nothing there to tunnel.")); @@ -1077,7 +1077,7 @@ static bool do_cmd_tunnel_test(POSITION y, POSITION x) */ static bool do_cmd_tunnel_aux(POSITION y, POSITION x) { - grid_type *c_ptr; + grid_type *g_ptr; feature_type *f_ptr, *mimic_f_ptr; int power; concptr name; @@ -1089,12 +1089,12 @@ static bool do_cmd_tunnel_aux(POSITION y, POSITION x) take_turn(p_ptr, 100);; /* Get grid */ - c_ptr = &grid_array[y][x]; - f_ptr = &f_info[c_ptr->feat]; + g_ptr = &grid_array[y][x]; + f_ptr = &f_info[g_ptr->feat]; power = f_ptr->power; /* Feature code (applying "mimic" field) */ - mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)]; + mimic_f_ptr = &f_info[get_feat_mimic(g_ptr)]; name = f_name + mimic_f_ptr->name; @@ -1181,7 +1181,7 @@ static bool do_cmd_tunnel_aux(POSITION y, POSITION x) } } - if (is_hidden_door(c_ptr)) + if (is_hidden_door(g_ptr)) { /* Occasional Search XXX XXX */ if (randint0(100) < 25) search(); @@ -1207,7 +1207,7 @@ void do_cmd_tunnel(void) { int y, x, dir; - grid_type *c_ptr; + grid_type *g_ptr; FEAT_IDX feat; bool more = FALSE; @@ -1237,10 +1237,10 @@ void do_cmd_tunnel(void) x = p_ptr->x + ddx[dir]; /* Get grid */ - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Feature code (applying "mimic" field) */ - feat = get_feat_mimic(c_ptr); + feat = get_feat_mimic(g_ptr); /* No tunnelling through doors */ if (have_flag(f_info[feat].flags, FF_DOOR)) @@ -1255,7 +1255,7 @@ void do_cmd_tunnel(void) } /* A monster is in the way */ - else if (c_ptr->m_idx) + else if (g_ptr->m_idx) { take_turn(p_ptr, 100);; @@ -1295,11 +1295,11 @@ bool easy_open_door(POSITION y, POSITION x) { int i, j; - grid_type *c_ptr = &grid_array[y][x]; - feature_type *f_ptr = &f_info[c_ptr->feat]; + grid_type *g_ptr = &grid_array[y][x]; + feature_type *f_ptr = &f_info[g_ptr->feat]; /* Must be a closed door */ - if (!is_closed_door(c_ptr->feat)) + if (!is_closed_door(g_ptr->feat)) { return (FALSE); } @@ -1308,7 +1308,7 @@ bool easy_open_door(POSITION y, POSITION x) if (!have_flag(f_ptr->flags, FF_OPEN)) { /* Stuck */ - msg_format(_("%sはがっちりと閉じられているようだ。", "The %s appears to be stuck."), f_name + f_info[get_feat_mimic(c_ptr)].name); + msg_format(_("%sはがっちりと閉じられているようだ。", "The %s appears to be stuck."), f_name + f_info[get_feat_mimic(g_ptr)].name); } @@ -1466,10 +1466,10 @@ 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 = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; /* Get feature */ - feature_type *f_ptr = &f_info[c_ptr->feat]; + feature_type *f_ptr = &f_info[g_ptr->feat]; /* Access trap name */ concptr name = (f_name + f_ptr->name); @@ -1586,15 +1586,15 @@ void do_cmd_disarm(void) /* Get a direction (or abort) */ if (get_rep_dir(&dir,TRUE)) { - grid_type *c_ptr; + grid_type *g_ptr; FEAT_IDX feat; y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Feature code (applying "mimic" field) */ - feat = get_feat_mimic(c_ptr); + feat = get_feat_mimic(g_ptr); /* Check for chests */ o_idx = chest_check(y, x, TRUE); @@ -1606,7 +1606,7 @@ void do_cmd_disarm(void) } /* Monster in the way */ - else if (c_ptr->m_idx && p_ptr->riding != c_ptr->m_idx) + else if (g_ptr->m_idx && p_ptr->riding != g_ptr->m_idx) { msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!")); @@ -1649,10 +1649,10 @@ void do_cmd_disarm(void) static bool do_cmd_bash_aux(POSITION y, POSITION x, DIRECTION dir) { /* Get grid */ - grid_type *c_ptr = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; /* Get feature */ - feature_type *f_ptr = &f_info[c_ptr->feat]; + feature_type *f_ptr = &f_info[g_ptr->feat]; /* Hack -- Bash power based on strength */ /* (Ranges from 3 to 20 to 100 to 200) */ @@ -1663,7 +1663,7 @@ static bool do_cmd_bash_aux(POSITION y, POSITION x, DIRECTION dir) bool more = FALSE; - concptr name = f_name + f_info[get_feat_mimic(c_ptr)].name; + concptr name = f_name + f_info[get_feat_mimic(g_ptr)].name; take_turn(p_ptr, 100);; @@ -1685,7 +1685,7 @@ static bool do_cmd_bash_aux(POSITION y, POSITION x, DIRECTION dir) sound(have_flag(f_ptr->flags, FF_GLASS) ? SOUND_GLASS : SOUND_OPENDOOR); /* Break down the door */ - if ((randint0(100) < 50) || (feat_state(c_ptr->feat, FF_OPEN) == c_ptr->feat) || have_flag(f_ptr->flags, FF_GLASS)) + if ((randint0(100) < 50) || (feat_state(g_ptr->feat, FF_OPEN) == g_ptr->feat) || have_flag(f_ptr->flags, FF_GLASS)) { cave_alter_feat(y, x, FF_BASH); } @@ -1743,7 +1743,7 @@ static bool do_cmd_bash_aux(POSITION y, POSITION x, DIRECTION dir) void do_cmd_bash(void) { int y, x, dir; - grid_type *c_ptr; + grid_type *g_ptr; bool more = FALSE; if (p_ptr->wild_mode) return; @@ -1774,10 +1774,10 @@ void do_cmd_bash(void) x = p_ptr->x + ddx[dir]; /* Get grid */ - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Feature code (applying "mimic" field) */ - feat = get_feat_mimic(c_ptr); + feat = get_feat_mimic(g_ptr); /* Nothing useful */ if (!have_flag(f_info[feat].flags, FF_BASH)) @@ -1786,7 +1786,7 @@ void do_cmd_bash(void) } /* Monster in the way */ - else if (c_ptr->m_idx) + else if (g_ptr->m_idx) { take_turn(p_ptr, 100);; @@ -1828,7 +1828,7 @@ void do_cmd_alter(void) { POSITION y, x; DIRECTION dir; - grid_type *c_ptr; + grid_type *g_ptr; bool more = FALSE; if (p_ptr->special_defense & KATA_MUSOU) @@ -1857,15 +1857,15 @@ void do_cmd_alter(void) x = p_ptr->x + ddx[dir]; /* Get grid */ - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Feature code (applying "mimic" field) */ - feat = get_feat_mimic(c_ptr); + feat = get_feat_mimic(g_ptr); f_ptr = &f_info[feat]; take_turn(p_ptr, 100);; - if (c_ptr->m_idx) + if (g_ptr->m_idx) { py_attack(y, x, 0); } @@ -1974,15 +1974,15 @@ void do_cmd_spike(void) { POSITION y, x; INVENTORY_IDX item; - grid_type *c_ptr; + grid_type *g_ptr; FEAT_IDX feat; y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Feature code (applying "mimic" field) */ - feat = get_feat_mimic(c_ptr); + feat = get_feat_mimic(g_ptr); /* Require closed door */ if (!have_flag(f_info[feat].flags, FF_SPIKE)) @@ -1997,7 +1997,7 @@ void do_cmd_spike(void) } /* Is a monster in the way? */ - else if (c_ptr->m_idx) + else if (g_ptr->m_idx) { take_turn(p_ptr, 100);; @@ -2600,8 +2600,8 @@ bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken) /* Monster here, Try to hit it */ if (grid_array[y][x].m_idx) { - grid_type *c_ptr = &grid_array[y][x]; - monster_type *m_ptr = &m_list[c_ptr->m_idx]; + grid_type *g_ptr = &grid_array[y][x]; + monster_type *m_ptr = &m_list[g_ptr->m_idx]; /* Check the visibility */ visible = m_ptr->ml; @@ -2631,7 +2631,7 @@ bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken) if (m_ptr->ml) { if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx); - health_track(c_ptr->m_idx); + health_track(g_ptr->m_idx); } } @@ -2677,7 +2677,7 @@ bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken) tdam, m_ptr->hp - tdam, m_ptr->maxhp, m_ptr->max_maxhp); /* Hit the monster, check for death */ - if (mon_take_hit(c_ptr->m_idx, tdam, &fear, extract_note_dies(real_r_idx(m_ptr)))) + if (mon_take_hit(g_ptr->m_idx, tdam, &fear, extract_note_dies(real_r_idx(m_ptr)))) { /* Dead monster */ } @@ -2685,7 +2685,7 @@ bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken) /* No death */ else { - message_pain(c_ptr->m_idx, tdam); + message_pain(g_ptr->m_idx, tdam); /* Anger the monster */ if ((tdam > 0) && !object_is_potion(q_ptr)) @@ -2942,8 +2942,8 @@ 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 = &grid_array[y][x]; - feature_type *f_ptr = &f_info[c_ptr->feat]; + grid_type *g_ptr = &grid_array[y][x]; + feature_type *f_ptr = &f_info[g_ptr->feat]; int old_head = flow_head; int add_cost = 1; int base_cost = (n % TRAVEL_UNABLE); @@ -2954,7 +2954,7 @@ static void travel_flow_aux(POSITION y, POSITION x, int n, bool wall) if (!in_bounds(y, x)) return; /* Ignore unknown grid except in wilderness */ - if (dun_level > 0 && !(c_ptr->info & CAVE_KNOWN)) return; + if (dun_level > 0 && !(g_ptr->info & CAVE_KNOWN)) return; /* Ignore "walls" and "rubble" (include "secret doors") */ if (have_flag(f_ptr->flags, FF_WALL) || diff --git a/src/cmd4.c b/src/cmd4.c index 24fea9b67..652c961c7 100644 --- a/src/cmd4.c +++ b/src/cmd4.c @@ -5273,12 +5273,12 @@ static void do_cmd_knowledge_artifacts(void) { for (x = 0; x < cur_wid; x++) { - grid_type *c_ptr = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; OBJECT_IDX this_o_idx, next_o_idx = 0; /* Scan all objects in the grid */ - for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) + for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) { object_type *o_ptr; o_ptr = &o_list[this_o_idx]; diff --git a/src/dungeon.c b/src/dungeon.c index 40ba4dbb4..6ac342445 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -3405,12 +3405,12 @@ static void process_world(void) for (i2 = 0; i2 < cur_wid; ++i2) for (j2 = 0; j2 < cur_hgt; j2++) { - grid_type *c_ptr = &grid_array[j2][i2]; + grid_type *g_ptr = &grid_array[j2][i2]; - if ((c_ptr->m_idx > 0) && (c_ptr->m_idx != p_ptr->riding)) + if ((g_ptr->m_idx > 0) && (g_ptr->m_idx != p_ptr->riding)) { number_mon++; - win_m_idx = c_ptr->m_idx; + win_m_idx = g_ptr->m_idx; } } diff --git a/src/externs.h b/src/externs.h index e7ebb7854..8a24794fa 100644 --- a/src/externs.h +++ b/src/externs.h @@ -454,7 +454,7 @@ extern concptr autopick_line_from_entry(autopick_type *entry); extern int is_autopick(object_type *o_ptr); extern void autopick_alter_item(INVENTORY_IDX item, bool destroy); extern void autopick_delayed_alter(void); -extern void autopick_pickup_items(grid_type *c_ptr); +extern void autopick_pickup_items(grid_type *g_ptr); extern bool autopick_autoregister(object_type *o_ptr); extern void do_cmd_edit_autopick(void); @@ -469,9 +469,9 @@ extern void dump_yourself(FILE *fff); /* 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); +extern bool is_known_trap(grid_type *g_ptr); extern bool is_closed_door(IDX feat); -extern bool is_hidden_door(grid_type *c_ptr); +extern bool is_hidden_door(grid_type *g_ptr); extern bool los(POSITION y1, POSITION x1, POSITION y2, POSITION x2); extern void update_local_illumination(POSITION y, POSITION x); extern bool player_can_see_bold(POSITION y, POSITION x); @@ -506,9 +506,9 @@ extern FEAT_IDX conv_dungeon_feat(FEAT_IDX newfeat); extern FEAT_IDX feat_state(IDX feat, int action); extern void cave_alter_feat(POSITION y, POSITION x, int action); extern void remove_mirror(POSITION y, POSITION x); -extern bool is_mirror_grid(grid_type *c_ptr); -extern bool is_glyph_grid(grid_type *c_ptr); -extern bool is_explosive_rune_grid(grid_type *c_ptr); +extern bool is_mirror_grid(grid_type *g_ptr); +extern bool is_glyph_grid(grid_type *g_ptr); +extern bool is_explosive_rune_grid(grid_type *g_ptr); extern void mmove2(POSITION *y, POSITION *x, POSITION y1, POSITION x1, POSITION y2, POSITION x2); extern bool projectable(POSITION y1, POSITION x1, POSITION y2, POSITION x2); extern void scatter(POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode); diff --git a/src/floor-events.c b/src/floor-events.c index a417ac60d..3e32ff741 100644 --- a/src/floor-events.c +++ b/src/floor-events.c @@ -13,13 +13,13 @@ void day_break() for (x = 0; x < cur_wid; x++) { /* Get the grid */ - grid_type *c_ptr = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; /* Assume lit */ - c_ptr->info |= (CAVE_GLOW); + g_ptr->info |= (CAVE_GLOW); /* Hack -- Memorize lit grids if allowed */ - if (view_perma_grids) c_ptr->info |= (CAVE_MARK); + if (view_perma_grids) g_ptr->info |= (CAVE_MARK); /* Hack -- Notice spot */ note_spot(y, x); @@ -51,21 +51,21 @@ void night_falls(void) for (x = 0; x < cur_wid; x++) { /* Get the grid */ - grid_type *c_ptr = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; /* Feature code (applying "mimic" field) */ - feature_type *f_ptr = &f_info[get_feat_mimic(c_ptr)]; + feature_type *f_ptr = &f_info[get_feat_mimic(g_ptr)]; - if (!is_mirror_grid(c_ptr) && !have_flag(f_ptr->flags, FF_QUEST_ENTER) && + if (!is_mirror_grid(g_ptr) && !have_flag(f_ptr->flags, FF_QUEST_ENTER) && !have_flag(f_ptr->flags, FF_ENTRANCE)) { /* Assume dark */ - c_ptr->info &= ~(CAVE_GLOW); + g_ptr->info &= ~(CAVE_GLOW); if (!have_flag(f_ptr->flags, FF_REMEMBER)) { /* Forget the normal floor grid */ - c_ptr->info &= ~(CAVE_MARK); + g_ptr->info &= ~(CAVE_MARK); /* Hack -- Notice spot */ note_spot(y, x); diff --git a/src/floor-generate.c b/src/floor-generate.c index dfb850b9a..82341e8a8 100644 --- a/src/floor-generate.c +++ b/src/floor-generate.c @@ -147,12 +147,12 @@ static int next_to_walls(POSITION y, POSITION x) */ static bool alloc_stairs_aux(POSITION y, POSITION x, int walls) { - grid_type *c_ptr = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; /* Require "naked" floor grid */ - if (!is_floor_grid(c_ptr)) return FALSE; + if (!is_floor_grid(g_ptr)) return FALSE; if (pattern_tile(y, x)) return FALSE; - if (c_ptr->o_idx || c_ptr->m_idx) return FALSE; + if (g_ptr->o_idx || g_ptr->m_idx) return FALSE; /* Require a certain number of adjacent walls */ if (next_to_walls(y, x) < walls) return FALSE; @@ -214,7 +214,7 @@ static bool alloc_stairs(IDX feat, int num, int walls) while (TRUE) { POSITION y, x = 0; - grid_type *c_ptr; + grid_type *g_ptr; int candidates = 0; int pick; @@ -260,16 +260,16 @@ static bool alloc_stairs(IDX feat, int num, int walls) if (!pick) break; } - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Clear possible garbage of hidden trap */ - c_ptr->mimic = 0; + g_ptr->mimic = 0; /* Clear previous contents, add stairs */ - c_ptr->feat = (i < shaft_num) ? feat_state(feat, FF_SHAFT) : feat; + g_ptr->feat = (i < shaft_num) ? feat_state(feat, FF_SHAFT) : feat; /* No longer "FLOOR" */ - c_ptr->info &= ~(CAVE_FLOOR); + g_ptr->info &= ~(CAVE_FLOOR); /* Success */ break; @@ -290,7 +290,7 @@ static void alloc_object(int set, EFFECT_ID typ, int num) POSITION y = 0, x = 0; int k; int dummy = 0; - grid_type *c_ptr; + grid_type *g_ptr; /* A small level has few objects. */ num = num * cur_hgt * cur_wid / (MAX_HGT*MAX_WID) +1; @@ -308,10 +308,10 @@ static void alloc_object(int set, EFFECT_ID typ, int num) y = randint0(cur_hgt); x = randint0(cur_wid); - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Require "naked" floor grid */ - if (!is_floor_grid(c_ptr) || c_ptr->o_idx || c_ptr->m_idx) continue; + if (!is_floor_grid(g_ptr) || g_ptr->o_idx || g_ptr->m_idx) continue; /* Avoid player location */ if (player_bold(y, x)) continue; @@ -420,19 +420,19 @@ bool place_quest_monsters(void) /* Find an empty grid */ for (l = SAFE_MAX_ATTEMPTS; l > 0; l--) { - grid_type *c_ptr; + grid_type *g_ptr; feature_type *f_ptr; y = randint0(cur_hgt); x = randint0(cur_wid); - c_ptr = &grid_array[y][x]; - f_ptr = &f_info[c_ptr->feat]; + g_ptr = &grid_array[y][x]; + f_ptr = &f_info[g_ptr->feat]; if (!have_flag(f_ptr->flags, FF_MOVE) && !have_flag(f_ptr->flags, FF_CAN_FLY)) continue; if (!monster_can_enter(y, x, r_ptr, 0)) continue; if (distance(y, x, p_ptr->y, p_ptr->x) < 10) continue; - if (c_ptr->info & CAVE_ICKY) continue; + if (g_ptr->info & CAVE_ICKY) continue; else break; } @@ -463,31 +463,31 @@ bool place_quest_monsters(void) /*! * @brief マスにフロア端用の永久壁を配置する / Set boundary mimic and add "solid" perma-wall - * @param c_ptr 永久壁を廃止したいマス構造体の参照ポインタ + * @param g_ptr 永久壁を廃止したいマス構造体の参照ポインタ * @return なし */ -static void set_bound_perm_wall(grid_type *c_ptr) +static void set_bound_perm_wall(grid_type *g_ptr) { if (bound_walls_perm) { /* Clear boundary mimic */ - c_ptr->mimic = 0; + g_ptr->mimic = 0; } else { - feature_type *f_ptr = &f_info[c_ptr->feat]; + feature_type *f_ptr = &f_info[g_ptr->feat]; /* Hack -- Decline boundary walls with known treasure */ if ((have_flag(f_ptr->flags, FF_HAS_GOLD) || have_flag(f_ptr->flags, FF_HAS_ITEM)) && !have_flag(f_ptr->flags, FF_SECRET)) - c_ptr->feat = feat_state(c_ptr->feat, FF_ENSECRET); + g_ptr->feat = feat_state(g_ptr->feat, FF_ENSECRET); /* Set boundary mimic */ - c_ptr->mimic = c_ptr->feat; + g_ptr->mimic = g_ptr->feat; } /* Add "solid" perma-wall */ - place_solid_perm_grid(c_ptr); + place_solid_perm_grid(g_ptr); } /*! @@ -810,36 +810,36 @@ static bool cave_gen(void) /* Turn the tunnel into corridor */ for (j = 0; j < dun->tunn_n; j++) { - grid_type *c_ptr; + grid_type *g_ptr; feature_type *f_ptr; y = dun->tunn[j].y; x = dun->tunn[j].x; - c_ptr = &grid_array[y][x]; - f_ptr = &f_info[c_ptr->feat]; + g_ptr = &grid_array[y][x]; + f_ptr = &f_info[g_ptr->feat]; /* Clear previous contents (if not a lake), add a floor */ if (!have_flag(f_ptr->flags, FF_MOVE) || (!have_flag(f_ptr->flags, FF_WATER) && !have_flag(f_ptr->flags, FF_LAVA))) { /* Clear mimic type */ - c_ptr->mimic = 0; + g_ptr->mimic = 0; - place_floor_grid(c_ptr); + place_floor_grid(g_ptr); } } /* Apply the piercings that we found */ for (j = 0; j < dun->wall_n; j++) { - grid_type *c_ptr; + grid_type *g_ptr; y = dun->wall[j].y; x = dun->wall[j].x; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Clear mimic type */ - c_ptr->mimic = 0; + g_ptr->mimic = 0; /* Clear previous contents, add up floor */ - place_floor_grid(c_ptr); + place_floor_grid(g_ptr); /* Occasional doorway */ if ((randint0(100) < dun_tun_pen) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_DOORS)) @@ -1364,16 +1364,16 @@ void clear_cave(void) { for (x = 0; x < MAX_WID; x++) { - grid_type *c_ptr = &grid_array[y][x]; - c_ptr->info = 0; - c_ptr->feat = 0; - c_ptr->o_idx = 0; - c_ptr->m_idx = 0; - c_ptr->special = 0; - c_ptr->mimic = 0; - c_ptr->cost = 0; - c_ptr->dist = 0; - c_ptr->when = 0; + grid_type *g_ptr = &grid_array[y][x]; + g_ptr->info = 0; + g_ptr->feat = 0; + g_ptr->o_idx = 0; + g_ptr->m_idx = 0; + g_ptr->special = 0; + g_ptr->mimic = 0; + g_ptr->cost = 0; + g_ptr->dist = 0; + g_ptr->when = 0; } } @@ -1523,7 +1523,7 @@ bool build_tunnel(POSITION row1, POSITION col1, POSITION row2, POSITION col2) bool door_flag = FALSE; - grid_type *c_ptr; + grid_type *g_ptr; /* Save the starting location */ start_row = row1; @@ -1575,13 +1575,13 @@ bool build_tunnel(POSITION row1, POSITION col1, POSITION row2, POSITION col2) /* Access the location */ - c_ptr = &grid_array[tmp_row][tmp_col]; + g_ptr = &grid_array[tmp_row][tmp_col]; /* Avoid "solid" walls */ - if (is_solid_grid(c_ptr)) continue; + if (is_solid_grid(g_ptr)) continue; /* Pierce "outer" walls of rooms */ - if (is_outer_grid(c_ptr)) + if (is_outer_grid(g_ptr)) { /* Acquire the "next" location */ y = tmp_row + row_dir; @@ -1620,7 +1620,7 @@ bool build_tunnel(POSITION row1, POSITION col1, POSITION row2, POSITION col2) } /* Travel quickly through rooms */ - else if (c_ptr->info & (CAVE_ROOM)) + else if (g_ptr->info & (CAVE_ROOM)) { /* Accept the location */ row1 = tmp_row; @@ -1628,7 +1628,7 @@ bool build_tunnel(POSITION row1, POSITION col1, POSITION row2, POSITION col2) } /* Tunnel through all other walls */ - else if (is_extra_grid(c_ptr) || is_inner_grid(c_ptr) || is_solid_grid(c_ptr)) + else if (is_extra_grid(g_ptr) || is_inner_grid(g_ptr) || is_solid_grid(g_ptr)) { /* Accept this location */ row1 = tmp_row; @@ -1713,11 +1713,11 @@ static bool set_tunnel(POSITION *x, POSITION *y, bool affectwall) { int i, j, dx, dy; - grid_type *c_ptr = &grid_array[*y][*x]; + grid_type *g_ptr = &grid_array[*y][*x]; if (!in_bounds(*y, *x)) return TRUE; - if (is_inner_grid(c_ptr)) + if (is_inner_grid(g_ptr)) { return TRUE; } @@ -1742,7 +1742,7 @@ static bool set_tunnel(POSITION *x, POSITION *y, bool affectwall) return TRUE; } - if (is_outer_grid(c_ptr) && affectwall) + if (is_outer_grid(g_ptr) && affectwall) { /* Save the wall location */ if (dun->wall_n < WALL_MAX) @@ -1775,7 +1775,7 @@ static bool set_tunnel(POSITION *x, POSITION *y, bool affectwall) return TRUE; } - if (is_solid_grid(c_ptr) && affectwall) + if (is_solid_grid(g_ptr) && affectwall) { /* cannot place tunnel here - use a square to the side */ @@ -1802,7 +1802,7 @@ static bool set_tunnel(POSITION *x, POSITION *y, bool affectwall) if (i == 0) { /* Failed for some reason: hack - ignore the solidness */ - place_outer_grid(c_ptr); + place_outer_grid(g_ptr); dx = 0; dy = 0; } @@ -2007,7 +2007,7 @@ bool build_tunnel2(POSITION x1, POSITION y1, POSITION x2, POSITION y2, int type, int length; int i; bool retval, firstsuccede; - grid_type *c_ptr; + grid_type *g_ptr; length = distance(x1, y1, x2, y2); @@ -2033,9 +2033,9 @@ bool build_tunnel2(POSITION x1, POSITION y1, POSITION x2, POSITION y2, int type, x3 = (x1 + x2) / 2; y3 = (y1 + y2) / 2; } - /* cache c_ptr */ - c_ptr = &grid_array[y3][x3]; - if (is_solid_grid(c_ptr)) + /* cache g_ptr */ + g_ptr = &grid_array[y3][x3]; + if (is_solid_grid(g_ptr)) { /* move midpoint a bit to avoid problem. */ @@ -2064,10 +2064,10 @@ bool build_tunnel2(POSITION x1, POSITION y1, POSITION x2, POSITION y2, int type, } y3 += dy; x3 += dx; - c_ptr = &grid_array[y3][x3]; + g_ptr = &grid_array[y3][x3]; } - if (is_floor_grid(c_ptr)) + if (is_floor_grid(g_ptr)) { if (build_tunnel2(x1, y1, x3, y3, type, cutoff)) { diff --git a/src/floor-save.c b/src/floor-save.c index 02a4a84c4..c7a670424 100644 --- a/src/floor-save.c +++ b/src/floor-save.c @@ -735,7 +735,7 @@ static void get_out_monster(void) } /*! - * マス構造体のspecial要素を利用する地形かどうかを判定するマクロ / Is this feature has special meaning (except floor_id) with c_ptr->special? + * マス構造体のspecial要素を利用する地形かどうかを判定するマクロ / Is this feature has special meaning (except floor_id) with g_ptr->special? */ #define feat_uses_special(F) (have_flag(f_info[(F)].flags, FF_SPECIAL)) @@ -758,8 +758,8 @@ static void locate_connected_stairs(saved_floor_type *sf_ptr) { for (x = 0; x < cur_wid; x++) { - grid_type *c_ptr = &grid_array[y][x]; - feature_type *f_ptr = &f_info[c_ptr->feat]; + grid_type *g_ptr = &grid_array[y][x]; + feature_type *f_ptr = &f_info[g_ptr->feat]; bool ok = FALSE; if (change_floor_mode & CFM_UP) @@ -770,8 +770,8 @@ static void locate_connected_stairs(saved_floor_type *sf_ptr) ok = TRUE; /* Found fixed stairs? */ - if (c_ptr->special && - c_ptr->special == sf_ptr->upper_floor_id) + if (g_ptr->special && + g_ptr->special == sf_ptr->upper_floor_id) { sx = x; sy = y; @@ -787,8 +787,8 @@ static void locate_connected_stairs(saved_floor_type *sf_ptr) ok = TRUE; /* Found fixed stairs */ - if (c_ptr->special && - c_ptr->special == sf_ptr->lower_floor_id) + if (g_ptr->special && + g_ptr->special == sf_ptr->lower_floor_id) { sx = x; sy = y; @@ -845,7 +845,7 @@ static void locate_connected_stairs(saved_floor_type *sf_ptr) */ void leave_floor(void) { - grid_type *c_ptr = NULL; + grid_type *g_ptr = NULL; feature_type *f_ptr; saved_floor_type *sf_ptr; MONRACE_IDX quest_r_idx = 0; @@ -936,14 +936,14 @@ void leave_floor(void) if (change_floor_mode & CFM_SAVE_FLOORS) { /* Extract stair position */ - c_ptr = &grid_array[p_ptr->y][p_ptr->x]; - f_ptr = &f_info[c_ptr->feat]; + g_ptr = &grid_array[p_ptr->y][p_ptr->x]; + f_ptr = &f_info[g_ptr->feat]; /* Get back to old saved floor? */ - if (c_ptr->special && !have_flag(f_ptr->flags, FF_SPECIAL) && get_sf_ptr(c_ptr->special)) + if (g_ptr->special && !have_flag(f_ptr->flags, FF_SPECIAL) && get_sf_ptr(g_ptr->special)) { /* Saved floor is exist. Use it. */ - new_floor_id = c_ptr->special; + new_floor_id = g_ptr->special; } /* Mark shaft up/down */ @@ -1028,9 +1028,9 @@ void leave_floor(void) new_floor_id = get_new_floor_id(); /* Connect from here */ - if (c_ptr && !feat_uses_special(c_ptr->feat)) + if (g_ptr && !feat_uses_special(g_ptr->feat)) { - c_ptr->special = new_floor_id; + g_ptr->special = new_floor_id; } } @@ -1133,17 +1133,17 @@ void change_floor(void) /* Forbid return stairs */ if (change_floor_mode & CFM_NO_RETURN) { - grid_type *c_ptr = &grid_array[p_ptr->y][p_ptr->x]; + grid_type *g_ptr = &grid_array[p_ptr->y][p_ptr->x]; - if (!feat_uses_special(c_ptr->feat)) + if (!feat_uses_special(g_ptr->feat)) { if (change_floor_mode & (CFM_DOWN | CFM_UP)) { /* Reset to floor */ - c_ptr->feat = feat_ground_type[randint0(100)]; + g_ptr->feat = feat_ground_type[randint0(100)]; } - c_ptr->special = 0; + g_ptr->special = 0; } } } @@ -1310,27 +1310,27 @@ void change_floor(void) if (!(change_floor_mode & CFM_NO_RETURN)) { /* Extract stair position */ - grid_type *c_ptr = &grid_array[p_ptr->y][p_ptr->x]; + grid_type *g_ptr = &grid_array[p_ptr->y][p_ptr->x]; /*** Create connected stairs ***/ /* No stairs down from Quest */ if ((change_floor_mode & CFM_UP) && !quest_number(dun_level)) { - c_ptr->feat = (change_floor_mode & CFM_SHAFT) ? feat_state(feat_down_stair, FF_SHAFT) : feat_down_stair; + g_ptr->feat = (change_floor_mode & CFM_SHAFT) ? feat_state(feat_down_stair, FF_SHAFT) : feat_down_stair; } /* No stairs up when ironman_downward */ else if ((change_floor_mode & CFM_DOWN) && !ironman_downward) { - c_ptr->feat = (change_floor_mode & CFM_SHAFT) ? feat_state(feat_up_stair, FF_SHAFT) : feat_up_stair; + g_ptr->feat = (change_floor_mode & CFM_SHAFT) ? feat_state(feat_up_stair, FF_SHAFT) : feat_up_stair; } /* Paranoia -- Clear mimic */ - c_ptr->mimic = 0; + g_ptr->mimic = 0; /* Connect to previous floor */ - c_ptr->special = p_ptr->floor_id; + g_ptr->special = p_ptr->floor_id; } } @@ -1475,14 +1475,14 @@ void stair_creation(void) { for (x = 0; x < cur_wid; x++) { - grid_type *c_ptr = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; - if (!c_ptr->special) continue; - if (feat_uses_special(c_ptr->feat)) continue; - if (c_ptr->special != dest_floor_id) continue; + if (!g_ptr->special) continue; + if (feat_uses_special(g_ptr->feat)) continue; + if (g_ptr->special != dest_floor_id) continue; /* Remove old stairs */ - c_ptr->special = 0; + g_ptr->special = 0; cave_set_feat(y, x, feat_ground_type[randint0(100)]); } } diff --git a/src/floor-streams.c b/src/floor-streams.c index 6df2e7156..00323d9aa 100644 --- a/src/floor-streams.c +++ b/src/floor-streams.c @@ -39,7 +39,7 @@ static void recursive_river(POSITION x1, POSITION y1, POSITION x2, POSITION y2, POSITION changex, changey; POSITION ty, tx; bool done; - grid_type *c_ptr; + grid_type *g_ptr; length = distance(x1, y1, x2, y2); @@ -108,36 +108,36 @@ static void recursive_river(POSITION x1, POSITION y1, POSITION x2, POSITION y2, { if (!in_bounds2(ty, tx)) continue; - c_ptr = &grid_array[ty][tx]; + g_ptr = &grid_array[ty][tx]; - if (c_ptr->feat == feat1) continue; - if (c_ptr->feat == feat2) continue; + if (g_ptr->feat == feat1) continue; + if (g_ptr->feat == feat2) continue; if (distance(ty, tx, y, x) > rand_spread(width, 1)) continue; /* Do not convert permanent features */ - if (cave_perma_grid(c_ptr)) continue; + if (cave_perma_grid(g_ptr)) continue; /* * Clear previous contents, add feature * The border mainly gets feat2, while the center gets feat1 */ if (distance(ty, tx, y, x) > width) - c_ptr->feat = feat2; + g_ptr->feat = feat2; else - c_ptr->feat = feat1; + g_ptr->feat = feat1; /* Clear garbage of hidden trap or door */ - c_ptr->mimic = 0; + g_ptr->mimic = 0; /* Lava terrain glows */ if (have_flag(f_info[feat1].flags, FF_LAVA)) { - if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) c_ptr->info |= CAVE_GLOW; + if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) g_ptr->info |= CAVE_GLOW; } /* Hack -- don't teleport here */ - c_ptr->info |= CAVE_ICKY; + g_ptr->info |= CAVE_ICKY; } } @@ -232,7 +232,7 @@ void build_streamer(IDX feat, int chance) int y, x, dir; int dummy = 0; - grid_type *c_ptr; + grid_type *g_ptr; feature_type *f_ptr; feature_type *streamer_ptr = &f_info[feat]; @@ -264,8 +264,8 @@ void build_streamer(IDX feat, int chance) if (!in_bounds2(ty, tx)) continue; break; } - c_ptr = &grid_array[ty][tx]; - f_ptr = &f_info[c_ptr->feat]; + g_ptr = &grid_array[ty][tx]; + f_ptr = &f_info[g_ptr->feat]; if (have_flag(f_ptr->flags, FF_MOVE) && (have_flag(f_ptr->flags, FF_WATER) || have_flag(f_ptr->flags, FF_LAVA))) continue; @@ -276,22 +276,22 @@ void build_streamer(IDX feat, int chance) /* Only convert "granite" walls */ if (streamer_is_wall) { - if (!is_extra_grid(c_ptr) && !is_inner_grid(c_ptr) && !is_outer_grid(c_ptr) && !is_solid_grid(c_ptr)) continue; - if (is_closed_door(c_ptr->feat)) continue; + if (!is_extra_grid(g_ptr) && !is_inner_grid(g_ptr) && !is_outer_grid(g_ptr) && !is_solid_grid(g_ptr)) continue; + if (is_closed_door(g_ptr->feat)) continue; } - if (c_ptr->m_idx && !(have_flag(streamer_ptr->flags, FF_PLACE) && monster_can_cross_terrain(feat, &r_info[m_list[c_ptr->m_idx].r_idx], 0))) + if (g_ptr->m_idx && !(have_flag(streamer_ptr->flags, FF_PLACE) && monster_can_cross_terrain(feat, &r_info[m_list[g_ptr->m_idx].r_idx], 0))) { /* Delete the monster (if any) */ delete_monster(ty, tx); } - if (c_ptr->o_idx && !have_flag(streamer_ptr->flags, FF_DROP)) + if (g_ptr->o_idx && !have_flag(streamer_ptr->flags, FF_DROP)) { OBJECT_IDX this_o_idx, next_o_idx = 0; /* Scan all objects in the grid */ - for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) + for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) { object_type *o_ptr = &o_list[this_o_idx]; @@ -323,10 +323,10 @@ void build_streamer(IDX feat, int chance) } /* Clear previous contents, add proper vein type */ - c_ptr->feat = feat; + g_ptr->feat = feat; /* Paranoia: Clear mimic field */ - c_ptr->mimic = 0; + g_ptr->mimic = 0; if (streamer_may_have_gold) { @@ -382,7 +382,7 @@ void build_streamer(IDX feat, int chance) void place_trees(POSITION x, POSITION y) { int i, j; - grid_type *c_ptr; + grid_type *g_ptr; /* place trees/ rubble in ovalish distribution */ for (i = x - 3; i < x + 4; i++) @@ -390,13 +390,13 @@ void place_trees(POSITION x, POSITION y) for (j = y - 3; j < y + 4; j++) { if (!in_bounds(j, i)) continue; - c_ptr = &grid_array[j][i]; + g_ptr = &grid_array[j][i]; - if (c_ptr->info & CAVE_ICKY) continue; - if (c_ptr->o_idx) continue; + if (g_ptr->info & CAVE_ICKY) continue; + if (g_ptr->o_idx) continue; /* Want square to be in the circle and accessable. */ - if ((distance(j, i, y, x) < 4) && !cave_perma_grid(c_ptr)) + if ((distance(j, i, y, x) < 4) && !cave_perma_grid(g_ptr)) { /* * Clear previous contents, add feature @@ -413,7 +413,7 @@ void place_trees(POSITION x, POSITION y) } /* Clear garbage of hidden trap or door */ - c_ptr->mimic = 0; + g_ptr->mimic = 0; /* Light area since is open above */ if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) grid_array[j][i].info |= (CAVE_GLOW | CAVE_ROOM); diff --git a/src/grid.c b/src/grid.c index e030a5959..a566e6edd 100644 --- a/src/grid.c +++ b/src/grid.c @@ -30,7 +30,7 @@ bool new_player_spot(void) POSITION y = 0, x = 0; int max_attempts = 10000; - grid_type *c_ptr; + grid_type *g_ptr; feature_type *f_ptr; /* Place the player */ @@ -40,13 +40,13 @@ bool new_player_spot(void) y = (POSITION)rand_range(1, cur_hgt - 2); x = (POSITION)rand_range(1, cur_wid - 2); - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Must be a "naked" floor grid */ - if (c_ptr->m_idx) continue; + if (g_ptr->m_idx) continue; if (dun_level) { - f_ptr = &f_info[c_ptr->feat]; + f_ptr = &f_info[g_ptr->feat]; if (max_attempts > 5000) /* Rule 1 */ { @@ -61,11 +61,11 @@ bool new_player_spot(void) /* Refuse to start on anti-teleport grids in dungeon */ if (!have_flag(f_ptr->flags, FF_TELEPORTABLE)) continue; } - if (!player_can_enter(c_ptr->feat, 0)) continue; + if (!player_can_enter(g_ptr->feat, 0)) continue; if (!in_bounds(y, x)) continue; /* Refuse to start on anti-teleport grids */ - if (c_ptr->info & (CAVE_ICKY)) continue; + if (g_ptr->info & (CAVE_ICKY)) continue; break; } @@ -92,11 +92,11 @@ void place_random_stairs(POSITION y, POSITION x) { bool up_stairs = TRUE; bool down_stairs = TRUE; - grid_type *c_ptr; + grid_type *g_ptr; /* Paranoia */ - c_ptr = &grid_array[y][x]; - if (!is_floor_grid(c_ptr) || c_ptr->o_idx) return; + g_ptr = &grid_array[y][x]; + if (!is_floor_grid(g_ptr) || g_ptr->o_idx) return; /* Town */ if (!dun_level) up_stairs = FALSE; @@ -134,10 +134,10 @@ void place_random_door(POSITION y, POSITION x, bool room) { int tmp, type; FEAT_IDX feat = feat_none; - grid_type *c_ptr = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; /* Initialize mimic info */ - c_ptr->mimic = 0; + g_ptr->mimic = 0; if (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_DOORS) { @@ -175,16 +175,16 @@ void place_random_door(POSITION y, POSITION x, bool room) if (type != DOOR_CURTAIN) { /* Hide. If on the edge of room, use outer wall. */ - c_ptr->mimic = room ? feat_wall_outer : feat_wall_type[randint0(100)]; + g_ptr->mimic = room ? feat_wall_outer : feat_wall_type[randint0(100)]; /* Floor type terrain cannot hide a door */ - if (feat_supports_los(c_ptr->mimic) && !feat_supports_los(c_ptr->feat)) + if (feat_supports_los(g_ptr->mimic) && !feat_supports_los(g_ptr->feat)) { - if (have_flag(f_info[c_ptr->mimic].flags, FF_MOVE) || have_flag(f_info[c_ptr->mimic].flags, FF_CAN_FLY)) + if (have_flag(f_info[g_ptr->mimic].flags, FF_MOVE) || have_flag(f_info[g_ptr->mimic].flags, FF_CAN_FLY)) { - c_ptr->feat = one_in_(2) ? c_ptr->mimic : feat_ground_type[randint0(100)]; + g_ptr->feat = one_in_(2) ? g_ptr->mimic : feat_ground_type[randint0(100)]; } - c_ptr->mimic = 0; + g_ptr->mimic = 0; } } } @@ -298,7 +298,7 @@ void place_secret_door(POSITION y, POSITION x, int type) } else { - grid_type *c_ptr = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; if (type == DOOR_DEFAULT) { @@ -313,20 +313,20 @@ void place_secret_door(POSITION y, POSITION x, int type) if (type != DOOR_CURTAIN) { /* Hide by inner wall because this is used in rooms only */ - c_ptr->mimic = feat_wall_inner; + g_ptr->mimic = feat_wall_inner; /* Floor type terrain cannot hide a door */ - if (feat_supports_los(c_ptr->mimic) && !feat_supports_los(c_ptr->feat)) + if (feat_supports_los(g_ptr->mimic) && !feat_supports_los(g_ptr->feat)) { - if (have_flag(f_info[c_ptr->mimic].flags, FF_MOVE) || have_flag(f_info[c_ptr->mimic].flags, FF_CAN_FLY)) + if (have_flag(f_info[g_ptr->mimic].flags, FF_MOVE) || have_flag(f_info[g_ptr->mimic].flags, FF_CAN_FLY)) { - c_ptr->feat = one_in_(2) ? c_ptr->mimic : feat_ground_type[randint0(100)]; + g_ptr->feat = one_in_(2) ? g_ptr->mimic : feat_ground_type[randint0(100)]; } - c_ptr->mimic = 0; + g_ptr->mimic = 0; } } - c_ptr->info &= ~(CAVE_FLOOR); + g_ptr->info &= ~(CAVE_FLOOR); delete_monster(y, x); } } @@ -399,7 +399,7 @@ static int next_to_corr(POSITION y1, POSITION x1) int i, k = 0; POSITION y, x; - grid_type *c_ptr; + grid_type *g_ptr; /* Scan adjacent grids */ for (i = 0; i < 4; i++) @@ -407,17 +407,17 @@ static int next_to_corr(POSITION y1, POSITION x1) /* Extract the location */ y = y1 + ddy_ddd[i]; x = x1 + ddx_ddd[i]; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Skip non floors */ - if (cave_have_flag_grid(c_ptr, FF_WALL)) continue; + if (cave_have_flag_grid(g_ptr, FF_WALL)) continue; /* Skip non "empty floor" grids */ - if (!is_floor_grid(c_ptr)) + if (!is_floor_grid(g_ptr)) continue; /* Skip grids inside rooms */ - if (c_ptr->info & (CAVE_ROOM)) continue; + if (g_ptr->info & (CAVE_ROOM)) continue; /* Count these grids */ k++; @@ -556,7 +556,7 @@ void vault_objects(POSITION y, POSITION x, int num) int dummy = 0; int i = 0, j = y, k = x; - grid_type *c_ptr; + grid_type *g_ptr; /* Attempt to place 'num' objects */ @@ -581,8 +581,8 @@ void vault_objects(POSITION y, POSITION x, int num) } /* Require "clean" floor space */ - c_ptr = &grid_array[j][k]; - if (!is_floor_grid(c_ptr) || c_ptr->o_idx) continue; + g_ptr = &grid_array[j][k]; + if (!is_floor_grid(g_ptr) || g_ptr->o_idx) continue; if (randint0(100) < 75) { @@ -614,7 +614,7 @@ void vault_trap_aux(POSITION y, POSITION x, POSITION yd, POSITION xd) int count = 0, y1 = y, x1 = x; int dummy = 0; - grid_type *c_ptr; + grid_type *g_ptr; /* Place traps */ for (count = 0; count <= 5; count++) @@ -635,8 +635,8 @@ void vault_trap_aux(POSITION y, POSITION x, POSITION yd, POSITION xd) } /* Require "naked" floor grids */ - c_ptr = &grid_array[y1][x1]; - if (!is_floor_grid(c_ptr) || c_ptr->o_idx || c_ptr->m_idx) continue; + g_ptr = &grid_array[y1][x1]; + if (!is_floor_grid(g_ptr) || g_ptr->o_idx || g_ptr->m_idx) continue; /* Place the trap */ place_trap(y1, x1); @@ -679,7 +679,7 @@ void vault_monsters(POSITION y1, POSITION x1, int num) { int k, i; POSITION y, x; - grid_type *c_ptr; + grid_type *g_ptr; /* Try to summon "num" monsters "near" the given location */ for (k = 0; k < num; k++) @@ -693,8 +693,8 @@ void vault_monsters(POSITION y1, POSITION x1, int num) scatter(&y, &x, y1, x1, d, 0); /* Require "empty" floor grids */ - c_ptr = &grid_array[y][x]; - if (!cave_empty_grid(c_ptr)) continue; + g_ptr = &grid_array[y][x]; + if (!cave_empty_grid(g_ptr)) continue; /* Place the monster (allow groups) */ monster_level = base_level + 2; diff --git a/src/init1.c b/src/init1.c index 818e1363c..ad72e0d34 100644 --- a/src/init1.c +++ b/src/init1.c @@ -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 = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; object_type *o_ptr; OBJECT_IDX o_idx = o_pop(); @@ -3919,10 +3919,10 @@ static void drop_here(object_type *j_ptr, POSITION y, POSITION x) o_ptr->held_m_idx = 0; /* Build a stack */ - o_ptr->next_o_idx = c_ptr->o_idx; + o_ptr->next_o_idx = g_ptr->o_idx; /* Place the object */ - c_ptr->o_idx = o_idx; + g_ptr->o_idx = o_idx; } @@ -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 = &grid_array[*y][*x]; + grid_type *g_ptr = &grid_array[*y][*x]; int idx = s[0]; @@ -3994,13 +3994,13 @@ static errr process_dungeon_file_aux(char *buf, int ymin, int xmin, int ymax, in ARTIFACT_IDX artifact_index = letter[idx].artifact; /* Lay down a floor */ - c_ptr->feat = conv_dungeon_feat(letter[idx].feature); + g_ptr->feat = conv_dungeon_feat(letter[idx].feature); /* Only the features */ if (init_flags & INIT_ONLY_FEATURES) continue; /* Cave info */ - c_ptr->info = letter[idx].cave_info; + g_ptr->info = letter[idx].cave_info; /* Create a monster */ if (random & RANDOM_MONSTER) @@ -4096,8 +4096,8 @@ static errr process_dungeon_file_aux(char *buf, int ymin, int xmin, int ymax, in /* Hidden trap (or door) */ else if (letter[idx].trap) { - c_ptr->mimic = c_ptr->feat; - c_ptr->feat = conv_dungeon_feat(letter[idx].trap); + g_ptr->mimic = g_ptr->feat; + g_ptr->feat = conv_dungeon_feat(letter[idx].trap); } else if (object_index) { @@ -4138,7 +4138,7 @@ static errr process_dungeon_file_aux(char *buf, int ymin, int xmin, int ymax, in } /* Terrain special */ - c_ptr->special = letter[idx].special; + g_ptr->special = letter[idx].special; } (*y)++; diff --git a/src/load.c b/src/load.c index 2deaa3585..fe19e7a62 100644 --- a/src/load.c +++ b/src/load.c @@ -2549,7 +2549,7 @@ static errr rd_dungeon_old(void) byte tmp8u; s16b tmp16s; u16b limit; - grid_type *c_ptr; + grid_type *g_ptr; /*** Basic info ***/ @@ -2619,10 +2619,10 @@ static errr rd_dungeon_old(void) for (i = count; i > 0; i--) { /* Access the grid_array */ - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Extract "info" */ - c_ptr->info = info; + g_ptr->info = info; /* Advance/Wrap */ if (++x >= xmax) @@ -2650,10 +2650,10 @@ static errr rd_dungeon_old(void) for (i = count; i > 0; i--) { /* Access the grid_array */ - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Extract "feat" */ - c_ptr->feat = (s16b)tmp8u; + g_ptr->feat = (s16b)tmp8u; /* Advance/Wrap */ if (++x >= xmax) @@ -2680,10 +2680,10 @@ static errr rd_dungeon_old(void) for (i = count; i > 0; i--) { /* Access the grid_array */ - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Extract "mimic" */ - c_ptr->mimic = (s16b)tmp8u; + g_ptr->mimic = (s16b)tmp8u; /* Advance/Wrap */ if (++x >= xmax) @@ -2710,10 +2710,10 @@ static errr rd_dungeon_old(void) for (i = count; i > 0; i--) { /* Access the grid_array */ - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Extract "feat" */ - c_ptr->special = tmp16s; + g_ptr->special = tmp16s; /* Advance/Wrap */ if (++x >= xmax) @@ -2742,20 +2742,20 @@ static errr rd_dungeon_old(void) for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++) { /* Access the grid_array */ - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Very old */ - if (c_ptr->feat == OLD_FEAT_INVIS) + if (g_ptr->feat == OLD_FEAT_INVIS) { - c_ptr->feat = feat_floor; - c_ptr->info |= CAVE_TRAP; + g_ptr->feat = feat_floor; + g_ptr->info |= CAVE_TRAP; } /* Older than 1.1.1 */ - if (c_ptr->feat == OLD_FEAT_MIRROR) + if (g_ptr->feat == OLD_FEAT_MIRROR) { - c_ptr->feat = feat_floor; - c_ptr->info |= CAVE_OBJECT; + g_ptr->feat = feat_floor; + g_ptr->info |= CAVE_OBJECT; } } } @@ -2765,36 +2765,36 @@ static errr rd_dungeon_old(void) for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++) { /* Access the grid_array */ - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Old CAVE_IN_MIRROR flag */ - if (c_ptr->info & CAVE_OBJECT) + if (g_ptr->info & CAVE_OBJECT) { - c_ptr->mimic = feat_mirror; + g_ptr->mimic = feat_mirror; } /* Runes will be mimics and flags */ - else if ((c_ptr->feat == OLD_FEAT_MINOR_GLYPH) || - (c_ptr->feat == OLD_FEAT_GLYPH)) + else if ((g_ptr->feat == OLD_FEAT_MINOR_GLYPH) || + (g_ptr->feat == OLD_FEAT_GLYPH)) { - c_ptr->info |= CAVE_OBJECT; - c_ptr->mimic = c_ptr->feat; - c_ptr->feat = feat_floor; + g_ptr->info |= CAVE_OBJECT; + g_ptr->mimic = g_ptr->feat; + g_ptr->feat = feat_floor; } /* Hidden traps will be trap terrains mimicing floor */ - else if (c_ptr->info & CAVE_TRAP) + else if (g_ptr->info & CAVE_TRAP) { - c_ptr->info &= ~CAVE_TRAP; - c_ptr->mimic = c_ptr->feat; - c_ptr->feat = choose_random_trap(); + g_ptr->info &= ~CAVE_TRAP; + g_ptr->mimic = g_ptr->feat; + g_ptr->feat = choose_random_trap(); } /* Another hidden trap */ - else if (c_ptr->feat == OLD_FEAT_INVIS) + else if (g_ptr->feat == OLD_FEAT_INVIS) { - c_ptr->mimic = feat_floor; - c_ptr->feat = feat_trap_open; + g_ptr->mimic = feat_floor; + g_ptr->feat = feat_trap_open; } } } @@ -2805,25 +2805,25 @@ static errr rd_dungeon_old(void) for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++) { /* Access the grid_array */ - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; - if ((c_ptr->special == OLD_QUEST_WATER_CAVE) && !dun_level) + if ((g_ptr->special == OLD_QUEST_WATER_CAVE) && !dun_level) { - if (c_ptr->feat == OLD_FEAT_QUEST_ENTER) + if (g_ptr->feat == OLD_FEAT_QUEST_ENTER) { - c_ptr->feat = feat_tree; - c_ptr->special = 0; + g_ptr->feat = feat_tree; + g_ptr->special = 0; } - else if (c_ptr->feat == OLD_FEAT_BLDG_1) + else if (g_ptr->feat == OLD_FEAT_BLDG_1) { - c_ptr->special = lite_town ? QUEST_OLD_CASTLE : QUEST_ROYAL_CRYPT; + g_ptr->special = lite_town ? QUEST_OLD_CASTLE : QUEST_ROYAL_CRYPT; } } - else if ((c_ptr->feat == OLD_FEAT_QUEST_EXIT) && + else if ((g_ptr->feat == OLD_FEAT_QUEST_EXIT) && (p_ptr->inside_quest == OLD_QUEST_WATER_CAVE)) { - c_ptr->feat = feat_up_stair; - c_ptr->special = 0; + g_ptr->feat = feat_up_stair; + g_ptr->special = 0; } } } @@ -2886,13 +2886,13 @@ static errr rd_dungeon_old(void) else { /* Access the item location */ - c_ptr = &grid_array[o_ptr->iy][o_ptr->ix]; + g_ptr = &grid_array[o_ptr->iy][o_ptr->ix]; /* Build a stack */ - o_ptr->next_o_idx = c_ptr->o_idx; + o_ptr->next_o_idx = g_ptr->o_idx; /* Place the object */ - c_ptr->o_idx = o_idx; + g_ptr->o_idx = o_idx; } } @@ -2933,10 +2933,10 @@ static errr rd_dungeon_old(void) /* Access grid */ - c_ptr = &grid_array[m_ptr->fy][m_ptr->fx]; + g_ptr = &grid_array[m_ptr->fy][m_ptr->fx]; /* Mark the location */ - c_ptr->m_idx = m_idx; + g_ptr->m_idx = m_idx; /* Count */ real_r_ptr(m_ptr)->cur_num++; @@ -3104,13 +3104,13 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr) for (i = count; i > 0; i--) { /* Access the grid_array */ - grid_type *c_ptr = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; /* Extract grid_array data */ - c_ptr->info = templates[id].info; - c_ptr->feat = templates[id].feat; - c_ptr->mimic = templates[id].mimic; - c_ptr->special = templates[id].special; + g_ptr->info = templates[id].info; + g_ptr->feat = templates[id].feat; + g_ptr->mimic = templates[id].mimic; + g_ptr->special = templates[id].special; /* Advance/Wrap */ if (++x >= xmax) @@ -3130,25 +3130,25 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr) for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++) { /* Access the grid_array */ - grid_type *c_ptr = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; - if ((c_ptr->special == OLD_QUEST_WATER_CAVE) && !dun_level) + if ((g_ptr->special == OLD_QUEST_WATER_CAVE) && !dun_level) { - if (c_ptr->feat == OLD_FEAT_QUEST_ENTER) + if (g_ptr->feat == OLD_FEAT_QUEST_ENTER) { - c_ptr->feat = feat_tree; - c_ptr->special = 0; + g_ptr->feat = feat_tree; + g_ptr->special = 0; } - else if (c_ptr->feat == OLD_FEAT_BLDG_1) + else if (g_ptr->feat == OLD_FEAT_BLDG_1) { - c_ptr->special = lite_town ? QUEST_OLD_CASTLE : QUEST_ROYAL_CRYPT; + g_ptr->special = lite_town ? QUEST_OLD_CASTLE : QUEST_ROYAL_CRYPT; } } - else if ((c_ptr->feat == OLD_FEAT_QUEST_EXIT) && + else if ((g_ptr->feat == OLD_FEAT_QUEST_EXIT) && (p_ptr->inside_quest == OLD_QUEST_WATER_CAVE)) { - c_ptr->feat = feat_up_stair; - c_ptr->special = 0; + g_ptr->feat = feat_up_stair; + g_ptr->special = 0; } } } @@ -3204,13 +3204,13 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr) else { /* Access the item location */ - grid_type *c_ptr = &grid_array[o_ptr->iy][o_ptr->ix]; + grid_type *g_ptr = &grid_array[o_ptr->iy][o_ptr->ix]; /* Build a stack */ - o_ptr->next_o_idx = c_ptr->o_idx; + o_ptr->next_o_idx = g_ptr->o_idx; /* Place the object */ - c_ptr->o_idx = o_idx; + g_ptr->o_idx = o_idx; } } @@ -3226,7 +3226,7 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr) /* Read the monsters */ for (i = 1; i < limit; i++) { - grid_type *c_ptr; + grid_type *g_ptr; MONSTER_IDX m_idx; monster_type *m_ptr; @@ -3244,10 +3244,10 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr) /* Access grid */ - c_ptr = &grid_array[m_ptr->fy][m_ptr->fx]; + g_ptr = &grid_array[m_ptr->fy][m_ptr->fx]; /* Mark the location */ - c_ptr->m_idx = m_idx; + g_ptr->m_idx = m_idx; /* Count */ real_r_ptr(m_ptr)->cur_num++; diff --git a/src/melee1.c b/src/melee1.c index 4cbdfd583..fbd84efcc 100644 --- a/src/melee1.c +++ b/src/melee1.c @@ -434,9 +434,9 @@ 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 = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; - monster_type *m_ptr = &m_list[c_ptr->m_idx]; + monster_type *m_ptr = &m_list[g_ptr->m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; /* Access the weapon */ @@ -535,7 +535,7 @@ static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b } /* Disturb the monster */ - (void)set_monster_csleep(c_ptr->m_idx, 0); + (void)set_monster_csleep(g_ptr->m_idx, 0); /* Extract monster name (or "it") */ monster_desc(m_name, m_ptr, 0); @@ -773,7 +773,7 @@ static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b { if (p_ptr->lev > randint1(r_ptr->level + resist_stun + 10)) { - if (set_monster_stunned(c_ptr->m_idx, stun_effect + MON_STUNNED(m_ptr))) + if (set_monster_stunned(g_ptr->m_idx, stun_effect + MON_STUNNED(m_ptr))) { msg_format(_("%^sはフラフラになった。", "%^s is stunned."), m_name); } @@ -919,7 +919,7 @@ static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b } /* Apply stun */ - (void)set_monster_stunned(c_ptr->m_idx, MON_STUNNED(m_ptr) + tmp); + (void)set_monster_stunned(g_ptr->m_idx, MON_STUNNED(m_ptr) + tmp); } else { @@ -973,7 +973,7 @@ static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b drain_result = m_ptr->hp; /* Damage, check for fear and death */ - if (mon_take_hit(c_ptr->m_idx, k, fear, NULL)) + if (mon_take_hit(g_ptr->m_idx, k, fear, NULL)) { *mdeath = TRUE; if ((p_ptr->pclass == CLASS_BERSERKER) && p_ptr->energy_use) @@ -1100,7 +1100,7 @@ static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b else { msg_format(_("%^sは混乱したようだ。", "%^s appears confused."), m_name); - (void)set_monster_confused(c_ptr->m_idx, MON_CONFUSED(m_ptr) + 10 + randint0(p_ptr->lev) / 5); + (void)set_monster_confused(g_ptr->m_idx, MON_CONFUSED(m_ptr) + 10 + randint0(p_ptr->lev) / 5); } } @@ -1127,7 +1127,7 @@ static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b if (!resists_tele) { msg_format(_("%^sは消えた!", "%^s disappears!"), m_name); - teleport_away(c_ptr->m_idx, 50, TELEPORT_PASSIVE); + teleport_away(g_ptr->m_idx, 50, TELEPORT_PASSIVE); num = num_blow + 1; /* Can't hit it anymore! */ *mdeath = TRUE; } @@ -1150,7 +1150,7 @@ static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b } /* Hack -- Get new monster */ - m_ptr = &m_list[c_ptr->m_idx]; + m_ptr = &m_list[g_ptr->m_idx]; /* Oops, we need a different name... */ monster_desc(m_name, m_ptr, 0); @@ -1161,7 +1161,7 @@ static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b } else if (o_ptr->name1 == ART_G_HAMMER) { - monster_type *target_ptr = &m_list[c_ptr->m_idx]; + monster_type *target_ptr = &m_list[g_ptr->m_idx]; if (target_ptr->hold_o_idx) { @@ -1324,8 +1324,8 @@ bool py_attack(POSITION y, POSITION x, BIT_FLAGS mode) bool mdeath = FALSE; bool stormbringer = FALSE; - grid_type *c_ptr = &grid_array[y][x]; - monster_type *m_ptr = &m_list[c_ptr->m_idx]; + grid_type *g_ptr = &grid_array[y][x]; + monster_type *m_ptr = &m_list[g_ptr->m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; GAME_TEXT m_name[MAX_NLEN]; @@ -1350,7 +1350,7 @@ bool py_attack(POSITION y, POSITION x, BIT_FLAGS mode) if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx); /* Track a new monster */ - health_track(c_ptr->m_idx); + health_track(g_ptr->m_idx); } if ((r_ptr->flags1 & RF1_FEMALE) && @@ -1411,7 +1411,7 @@ bool py_attack(POSITION y, POSITION x, BIT_FLAGS mode) msg_format(_("そっちには何か恐いものがいる!", "There is something scary in your way!")); /* Disturb the monster */ - (void)set_monster_csleep(c_ptr->m_idx, 0); + (void)set_monster_csleep(g_ptr->m_idx, 0); return FALSE; } @@ -1467,7 +1467,7 @@ bool py_attack(POSITION y, POSITION x, BIT_FLAGS mode) } } - riding_t_m_idx = c_ptr->m_idx; + riding_t_m_idx = g_ptr->m_idx; if (p_ptr->migite) py_attack_aux(y, x, &fear, &mdeath, 0, mode); if (p_ptr->hidarite && !mdeath) py_attack_aux(y, x, &fear, &mdeath, 1, mode); @@ -1475,15 +1475,15 @@ bool py_attack(POSITION y, POSITION x, BIT_FLAGS mode) if (!mdeath) { if ((p_ptr->muta2 & MUT2_HORNS) && !mdeath) - natural_attack(c_ptr->m_idx, MUT2_HORNS, &fear, &mdeath); + natural_attack(g_ptr->m_idx, MUT2_HORNS, &fear, &mdeath); if ((p_ptr->muta2 & MUT2_BEAK) && !mdeath) - natural_attack(c_ptr->m_idx, MUT2_BEAK, &fear, &mdeath); + natural_attack(g_ptr->m_idx, MUT2_BEAK, &fear, &mdeath); if ((p_ptr->muta2 & MUT2_SCOR_TAIL) && !mdeath) - natural_attack(c_ptr->m_idx, MUT2_SCOR_TAIL, &fear, &mdeath); + natural_attack(g_ptr->m_idx, MUT2_SCOR_TAIL, &fear, &mdeath); if ((p_ptr->muta2 & MUT2_TRUNK) && !mdeath) - natural_attack(c_ptr->m_idx, MUT2_TRUNK, &fear, &mdeath); + natural_attack(g_ptr->m_idx, MUT2_TRUNK, &fear, &mdeath); if ((p_ptr->muta2 & MUT2_TENTACLES) && !mdeath) - natural_attack(c_ptr->m_idx, MUT2_TENTACLES, &fear, &mdeath); + natural_attack(g_ptr->m_idx, MUT2_TENTACLES, &fear, &mdeath); } /* Hack -- delay fear messages */ diff --git a/src/mind.c b/src/mind.c index ce179fcaa..a9c5e87bf 100644 --- a/src/mind.c +++ b/src/mind.c @@ -1644,10 +1644,10 @@ 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 = &grid_array[ny][nx]; + grid_type *g_ptr = &grid_array[ny][nx]; if (in_bounds(ny, nx) && cave_empty_bold(ny, nx) && - !(c_ptr->info & CAVE_OBJECT) && + !(g_ptr->info & CAVE_OBJECT) && !pattern_tile(ny, nx)) { ty = ny; diff --git a/src/monster-process.c b/src/monster-process.c index 5df69c21a..ef776e6df 100644 --- a/src/monster-process.c +++ b/src/monster-process.c @@ -472,7 +472,7 @@ static bool get_moves_aux2(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp) int i, best = 999; POSITION y, x, y1, x1; - grid_type *c_ptr; + grid_type *g_ptr; bool can_open_door = FALSE; int now_cost; @@ -510,15 +510,15 @@ 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 = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; - cost = c_ptr->cost; + cost = g_ptr->cost; /* Monster cannot kill or pass walls */ if (!(((r_ptr->flags2 & RF2_PASS_WALL) && ((m_idx != p_ptr->riding) || p_ptr->pass_wall)) || ((r_ptr->flags2 & RF2_KILL_WALL) && (m_idx != p_ptr->riding)))) { if (cost == 0) continue; - if (!can_open_door && is_closed_door(c_ptr->feat)) continue; + if (!can_open_door && is_closed_door(g_ptr->feat)) continue; } /* Hack -- for kill or pass wall monster.. */ @@ -577,7 +577,7 @@ static bool get_moves_aux(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp, bool no int i, best; POSITION y, x, y1, x1; - grid_type *c_ptr; + grid_type *g_ptr; bool use_scent = FALSE; monster_type *m_ptr = &m_list[m_idx]; @@ -607,19 +607,19 @@ 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 = &grid_array[y1][x1]; + g_ptr = &grid_array[y1][x1]; /* If we can hear noises, advance towards them */ - if (c_ptr->cost) + if (g_ptr->cost) { best = 999; } /* Otherwise, try to follow a scent trail */ - else if (c_ptr->when) + else if (g_ptr->when) { /* Too old smell */ - if (grid_array[p_ptr->y][p_ptr->x].when - c_ptr->when > 127) return (FALSE); + if (grid_array[p_ptr->y][p_ptr->x].when - g_ptr->when > 127) return (FALSE); use_scent = TRUE; best = 0; @@ -640,12 +640,12 @@ 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 = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* We're following a scent trail */ if (use_scent) { - int when = c_ptr->when; + int when = g_ptr->when; /* Accept younger scent */ if (best > when) continue; @@ -658,8 +658,8 @@ static bool get_moves_aux(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp, bool no int cost; if (r_ptr->flags2 & (RF2_BASH_DOOR | RF2_OPEN_DOOR)) - cost = c_ptr->dist; - else cost = c_ptr->cost; + cost = g_ptr->dist; + else cost = g_ptr->cost; /* Accept louder sounds */ if ((cost == 0) || (best < cost)) continue; @@ -895,7 +895,7 @@ static bool find_safety(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp) POSITION *y_offsets; POSITION *x_offsets; - grid_type *c_ptr; + grid_type *g_ptr; /* Start with adjacent locations, spread further */ for (d = 1; d < 10; d++) @@ -915,19 +915,19 @@ static bool find_safety(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp) /* Skip illegal locations */ if (!in_bounds(y, x)) continue; - c_ptr = &grid_array[y][x]; + g_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; + if (!monster_can_cross_terrain(g_ptr->feat, &r_info[m_ptr->r_idx], (m_idx == p_ptr->riding) ? CEM_RIDING : 0)) continue; /* Check for "availability" (if monsters can flow) */ if (!(m_ptr->mflag2 & MFLAG2_NOFLOW)) { /* Ignore grids very far from the player */ - if (c_ptr->dist == 0) continue; + if (g_ptr->dist == 0) continue; /* Ignore too-distant grids */ - if (c_ptr->dist > grid_array[fy][fx].dist + 2 * d) continue; + if (g_ptr->dist > grid_array[fy][fx].dist + 2 * d) continue; } /* Check for absence of shot (more or less) */ @@ -1060,7 +1060,7 @@ static bool get_moves(MONSTER_IDX m_idx, DIRECTION *mm) POSITION x2 = p_ptr->x; bool done = FALSE; bool will_run = mon_will_run(m_idx); - grid_type *c_ptr; + grid_type *g_ptr; 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)); @@ -1104,10 +1104,10 @@ static bool get_moves(MONSTER_IDX m_idx, DIRECTION *mm) if (!in_bounds2(yy, xx)) continue; - c_ptr = &grid_array[yy][xx]; + g_ptr = &grid_array[yy][xx]; /* Check grid */ - if (monster_can_cross_terrain(c_ptr->feat, r_ptr, 0)) + if (monster_can_cross_terrain(g_ptr->feat, r_ptr, 0)) { /* One more room grid */ room++; @@ -2084,7 +2084,7 @@ void process_monster(MONSTER_IDX m_idx) DIRECTION mm[8]; - grid_type *c_ptr; + grid_type *g_ptr; feature_type *f_ptr; monster_type *y_ptr; @@ -2620,12 +2620,12 @@ void process_monster(MONSTER_IDX m_idx) if (!in_bounds2(ny, nx)) continue; /* 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); + g_ptr = &grid_array[ny][nx]; + f_ptr = &f_info[g_ptr->feat]; + can_cross = monster_can_cross_terrain(g_ptr->feat, r_ptr, is_riding_mon ? CEM_RIDING : 0); /* Access that grid's contents */ - y_ptr = &m_list[c_ptr->m_idx]; + y_ptr = &m_list[g_ptr->m_idx]; /* Hack -- player 'in' wall */ if (player_bold(ny, nx)) @@ -2634,7 +2634,7 @@ void process_monster(MONSTER_IDX m_idx) } /* Possibly a monster to attack */ - else if (c_ptr->m_idx) + else if (g_ptr->m_idx) { do_move = TRUE; } @@ -2669,7 +2669,7 @@ void process_monster(MONSTER_IDX m_idx) } /* Handle doors and secret doors */ - else if (is_closed_door(c_ptr->feat)) + else if (is_closed_door(g_ptr->feat)) { bool may_bash = TRUE; @@ -2738,7 +2738,7 @@ void process_monster(MONSTER_IDX m_idx) if (did_open_door || did_bash_door) { /* Break down the door */ - if (did_bash_door && ((randint0(100) < 50) || (feat_state(c_ptr->feat, FF_OPEN) == c_ptr->feat) || have_flag(f_ptr->flags, FF_GLASS))) + if (did_bash_door && ((randint0(100) < 50) || (feat_state(g_ptr->feat, FF_OPEN) == g_ptr->feat) || have_flag(f_ptr->flags, FF_GLASS))) { cave_alter_feat(ny, nx, FF_BASH); @@ -2759,7 +2759,7 @@ void process_monster(MONSTER_IDX m_idx) cave_alter_feat(ny, nx, FF_OPEN); } - f_ptr = &f_info[c_ptr->feat]; + f_ptr = &f_info[g_ptr->feat]; /* Handle viewable doors */ do_view = TRUE; @@ -2767,7 +2767,7 @@ void process_monster(MONSTER_IDX m_idx) } /* Hack -- check for Glyph of Warding */ - if (do_move && is_glyph_grid(c_ptr) && + if (do_move && is_glyph_grid(g_ptr) && !((r_ptr->flags1 & RF1_NEVER_BLOW) && player_bold(ny, nx))) { /* Assume no move allowed */ @@ -2777,17 +2777,17 @@ void process_monster(MONSTER_IDX m_idx) if (!is_pet(m_ptr) && (randint1(BREAK_GLYPH) < r_ptr->level)) { /* Describe observable breakage */ - if (c_ptr->info & CAVE_MARK) + if (g_ptr->info & CAVE_MARK) { msg_print(_("守りのルーンが壊れた!", "The rune of protection is broken!")); } /* Forget the rune */ - c_ptr->info &= ~(CAVE_MARK); + g_ptr->info &= ~(CAVE_MARK); /* Break the rune */ - c_ptr->info &= ~(CAVE_OBJECT); - c_ptr->mimic = 0; + g_ptr->info &= ~(CAVE_OBJECT); + g_ptr->mimic = 0; /* Allow movement */ do_move = TRUE; @@ -2795,7 +2795,7 @@ void process_monster(MONSTER_IDX m_idx) note_spot(ny, nx); } } - else if (do_move && is_explosive_rune_grid(c_ptr) && + else if (do_move && is_explosive_rune_grid(g_ptr) && !((r_ptr->flags1 & RF1_NEVER_BLOW) && player_bold(ny, nx))) { /* Assume no move allowed */ @@ -2808,7 +2808,7 @@ void process_monster(MONSTER_IDX m_idx) if (randint1(BREAK_MINOR_GLYPH) > r_ptr->level) { /* Describe observable breakage */ - if (c_ptr->info & CAVE_MARK) + if (g_ptr->info & CAVE_MARK) { msg_print(_("ルーンが爆発した!", "The rune explodes!")); project(0, 2, ny, nx, 2 * (p_ptr->lev + damroll(7, 7)), GF_MANA, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1); @@ -2820,11 +2820,11 @@ void process_monster(MONSTER_IDX m_idx) } /* Forget the rune */ - c_ptr->info &= ~(CAVE_MARK); + g_ptr->info &= ~(CAVE_MARK); /* Break the rune */ - c_ptr->info &= ~(CAVE_OBJECT); - c_ptr->mimic = 0; + g_ptr->info &= ~(CAVE_OBJECT); + g_ptr->mimic = 0; note_spot(ny, nx); lite_spot(ny, nx); @@ -2879,7 +2879,7 @@ void process_monster(MONSTER_IDX m_idx) } /* A monster is in the way */ - if (do_move && c_ptr->m_idx) + if (do_move && g_ptr->m_idx) { monster_race *z_ptr = &r_info[y_ptr->r_idx]; @@ -2889,7 +2889,7 @@ void process_monster(MONSTER_IDX m_idx) /* Attack 'enemies' */ if (((r_ptr->flags2 & RF2_KILL_BODY) && !(r_ptr->flags1 & RF1_NEVER_BLOW) && (r_ptr->mexp * r_ptr->level > z_ptr->mexp * z_ptr->level) && - can_cross && (c_ptr->m_idx != p_ptr->riding)) || + can_cross && (g_ptr->m_idx != p_ptr->riding)) || are_enemies(m_ptr, y_ptr) || MON_CONFUSED(m_ptr)) { if (!(r_ptr->flags1 & RF1_NEVER_BLOW)) @@ -2902,7 +2902,7 @@ void process_monster(MONSTER_IDX m_idx) /* attack */ if (y_ptr->r_idx && (y_ptr->hp >= 0)) { - if (monst_attack_monst(m_idx, c_ptr->m_idx)) return; + if (monst_attack_monst(m_idx, g_ptr->m_idx)) return; /* In anti-melee dungeon, stupid or confused monster takes useless turn */ else if (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MELEE) @@ -2921,7 +2921,7 @@ void process_monster(MONSTER_IDX m_idx) /* Push past weaker monsters (unless leaving a wall) */ 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) && + can_cross && (g_ptr->m_idx != p_ptr->riding) && monster_can_cross_terrain(grid_array[m_ptr->fy][m_ptr->fx].feat, z_ptr, 0)) { /* Allow movement */ @@ -2931,7 +2931,7 @@ void process_monster(MONSTER_IDX m_idx) did_move_body = TRUE; /* Wake up the moved monster */ - (void)set_monster_csleep(c_ptr->m_idx, 0); + (void)set_monster_csleep(g_ptr->m_idx, 0); /* Message */ } @@ -2964,7 +2964,7 @@ void process_monster(MONSTER_IDX m_idx) return; } - f_ptr = &f_info[c_ptr->feat]; + f_ptr = &f_info[g_ptr->feat]; /* Note changes to viewable region */ do_view = TRUE; @@ -2973,7 +2973,7 @@ void process_monster(MONSTER_IDX m_idx) if (must_alter_to_move && (r_ptr->flags7 & RF7_AQUATIC)) { - if (!monster_can_cross_terrain(c_ptr->feat, r_ptr, is_riding_mon ? CEM_RIDING : 0)) + if (!monster_can_cross_terrain(g_ptr->feat, r_ptr, is_riding_mon ? CEM_RIDING : 0)) { /* Assume no move allowed */ do_move = FALSE; @@ -3018,21 +3018,21 @@ void process_monster(MONSTER_IDX m_idx) if (!is_riding_mon) { /* Hack -- Update the old location */ - grid_array[oy][ox].m_idx = c_ptr->m_idx; + grid_array[oy][ox].m_idx = g_ptr->m_idx; /* Mega-Hack -- move the old monster, if any */ - if (c_ptr->m_idx) + if (g_ptr->m_idx) { /* Move the old monster */ y_ptr->fy = oy; y_ptr->fx = ox; /* Update the old monster */ - update_monster(c_ptr->m_idx, TRUE); + update_monster(g_ptr->m_idx, TRUE); } /* Hack -- Update the new location */ - c_ptr->m_idx = m_idx; + g_ptr->m_idx = m_idx; /* Move the monster */ m_ptr->fy = ny; @@ -3059,14 +3059,14 @@ void process_monster(MONSTER_IDX m_idx) } /* Take or Kill objects on the floor */ - if (c_ptr->o_idx && (r_ptr->flags2 & (RF2_TAKE_ITEM | RF2_KILL_ITEM)) && + if (g_ptr->o_idx && (r_ptr->flags2 & (RF2_TAKE_ITEM | RF2_KILL_ITEM)) && (!is_pet(m_ptr) || ((p_ptr->pet_extra_flags & PF_PICKUP_ITEMS) && (r_ptr->flags2 & RF2_TAKE_ITEM)))) { OBJECT_IDX this_o_idx, next_o_idx; bool do_take = (r_ptr->flags2 & RF2_TAKE_ITEM) ? TRUE : FALSE; /* Scan all objects in the grid */ - for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) + for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) { BIT_FLAGS flgs[TR_FLAG_SIZE], flg2 = 0L, flg3 = 0L, flgr = 0L; GAME_TEXT m_name[MAX_NLEN], o_name[MAX_NLEN]; diff --git a/src/monster1.c b/src/monster1.c index ed95e8fcb..82d9aa346 100644 --- a/src/monster1.c +++ b/src/monster1.c @@ -2370,13 +2370,13 @@ 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 = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; /* Player or other monster */ if (player_bold(y, x)) return FALSE; - if (c_ptr->m_idx) return FALSE; + if (g_ptr->m_idx) return FALSE; - return monster_can_cross_terrain(c_ptr->feat, r_ptr, mode); + return monster_can_cross_terrain(g_ptr->feat, r_ptr, mode); } diff --git a/src/monster2.c b/src/monster2.c index bcd99ea37..ab574619d 100644 --- a/src/monster2.c +++ b/src/monster2.c @@ -311,16 +311,16 @@ void delete_monster_idx(MONSTER_IDX i) */ void delete_monster(POSITION y, POSITION x) { - grid_type *c_ptr; + grid_type *g_ptr; /* Paranoia */ if (!in_bounds(y, x)) return; /* Check the grid */ - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Delete the monster (if any) */ - if (c_ptr->m_idx) delete_monster_idx(c_ptr->m_idx); + if (g_ptr->m_idx) delete_monster_idx(g_ptr->m_idx); } @@ -334,7 +334,7 @@ static void compact_monsters_aux(IDX i1, IDX i2) { POSITION y, x; int i; - grid_type *c_ptr; + grid_type *g_ptr; monster_type *m_ptr; OBJECT_IDX this_o_idx, next_o_idx = 0; @@ -348,10 +348,10 @@ static void compact_monsters_aux(IDX i1, IDX i2) x = m_ptr->fx; /* Cave grid */ - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Update the grid_array */ - c_ptr->m_idx = i2; + g_ptr->m_idx = i2; /* Repair objects being carried by monster */ for (this_o_idx = m_ptr->hold_o_idx; this_o_idx; this_o_idx = next_o_idx) @@ -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 = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; monster_type *m_ptr; monster_race *r_ptr = &r_info[r_idx]; concptr name = (r_name + r_ptr->name); @@ -3022,22 +3022,22 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I } } - if (is_glyph_grid(c_ptr)) + if (is_glyph_grid(g_ptr)) { if (randint1(BREAK_GLYPH) < (r_ptr->level+20)) { /* Describe observable breakage */ - if (c_ptr->info & CAVE_MARK) + if (g_ptr->info & CAVE_MARK) { msg_print(_("守りのルーンが壊れた!", "The rune of protection is broken!")); } /* Forget the rune */ - c_ptr->info &= ~(CAVE_MARK); + g_ptr->info &= ~(CAVE_MARK); /* Break the rune */ - c_ptr->info &= ~(CAVE_OBJECT); - c_ptr->mimic = 0; + g_ptr->info &= ~(CAVE_OBJECT); + g_ptr->mimic = 0; note_spot(y, x); } @@ -3049,15 +3049,15 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL) || (r_ptr->level < 10)) mode &= ~PM_KAGE; /* Make a new monster */ - c_ptr->m_idx = m_pop(); - hack_m_idx_ii = c_ptr->m_idx; + g_ptr->m_idx = m_pop(); + hack_m_idx_ii = g_ptr->m_idx; /* Mega-Hack -- catch "failure" */ - if (!c_ptr->m_idx) return (FALSE); + if (!g_ptr->m_idx) return (FALSE); /* Get a new monster record */ - m_ptr = &m_list[c_ptr->m_idx]; + m_ptr = &m_list[g_ptr->m_idx]; /* Save the race */ m_ptr->r_idx = r_idx; @@ -3117,7 +3117,7 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I if (r_ptr->flags7 & RF7_CHAMELEON) { - choose_new_monster(c_ptr->m_idx, TRUE, 0); + choose_new_monster(g_ptr->m_idx, TRUE, 0); r_ptr = &r_info[m_ptr->r_idx]; m_ptr->mflag2 |= MFLAG2_CHAMELEON; @@ -3155,7 +3155,7 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I if ((mode & PM_ALLOW_SLEEP) && r_ptr->sleep && !ironman_nightmare) { int val = r_ptr->sleep; - (void)set_monster_csleep(c_ptr->m_idx, (val * 2) + randint1(val * 10)); + (void)set_monster_csleep(g_ptr->m_idx, (val * 2) + randint1(val * 10)); } /* Assign maximal hitpoints */ @@ -3191,7 +3191,7 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I /* Extract the monster base speed */ m_ptr->mspeed = get_mspeed(r_ptr); - if (mode & PM_HASTE) (void)set_monster_fast(c_ptr->m_idx, 100); + if (mode & PM_HASTE) (void)set_monster_fast(g_ptr->m_idx, 100); /* Give a random starting energy */ if (!ironman_nightmare) @@ -3215,7 +3215,7 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I } /* Hack -- see "process_monsters()" */ - if (c_ptr->m_idx < hack_m_idx) + if (g_ptr->m_idx < hack_m_idx) { /* Monster is still being born */ m_ptr->mflag |= (MFLAG_BORN); @@ -3226,7 +3226,7 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I p_ptr->update |= (PU_MON_LITE); else if ((r_ptr->flags7 & RF7_HAS_LD_MASK) && !MON_CSLEEP(m_ptr)) p_ptr->update |= (PU_MON_LITE); - update_monster(c_ptr->m_idx, TRUE); + update_monster(g_ptr->m_idx, TRUE); /* Count the monsters on the level */ @@ -3284,13 +3284,13 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I } } - if (is_explosive_rune_grid(c_ptr)) + if (is_explosive_rune_grid(g_ptr)) { /* Break the ward */ if (randint1(BREAK_MINOR_GLYPH) > r_ptr->level) { /* Describe observable breakage */ - if (c_ptr->info & CAVE_MARK) + if (g_ptr->info & CAVE_MARK) { msg_print(_("ルーンが爆発した!", "The rune explodes!")); project(0, 2, y, x, 2 * (p_ptr->lev + damroll(7, 7)), GF_MANA, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1); @@ -3302,11 +3302,11 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I } /* Forget the rune */ - c_ptr->info &= ~(CAVE_MARK); + g_ptr->info &= ~(CAVE_MARK); /* Break the rune */ - c_ptr->info &= ~(CAVE_OBJECT); - c_ptr->mimic = 0; + g_ptr->info &= ~(CAVE_OBJECT); + g_ptr->mimic = 0; note_spot(y, x); lite_spot(y, x); diff --git a/src/mspells1.c b/src/mspells1.c index 87dce4e69..558be8781 100644 --- a/src/mspells1.c +++ b/src/mspells1.c @@ -404,7 +404,7 @@ bool raise_possible(monster_type *m_ptr) POSITION y = m_ptr->fy; POSITION x = m_ptr->fx; OBJECT_IDX this_o_idx, next_o_idx = 0; - grid_type *c_ptr; + grid_type *g_ptr; for (xx = x - 5; xx <= x + 5; xx++) { @@ -414,9 +414,9 @@ bool raise_possible(monster_type *m_ptr) if (!los(y, x, yy, xx)) continue; if (!projectable(y, x, yy, xx)) continue; - c_ptr = &grid_array[yy][xx]; + g_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) + for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) { object_type *o_ptr = &o_list[this_o_idx]; @@ -1257,13 +1257,13 @@ static bool adjacent_grid_check(monster_type *m_ptr, POSITION *yp, POSITION *xp, { int next_x = *xp + tonari_x[tonari][i]; int next_y = *yp + tonari_y[tonari][i]; - grid_type *c_ptr; + grid_type *g_ptr; /* Access the next grid */ - c_ptr = &grid_array[next_y][next_x]; + g_ptr = &grid_array[next_y][next_x]; /* Skip this feature */ - if (!cave_have_flag_grid(c_ptr, f_flag)) continue; + if (!cave_have_flag_grid(g_ptr, f_flag)) continue; if (path_check(m_ptr->fy, m_ptr->fx, next_y, next_x)) { diff --git a/src/mutation.c b/src/mutation.c index 02fefc884..9e1725219 100644 --- a/src/mutation.c +++ b/src/mutation.c @@ -2281,22 +2281,22 @@ bool mutation_power_aux(int power) case MUT1_BANISH: { POSITION x, y; - grid_type *c_ptr; + grid_type *g_ptr; monster_type *m_ptr; monster_race *r_ptr; if (!get_direction(&dir, FALSE, FALSE)) return FALSE; y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; - if (!c_ptr->m_idx) + if (!g_ptr->m_idx) { msg_print(_("邪悪な存在を感じとれません!", "You sense no evil there!")); break; } - m_ptr = &m_list[c_ptr->m_idx]; + m_ptr = &m_list[g_ptr->m_idx]; r_ptr = &r_info[m_ptr->r_idx]; if ((r_ptr->flags3 & RF3_EVIL) && @@ -2313,7 +2313,7 @@ bool mutation_power_aux(int power) do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_GENOCIDE, m_name); } /* Delete the monster, rather than killing it. */ - delete_monster_idx(c_ptr->m_idx); + delete_monster_idx(g_ptr->m_idx); msg_print(_("その邪悪なモンスターは硫黄臭い煙とともに消え去った!", "The evil creature vanishes in a puff of sulfurous smoke!")); } @@ -2328,12 +2328,12 @@ bool mutation_power_aux(int power) case MUT1_COLD_TOUCH: { POSITION x, y; - grid_type *c_ptr; + grid_type *g_ptr; if (!get_direction(&dir, FALSE, FALSE)) return FALSE; y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - c_ptr = &grid_array[y][x]; - if (!c_ptr->m_idx) + g_ptr = &grid_array[y][x]; + if (!g_ptr->m_idx) { msg_print(_("あなたは何もない場所で手を振った。", "You wave your hands in the air.")); diff --git a/src/object1.c b/src/object1.c index 0ea7d0865..6c29b9f12 100644 --- a/src/object1.c +++ b/src/object1.c @@ -4368,12 +4368,12 @@ bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode) { int i; OBJECT_IDX o_idx; - grid_type *c_ptr = &grid_array[p_ptr->y][p_ptr->x]; + grid_type *g_ptr = &grid_array[p_ptr->y][p_ptr->x]; if (command_wrk != (USE_FLOOR)) break; /* Get the object being moved. */ - o_idx = c_ptr->o_idx; + o_idx = g_ptr->o_idx; /* Only rotate a pile of two or more objects. */ if (!(o_idx && o_list[o_idx].next_o_idx)) break; @@ -4382,7 +4382,7 @@ bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode) excise_object_idx(o_idx); /* Find end of the list. */ - i = c_ptr->o_idx; + i = g_ptr->o_idx; while (o_list[i].next_o_idx) i = o_list[i].next_o_idx; diff --git a/src/object2.c b/src/object2.c index f724a572f..aa32d8aa6 100644 --- a/src/object2.c +++ b/src/object2.c @@ -123,15 +123,15 @@ void excise_object_idx(OBJECT_IDX o_idx) /* Dungeon */ else { - grid_type *c_ptr; + grid_type *g_ptr; POSITION y = j_ptr->iy; POSITION x = j_ptr->ix; - c_ptr = &grid_array[y][x]; + g_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) + for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) { object_type *o_ptr; o_ptr = &o_list[this_o_idx]; @@ -145,7 +145,7 @@ void excise_object_idx(OBJECT_IDX o_idx) if (prev_o_idx == 0) { /* Remove from list */ - c_ptr->o_idx = next_o_idx; + g_ptr->o_idx = next_o_idx; } /* Real previous */ @@ -217,16 +217,16 @@ void delete_object_idx(OBJECT_IDX o_idx) */ void delete_object(POSITION y, POSITION x) { - grid_type *c_ptr; + grid_type *g_ptr; OBJECT_IDX this_o_idx, next_o_idx = 0; /* Refuse "illegal" locations */ if (!in_bounds(y, x)) return; - c_ptr = &grid_array[y][x]; + g_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) + for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) { object_type *o_ptr; o_ptr = &o_list[this_o_idx]; @@ -240,7 +240,7 @@ void delete_object(POSITION y, POSITION x) } /* Objects are gone */ - c_ptr->o_idx = 0; + g_ptr->o_idx = 0; /* Visual update */ lite_spot(y, x); @@ -257,7 +257,7 @@ void delete_object(POSITION y, POSITION x) static void compact_objects_aux(OBJECT_IDX i1, OBJECT_IDX i2) { OBJECT_IDX i; - grid_type *c_ptr; + grid_type *g_ptr; object_type *o_ptr; /* Do nothing */ @@ -306,13 +306,13 @@ static void compact_objects_aux(OBJECT_IDX i1, OBJECT_IDX i2) x = o_ptr->ix; /* Acquire grid */ - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Repair grid */ - if (c_ptr->o_idx == i1) + if (g_ptr->o_idx == i1) { /* Repair */ - c_ptr->o_idx = i2; + g_ptr->o_idx = i2; } } @@ -442,7 +442,7 @@ void compact_objects(int size) * Delete all the items when player leaves the level * @note we do NOT visually reflect these (irrelevant) changes * @details - * Hack -- we clear the "c_ptr->o_idx" field for every grid, + * Hack -- we clear the "g_ptr->o_idx" field for every grid, * and the "m_ptr->next_o_idx" field for every monster, since * we know we are clearing every object. Technically, we only * clear those fields for grids/monsters containing objects, @@ -487,17 +487,17 @@ void wipe_o_list(void) /* Dungeon */ else { - grid_type *c_ptr; + grid_type *g_ptr; /* Access location */ POSITION y = o_ptr->iy; POSITION x = o_ptr->ix; /* Access grid */ - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Hack -- see above */ - c_ptr->o_idx = 0; + g_ptr->o_idx = 0; } object_wipe(o_ptr); } @@ -4868,7 +4868,7 @@ void place_object(POSITION y, POSITION x, BIT_FLAGS mode) OBJECT_IDX o_idx; /* Acquire grid */ - grid_type *c_ptr = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; object_type forge; object_type *q_ptr; @@ -4881,7 +4881,7 @@ void place_object(POSITION y, POSITION x, BIT_FLAGS mode) if (!cave_drop_bold(y, x)) return; /* Avoid stacking on other objects */ - if (c_ptr->o_idx) return; + if (g_ptr->o_idx) return; q_ptr = &forge; object_wipe(q_ptr); @@ -4906,10 +4906,10 @@ void place_object(POSITION y, POSITION x, BIT_FLAGS mode) o_ptr->ix = x; /* Build a stack */ - o_ptr->next_o_idx = c_ptr->o_idx; + o_ptr->next_o_idx = g_ptr->o_idx; /* Place the object */ - c_ptr->o_idx = o_idx; + g_ptr->o_idx = o_idx; note_spot(y, x); @@ -4982,7 +4982,7 @@ void place_gold(POSITION y, POSITION x) OBJECT_IDX o_idx; /* Acquire grid */ - grid_type *c_ptr = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; object_type forge; object_type *q_ptr; @@ -4995,7 +4995,7 @@ void place_gold(POSITION y, POSITION x) if (!cave_drop_bold(y, x)) return; /* Avoid stacking on other objects */ - if (c_ptr->o_idx) return; + if (g_ptr->o_idx) return; q_ptr = &forge; object_wipe(q_ptr); @@ -5020,10 +5020,10 @@ void place_gold(POSITION y, POSITION x) o_ptr->ix = x; /* Build a stack */ - o_ptr->next_o_idx = c_ptr->o_idx; + o_ptr->next_o_idx = g_ptr->o_idx; /* Place the object */ - c_ptr->o_idx = o_idx; + g_ptr->o_idx = o_idx; note_spot(y, x); @@ -5066,7 +5066,7 @@ OBJECT_IDX drop_near(object_type *j_ptr, PERCENTAGE chance, POSITION y, POSITION OBJECT_IDX o_idx = 0; OBJECT_IDX this_o_idx, next_o_idx = 0; - grid_type *c_ptr; + grid_type *g_ptr; GAME_TEXT o_name[MAX_NLEN]; @@ -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 = &grid_array[ty][tx]; + g_ptr = &grid_array[ty][tx]; /* Require floor space */ if (!cave_drop_bold(ty, tx)) continue; @@ -5141,7 +5141,7 @@ OBJECT_IDX drop_near(object_type *j_ptr, PERCENTAGE chance, POSITION y, POSITION k = 0; /* Scan objects in that grid */ - for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) + for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) { object_type *o_ptr; o_ptr = &o_list[this_o_idx]; @@ -5289,10 +5289,10 @@ OBJECT_IDX drop_near(object_type *j_ptr, PERCENTAGE chance, POSITION y, POSITION } - c_ptr = &grid_array[by][bx]; + g_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) + for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) { object_type *o_ptr; o_ptr = &o_list[this_o_idx]; @@ -5353,10 +5353,10 @@ OBJECT_IDX drop_near(object_type *j_ptr, PERCENTAGE chance, POSITION y, POSITION j_ptr->held_m_idx = 0; /* Build a stack */ - j_ptr->next_o_idx = c_ptr->o_idx; + j_ptr->next_o_idx = g_ptr->o_idx; /* Place the object */ - c_ptr->o_idx = o_idx; + g_ptr->o_idx = o_idx; /* Success */ done = TRUE; @@ -6699,7 +6699,7 @@ static int blow_damcalc(monster_type *m_ptr, monster_blow *blow_ptr) bool process_warning(POSITION xx, POSITION yy) { POSITION mx, my; - grid_type *c_ptr; + grid_type *g_ptr; GAME_TEXT o_name[MAX_NLEN]; #define WARNING_AWARE_RANGE 12 @@ -6716,11 +6716,11 @@ bool process_warning(POSITION xx, POSITION yy) if (!in_bounds(my, mx) || (distance(my, mx, yy, xx) > WARNING_AWARE_RANGE)) continue; - c_ptr = &grid_array[my][mx]; + g_ptr = &grid_array[my][mx]; - if (!c_ptr->m_idx) continue; + if (!g_ptr->m_idx) continue; - m_ptr = &m_list[c_ptr->m_idx]; + m_ptr = &m_list[g_ptr->m_idx]; if (MON_CSLEEP(m_ptr)) continue; if (!is_hostile(m_ptr)) continue; @@ -6736,36 +6736,36 @@ bool process_warning(POSITION xx, POSITION yy) if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC)) { - if (f4 & RF4_BA_CHAO) spell_damcalc_by_spellnum(MS_BALL_CHAOS, GF_CHAOS, c_ptr->m_idx, &dam_max0); - if (f5 & RF5_BA_MANA) spell_damcalc_by_spellnum(MS_BALL_MANA, GF_MANA, c_ptr->m_idx, &dam_max0); - if (f5 & RF5_BA_DARK) spell_damcalc_by_spellnum(MS_BALL_DARK, GF_DARK, c_ptr->m_idx, &dam_max0); - if (f5 & RF5_BA_LITE) spell_damcalc_by_spellnum(MS_STARBURST, GF_LITE, c_ptr->m_idx, &dam_max0); - if (f6 & RF6_HAND_DOOM) spell_damcalc_by_spellnum(MS_HAND_DOOM, GF_HAND_DOOM, c_ptr->m_idx, &dam_max0); - if (f6 & RF6_PSY_SPEAR) spell_damcalc_by_spellnum(MS_PSY_SPEAR, GF_PSY_SPEAR, c_ptr->m_idx, &dam_max0); + if (f4 & RF4_BA_CHAO) spell_damcalc_by_spellnum(MS_BALL_CHAOS, GF_CHAOS, g_ptr->m_idx, &dam_max0); + if (f5 & RF5_BA_MANA) spell_damcalc_by_spellnum(MS_BALL_MANA, GF_MANA, g_ptr->m_idx, &dam_max0); + if (f5 & RF5_BA_DARK) spell_damcalc_by_spellnum(MS_BALL_DARK, GF_DARK, g_ptr->m_idx, &dam_max0); + if (f5 & RF5_BA_LITE) spell_damcalc_by_spellnum(MS_STARBURST, GF_LITE, g_ptr->m_idx, &dam_max0); + if (f6 & RF6_HAND_DOOM) spell_damcalc_by_spellnum(MS_HAND_DOOM, GF_HAND_DOOM, g_ptr->m_idx, &dam_max0); + if (f6 & RF6_PSY_SPEAR) spell_damcalc_by_spellnum(MS_PSY_SPEAR, GF_PSY_SPEAR, g_ptr->m_idx, &dam_max0); } - if (f4 & RF4_ROCKET) spell_damcalc_by_spellnum(MS_ROCKET, GF_ROCKET, c_ptr->m_idx, &dam_max0); - if (f4 & RF4_BR_ACID) spell_damcalc_by_spellnum(MS_BR_ACID, GF_ACID, c_ptr->m_idx, &dam_max0); - if (f4 & RF4_BR_ELEC) spell_damcalc_by_spellnum(MS_BR_ELEC, GF_ELEC, c_ptr->m_idx, &dam_max0); - if (f4 & RF4_BR_FIRE) spell_damcalc_by_spellnum(MS_BR_FIRE, GF_FIRE, c_ptr->m_idx, &dam_max0); - if (f4 & RF4_BR_COLD) spell_damcalc_by_spellnum(MS_BR_COLD, GF_COLD, c_ptr->m_idx, &dam_max0); - if (f4 & RF4_BR_POIS) spell_damcalc_by_spellnum(MS_BR_POIS, GF_POIS, c_ptr->m_idx, &dam_max0); - if (f4 & RF4_BR_NETH) spell_damcalc_by_spellnum(MS_BR_NETHER, GF_NETHER, c_ptr->m_idx, &dam_max0); - if (f4 & RF4_BR_LITE) spell_damcalc_by_spellnum(MS_BR_LITE, GF_LITE, c_ptr->m_idx, &dam_max0); - if (f4 & RF4_BR_DARK) spell_damcalc_by_spellnum(MS_BR_DARK, GF_DARK, c_ptr->m_idx, &dam_max0); - if (f4 & RF4_BR_CONF) spell_damcalc_by_spellnum(MS_BR_CONF, GF_CONFUSION, c_ptr->m_idx, &dam_max0); - if (f4 & RF4_BR_SOUN) spell_damcalc_by_spellnum(MS_BR_SOUND, GF_SOUND, c_ptr->m_idx, &dam_max0); - if (f4 & RF4_BR_CHAO) spell_damcalc_by_spellnum(MS_BR_CHAOS, GF_CHAOS, c_ptr->m_idx, &dam_max0); - if (f4 & RF4_BR_DISE) spell_damcalc_by_spellnum(MS_BR_DISEN, GF_DISENCHANT, c_ptr->m_idx, &dam_max0); - if (f4 & RF4_BR_NEXU) spell_damcalc_by_spellnum(MS_BR_NEXUS, GF_NEXUS, c_ptr->m_idx, &dam_max0); - if (f4 & RF4_BR_TIME) spell_damcalc_by_spellnum(MS_BR_TIME, GF_TIME, c_ptr->m_idx, &dam_max0); - if (f4 & RF4_BR_INER) spell_damcalc_by_spellnum(MS_BR_INERTIA, GF_INERTIAL, c_ptr->m_idx, &dam_max0); - if (f4 & RF4_BR_GRAV) spell_damcalc_by_spellnum(MS_BR_GRAVITY, GF_GRAVITY, c_ptr->m_idx, &dam_max0); - if (f4 & RF4_BR_SHAR) spell_damcalc_by_spellnum(MS_BR_SHARDS, GF_SHARDS, c_ptr->m_idx, &dam_max0); - if (f4 & RF4_BR_PLAS) spell_damcalc_by_spellnum(MS_BR_PLASMA, GF_PLASMA, c_ptr->m_idx, &dam_max0); - if (f4 & RF4_BR_WALL) spell_damcalc_by_spellnum(MS_BR_FORCE, GF_FORCE, c_ptr->m_idx, &dam_max0); - if (f4 & RF4_BR_MANA) spell_damcalc_by_spellnum(MS_BR_MANA, GF_MANA, c_ptr->m_idx, &dam_max0); - if (f4 & RF4_BR_NUKE) spell_damcalc_by_spellnum(MS_BR_NUKE, GF_NUKE, c_ptr->m_idx, &dam_max0); - if (f4 & RF4_BR_DISI) spell_damcalc_by_spellnum(MS_BR_DISI, GF_DISINTEGRATE, c_ptr->m_idx, &dam_max0); + if (f4 & RF4_ROCKET) spell_damcalc_by_spellnum(MS_ROCKET, GF_ROCKET, g_ptr->m_idx, &dam_max0); + if (f4 & RF4_BR_ACID) spell_damcalc_by_spellnum(MS_BR_ACID, GF_ACID, g_ptr->m_idx, &dam_max0); + if (f4 & RF4_BR_ELEC) spell_damcalc_by_spellnum(MS_BR_ELEC, GF_ELEC, g_ptr->m_idx, &dam_max0); + if (f4 & RF4_BR_FIRE) spell_damcalc_by_spellnum(MS_BR_FIRE, GF_FIRE, g_ptr->m_idx, &dam_max0); + if (f4 & RF4_BR_COLD) spell_damcalc_by_spellnum(MS_BR_COLD, GF_COLD, g_ptr->m_idx, &dam_max0); + if (f4 & RF4_BR_POIS) spell_damcalc_by_spellnum(MS_BR_POIS, GF_POIS, g_ptr->m_idx, &dam_max0); + if (f4 & RF4_BR_NETH) spell_damcalc_by_spellnum(MS_BR_NETHER, GF_NETHER, g_ptr->m_idx, &dam_max0); + if (f4 & RF4_BR_LITE) spell_damcalc_by_spellnum(MS_BR_LITE, GF_LITE, g_ptr->m_idx, &dam_max0); + if (f4 & RF4_BR_DARK) spell_damcalc_by_spellnum(MS_BR_DARK, GF_DARK, g_ptr->m_idx, &dam_max0); + if (f4 & RF4_BR_CONF) spell_damcalc_by_spellnum(MS_BR_CONF, GF_CONFUSION, g_ptr->m_idx, &dam_max0); + if (f4 & RF4_BR_SOUN) spell_damcalc_by_spellnum(MS_BR_SOUND, GF_SOUND, g_ptr->m_idx, &dam_max0); + if (f4 & RF4_BR_CHAO) spell_damcalc_by_spellnum(MS_BR_CHAOS, GF_CHAOS, g_ptr->m_idx, &dam_max0); + if (f4 & RF4_BR_DISE) spell_damcalc_by_spellnum(MS_BR_DISEN, GF_DISENCHANT, g_ptr->m_idx, &dam_max0); + if (f4 & RF4_BR_NEXU) spell_damcalc_by_spellnum(MS_BR_NEXUS, GF_NEXUS, g_ptr->m_idx, &dam_max0); + if (f4 & RF4_BR_TIME) spell_damcalc_by_spellnum(MS_BR_TIME, GF_TIME, g_ptr->m_idx, &dam_max0); + if (f4 & RF4_BR_INER) spell_damcalc_by_spellnum(MS_BR_INERTIA, GF_INERTIAL, g_ptr->m_idx, &dam_max0); + if (f4 & RF4_BR_GRAV) spell_damcalc_by_spellnum(MS_BR_GRAVITY, GF_GRAVITY, g_ptr->m_idx, &dam_max0); + if (f4 & RF4_BR_SHAR) spell_damcalc_by_spellnum(MS_BR_SHARDS, GF_SHARDS, g_ptr->m_idx, &dam_max0); + if (f4 & RF4_BR_PLAS) spell_damcalc_by_spellnum(MS_BR_PLASMA, GF_PLASMA, g_ptr->m_idx, &dam_max0); + if (f4 & RF4_BR_WALL) spell_damcalc_by_spellnum(MS_BR_FORCE, GF_FORCE, g_ptr->m_idx, &dam_max0); + if (f4 & RF4_BR_MANA) spell_damcalc_by_spellnum(MS_BR_MANA, GF_MANA, g_ptr->m_idx, &dam_max0); + if (f4 & RF4_BR_NUKE) spell_damcalc_by_spellnum(MS_BR_NUKE, GF_NUKE, g_ptr->m_idx, &dam_max0); + if (f4 & RF4_BR_DISI) spell_damcalc_by_spellnum(MS_BR_DISI, GF_DISINTEGRATE, g_ptr->m_idx, &dam_max0); } /* Monster melee attacks */ @@ -6814,9 +6814,9 @@ bool process_warning(POSITION xx, POSITION yy) } else old_damage = old_damage / 2; - 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)) + g_ptr = &grid_array[yy][xx]; + if (((!easy_disarm && is_trap(g_ptr->feat)) + || (g_ptr->mimic && is_trap(g_ptr->feat))) && !one_in_(13)) { object_type *o_ptr = choose_warning_item(); diff --git a/src/player-move.c b/src/player-move.c index 7cd8477d8..fd2e7b365 100644 --- a/src/player-move.c +++ b/src/player-move.c @@ -360,11 +360,11 @@ HIT_POINT tot_dam_aux(object_type *o_ptr, HIT_POINT tdam, monster_type *m_ptr, B static void discover_hidden_things(POSITION y, POSITION x) { OBJECT_IDX this_o_idx, next_o_idx = 0; - grid_type *c_ptr; - c_ptr = &grid_array[y][x]; + grid_type *g_ptr; + g_ptr = &grid_array[y][x]; /* Invisible trap */ - if (c_ptr->mimic && is_trap(c_ptr->feat)) + if (g_ptr->mimic && is_trap(g_ptr->feat)) { /* Pick a trap */ disclose_grid(y, x); @@ -375,7 +375,7 @@ static void discover_hidden_things(POSITION y, POSITION x) } /* Secret door */ - if (is_hidden_door(c_ptr)) + if (is_hidden_door(g_ptr)) { msg_print(_("隠しドアを発見した。", "You have found a secret door.")); @@ -386,7 +386,7 @@ static void discover_hidden_things(POSITION y, POSITION x) } /* Scan all objects in the grid */ - for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) + for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) { object_type *o_ptr; o_ptr = &o_list[this_o_idx]; @@ -545,7 +545,7 @@ void py_pickup_aux(OBJECT_IDX o_idx) */ void carry(bool pickup) { - grid_type *c_ptr = &grid_array[p_ptr->y][p_ptr->x]; + grid_type *g_ptr = &grid_array[p_ptr->y][p_ptr->x]; OBJECT_IDX this_o_idx, next_o_idx = 0; @@ -560,7 +560,7 @@ void carry(bool pickup) handle_stuff(); /* Automatically pickup/destroy/inscribe items */ - autopick_pickup_items(c_ptr); + autopick_pickup_items(g_ptr); if (easy_floor) { @@ -569,7 +569,7 @@ void carry(bool pickup) } /* Scan the pile of objects */ - for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) + for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) { object_type *o_ptr; o_ptr = &o_list[this_o_idx]; @@ -825,15 +825,15 @@ 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 = &grid_array[ny][nx]; + grid_type *g_ptr = &grid_array[ny][nx]; grid_type *oc_ptr = &grid_array[oy][ox]; - feature_type *f_ptr = &f_info[c_ptr->feat]; + feature_type *f_ptr = &f_info[g_ptr->feat]; feature_type *of_ptr = &f_info[oc_ptr->feat]; if (!(mpe_mode & MPE_STAYING)) { MONSTER_IDX om_idx = oc_ptr->m_idx; - MONSTER_IDX nm_idx = c_ptr->m_idx; + MONSTER_IDX nm_idx = g_ptr->m_idx; p_ptr->y = ny; p_ptr->x = nx; @@ -842,7 +842,7 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode) if (!(mpe_mode & MPE_DONT_SWAP_MON)) { /* Swap two monsters */ - c_ptr->m_idx = om_idx; + g_ptr->m_idx = om_idx; oc_ptr->m_idx = nm_idx; if (om_idx > 0) /* Monster on old spot (or p_ptr->riding) */ @@ -880,7 +880,7 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode) p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); /* Remove "unsafe" flag */ - if ((!p_ptr->blind && !no_lite()) || !is_trap(c_ptr->feat)) c_ptr->info &= ~(CAVE_UNSAFE); + if ((!p_ptr->blind && !no_lite()) || !is_trap(g_ptr->feat)) g_ptr->info &= ~(CAVE_UNSAFE); /* For get everything when requested hehe I'm *NASTY* */ if (dun_level && (d_info[p_ptr->dungeon_idx].flags1 & DF1_FORGET)) wiz_dark(); @@ -888,7 +888,7 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode) if (p_ptr->pclass == CLASS_NINJA) { - if (c_ptr->info & (CAVE_GLOW)) set_superstealth(FALSE); + if (g_ptr->info & (CAVE_GLOW)) set_superstealth(FALSE); else if (p_ptr->cur_lite <= 0) set_superstealth(TRUE); } @@ -977,7 +977,7 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode) leave_quest_check(); - p_ptr->inside_quest = c_ptr->special; + p_ptr->inside_quest = g_ptr->special; dun_level = 0; p_ptr->oldpx = 0; p_ptr->oldpy = 0; @@ -991,7 +991,7 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode) disturb(FALSE, TRUE); /* Hidden trap */ - if (c_ptr->mimic || have_flag(f_ptr->flags, FF_SECRET)) + if (g_ptr->mimic || have_flag(f_ptr->flags, FF_SECRET)) { msg_print(_("トラップだ!", "You found a trap!")); @@ -1007,13 +1007,13 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode) /* Warn when leaving trap detected region */ if (!(mpe_mode & MPE_STAYING) && (disturb_trap_detect || alert_trap_detect) - && p_ptr->dtrap && !(c_ptr->info & CAVE_IN_DETECT)) + && p_ptr->dtrap && !(g_ptr->info & CAVE_IN_DETECT)) { /* No duplicate warning */ p_ptr->dtrap = FALSE; /* You are just on the edge */ - if (!(c_ptr->info & CAVE_UNSAFE)) + if (!(g_ptr->info & CAVE_UNSAFE)) { if (alert_trap_detect) { @@ -1104,9 +1104,9 @@ 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 = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; - feature_type *f_ptr = &f_info[c_ptr->feat]; + feature_type *f_ptr = &f_info[g_ptr->feat]; monster_type *m_ptr; @@ -1115,7 +1115,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap) GAME_TEXT m_name[MAX_NLEN]; - bool p_can_enter = player_can_enter(c_ptr->feat, CEM_P_CAN_ENTER_PATTERN); + bool p_can_enter = player_can_enter(g_ptr->feat, CEM_P_CAN_ENTER_PATTERN); bool p_can_kill_walls = FALSE; bool stormbringer = FALSE; @@ -1128,7 +1128,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap) (y == 0) || (y == MAX_HGT - 1))) { /* Can the player enter the grid? */ - if (c_ptr->mimic && player_can_enter(c_ptr->mimic, 0)) + if (g_ptr->mimic && player_can_enter(g_ptr->mimic, 0)) { /* Hack: move to new area */ if ((y == 0) && (x == 0)) @@ -1210,7 +1210,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap) p_can_enter = FALSE; } - m_ptr = &m_list[c_ptr->m_idx]; + m_ptr = &m_list[g_ptr->m_idx]; if (inventory[INVEN_RARM].name1 == ART_STORMBRINGER) stormbringer = TRUE; if (inventory[INVEN_LARM].name1 == ART_STORMBRINGER) stormbringer = TRUE; @@ -1222,7 +1222,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap) !have_flag(f_ptr->flags, FF_PERMANENT); /* Hack -- attack monsters */ - if (c_ptr->m_idx && (m_ptr->ml || p_can_enter || p_can_kill_walls)) + if (g_ptr->m_idx && (m_ptr->ml || p_can_enter || p_can_kill_walls)) { monster_race *r_ptr = &r_info[m_ptr->r_idx]; @@ -1233,7 +1233,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap) pattern_seq(p_ptr->y, p_ptr->x, y, x) && (p_can_enter || p_can_kill_walls)) { /* Disturb the monster */ - (void)set_monster_csleep(c_ptr->m_idx, 0); + (void)set_monster_csleep(g_ptr->m_idx, 0); /* Extract monster name (or "it") */ monster_desc(m_name, m_ptr, 0); @@ -1244,7 +1244,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap) if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx); /* Track a new monster */ - health_track(c_ptr->m_idx); + health_track(g_ptr->m_idx); } /* displace? */ @@ -1307,7 +1307,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap) !(riding_r_ptr->flags7 & RF7_AQUATIC) && (have_flag(f_ptr->flags, FF_DEEP) || (riding_r_ptr->flags2 & RF2_AURA_FIRE))) { - msg_format(_("%sの上に行けない。", "Can't swim."), f_name + f_info[get_feat_mimic(c_ptr)].name); + msg_format(_("%sの上に行けない。", "Can't swim."), f_name + f_info[get_feat_mimic(g_ptr)].name); free_turn(p_ptr); oktomove = FALSE; disturb(FALSE, TRUE); @@ -1321,7 +1321,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap) } else if (have_flag(f_ptr->flags, FF_LAVA) && !(riding_r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK)) { - msg_format(_("%sの上に行けない。", "Too hot to go through."), f_name + f_info[get_feat_mimic(c_ptr)].name); + msg_format(_("%sの上に行けない。", "Too hot to go through."), f_name + f_info[get_feat_mimic(g_ptr)].name); free_turn(p_ptr); oktomove = FALSE; disturb(FALSE, TRUE); @@ -1343,7 +1343,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap) else if (!have_flag(f_ptr->flags, FF_MOVE) && have_flag(f_ptr->flags, FF_CAN_FLY) && !p_ptr->levitation) { - msg_format(_("空を飛ばないと%sの上には行けない。", "You need to fly to go through the %s."), f_name + f_info[get_feat_mimic(c_ptr)].name); + msg_format(_("空を飛ばないと%sの上には行けない。", "You need to fly to go through the %s."), f_name + f_info[get_feat_mimic(g_ptr)].name); free_turn(p_ptr); running = 0; oktomove = FALSE; @@ -1361,9 +1361,9 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap) /* Disarm a visible trap */ - else if ((do_pickup != easy_disarm) && have_flag(f_ptr->flags, FF_DISARM) && !c_ptr->mimic) + else if ((do_pickup != easy_disarm) && have_flag(f_ptr->flags, FF_DISARM) && !g_ptr->mimic) { - if (!trap_can_be_ignored(c_ptr->feat)) + if (!trap_can_be_ignored(g_ptr->feat)) { (void)do_cmd_disarm_aux(y, x, dir); return; @@ -1375,17 +1375,17 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap) else if (!p_can_enter && !p_can_kill_walls) { /* Feature code (applying "mimic" field) */ - FEAT_IDX feat = get_feat_mimic(c_ptr); + FEAT_IDX feat = get_feat_mimic(g_ptr); feature_type *mimic_f_ptr = &f_info[feat]; concptr name = f_name + mimic_f_ptr->name; oktomove = FALSE; /* Notice things in the dark */ - if (!(c_ptr->info & CAVE_MARK) && !player_can_see_bold(y, x)) + if (!(g_ptr->info & CAVE_MARK) && !player_can_see_bold(y, x)) { /* Boundary floor mimic */ - if (boundary_floor(c_ptr, f_ptr, mimic_f_ptr)) + if (boundary_floor(g_ptr, f_ptr, mimic_f_ptr)) { msg_print(_("それ以上先には進めないようだ。", "You feel you cannot go any more.")); } @@ -1400,7 +1400,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap) is_a_vowel(name[0]) ? "an" : "a", name); #endif - c_ptr->info |= (CAVE_MARK); + g_ptr->info |= (CAVE_MARK); lite_spot(y, x); } } @@ -1409,7 +1409,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap) else { /* Boundary floor mimic */ - if (boundary_floor(c_ptr, f_ptr, mimic_f_ptr)) + if (boundary_floor(g_ptr, f_ptr, mimic_f_ptr)) { msg_print(_("それ以上先には進めない。", "You cannot go any more.")); if (!(p_ptr->confused || p_ptr->stun || p_ptr->image)) @@ -1441,7 +1441,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap) disturb(FALSE, TRUE); - if (!boundary_floor(c_ptr, f_ptr, mimic_f_ptr)) sound(SOUND_HITWALL); + if (!boundary_floor(g_ptr, f_ptr, mimic_f_ptr)) sound(SOUND_HITWALL); } /* Normal movement */ @@ -1518,7 +1518,7 @@ static bool ignore_avoid_run; */ static bool see_wall(DIRECTION dir, POSITION y, POSITION x) { - grid_type *c_ptr; + grid_type *g_ptr; /* Get the new location */ y += ddy[dir]; @@ -1528,13 +1528,13 @@ static bool see_wall(DIRECTION dir, POSITION y, POSITION x) if (!in_bounds2(y, x)) return (FALSE); /* Access grid */ - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Must be known to the player */ - if (c_ptr->info & (CAVE_MARK)) + if (g_ptr->info & (CAVE_MARK)) { /* Feature code (applying "mimic" field) */ - s16b feat = get_feat_mimic(c_ptr); + s16b feat = get_feat_mimic(g_ptr); feature_type *f_ptr = &f_info[feat]; /* Wall grids are known walls */ @@ -1733,7 +1733,7 @@ static bool run_test(void) int row, col; int i, max, inv; int option = 0, option2 = 0; - grid_type *c_ptr; + grid_type *g_ptr; FEAT_IDX feat; feature_type *f_ptr; @@ -1780,23 +1780,23 @@ static bool run_test(void) col = p_ptr->x + ddx[new_dir]; /* Access grid */ - c_ptr = &grid_array[row][col]; + g_ptr = &grid_array[row][col]; /* Feature code (applying "mimic" field) */ - feat = get_feat_mimic(c_ptr); + feat = get_feat_mimic(g_ptr); f_ptr = &f_info[feat]; /* Visible monsters abort running */ - if (c_ptr->m_idx) + if (g_ptr->m_idx) { - monster_type *m_ptr = &m_list[c_ptr->m_idx]; + monster_type *m_ptr = &m_list[g_ptr->m_idx]; /* Visible monster */ if (m_ptr->ml) return (TRUE); } /* Visible objects abort running */ - for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) + for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) { object_type *o_ptr; o_ptr = &o_list[this_o_idx]; @@ -1812,7 +1812,7 @@ static bool run_test(void) inv = TRUE; /* Check memorized grids */ - if (c_ptr->info & (CAVE_MARK)) + if (g_ptr->info & (CAVE_MARK)) { bool notice = have_flag(f_ptr->flags, FF_NOTICE); @@ -2127,7 +2127,7 @@ static DIRECTION travel_test(DIRECTION prev_dir) { DIRECTION new_dir = 0; int i, max; - const grid_type *c_ptr; + const grid_type *g_ptr; int cost; /* Cannot travel when blind */ @@ -2174,12 +2174,12 @@ static DIRECTION travel_test(DIRECTION prev_dir) POSITION col = p_ptr->x + ddx[dir]; /* Access grid */ - c_ptr = &grid_array[row][col]; + g_ptr = &grid_array[row][col]; /* Visible monsters abort running */ - if (c_ptr->m_idx) + if (g_ptr->m_idx) { - monster_type *m_ptr = &m_list[c_ptr->m_idx]; + monster_type *m_ptr = &m_list[g_ptr->m_idx]; /* Visible monster */ if (m_ptr->ml) return (0); @@ -2204,13 +2204,13 @@ static DIRECTION travel_test(DIRECTION prev_dir) if (!new_dir) return (0); /* Access newly move grid */ - c_ptr = &grid_array[p_ptr->y+ddy[new_dir]][p_ptr->x+ddx[new_dir]]; + g_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); + if (!easy_open && is_closed_door(g_ptr->feat)) return (0); /* Visible and unignorable trap abort tarveling */ - if (!c_ptr->mimic && !trap_can_be_ignored(c_ptr->feat)) return (0); + if (!g_ptr->mimic && !trap_can_be_ignored(g_ptr->feat)) return (0); /* Move new grid */ return (new_dir); diff --git a/src/realm-hissatsu.c b/src/realm-hissatsu.c index aa4421b08..27ad79541 100644 --- a/src/realm-hissatsu.c +++ b/src/realm-hissatsu.c @@ -512,7 +512,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) { POSITION y = 0, x = 0; - grid_type *c_ptr; + grid_type *g_ptr; monster_type *m_ptr; if (p_ptr->cut < 300) @@ -524,11 +524,11 @@ 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 = &grid_array[y][x]; - m_ptr = &m_list[c_ptr->m_idx]; + g_ptr = &grid_array[y][x]; + m_ptr = &m_list[g_ptr->m_idx]; /* Hack -- attack monsters */ - if (c_ptr->m_idx && (m_ptr->ml || cave_have_flag_bold(y, x, FF_PROJECT))) + if (g_ptr->m_idx && (m_ptr->ml || cave_have_flag_bold(y, x, FF_PROJECT))) { if (!monster_living(m_ptr->r_idx)) { @@ -634,14 +634,14 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) POSITION y, x; POSITION ny, nx; MONSTER_IDX m_idx; - grid_type *c_ptr; + grid_type *g_ptr; monster_type *m_ptr; y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; - if (c_ptr->m_idx) + if (g_ptr->m_idx) py_attack(y, x, HISSATSU_3DAN); else { @@ -655,11 +655,11 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) } /* Monster is dead? */ - if (!c_ptr->m_idx) break; + if (!g_ptr->m_idx) break; ny = y + ddy[dir]; nx = x + ddx[dir]; - m_idx = c_ptr->m_idx; + m_idx = g_ptr->m_idx; m_ptr = &m_list[m_idx]; /* Monster cannot move back? */ @@ -670,7 +670,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) continue; } - c_ptr->m_idx = 0; + g_ptr->m_idx = 0; grid_array[ny][nx].m_idx = m_idx; m_ptr->fy = ny; m_ptr->fx = nx; @@ -684,7 +684,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) lite_spot(ny, nx); /* Player can move forward? */ - if (player_can_enter(c_ptr->feat, 0)) + if (player_can_enter(g_ptr->feat, 0)) { if (!move_player_effect(y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP)) break; } diff --git a/src/rooms-normal.c b/src/rooms-normal.c index d550ce396..4377097d2 100644 --- a/src/rooms-normal.c +++ b/src/rooms-normal.c @@ -16,7 +16,7 @@ bool build_type1(void) bool light; - grid_type *c_ptr; + grid_type *g_ptr; bool curtain = (d_info[p_ptr->dungeon_idx].flags1 & DF1_CURTAIN) && one_in_((d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_CAVE) ? 48 : 512); @@ -62,27 +62,27 @@ bool build_type1(void) { for (x = x1 - 1; x <= x2 + 1; x++) { - c_ptr = &grid_array[y][x]; - place_floor_grid(c_ptr); - c_ptr->info |= (CAVE_ROOM); - if (light) c_ptr->info |= (CAVE_GLOW); + g_ptr = &grid_array[y][x]; + place_floor_grid(g_ptr); + g_ptr->info |= (CAVE_ROOM); + if (light) g_ptr->info |= (CAVE_GLOW); } } /* Walls around the room */ for (y = y1 - 1; y <= y2 + 1; y++) { - c_ptr = &grid_array[y][x1 - 1]; - place_outer_grid(c_ptr); - c_ptr = &grid_array[y][x2 + 1]; - place_outer_grid(c_ptr); + g_ptr = &grid_array[y][x1 - 1]; + place_outer_grid(g_ptr); + g_ptr = &grid_array[y][x2 + 1]; + place_outer_grid(g_ptr); } for (x = x1 - 1; x <= x2 + 1; x++) { - c_ptr = &grid_array[y1 - 1][x]; - place_outer_grid(c_ptr); - c_ptr = &grid_array[y2 + 1][x]; - place_outer_grid(c_ptr); + g_ptr = &grid_array[y1 - 1][x]; + place_outer_grid(g_ptr); + g_ptr = &grid_array[y2 + 1][x]; + place_outer_grid(g_ptr); } @@ -91,21 +91,21 @@ bool build_type1(void) { for (y = y1; y <= y2; y++) { - c_ptr = &grid_array[y][x1]; - c_ptr->feat = feat_door[DOOR_CURTAIN].closed; - c_ptr->info &= ~(CAVE_MASK); - c_ptr = &grid_array[y][x2]; - c_ptr->feat = feat_door[DOOR_CURTAIN].closed; - c_ptr->info &= ~(CAVE_MASK); + g_ptr = &grid_array[y][x1]; + g_ptr->feat = feat_door[DOOR_CURTAIN].closed; + g_ptr->info &= ~(CAVE_MASK); + g_ptr = &grid_array[y][x2]; + g_ptr->feat = feat_door[DOOR_CURTAIN].closed; + g_ptr->info &= ~(CAVE_MASK); } for (x = x1; x <= x2; x++) { - c_ptr = &grid_array[y1][x]; - c_ptr->feat = feat_door[DOOR_CURTAIN].closed; - c_ptr->info &= ~(CAVE_MASK); - c_ptr = &grid_array[y2][x]; - c_ptr->feat = feat_door[DOOR_CURTAIN].closed; - c_ptr->info &= ~(CAVE_MASK); + g_ptr = &grid_array[y1][x]; + g_ptr->feat = feat_door[DOOR_CURTAIN].closed; + g_ptr->info &= ~(CAVE_MASK); + g_ptr = &grid_array[y2][x]; + g_ptr->feat = feat_door[DOOR_CURTAIN].closed; + g_ptr->info &= ~(CAVE_MASK); } } @@ -117,8 +117,8 @@ bool build_type1(void) { for (x = x1; x <= x2; x += 2) { - c_ptr = &grid_array[y][x]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[y][x]; + place_inner_grid(g_ptr); } } } @@ -128,17 +128,17 @@ bool build_type1(void) { if ((y1 + 4 < y2) && (x1 + 4 < x2)) { - c_ptr = &grid_array[y1 + 1][x1 + 1]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[y1 + 1][x1 + 1]; + place_inner_grid(g_ptr); - c_ptr = &grid_array[y1 + 1][x2 - 1]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[y1 + 1][x2 - 1]; + place_inner_grid(g_ptr); - c_ptr = &grid_array[y2 - 1][x1 + 1]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[y2 - 1][x1 + 1]; + place_inner_grid(g_ptr); - c_ptr = &grid_array[y2 - 1][x2 - 1]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[y2 - 1][x2 - 1]; + place_inner_grid(g_ptr); } } @@ -147,17 +147,17 @@ bool build_type1(void) { for (y = y1 + 2; y <= y2 - 2; y += 2) { - c_ptr = &grid_array[y][x1]; - place_inner_grid(c_ptr); - c_ptr = &grid_array[y][x2]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[y][x1]; + place_inner_grid(g_ptr); + g_ptr = &grid_array[y][x2]; + place_inner_grid(g_ptr); } for (x = x1 + 2; x <= x2 - 2; x += 2) { - c_ptr = &grid_array[y1][x]; - place_inner_grid(c_ptr); - c_ptr = &grid_array[y2][x]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[y1][x]; + place_inner_grid(g_ptr); + g_ptr = &grid_array[y2][x]; + place_inner_grid(g_ptr); } } /* Hack -- Occasional divided room */ @@ -210,7 +210,7 @@ bool build_type2(void) POSITION y1a, x1a, y2a, x2a; POSITION y1b, x1b, y2b, x2b; bool light; - grid_type *c_ptr; + grid_type *g_ptr; /* Find and reserve some space in the dungeon. Get center of room. */ if (!find_space(&yval, &xval, 11, 25)) return FALSE; @@ -236,10 +236,10 @@ bool build_type2(void) { for (x = x1a - 1; x <= x2a + 1; x++) { - c_ptr = &grid_array[y][x]; - place_floor_grid(c_ptr); - c_ptr->info |= (CAVE_ROOM); - if (light) c_ptr->info |= (CAVE_GLOW); + g_ptr = &grid_array[y][x]; + place_floor_grid(g_ptr); + g_ptr->info |= (CAVE_ROOM); + if (light) g_ptr->info |= (CAVE_GLOW); } } @@ -248,10 +248,10 @@ bool build_type2(void) { for (x = x1b - 1; x <= x2b + 1; x++) { - c_ptr = &grid_array[y][x]; - place_floor_grid(c_ptr); - c_ptr->info |= (CAVE_ROOM); - if (light) c_ptr->info |= (CAVE_GLOW); + g_ptr = &grid_array[y][x]; + place_floor_grid(g_ptr); + g_ptr->info |= (CAVE_ROOM); + if (light) g_ptr->info |= (CAVE_GLOW); } } @@ -259,33 +259,33 @@ bool build_type2(void) /* Place the walls around room "a" */ for (y = y1a - 1; y <= y2a + 1; y++) { - c_ptr = &grid_array[y][x1a - 1]; - place_outer_grid(c_ptr); - c_ptr = &grid_array[y][x2a + 1]; - place_outer_grid(c_ptr); + g_ptr = &grid_array[y][x1a - 1]; + place_outer_grid(g_ptr); + g_ptr = &grid_array[y][x2a + 1]; + place_outer_grid(g_ptr); } for (x = x1a - 1; x <= x2a + 1; x++) { - c_ptr = &grid_array[y1a - 1][x]; - place_outer_grid(c_ptr); - c_ptr = &grid_array[y2a + 1][x]; - place_outer_grid(c_ptr); + g_ptr = &grid_array[y1a - 1][x]; + place_outer_grid(g_ptr); + g_ptr = &grid_array[y2a + 1][x]; + place_outer_grid(g_ptr); } /* Place the walls around room "b" */ for (y = y1b - 1; y <= y2b + 1; y++) { - c_ptr = &grid_array[y][x1b - 1]; - place_outer_grid(c_ptr); - c_ptr = &grid_array[y][x2b + 1]; - place_outer_grid(c_ptr); + g_ptr = &grid_array[y][x1b - 1]; + place_outer_grid(g_ptr); + g_ptr = &grid_array[y][x2b + 1]; + place_outer_grid(g_ptr); } for (x = x1b - 1; x <= x2b + 1; x++) { - c_ptr = &grid_array[y1b - 1][x]; - place_outer_grid(c_ptr); - c_ptr = &grid_array[y2b + 1][x]; - place_outer_grid(c_ptr); + g_ptr = &grid_array[y1b - 1][x]; + place_outer_grid(g_ptr); + g_ptr = &grid_array[y2b + 1][x]; + place_outer_grid(g_ptr); } @@ -295,8 +295,8 @@ bool build_type2(void) { for (x = x1a; x <= x2a; x++) { - c_ptr = &grid_array[y][x]; - place_floor_grid(c_ptr); + g_ptr = &grid_array[y][x]; + place_floor_grid(g_ptr); } } @@ -305,8 +305,8 @@ bool build_type2(void) { for (x = x1b; x <= x2b; x++) { - c_ptr = &grid_array[y][x]; - place_floor_grid(c_ptr); + g_ptr = &grid_array[y][x]; + place_floor_grid(g_ptr); } } @@ -333,7 +333,7 @@ bool build_type3(void) POSITION y1b, x1b, y2b, x2b; POSITION yval, xval; bool light; - grid_type *c_ptr; + grid_type *g_ptr; /* Find and reserve some space in the dungeon. Get center of room. */ @@ -371,10 +371,10 @@ bool build_type3(void) { for (x = x1a - 1; x <= x2a + 1; x++) { - c_ptr = &grid_array[y][x]; - place_floor_grid(c_ptr); - c_ptr->info |= (CAVE_ROOM); - if (light) c_ptr->info |= (CAVE_GLOW); + g_ptr = &grid_array[y][x]; + place_floor_grid(g_ptr); + g_ptr->info |= (CAVE_ROOM); + if (light) g_ptr->info |= (CAVE_GLOW); } } @@ -383,10 +383,10 @@ bool build_type3(void) { for (x = x1b - 1; x <= x2b + 1; x++) { - c_ptr = &grid_array[y][x]; - place_floor_grid(c_ptr); - c_ptr->info |= (CAVE_ROOM); - if (light) c_ptr->info |= (CAVE_GLOW); + g_ptr = &grid_array[y][x]; + place_floor_grid(g_ptr); + g_ptr->info |= (CAVE_ROOM); + if (light) g_ptr->info |= (CAVE_GLOW); } } @@ -394,33 +394,33 @@ bool build_type3(void) /* Place the walls around room "a" */ for (y = y1a - 1; y <= y2a + 1; y++) { - c_ptr = &grid_array[y][x1a - 1]; - place_outer_grid(c_ptr); - c_ptr = &grid_array[y][x2a + 1]; - place_outer_grid(c_ptr); + g_ptr = &grid_array[y][x1a - 1]; + place_outer_grid(g_ptr); + g_ptr = &grid_array[y][x2a + 1]; + place_outer_grid(g_ptr); } for (x = x1a - 1; x <= x2a + 1; x++) { - c_ptr = &grid_array[y1a - 1][x]; - place_outer_grid(c_ptr); - c_ptr = &grid_array[y2a + 1][x]; - place_outer_grid(c_ptr); + g_ptr = &grid_array[y1a - 1][x]; + place_outer_grid(g_ptr); + g_ptr = &grid_array[y2a + 1][x]; + place_outer_grid(g_ptr); } /* Place the walls around room "b" */ for (y = y1b - 1; y <= y2b + 1; y++) { - c_ptr = &grid_array[y][x1b - 1]; - place_outer_grid(c_ptr); - c_ptr = &grid_array[y][x2b + 1]; - place_outer_grid(c_ptr); + g_ptr = &grid_array[y][x1b - 1]; + place_outer_grid(g_ptr); + g_ptr = &grid_array[y][x2b + 1]; + place_outer_grid(g_ptr); } for (x = x1b - 1; x <= x2b + 1; x++) { - c_ptr = &grid_array[y1b - 1][x]; - place_outer_grid(c_ptr); - c_ptr = &grid_array[y2b + 1][x]; - place_outer_grid(c_ptr); + g_ptr = &grid_array[y1b - 1][x]; + place_outer_grid(g_ptr); + g_ptr = &grid_array[y2b + 1][x]; + place_outer_grid(g_ptr); } @@ -429,8 +429,8 @@ bool build_type3(void) { for (x = x1a; x <= x2a; x++) { - c_ptr = &grid_array[y][x]; - place_floor_grid(c_ptr); + g_ptr = &grid_array[y][x]; + place_floor_grid(g_ptr); } } @@ -439,8 +439,8 @@ bool build_type3(void) { for (x = x1b; x <= x2b; x++) { - c_ptr = &grid_array[y][x]; - place_floor_grid(c_ptr); + g_ptr = &grid_array[y][x]; + place_floor_grid(g_ptr); } } @@ -456,8 +456,8 @@ bool build_type3(void) { for (x = x1a; x <= x2a; x++) { - c_ptr = &grid_array[y][x]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[y][x]; + place_inner_grid(g_ptr); } } break; @@ -469,17 +469,17 @@ bool build_type3(void) /* Build the vault */ for (y = y1b; y <= y2b; y++) { - c_ptr = &grid_array[y][x1a]; - place_inner_grid(c_ptr); - c_ptr = &grid_array[y][x2a]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[y][x1a]; + place_inner_grid(g_ptr); + g_ptr = &grid_array[y][x2a]; + place_inner_grid(g_ptr); } for (x = x1a; x <= x2a; x++) { - c_ptr = &grid_array[y1b][x]; - place_inner_grid(c_ptr); - c_ptr = &grid_array[y2b][x]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[y1b][x]; + place_inner_grid(g_ptr); + g_ptr = &grid_array[y2b][x]; + place_inner_grid(g_ptr); } /* Place a secret door on the inner room */ @@ -513,20 +513,20 @@ bool build_type3(void) for (y = y1b; y <= y2b; y++) { if (y == yval) continue; - c_ptr = &grid_array[y][x1a - 1]; - place_inner_grid(c_ptr); - c_ptr = &grid_array[y][x2a + 1]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[y][x1a - 1]; + place_inner_grid(g_ptr); + g_ptr = &grid_array[y][x2a + 1]; + place_inner_grid(g_ptr); } /* Pinch the north/south sides */ for (x = x1a; x <= x2a; x++) { if (x == xval) continue; - c_ptr = &grid_array[y1b - 1][x]; - place_inner_grid(c_ptr); - c_ptr = &grid_array[y2b + 1][x]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[y1b - 1][x]; + place_inner_grid(g_ptr); + g_ptr = &grid_array[y2b + 1][x]; + place_inner_grid(g_ptr); } /* Sometimes shut using secret doors */ @@ -546,23 +546,23 @@ bool build_type3(void) /* Occasionally put a "plus" in the center */ else if (one_in_(3)) { - c_ptr = &grid_array[yval][xval]; - place_inner_grid(c_ptr); - c_ptr = &grid_array[y1b][xval]; - place_inner_grid(c_ptr); - c_ptr = &grid_array[y2b][xval]; - place_inner_grid(c_ptr); - c_ptr = &grid_array[yval][x1a]; - place_inner_grid(c_ptr); - c_ptr = &grid_array[yval][x2a]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[yval][xval]; + place_inner_grid(g_ptr); + g_ptr = &grid_array[y1b][xval]; + place_inner_grid(g_ptr); + g_ptr = &grid_array[y2b][xval]; + place_inner_grid(g_ptr); + g_ptr = &grid_array[yval][x1a]; + place_inner_grid(g_ptr); + g_ptr = &grid_array[yval][x2a]; + place_inner_grid(g_ptr); } /* Occasionally put a pillar in the center */ else if (one_in_(3)) { - c_ptr = &grid_array[yval][xval]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[yval][xval]; + place_inner_grid(g_ptr); } break; @@ -588,7 +588,7 @@ bool build_type4(void) POSITION y, x, y1, x1; POSITION y2, x2, tmp, yval, xval; bool light; - grid_type *c_ptr; + grid_type *g_ptr; /* Find and reserve some space in the dungeon. Get center of room. */ @@ -608,27 +608,27 @@ bool build_type4(void) { for (x = x1 - 1; x <= x2 + 1; x++) { - c_ptr = &grid_array[y][x]; - place_floor_grid(c_ptr); - c_ptr->info |= (CAVE_ROOM); - if (light) c_ptr->info |= (CAVE_GLOW); + g_ptr = &grid_array[y][x]; + place_floor_grid(g_ptr); + g_ptr->info |= (CAVE_ROOM); + if (light) g_ptr->info |= (CAVE_GLOW); } } /* Outer Walls */ for (y = y1 - 1; y <= y2 + 1; y++) { - c_ptr = &grid_array[y][x1 - 1]; - place_outer_grid(c_ptr); - c_ptr = &grid_array[y][x2 + 1]; - place_outer_grid(c_ptr); + g_ptr = &grid_array[y][x1 - 1]; + place_outer_grid(g_ptr); + g_ptr = &grid_array[y][x2 + 1]; + place_outer_grid(g_ptr); } for (x = x1 - 1; x <= x2 + 1; x++) { - c_ptr = &grid_array[y1 - 1][x]; - place_outer_grid(c_ptr); - c_ptr = &grid_array[y2 + 1][x]; - place_outer_grid(c_ptr); + g_ptr = &grid_array[y1 - 1][x]; + place_outer_grid(g_ptr); + g_ptr = &grid_array[y2 + 1][x]; + place_outer_grid(g_ptr); } @@ -641,17 +641,17 @@ bool build_type4(void) /* The inner walls */ for (y = y1 - 1; y <= y2 + 1; y++) { - c_ptr = &grid_array[y][x1 - 1]; - place_inner_grid(c_ptr); - c_ptr = &grid_array[y][x2 + 1]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[y][x1 - 1]; + place_inner_grid(g_ptr); + g_ptr = &grid_array[y][x2 + 1]; + place_inner_grid(g_ptr); } for (x = x1 - 1; x <= x2 + 1; x++) { - c_ptr = &grid_array[y1 - 1][x]; - place_inner_grid(c_ptr); - c_ptr = &grid_array[y2 + 1][x]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[y1 - 1][x]; + place_inner_grid(g_ptr); + g_ptr = &grid_array[y2 + 1][x]; + place_inner_grid(g_ptr); } @@ -694,8 +694,8 @@ bool build_type4(void) for (x = xval - 1; x <= xval + 1; x++) { if ((x == xval) && (y == yval)) continue; - c_ptr = &grid_array[y][x]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[y][x]; + place_inner_grid(g_ptr); } } @@ -746,8 +746,8 @@ bool build_type4(void) { for (x = xval - 1; x <= xval + 1; x++) { - c_ptr = &grid_array[y][x]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[y][x]; + place_inner_grid(g_ptr); } } @@ -759,13 +759,13 @@ bool build_type4(void) { for (x = xval - 5 - tmp; x <= xval - 3 - tmp; x++) { - c_ptr = &grid_array[y][x]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[y][x]; + place_inner_grid(g_ptr); } for (x = xval + 3 + tmp; x <= xval + 5 + tmp; x++) { - c_ptr = &grid_array[y][x]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[y][x]; + place_inner_grid(g_ptr); } } } @@ -780,17 +780,17 @@ bool build_type4(void) /* Long horizontal walls */ for (x = xval - 5; x <= xval + 5; x++) { - c_ptr = &grid_array[yval - 1][x]; - place_inner_grid(c_ptr); - c_ptr = &grid_array[yval + 1][x]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[yval - 1][x]; + place_inner_grid(g_ptr); + g_ptr = &grid_array[yval + 1][x]; + place_inner_grid(g_ptr); } /* Close off the left/right edges */ - c_ptr = &grid_array[yval][xval - 5]; - place_inner_grid(c_ptr); - c_ptr = &grid_array[yval][xval + 5]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[yval][xval - 5]; + place_inner_grid(g_ptr); + g_ptr = &grid_array[yval][xval + 5]; + place_inner_grid(g_ptr); /* Secret doors (random top/bottom) */ place_secret_door(yval - 3 + (randint1(2) * 2), xval - 3, door_type); @@ -827,8 +827,8 @@ bool build_type4(void) { if (0x1 & (x + y)) { - c_ptr = &grid_array[y][x]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[y][x]; + place_inner_grid(g_ptr); } } } @@ -857,13 +857,13 @@ bool build_type4(void) /* Inner "cross" */ for (y = y1; y <= y2; y++) { - c_ptr = &grid_array[y][xval]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[y][xval]; + place_inner_grid(g_ptr); } for (x = x1; x <= x2; x++) { - c_ptr = &grid_array[yval][x]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[yval][x]; + place_inner_grid(g_ptr); } /* Doors into the rooms */ diff --git a/src/rooms-pitnest.c b/src/rooms-pitnest.c index d80ceefe6..f68d190ad 100644 --- a/src/rooms-pitnest.c +++ b/src/rooms-pitnest.c @@ -284,7 +284,7 @@ bool build_type5(void) monster_type align; - grid_type *c_ptr; + grid_type *g_ptr; int cur_nest_type = pick_vault_type(nest_types, d_info[p_ptr->dungeon_idx].nest); vault_aux_type *n_ptr; @@ -345,26 +345,26 @@ bool build_type5(void) { for (x = x1 - 1; x <= x2 + 1; x++) { - c_ptr = &grid_array[y][x]; - place_floor_grid(c_ptr); - c_ptr->info |= (CAVE_ROOM); + g_ptr = &grid_array[y][x]; + place_floor_grid(g_ptr); + g_ptr->info |= (CAVE_ROOM); } } /* Place the outer walls */ for (y = y1 - 1; y <= y2 + 1; y++) { - c_ptr = &grid_array[y][x1 - 1]; - place_outer_grid(c_ptr); - c_ptr = &grid_array[y][x2 + 1]; - place_outer_grid(c_ptr); + g_ptr = &grid_array[y][x1 - 1]; + place_outer_grid(g_ptr); + g_ptr = &grid_array[y][x2 + 1]; + place_outer_grid(g_ptr); } for (x = x1 - 1; x <= x2 + 1; x++) { - c_ptr = &grid_array[y1 - 1][x]; - place_outer_grid(c_ptr); - c_ptr = &grid_array[y2 + 1][x]; - place_outer_grid(c_ptr); + g_ptr = &grid_array[y1 - 1][x]; + place_outer_grid(g_ptr); + g_ptr = &grid_array[y2 + 1][x]; + place_outer_grid(g_ptr); } @@ -377,18 +377,18 @@ bool build_type5(void) /* The inner walls */ for (y = y1 - 1; y <= y2 + 1; y++) { - c_ptr = &grid_array[y][x1 - 1]; - place_inner_grid(c_ptr); - c_ptr = &grid_array[y][x2 + 1]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[y][x1 - 1]; + place_inner_grid(g_ptr); + g_ptr = &grid_array[y][x2 + 1]; + place_inner_grid(g_ptr); } for (x = x1 - 1; x <= x2 + 1; x++) { - c_ptr = &grid_array[y1 - 1][x]; - place_inner_grid(c_ptr); - c_ptr = &grid_array[y2 + 1][x]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[y1 - 1][x]; + place_inner_grid(g_ptr); + g_ptr = &grid_array[y2 + 1][x]; + place_inner_grid(g_ptr); } for (y = y1; y <= y2; y++) { @@ -495,7 +495,7 @@ bool build_type6(void) monster_type align; - grid_type *c_ptr; + grid_type *g_ptr; int cur_pit_type = pick_vault_type(pit_types, d_info[p_ptr->dungeon_idx].pit); vault_aux_type *n_ptr; @@ -555,26 +555,26 @@ bool build_type6(void) { for (x = x1 - 1; x <= x2 + 1; x++) { - c_ptr = &grid_array[y][x]; - place_floor_grid(c_ptr); - c_ptr->info |= (CAVE_ROOM); + g_ptr = &grid_array[y][x]; + place_floor_grid(g_ptr); + g_ptr->info |= (CAVE_ROOM); } } /* Place the outer walls */ for (y = y1 - 1; y <= y2 + 1; y++) { - c_ptr = &grid_array[y][x1 - 1]; - place_outer_grid(c_ptr); - c_ptr = &grid_array[y][x2 + 1]; - place_outer_grid(c_ptr); + g_ptr = &grid_array[y][x1 - 1]; + place_outer_grid(g_ptr); + g_ptr = &grid_array[y][x2 + 1]; + place_outer_grid(g_ptr); } for (x = x1 - 1; x <= x2 + 1; x++) { - c_ptr = &grid_array[y1 - 1][x]; - place_outer_grid(c_ptr); - c_ptr = &grid_array[y2 + 1][x]; - place_outer_grid(c_ptr); + g_ptr = &grid_array[y1 - 1][x]; + place_outer_grid(g_ptr); + g_ptr = &grid_array[y2 + 1][x]; + place_outer_grid(g_ptr); } /* Advance to the center room */ @@ -586,17 +586,17 @@ bool build_type6(void) /* The inner walls */ for (y = y1 - 1; y <= y2 + 1; y++) { - c_ptr = &grid_array[y][x1 - 1]; - place_inner_grid(c_ptr); - c_ptr = &grid_array[y][x2 + 1]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[y][x1 - 1]; + place_inner_grid(g_ptr); + g_ptr = &grid_array[y][x2 + 1]; + place_inner_grid(g_ptr); } for (x = x1 - 1; x <= x2 + 1; x++) { - c_ptr = &grid_array[y1 - 1][x]; - place_inner_grid(c_ptr); - c_ptr = &grid_array[y2 + 1][x]; - place_inner_grid(c_ptr); + g_ptr = &grid_array[y1 - 1][x]; + place_inner_grid(g_ptr); + g_ptr = &grid_array[y2 + 1][x]; + place_inner_grid(g_ptr); } for (y = y1; y <= y2; y++) { @@ -800,7 +800,7 @@ bool build_type13(void) monster_type align; - grid_type *c_ptr; + grid_type *g_ptr; int cur_pit_type = pick_vault_type(pit_types, d_info[p_ptr->dungeon_idx].pit); vault_aux_type *n_ptr; @@ -863,61 +863,61 @@ bool build_type13(void) { for (x = x1 - 1; x <= x2 + 1; x++) { - c_ptr = &grid_array[y][x]; - place_inner_grid(c_ptr); - c_ptr->info |= (CAVE_ROOM); + g_ptr = &grid_array[y][x]; + place_inner_grid(g_ptr); + g_ptr->info |= (CAVE_ROOM); } } /* Place the floor area 1 */ for (x = x1 + 3; x <= x2 - 3; x++) { - c_ptr = &grid_array[yval - 2][x]; - place_floor_grid(c_ptr); + g_ptr = &grid_array[yval - 2][x]; + place_floor_grid(g_ptr); add_cave_info(yval - 2, x, CAVE_ICKY); - c_ptr = &grid_array[yval + 2][x]; - place_floor_grid(c_ptr); + g_ptr = &grid_array[yval + 2][x]; + place_floor_grid(g_ptr); add_cave_info(yval + 2, x, CAVE_ICKY); } /* Place the floor area 2 */ for (x = x1 + 5; x <= x2 - 5; x++) { - c_ptr = &grid_array[yval - 3][x]; - place_floor_grid(c_ptr); + g_ptr = &grid_array[yval - 3][x]; + place_floor_grid(g_ptr); add_cave_info(yval - 3, x, CAVE_ICKY); - c_ptr = &grid_array[yval + 3][x]; - place_floor_grid(c_ptr); + g_ptr = &grid_array[yval + 3][x]; + place_floor_grid(g_ptr); add_cave_info(yval + 3, x, CAVE_ICKY); } /* Corridor */ for (x = x1; x <= x2; x++) { - c_ptr = &grid_array[yval][x]; - place_floor_grid(c_ptr); - c_ptr = &grid_array[y1][x]; - place_floor_grid(c_ptr); - c_ptr = &grid_array[y2][x]; - place_floor_grid(c_ptr); + g_ptr = &grid_array[yval][x]; + place_floor_grid(g_ptr); + g_ptr = &grid_array[y1][x]; + place_floor_grid(g_ptr); + g_ptr = &grid_array[y2][x]; + place_floor_grid(g_ptr); } /* Place the outer walls */ for (y = y1 - 1; y <= y2 + 1; y++) { - c_ptr = &grid_array[y][x1 - 1]; - place_outer_grid(c_ptr); - c_ptr = &grid_array[y][x2 + 1]; - place_outer_grid(c_ptr); + g_ptr = &grid_array[y][x1 - 1]; + place_outer_grid(g_ptr); + g_ptr = &grid_array[y][x2 + 1]; + place_outer_grid(g_ptr); } for (x = x1 - 1; x <= x2 + 1; x++) { - c_ptr = &grid_array[y1 - 1][x]; - place_outer_grid(c_ptr); - c_ptr = &grid_array[y2 + 1][x]; - place_outer_grid(c_ptr); + g_ptr = &grid_array[y1 - 1][x]; + place_outer_grid(g_ptr); + g_ptr = &grid_array[y2 + 1][x]; + place_outer_grid(g_ptr); } /* Random corridor */ diff --git a/src/rooms-special.c b/src/rooms-special.c index 159ac9b8a..dec2e9626 100644 --- a/src/rooms-special.c +++ b/src/rooms-special.c @@ -17,7 +17,7 @@ bool build_type15(void) POSITION y1, x1, xsize, ysize; bool light; - grid_type *c_ptr; + grid_type *g_ptr; /* Pick a room size */ xsize = rand_range(9, 13); @@ -40,32 +40,32 @@ bool build_type15(void) { for (x = x1 - 1; x <= x2 + 1; x++) { - c_ptr = &grid_array[y][x]; - place_floor_grid(c_ptr); - c_ptr->feat = feat_glass_floor; - c_ptr->info |= (CAVE_ROOM); - if (light) c_ptr->info |= (CAVE_GLOW); + g_ptr = &grid_array[y][x]; + place_floor_grid(g_ptr); + g_ptr->feat = feat_glass_floor; + g_ptr->info |= (CAVE_ROOM); + if (light) g_ptr->info |= (CAVE_GLOW); } } /* Walls around the room */ for (y = y1 - 1; y <= y2 + 1; y++) { - c_ptr = &grid_array[y][x1 - 1]; - place_outer_grid(c_ptr); - c_ptr->feat = feat_glass_wall; - c_ptr = &grid_array[y][x2 + 1]; - place_outer_grid(c_ptr); - c_ptr->feat = feat_glass_wall; + g_ptr = &grid_array[y][x1 - 1]; + place_outer_grid(g_ptr); + g_ptr->feat = feat_glass_wall; + g_ptr = &grid_array[y][x2 + 1]; + place_outer_grid(g_ptr); + g_ptr->feat = feat_glass_wall; } for (x = x1 - 1; x <= x2 + 1; x++) { - c_ptr = &grid_array[y1 - 1][x]; - place_outer_grid(c_ptr); - c_ptr->feat = feat_glass_wall; - c_ptr = &grid_array[y2 + 1][x]; - place_outer_grid(c_ptr); - c_ptr->feat = feat_glass_wall; + g_ptr = &grid_array[y1 - 1][x]; + place_outer_grid(g_ptr); + g_ptr->feat = feat_glass_wall; + g_ptr = &grid_array[y2 + 1][x]; + place_outer_grid(g_ptr); + g_ptr->feat = feat_glass_wall; } switch (randint1(3)) @@ -87,9 +87,9 @@ bool build_type15(void) /* Walls around the breather */ for (dir2 = 0; dir2 < 8; dir2++) { - c_ptr = &grid_array[y + ddy_ddd[dir2]][x + ddx_ddd[dir2]]; - place_inner_grid(c_ptr); - c_ptr->feat = feat_glass_wall; + g_ptr = &grid_array[y + ddy_ddd[dir2]][x + ddx_ddd[dir2]]; + place_inner_grid(g_ptr); + g_ptr->feat = feat_glass_wall; } } @@ -98,9 +98,9 @@ bool build_type15(void) { y = yval + 2 * ddy_ddd[dir1]; x = xval + 2 * ddx_ddd[dir1]; - c_ptr = &grid_array[y][x]; - place_inner_perm_grid(c_ptr); - c_ptr->feat = feat_permanent_glass_wall; + g_ptr = &grid_array[y][x]; + place_inner_perm_grid(g_ptr); + g_ptr->feat = feat_permanent_glass_wall; grid_array[yval + ddy_ddd[dir1]][xval + ddx_ddd[dir1]].info |= (CAVE_ICKY); } @@ -109,8 +109,8 @@ 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 = &grid_array[y][x]; - if (is_closed_door(c_ptr->feat)) c_ptr->mimic = feat_glass_wall; + g_ptr = &grid_array[y][x]; + if (is_closed_door(g_ptr->feat)) g_ptr->mimic = feat_glass_wall; /* Place a potion */ get_obj_num_hook = kind_is_potion; @@ -125,21 +125,21 @@ bool build_type15(void) DIRECTION dir1; /* Pillars */ - c_ptr = &grid_array[y1 + 1][x1 + 1]; - place_inner_grid(c_ptr); - c_ptr->feat = feat_glass_wall; + g_ptr = &grid_array[y1 + 1][x1 + 1]; + place_inner_grid(g_ptr); + g_ptr->feat = feat_glass_wall; - c_ptr = &grid_array[y1 + 1][x2 - 1]; - place_inner_grid(c_ptr); - c_ptr->feat = feat_glass_wall; + g_ptr = &grid_array[y1 + 1][x2 - 1]; + place_inner_grid(g_ptr); + g_ptr->feat = feat_glass_wall; - c_ptr = &grid_array[y2 - 1][x1 + 1]; - place_inner_grid(c_ptr); - c_ptr->feat = feat_glass_wall; + g_ptr = &grid_array[y2 - 1][x1 + 1]; + place_inner_grid(g_ptr); + g_ptr->feat = feat_glass_wall; - c_ptr = &grid_array[y2 - 1][x2 - 1]; - place_inner_grid(c_ptr); - c_ptr->feat = feat_glass_wall; + g_ptr = &grid_array[y2 - 1][x2 - 1]; + place_inner_grid(g_ptr); + g_ptr->feat = feat_glass_wall; get_mon_num_prep(vault_aux_lite, NULL); r_idx = get_mon_num(dun_level); @@ -148,9 +148,9 @@ bool build_type15(void) /* Walls around the breather */ for (dir1 = 0; dir1 < 8; dir1++) { - c_ptr = &grid_array[yval + ddy_ddd[dir1]][xval + ddx_ddd[dir1]]; - place_inner_grid(c_ptr); - c_ptr->feat = feat_glass_wall; + g_ptr = &grid_array[yval + ddy_ddd[dir1]][xval + ddx_ddd[dir1]]; + place_inner_grid(g_ptr); + g_ptr->feat = feat_glass_wall; } /* Curtains around the breather */ @@ -178,27 +178,27 @@ bool build_type15(void) /* Walls around the potion */ for (y = yval - 2; y <= yval + 2; y++) { - c_ptr = &grid_array[y][xval - 3]; - place_inner_grid(c_ptr); - c_ptr->feat = feat_glass_wall; - c_ptr = &grid_array[y][xval + 3]; - place_inner_grid(c_ptr); - c_ptr->feat = feat_glass_wall; + g_ptr = &grid_array[y][xval - 3]; + place_inner_grid(g_ptr); + g_ptr->feat = feat_glass_wall; + g_ptr = &grid_array[y][xval + 3]; + place_inner_grid(g_ptr); + g_ptr->feat = feat_glass_wall; } for (x = xval - 2; x <= xval + 2; x++) { - c_ptr = &grid_array[yval - 3][x]; - place_inner_grid(c_ptr); - c_ptr->feat = feat_glass_wall; - c_ptr = &grid_array[yval + 3][x]; - place_inner_grid(c_ptr); - c_ptr->feat = feat_glass_wall; + g_ptr = &grid_array[yval - 3][x]; + place_inner_grid(g_ptr); + g_ptr->feat = feat_glass_wall; + g_ptr = &grid_array[yval + 3][x]; + place_inner_grid(g_ptr); + g_ptr->feat = feat_glass_wall; } for (dir1 = 4; dir1 < 8; 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; + g_ptr = &grid_array[yval + 2 * ddy_ddd[dir1]][xval + 2 * ddx_ddd[dir1]]; + place_inner_grid(g_ptr); + g_ptr->feat = feat_glass_wall; } get_mon_num_prep(vault_aux_shards, NULL); diff --git a/src/rooms-trap.c b/src/rooms-trap.c index f64b0417c..15e711706 100644 --- a/src/rooms-trap.c +++ b/src/rooms-trap.c @@ -17,7 +17,7 @@ bool build_type14(void) bool light; - grid_type *c_ptr; + grid_type *g_ptr; s16b trap; /* Pick a room size */ @@ -48,27 +48,27 @@ bool build_type14(void) { for (x = x1 - 1; x <= x2 + 1; x++) { - c_ptr = &grid_array[y][x]; - place_floor_grid(c_ptr); - c_ptr->info |= (CAVE_ROOM); - if (light) c_ptr->info |= (CAVE_GLOW); + g_ptr = &grid_array[y][x]; + place_floor_grid(g_ptr); + g_ptr->info |= (CAVE_ROOM); + if (light) g_ptr->info |= (CAVE_GLOW); } } /* Walls around the room */ for (y = y1 - 1; y <= y2 + 1; y++) { - c_ptr = &grid_array[y][x1 - 1]; - place_outer_grid(c_ptr); - c_ptr = &grid_array[y][x2 + 1]; - place_outer_grid(c_ptr); + g_ptr = &grid_array[y][x1 - 1]; + place_outer_grid(g_ptr); + g_ptr = &grid_array[y][x2 + 1]; + place_outer_grid(g_ptr); } for (x = x1 - 1; x <= x2 + 1; x++) { - c_ptr = &grid_array[y1 - 1][x]; - place_outer_grid(c_ptr); - c_ptr = &grid_array[y2 + 1][x]; - place_outer_grid(c_ptr); + g_ptr = &grid_array[y1 - 1][x]; + place_outer_grid(g_ptr); + g_ptr = &grid_array[y2 + 1][x]; + place_outer_grid(g_ptr); } if (dun_level < 30 + randint1(30)) @@ -77,9 +77,9 @@ bool build_type14(void) trap = feat_trap_armageddon; /* Place a special trap */ - c_ptr = &grid_array[rand_spread(yval, ysize / 4)][rand_spread(xval, xsize / 4)]; - c_ptr->mimic = c_ptr->feat; - c_ptr->feat = trap; + g_ptr = &grid_array[rand_spread(yval, ysize / 4)][rand_spread(xval, xsize / 4)]; + g_ptr->mimic = g_ptr->feat; + g_ptr->feat = trap; msg_format_wizard(CHEAT_DUNGEON, _("%sの部屋が生成されました。", "Room of %s was generated."), f_name + f_info[trap].name); diff --git a/src/rooms-vault.c b/src/rooms-vault.c index 917d63c75..2139bd6e2 100644 --- a/src/rooms-vault.c +++ b/src/rooms-vault.c @@ -309,7 +309,7 @@ static void build_vault(POSITION yval, POSITION xval, POSITION ymax, POSITION xm { POSITION dx, dy, x, y, i, j; concptr t; - grid_type *c_ptr; + grid_type *g_ptr; /* Place dungeon features and objects */ for (t = data, dy = 0; dy < ymax; dy++) @@ -339,45 +339,45 @@ static void build_vault(POSITION yval, POSITION xval, POSITION ymax, POSITION xm /* Hack -- skip "non-grids" */ if (*t == ' ') continue; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Lay down a floor */ - place_floor_grid(c_ptr); + place_floor_grid(g_ptr); /* Remove any mimic */ - c_ptr->mimic = 0; + g_ptr->mimic = 0; /* Part of a vault */ - c_ptr->info |= (CAVE_ROOM | CAVE_ICKY); + g_ptr->info |= (CAVE_ROOM | CAVE_ICKY); /* Analyze the grid */ switch (*t) { /* Granite wall (outer) */ case '%': - place_outer_noperm_grid(c_ptr); + place_outer_noperm_grid(g_ptr); break; /* Granite wall (inner) */ case '#': - place_inner_grid(c_ptr); + place_inner_grid(g_ptr); break; /* Glass wall (inner) */ case '$': - place_inner_grid(c_ptr); - c_ptr->feat = feat_glass_wall; + place_inner_grid(g_ptr); + g_ptr->feat = feat_glass_wall; break; /* Permanent wall (inner) */ case 'X': - place_inner_perm_grid(c_ptr); + place_inner_perm_grid(g_ptr); break; /* Permanent glass wall (inner) */ case 'Y': - place_inner_perm_grid(c_ptr); - c_ptr->feat = feat_permanent_glass_wall; + place_inner_perm_grid(g_ptr); + g_ptr->feat = feat_permanent_glass_wall; break; /* Treasure/trap */ @@ -399,7 +399,7 @@ static void build_vault(POSITION yval, POSITION xval, POSITION ymax, POSITION xm /* Tree */ case ':': - c_ptr->feat = feat_tree; + g_ptr->feat = feat_tree; break; /* Secret doors */ @@ -410,7 +410,7 @@ static void build_vault(POSITION yval, POSITION xval, POSITION ymax, POSITION xm /* Secret glass doors */ case '-': place_secret_door(y, x, DOOR_GLASS_DOOR); - if (is_closed_door(c_ptr->feat)) c_ptr->mimic = feat_glass_wall; + if (is_closed_door(g_ptr->feat)) g_ptr->mimic = feat_glass_wall; break; /* Curtains */ @@ -1066,12 +1066,12 @@ 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 = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; - c_ptr->info |= (CAVE_ROOM | CAVE_ICKY); + g_ptr->info |= (CAVE_ROOM | CAVE_ICKY); /* Permanent walls */ - place_inner_perm_grid(c_ptr); + place_inner_perm_grid(g_ptr); } } diff --git a/src/rooms.c b/src/rooms.c index bb393e232..c1173d7ba 100644 --- a/src/rooms.c +++ b/src/rooms.c @@ -1692,7 +1692,7 @@ void build_maze_vault(POSITION x0, POSITION y0, POSITION xsize, POSITION ysize, POSITION y1, x1, y2, x2; int m, n, num_vertices, *visited; bool light; - grid_type *c_ptr; + grid_type *g_ptr; msg_print_wizard(CHEAT_DUNGEON, _("迷路ランダムVaultを生成しました。", "Maze Vault.")); @@ -1713,22 +1713,22 @@ void build_maze_vault(POSITION x0, POSITION y0, POSITION xsize, POSITION ysize, { for (x = x1 - 1; x <= x2 + 1; x++) { - c_ptr = &grid_array[y][x]; - c_ptr->info |= CAVE_ROOM; - if (is_vault) c_ptr->info |= CAVE_ICKY; + g_ptr = &grid_array[y][x]; + g_ptr->info |= CAVE_ROOM; + if (is_vault) g_ptr->info |= CAVE_ICKY; if ((x == x1 - 1) || (x == x2 + 1) || (y == y1 - 1) || (y == y2 + 1)) { - place_outer_grid(c_ptr); + place_outer_grid(g_ptr); } else if (!is_vault) { - place_extra_grid(c_ptr); + place_extra_grid(g_ptr); } else { - place_inner_grid(c_ptr); + place_inner_grid(g_ptr); } - if (light) c_ptr->info |= (CAVE_GLOW); + if (light) g_ptr->info |= (CAVE_GLOW); } } @@ -1963,22 +1963,22 @@ void build_recursive_room(POSITION x1, POSITION y1, POSITION x2, POSITION y2, in */ void add_outer_wall(POSITION x, POSITION y, int light, POSITION x1, POSITION y1, POSITION x2, POSITION y2) { - grid_type *c_ptr; + grid_type *g_ptr; feature_type *f_ptr; int i, j; if (!in_bounds(y, x)) return; - c_ptr = &grid_array[y][x]; + g_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) */ - if (c_ptr->info & CAVE_ROOM) return; + if (g_ptr->info & CAVE_ROOM) return; /* set room flag */ - c_ptr->info |= CAVE_ROOM; + g_ptr->info |= CAVE_ROOM; - f_ptr = &f_info[c_ptr->feat]; + f_ptr = &f_info[g_ptr->feat]; if (is_floor_bold(y, x)) { @@ -1990,7 +1990,7 @@ void add_outer_wall(POSITION x, POSITION y, int light, POSITION x1, POSITION y1, (y + j >= y1) && (y + j <= y2)) { add_outer_wall(x + i, y + j, light, x1, y1, x2, y2); - if (light) c_ptr->info |= CAVE_GLOW; + if (light) g_ptr->info |= CAVE_GLOW; } } } @@ -1999,12 +1999,12 @@ void add_outer_wall(POSITION x, POSITION y, int light, POSITION x1, POSITION y1, { /* Set bounding walls */ place_outer_bold(y, x); - if (light) c_ptr->info |= CAVE_GLOW; + if (light) g_ptr->info |= CAVE_GLOW; } else if (permanent_wall(f_ptr)) { /* Set bounding walls */ - if (light) c_ptr->info |= CAVE_GLOW; + if (light) g_ptr->info |= CAVE_GLOW; } } @@ -2042,17 +2042,17 @@ void generate_room_floor(POSITION y1, POSITION x1, POSITION y2, POSITION x2, int { POSITION y, x; - grid_type *c_ptr; + grid_type *g_ptr; for (y = y1; y <= y2; y++) { for (x = x1; x <= x2; x++) { /* Point to grid */ - c_ptr = &grid_array[y][x]; - place_floor_grid(c_ptr); - c_ptr->info |= (CAVE_ROOM); - if (light) c_ptr->info |= (CAVE_GLOW); + g_ptr = &grid_array[y][x]; + place_floor_grid(g_ptr); + g_ptr->info |= (CAVE_ROOM); + if (light) g_ptr->info |= (CAVE_GLOW); } } } diff --git a/src/save.c b/src/save.c index 51ce711e3..d7b1e8684 100644 --- a/src/save.c +++ b/src/save.c @@ -973,14 +973,14 @@ static void wr_saved_floor(saved_floor_type *sf_ptr) { for (x = 0; x < cur_wid; x++) { - grid_type *c_ptr = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; for (i = 0; i < num_temp; i++) { - if (templates[i].info == c_ptr->info && - templates[i].feat == c_ptr->feat && - templates[i].mimic == c_ptr->mimic && - templates[i].special == c_ptr->special) + if (templates[i].info == g_ptr->info && + templates[i].feat == g_ptr->feat && + templates[i].mimic == g_ptr->mimic && + templates[i].special == g_ptr->special) { /* Same terrain is exist */ templates[i].occurrence++; @@ -1004,10 +1004,10 @@ static void wr_saved_floor(saved_floor_type *sf_ptr) } /* Add new template */ - templates[num_temp].info = c_ptr->info; - templates[num_temp].feat = c_ptr->feat; - templates[num_temp].mimic = c_ptr->mimic; - templates[num_temp].special = c_ptr->special; + templates[num_temp].info = g_ptr->info; + templates[num_temp].feat = g_ptr->feat; + templates[num_temp].mimic = g_ptr->mimic; + templates[num_temp].special = g_ptr->special; templates[num_temp].occurrence = 1; /* Increase number of template */ @@ -1053,14 +1053,14 @@ static void wr_saved_floor(saved_floor_type *sf_ptr) { for (x = 0; x < cur_wid; x++) { - grid_type *c_ptr = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; for (i = 0; i < num_temp; i++) { - if (templates[i].info == c_ptr->info && - templates[i].feat == c_ptr->feat && - templates[i].mimic == c_ptr->mimic && - templates[i].special == c_ptr->special) + if (templates[i].info == g_ptr->info && + templates[i].feat == g_ptr->feat && + templates[i].mimic == g_ptr->mimic && + templates[i].special == g_ptr->special) break; } diff --git a/src/shoot.c b/src/shoot.c index 55109b1ec..33d1099f9 100644 --- a/src/shoot.c +++ b/src/shoot.c @@ -506,7 +506,7 @@ void exe_fire(INVENTORY_IDX item, object_type *j_ptr) /* Travel until stopped */ for (cur_dis = 0; cur_dis <= tdis; ) { - grid_type *c_ptr; + grid_type *g_ptr; /* Hack -- Stop at the target */ if ((y == ty) && (x == tx)) break; @@ -519,13 +519,13 @@ void exe_fire(INVENTORY_IDX item, object_type *j_ptr) /* Shatter Arrow */ if (snipe_type == SP_KILL_WALL) { - c_ptr = &grid_array[ny][nx]; + g_ptr = &grid_array[ny][nx]; - if (cave_have_flag_grid(c_ptr, FF_HURT_ROCK) && !c_ptr->m_idx) + if (cave_have_flag_grid(g_ptr, FF_HURT_ROCK) && !g_ptr->m_idx) { - if (c_ptr->info & (CAVE_MARK)) msg_print(_("岩が砕け散った。", "Wall rocks were shattered.")); + if (g_ptr->info & (CAVE_MARK)) msg_print(_("岩が砕け散った。", "Wall rocks were shattered.")); /* Forget the wall */ - c_ptr->info &= ~(CAVE_MARK); + g_ptr->info &= ~(CAVE_MARK); p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE); /* Destroy the wall */ diff --git a/src/spells-object.c b/src/spells-object.c index f4ecc3daa..e5dc949db 100644 --- a/src/spells-object.c +++ b/src/spells-object.c @@ -107,19 +107,19 @@ bool create_ammo(void) { POSITION x, y; DIRECTION dir; - grid_type *c_ptr; + grid_type *g_ptr; if (!get_rep_dir(&dir, FALSE)) return FALSE; y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; - if (!have_flag(f_info[get_feat_mimic(c_ptr)].flags, FF_CAN_DIG)) + if (!have_flag(f_info[get_feat_mimic(g_ptr)].flags, FF_CAN_DIG)) { msg_print(_("そこには岩石がない。", "You need pile of rubble.")); return FALSE; } - else if (!cave_have_flag_grid(c_ptr, FF_CAN_DIG) || !cave_have_flag_grid(c_ptr, FF_HURT_ROCK)) + else if (!cave_have_flag_grid(g_ptr, FF_CAN_DIG) || !cave_have_flag_grid(g_ptr, FF_HURT_ROCK)) { msg_print(_("硬すぎて崩せなかった。", "You failed to make ammo.")); } diff --git a/src/spells1.c b/src/spells1.c index 3949c7c11..826fc116f 100644 --- a/src/spells1.c +++ b/src/spells1.c @@ -304,8 +304,8 @@ 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 = &grid_array[y][x]; - feature_type *f_ptr = &f_info[c_ptr->feat]; + grid_type *g_ptr = &grid_array[y][x]; + feature_type *f_ptr = &f_info[g_ptr->feat]; bool obvious = FALSE; bool known = player_has_los_bold(y, x); @@ -358,7 +358,7 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P cave_set_feat(y, x, one_in_(3) ? feat_brake : feat_grass); /* Observe */ - if (c_ptr->info & (CAVE_MARK)) obvious = TRUE; + if (g_ptr->info & (CAVE_MARK)) obvious = TRUE; } } @@ -404,7 +404,7 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P case GF_KILL_TRAP: { /* Reveal secret doors */ - if (is_hidden_door(c_ptr)) + if (is_hidden_door(g_ptr)) { /* Pick a door */ disclose_grid(y, x); @@ -417,7 +417,7 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P } /* Destroy traps */ - if (is_trap(c_ptr->feat)) + if (is_trap(g_ptr->feat)) { /* Check line of sight */ if (known) @@ -431,15 +431,15 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P } /* Locked doors are unlocked */ - if (is_closed_door(c_ptr->feat) && f_ptr->power && have_flag(f_ptr->flags, FF_OPEN)) + if (is_closed_door(g_ptr->feat) && f_ptr->power && have_flag(f_ptr->flags, FF_OPEN)) { - s16b old_feat = c_ptr->feat; + s16b old_feat = g_ptr->feat; /* Unlock the door */ cave_alter_feat(y, x, FF_DISARM); /* Check line of sound */ - if (known && (old_feat != c_ptr->feat)) + if (known && (old_feat != g_ptr->feat)) { msg_print(_("カチッと音がした!", "Click!")); obvious = TRUE; @@ -449,7 +449,7 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P /* Remove "unsafe" flag if player is not blind */ if (!p_ptr->blind && player_has_los_bold(y, x)) { - c_ptr->info &= ~(CAVE_UNSAFE); + g_ptr->info &= ~(CAVE_UNSAFE); lite_spot(y, x); obvious = TRUE; } @@ -461,7 +461,7 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P case GF_KILL_DOOR: { /* Destroy all doors and traps */ - if (is_trap(c_ptr->feat) || have_flag(f_ptr->flags, FF_DOOR)) + if (is_trap(g_ptr->feat) || have_flag(f_ptr->flags, FF_DOOR)) { /* Check line of sight */ if (known) @@ -477,7 +477,7 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P /* Remove "unsafe" flag if player is not blind */ if (!p_ptr->blind && player_has_los_bold(y, x)) { - c_ptr->info &= ~(CAVE_UNSAFE); + g_ptr->info &= ~(CAVE_UNSAFE); lite_spot(y, x); obvious = TRUE; } @@ -489,11 +489,11 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P { if (have_flag(f_ptr->flags, FF_SPIKE)) { - s16b old_mimic = c_ptr->mimic; - feature_type *mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)]; + s16b old_mimic = g_ptr->mimic; + feature_type *mimic_f_ptr = &f_info[get_feat_mimic(g_ptr)]; cave_alter_feat(y, x, FF_SPIKE); - c_ptr->mimic = old_mimic; + g_ptr->mimic = old_mimic; note_spot(y, x); lite_spot(y, x); @@ -513,9 +513,9 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P { if (have_flag(f_ptr->flags, FF_HURT_ROCK)) { - if (known && (c_ptr->info & (CAVE_MARK))) + if (known && (g_ptr->info & (CAVE_MARK))) { - msg_format(_("%sが溶けて泥になった!", "The %s turns into mud!"), f_name + f_info[get_feat_mimic(c_ptr)].name); + msg_format(_("%sが溶けて泥になった!", "The %s turns into mud!"), f_name + f_info[get_feat_mimic(g_ptr)].name); obvious = TRUE; } @@ -534,7 +534,7 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P if (!cave_naked_bold(y, x)) break; if (player_bold(y, x)) break; cave_set_feat(y, x, feat_door[DOOR_DOOR].closed); - if (c_ptr->info & (CAVE_MARK)) obvious = TRUE; + if (g_ptr->info & (CAVE_MARK)) obvious = TRUE; break; } @@ -549,15 +549,15 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P if (!cave_naked_bold(y, x)) break; if (player_bold(y, x)) break; cave_set_feat(y, x, feat_tree); - if (c_ptr->info & (CAVE_MARK)) obvious = TRUE; + if (g_ptr->info & (CAVE_MARK)) obvious = TRUE; break; } case GF_MAKE_GLYPH: { if (!cave_naked_bold(y, x)) break; - c_ptr->info |= CAVE_OBJECT; - c_ptr->mimic = feat_glyph; + g_ptr->info |= CAVE_OBJECT; + g_ptr->mimic = feat_glyph; note_spot(y, x); lite_spot(y, x); break; @@ -608,7 +608,7 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P /* Turn on the light */ if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) { - c_ptr->info |= (CAVE_GLOW); + g_ptr->info |= (CAVE_GLOW); note_spot(y, x); lite_spot(y, x); update_local_illumination(y, x); @@ -618,7 +618,7 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P /* Mega-Hack -- Update the monster in the affected grid */ /* This allows "spear of light" (etc) to work "correctly" */ - if (c_ptr->m_idx) update_monster(c_ptr->m_idx, FALSE); + if (g_ptr->m_idx) update_monster(g_ptr->m_idx, FALSE); if (p_ptr->special_defense & NINJA_S_STEALTH) { @@ -633,7 +633,7 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P case GF_DARK_WEAK: case GF_DARK: { - bool do_dark = !p_ptr->inside_battle && !is_mirror_grid(c_ptr); + bool do_dark = !p_ptr->inside_battle && !is_mirror_grid(g_ptr); int j; /* Turn off the light. */ @@ -661,13 +661,13 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P if (!do_dark) break; } - c_ptr->info &= ~(CAVE_GLOW); + g_ptr->info &= ~(CAVE_GLOW); /* Hack -- Forget "boring" grids */ if (!have_flag(f_ptr->flags, FF_REMEMBER)) { /* Forget */ - c_ptr->info &= ~(CAVE_MARK); + g_ptr->info &= ~(CAVE_MARK); note_spot(y, x); } @@ -680,7 +680,7 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P /* Mega-Hack -- Update the monster in the affected grid */ /* This allows "spear of light" (etc) to work "correctly" */ - if (c_ptr->m_idx) update_monster(c_ptr->m_idx, FALSE); + if (g_ptr->m_idx) update_monster(g_ptr->m_idx, FALSE); } /* All done */ @@ -690,7 +690,7 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P case GF_SHARDS: case GF_ROCKET: { - if (is_mirror_grid(c_ptr)) + if (is_mirror_grid(g_ptr)) { msg_print(_("鏡が割れた!", "The mirror was crashed!")); sound(SOUND_GLASS); @@ -700,9 +700,9 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P if (have_flag(f_ptr->flags, FF_GLASS) && !have_flag(f_ptr->flags, FF_PERMANENT) && (dam >= 50)) { - if (known && (c_ptr->info & CAVE_MARK)) + if (known && (g_ptr->info & CAVE_MARK)) { - msg_format(_("%sが割れた!", "The %s was crashed!"), f_name + f_info[get_feat_mimic(c_ptr)].name); + msg_format(_("%sが割れた!", "The %s was crashed!"), f_name + f_info[get_feat_mimic(g_ptr)].name); sound(SOUND_GLASS); } @@ -717,7 +717,7 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P case GF_SOUND: { - if (is_mirror_grid(c_ptr) && p_ptr->lev < 40) + if (is_mirror_grid(g_ptr) && p_ptr->lev < 40) { msg_print(_("鏡が割れた!", "The mirror was crashed!")); sound(SOUND_GLASS); @@ -727,9 +727,9 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P if (have_flag(f_ptr->flags, FF_GLASS) && !have_flag(f_ptr->flags, FF_PERMANENT) && (dam >= 200)) { - if (known && (c_ptr->info & CAVE_MARK)) + if (known && (g_ptr->info & CAVE_MARK)) { - msg_format(_("%sが割れた!", "The %s was crashed!"), f_name + f_info[get_feat_mimic(c_ptr)].name); + msg_format(_("%sが割れた!", "The %s was crashed!"), f_name + f_info[get_feat_mimic(g_ptr)].name); sound(SOUND_GLASS); } @@ -745,7 +745,7 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P case GF_DISINTEGRATE: { /* Destroy mirror/glyph */ - if (is_mirror_grid(c_ptr) || is_glyph_grid(c_ptr) || is_explosive_rune_grid(c_ptr)) + if (is_mirror_grid(g_ptr) || is_glyph_grid(g_ptr) || is_explosive_rune_grid(g_ptr)) remove_mirror(y, x); /* Permanent features don't get effect */ @@ -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 = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; OBJECT_IDX this_o_idx, next_o_idx = 0; @@ -819,7 +819,7 @@ static bool project_o(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P /* Scan all objects in the grid */ - for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) + for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) { object_type *o_ptr = &o_list[this_o_idx]; @@ -1177,9 +1177,9 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P { int tmp; - grid_type *c_ptr = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; - monster_type *m_ptr = &m_list[c_ptr->m_idx]; + monster_type *m_ptr = &m_list[g_ptr->m_idx]; monster_type *caster_ptr = (who > 0) ? &m_list[who] : NULL; monster_race *r_ptr = &r_info[m_ptr->r_idx]; @@ -1245,11 +1245,11 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P DEPTH caster_lev = (who > 0) ? r_info[caster_ptr->r_idx].level : (p_ptr->lev * 2); /* Nobody here */ - if (!c_ptr->m_idx) return (FALSE); + if (!g_ptr->m_idx) return (FALSE); /* Never affect projector */ - if (who && (c_ptr->m_idx == who)) return (FALSE); - if ((c_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE); + if (who && (g_ptr->m_idx == who)) return (FALSE); + if ((g_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE); if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE; /* Don't affect already death monsters */ @@ -1266,7 +1266,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P /* Get the monster possessive ("his"/"her"/"its") */ monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE); - if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(TRUE, TRUE); + if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) disturb(TRUE, TRUE); /* Analyze the damage type */ switch (typ) @@ -1791,7 +1791,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P /* Normal monsters slow down */ else { - if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50)) + if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50)) { note = _("の動きが遅くなった。", " starts moving slower."); } @@ -1854,7 +1854,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P if (!resist_tele) do_dist = 10; else do_dist = 0; - if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0; + if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) do_dist = 0; if (r_ptr->flagsr & RFR_RES_GRAV) { @@ -1875,7 +1875,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P /* Normal monsters slow down */ else { - if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50)) + if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50)) { note = _("の動きが遅くなった。", " starts moving slower."); } @@ -2136,7 +2136,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P } if (one_in_(4)) { - if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0; + if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) do_dist = 0; else do_dist = 7; } @@ -2430,7 +2430,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P m_ptr->hp = m_ptr->maxhp; /* Attempt to clone. */ - if (multiply_monster(c_ptr->m_idx, TRUE, 0L)) + if (multiply_monster(g_ptr->m_idx, TRUE, 0L)) { note = _("が分裂した!", " spawns!"); } @@ -2449,7 +2449,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P if (seen) obvious = TRUE; /* Wake up */ - (void)set_monster_csleep(c_ptr->m_idx, 0); + (void)set_monster_csleep(g_ptr->m_idx, 0); if (m_ptr->maxhp < m_ptr->max_maxhp) { @@ -2460,8 +2460,8 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P if (!dam) { /* Redraw (later) if needed */ - if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH); - if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH); + if (p_ptr->health_who == g_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH); + if (p_ptr->riding == g_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH); break; } @@ -2472,21 +2472,21 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P if (seen) obvious = TRUE; /* Wake up */ - (void)set_monster_csleep(c_ptr->m_idx, 0); + (void)set_monster_csleep(g_ptr->m_idx, 0); if (MON_STUNNED(m_ptr)) { if (seen_msg) msg_format(_("%^sは朦朧状態から立ち直った。", "%^s is no longer stunned."), m_name); - (void)set_monster_stunned(c_ptr->m_idx, 0); + (void)set_monster_stunned(g_ptr->m_idx, 0); } if (MON_CONFUSED(m_ptr)) { if (seen_msg) msg_format(_("%^sは混乱から立ち直った。", "%^s is no longer confused."), m_name); - (void)set_monster_confused(c_ptr->m_idx, 0); + (void)set_monster_confused(g_ptr->m_idx, 0); } if (MON_MONFEAR(m_ptr)) { if (seen_msg) msg_format(_("%^sは勇気を取り戻した。", "%^s recovers %s courage."), m_name); - (void)set_monster_monfear(c_ptr->m_idx, 0); + (void)set_monster_monfear(g_ptr->m_idx, 0); } /* Heal */ @@ -2523,8 +2523,8 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P } /* Redraw (later) if needed */ - if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH); - if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH); + if (p_ptr->health_who == g_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH); + if (p_ptr->riding == g_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH); note = _("は体力を回復したようだ。", " looks healthier."); @@ -2540,7 +2540,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P if (seen) obvious = TRUE; /* Speed up */ - if (set_monster_fast(c_ptr->m_idx, MON_FAST(m_ptr) + 100)) + if (set_monster_fast(g_ptr->m_idx, MON_FAST(m_ptr) + 100)) { note = _("の動きが速くなった。", " starts moving faster."); } @@ -2582,7 +2582,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P /* Normal monsters slow down */ else { - if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50)) + if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50)) { note = _("の動きが遅くなった。", " starts moving slower."); } @@ -3698,7 +3698,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P do_conf = randint0(8) + 8; do_stun = randint0(8) + 8; } - (void)set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 10); + (void)set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 10); } break; } @@ -3858,14 +3858,14 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P } else if (m_ptr->hp < randint0(nokori_hp)) { - if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(c_ptr->m_idx, FALSE, MON_CHAMELEON); + if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(g_ptr->m_idx, FALSE, MON_CHAMELEON); msg_format(_("%sを捕えた!", "You capture %^s!"), m_name); cap_mon = m_ptr->r_idx; cap_mspeed = m_ptr->mspeed; cap_hp = m_ptr->hp; cap_maxhp = m_ptr->max_maxhp; cap_nickname = m_ptr->nickname; /* Quark transfer */ - if (c_ptr->m_idx == p_ptr->riding) + if (g_ptr->m_idx == p_ptr->riding) { if (rakuba(-1, FALSE)) { @@ -3873,7 +3873,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P } } - delete_monster_idx(c_ptr->m_idx); + delete_monster_idx(g_ptr->m_idx); return (TRUE); } @@ -3941,7 +3941,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P /* Normal monsters slow down */ else { - if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50)) + if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50)) { note = _("の動きが遅くなった。", " starts moving slower."); } @@ -4013,7 +4013,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P break; } - if (genocide_aux(c_ptr->m_idx, dam, !who, (r_ptr->level + 1) / 2, _("モンスター消滅", "Genocide One"))) + if (genocide_aux(g_ptr->m_idx, dam, !who, (r_ptr->level + 1) / 2, _("モンスター消滅", "Genocide One"))) { if (seen_msg) msg_format(_("%sは消滅した!", "%^s disappered!"), m_name); chg_virtue(V_VITALITY, -1); @@ -4083,7 +4083,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P if (is_pet(m_ptr)) { note = _("の動きが速くなった。", " starts moving faster."); - (void)set_monster_fast(c_ptr->m_idx, MON_FAST(m_ptr) + 100); + (void)set_monster_fast(g_ptr->m_idx, MON_FAST(m_ptr) + 100); success = TRUE; } @@ -4101,7 +4101,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P { note = _("を支配した。", " is tamed!"); set_pet(m_ptr); - (void)set_monster_fast(c_ptr->m_idx, MON_FAST(m_ptr) + 100); + (void)set_monster_fast(g_ptr->m_idx, MON_FAST(m_ptr) + 100); /* Learn about type */ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD); @@ -4167,7 +4167,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P /* Quest monsters cannot be polymorphed */ if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE; - if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_poly = FALSE; + if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) do_poly = FALSE; /* "Unique" and "quest" monsters can only be "killed" by the player. */ if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle) @@ -4214,7 +4214,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P } /* Apply stun */ - (void)set_monster_stunned(c_ptr->m_idx, tmp); + (void)set_monster_stunned(g_ptr->m_idx, tmp); /* Get angry */ get_angry = TRUE; @@ -4242,7 +4242,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P } /* Apply confusion */ - (void)set_monster_confused(c_ptr->m_idx, tmp); + (void)set_monster_confused(g_ptr->m_idx, tmp); /* Get angry */ get_angry = TRUE; @@ -4283,7 +4283,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P } /* Hack -- Get new monster */ - m_ptr = &m_list[c_ptr->m_idx]; + m_ptr = &m_list[g_ptr->m_idx]; /* Hack -- Get new race */ r_ptr = &r_info[m_ptr->r_idx]; @@ -4299,7 +4299,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P if (!who) chg_virtue(V_VALOUR, -1); /* Teleport */ - teleport_away(c_ptr->m_idx, do_dist, + teleport_away(g_ptr->m_idx, do_dist, (!who ? TELEPORT_DEC_VALOUR : 0L) | TELEPORT_PASSIVE); /* Hack -- get new location */ @@ -4307,14 +4307,14 @@ 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 = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; } /* Fear */ if (do_fear) { /* Set fear */ - (void)set_monster_monfear(c_ptr->m_idx, MON_MONFEAR(m_ptr) + do_fear); + (void)set_monster_monfear(g_ptr->m_idx, MON_MONFEAR(m_ptr) + do_fear); /* Get angry */ get_angry = TRUE; @@ -4330,11 +4330,11 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P else if (who) { /* Redraw (later) if needed */ - if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH); - if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH); + if (p_ptr->health_who == g_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH); + if (p_ptr->riding == g_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH); /* Wake the monster up */ - (void)set_monster_csleep(c_ptr->m_idx, 0); + (void)set_monster_csleep(g_ptr->m_idx, 0); /* Hurt the monster */ m_ptr->hp -= dam; @@ -4364,10 +4364,10 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P if (who > 0) monster_gain_exp(who, m_ptr->r_idx); /* Generate treasure, etc */ - monster_death(c_ptr->m_idx, FALSE); + monster_death(g_ptr->m_idx, FALSE); - delete_monster_idx(c_ptr->m_idx); + delete_monster_idx(g_ptr->m_idx); if (sad) { @@ -4384,7 +4384,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P /* Hack -- Pain message */ else if (see_s_msg) { - message_pain(c_ptr->m_idx, dam); + message_pain(g_ptr->m_idx, dam); } else { @@ -4392,7 +4392,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P } /* Hack -- handle sleep */ - if (do_sleep) (void)set_monster_csleep(c_ptr->m_idx, do_sleep); + if (do_sleep) (void)set_monster_csleep(g_ptr->m_idx, do_sleep); } } @@ -4408,7 +4408,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_HEAL_LEPER, m2_name); } - delete_monster_idx(c_ptr->m_idx); + delete_monster_idx(g_ptr->m_idx); } /* If the player did it, give him experience, check fear */ @@ -4417,7 +4417,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P bool fear = FALSE; /* Hurt the monster, check for fear and death */ - if (mon_take_hit(c_ptr->m_idx, dam, &fear, note_dies)) + if (mon_take_hit(g_ptr->m_idx, dam, &fear, note_dies)) { /* Dead monster */ } @@ -4435,7 +4435,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P /* Hack -- Pain message */ else if (known && (dam || !do_fear)) { - message_pain(c_ptr->m_idx, dam); + message_pain(g_ptr->m_idx, dam); } /* Anger monsters */ @@ -4449,7 +4449,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P } /* Hack -- handle sleep */ - if (do_sleep) (void)set_monster_csleep(c_ptr->m_idx, do_sleep); + if (do_sleep) (void)set_monster_csleep(g_ptr->m_idx, do_sleep); } } @@ -4482,7 +4482,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P { msg_print(_("空間が歪んだ!", "Space warps about you!")); - if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), TELEPORT_PASSIVE); + if (m_ptr->r_idx) teleport_away(g_ptr->m_idx, damroll(10, 10), TELEPORT_PASSIVE); if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE); if (!one_in_(6)) break; } @@ -4543,13 +4543,13 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P if (p_ptr->inside_battle) { - p_ptr->health_who = c_ptr->m_idx; + p_ptr->health_who = g_ptr->m_idx; p_ptr->redraw |= (PR_HEALTH); handle_stuff(); } /* Verify this code */ - if (m_ptr->r_idx) update_monster(c_ptr->m_idx, FALSE); + if (m_ptr->r_idx) update_monster(g_ptr->m_idx, FALSE); /* Redraw the monster grid */ lite_spot(y, x); @@ -4576,7 +4576,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P } } - if (p_ptr->riding && (p_ptr->riding == c_ptr->m_idx) && (dam > 0)) + if (p_ptr->riding && (p_ptr->riding == g_ptr->m_idx) && (dam > 0)) { if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2; rakubadam_m = (dam > 200) ? 200 : dam; diff --git a/src/spells2.c b/src/spells2.c index 9d63a7a54..9a0f2771e 100644 --- a/src/spells2.c +++ b/src/spells2.c @@ -38,7 +38,7 @@ static bool detect_feat_flag(POSITION range, int flag, bool known) { POSITION x, y; bool detect = FALSE; - grid_type *c_ptr; + grid_type *g_ptr; if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3; @@ -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 = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Hack -- Safe */ if (flag == FF_TRAP) @@ -57,22 +57,22 @@ static bool detect_feat_flag(POSITION range, int flag, bool known) /* Mark as detected */ if (dist <= range && known) { - if (dist <= range - 1) c_ptr->info |= (CAVE_IN_DETECT); + if (dist <= range - 1) g_ptr->info |= (CAVE_IN_DETECT); - c_ptr->info &= ~(CAVE_UNSAFE); + g_ptr->info &= ~(CAVE_UNSAFE); lite_spot(y, x); } } /* Detect flags */ - if (cave_have_flag_grid(c_ptr, flag)) + if (cave_have_flag_grid(g_ptr, flag)) { /* Detect secrets */ disclose_grid(y, x); /* Hack -- Memorize */ - c_ptr->info |= (CAVE_MARK); + g_ptr->info |= (CAVE_MARK); lite_spot(y, x); @@ -1394,7 +1394,7 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate) { POSITION y, x; int k, t; - grid_type *c_ptr; + grid_type *g_ptr; bool flag = FALSE; /* Prevent destruction of quest levels and town */ @@ -1419,18 +1419,18 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate) /* Stay in the circle of death */ if (k > r) continue; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Lose room and vault */ - c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY); + g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY); /* Lose light and knowledge */ - c_ptr->info &= ~(CAVE_MARK | CAVE_GLOW | CAVE_KNOWN); + g_ptr->info &= ~(CAVE_MARK | CAVE_GLOW | CAVE_KNOWN); if (!in_generate) /* Normal */ { /* Lose unsafety */ - c_ptr->info &= ~(CAVE_UNSAFE); + g_ptr->info &= ~(CAVE_UNSAFE); /* Hack -- Notice player affect */ if (player_bold(y, x)) @@ -1446,9 +1446,9 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate) /* Hack -- Skip the epicenter */ if ((y == y1) && (x == x1)) continue; - if (c_ptr->m_idx) + if (g_ptr->m_idx) { - monster_type *m_ptr = &m_list[c_ptr->m_idx]; + monster_type *m_ptr = &m_list[g_ptr->m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; if (in_generate) /* In generation */ @@ -1462,7 +1462,7 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate) m_ptr->hp = m_ptr->maxhp; /* Try to teleport away quest monsters */ - if (!teleport_away(c_ptr->m_idx, (r * 2) + 1, TELEPORT_DEC_VALOUR)) continue; + if (!teleport_away(g_ptr->m_idx, (r * 2) + 1, TELEPORT_DEC_VALOUR)) continue; } else { @@ -1485,7 +1485,7 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate) OBJECT_IDX this_o_idx, next_o_idx = 0; /* Scan all objects in the grid */ - for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) + for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) { object_type *o_ptr; o_ptr = &o_list[this_o_idx]; @@ -1517,7 +1517,7 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate) delete_object(y, x); /* Destroy "non-permanent" grids */ - if (!cave_perma_grid(c_ptr)) + if (!cave_perma_grid(g_ptr)) { /* Wall (or floor) type */ t = randint0(200); @@ -1550,26 +1550,26 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate) if (t < 20) { /* Create granite wall */ - place_extra_grid(c_ptr); + place_extra_grid(g_ptr); } else if (t < 70) { /* Create quartz vein */ - c_ptr->feat = feat_quartz_vein; + g_ptr->feat = feat_quartz_vein; } else if (t < 100) { /* Create magma vein */ - c_ptr->feat = feat_magma_vein; + g_ptr->feat = feat_magma_vein; } else { /* Create floor */ - place_floor_grid(c_ptr); + place_floor_grid(g_ptr); } /* Clear garbage of hidden trap or door */ - c_ptr->mimic = 0; + g_ptr->mimic = 0; } } } @@ -1590,9 +1590,9 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate) /* Stay in the circle of death */ if (k > r) continue; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; - if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW; + if (is_mirror_grid(g_ptr)) g_ptr->info |= CAVE_GLOW; else if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) { DIRECTION i; @@ -1607,7 +1607,7 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate) cc_ptr = &grid_array[yy][xx]; if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW)) { - c_ptr->info |= CAVE_GLOW; + g_ptr->info |= CAVE_GLOW; break; } } @@ -1682,7 +1682,7 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx) int sn = 0; POSITION sy = 0, sx = 0; bool hurt = FALSE; - grid_type *c_ptr; + grid_type *g_ptr; bool map[32][32]; /* Prevent destruction of quest levels and town */ @@ -1717,11 +1717,11 @@ 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 = &grid_array[yy][xx]; + g_ptr = &grid_array[yy][xx]; /* Lose room and vault / Lose light and knowledge */ - c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY | CAVE_UNSAFE); - c_ptr->info &= ~(CAVE_GLOW | CAVE_MARK | CAVE_KNOWN); + g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY | CAVE_UNSAFE); + g_ptr->info &= ~(CAVE_GLOW | CAVE_MARK | CAVE_KNOWN); /* Skip the epicenter */ if (!dx && !dy) continue; @@ -1862,14 +1862,14 @@ 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 = &grid_array[yy][xx]; + g_ptr = &grid_array[yy][xx]; - if (c_ptr->m_idx == p_ptr->riding) continue; + if (g_ptr->m_idx == p_ptr->riding) continue; /* Process monsters */ - if (c_ptr->m_idx) + if (g_ptr->m_idx) { - monster_type *m_ptr = &m_list[c_ptr->m_idx]; + monster_type *m_ptr = &m_list[g_ptr->m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; /* Quest monsters */ @@ -1935,7 +1935,7 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx) damage = (sn ? damroll(4, 8) : (m_ptr->hp + 1)); /* Monster is certainly awake */ - (void)set_monster_csleep(c_ptr->m_idx, 0); + (void)set_monster_csleep(g_ptr->m_idx, 0); /* Apply damage directly */ m_ptr->hp -= damage; @@ -1946,9 +1946,9 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx) if (!ignore_unview || is_seen(m_ptr)) msg_format(_("%^sは岩石に埋もれてしまった!", "%^s is embedded in the rock!"), m_name); - if (c_ptr->m_idx) + if (g_ptr->m_idx) { - if (record_named_pet && is_pet(&m_list[c_ptr->m_idx]) && m_list[c_ptr->m_idx].nickname) + if (record_named_pet && is_pet(&m_list[g_ptr->m_idx]) && m_list[g_ptr->m_idx].nickname) { char m2_name[MAX_NLEN]; @@ -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 = &grid_array[yy][xx]; + g_ptr = &grid_array[yy][xx]; /* Paranoia -- never affect player */ /* if (player_bold(yy, xx)) continue; */ @@ -2060,9 +2060,9 @@ 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 = &grid_array[yy][xx]; + g_ptr = &grid_array[yy][xx]; - if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW; + if (is_mirror_grid(g_ptr)) g_ptr->info |= CAVE_GLOW; else if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) { DIRECTION ii; @@ -2077,7 +2077,7 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx) cc_ptr = &grid_array[yyy][xxx]; if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW)) { - c_ptr->info |= CAVE_GLOW; + g_ptr->info |= CAVE_GLOW; break; } } @@ -2196,24 +2196,24 @@ static void cave_temp_room_lite(void) POSITION y = temp_y[i]; POSITION x = temp_x[i]; - grid_type *c_ptr = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; /* No longer in the array */ - c_ptr->info &= ~(CAVE_TEMP); + g_ptr->info &= ~(CAVE_TEMP); /* Update only non-CAVE_GLOW grids */ - /* if (c_ptr->info & (CAVE_GLOW)) continue; */ + /* if (g_ptr->info & (CAVE_GLOW)) continue; */ /* Perma-Lite */ - c_ptr->info |= (CAVE_GLOW); + g_ptr->info |= (CAVE_GLOW); /* Process affected monsters */ - if (c_ptr->m_idx) + if (g_ptr->m_idx) { int chance = 25; - monster_type *m_ptr = &m_list[c_ptr->m_idx]; + monster_type *m_ptr = &m_list[g_ptr->m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; - update_monster(c_ptr->m_idx, FALSE); + update_monster(g_ptr->m_idx, FALSE); /* Stupid monsters rarely wake up */ if (r_ptr->flags2 & (RF2_STUPID)) chance = 10; @@ -2225,7 +2225,7 @@ static void cave_temp_room_lite(void) if (MON_CSLEEP(m_ptr) && (randint0(100) < chance)) { /* Wake up! */ - (void)set_monster_csleep(c_ptr->m_idx, 0); + (void)set_monster_csleep(g_ptr->m_idx, 0); /* Notice the "waking up" */ if (m_ptr->ml) @@ -2271,11 +2271,11 @@ static void cave_temp_room_unlite(void) POSITION x = temp_x[i]; int j; - grid_type *c_ptr = &grid_array[y][x]; - bool do_dark = !is_mirror_grid(c_ptr); + grid_type *g_ptr = &grid_array[y][x]; + bool do_dark = !is_mirror_grid(g_ptr); /* No longer in the array */ - c_ptr->info &= ~(CAVE_TEMP); + g_ptr->info &= ~(CAVE_TEMP); /* Darken the grid */ if (do_dark) @@ -2302,20 +2302,20 @@ static void cave_temp_room_unlite(void) if (!do_dark) continue; } - c_ptr->info &= ~(CAVE_GLOW); + g_ptr->info &= ~(CAVE_GLOW); /* Hack -- Forget "boring" grids */ - if (!have_flag(f_info[get_feat_mimic(c_ptr)].flags, FF_REMEMBER)) + if (!have_flag(f_info[get_feat_mimic(g_ptr)].flags, FF_REMEMBER)) { /* Forget the grid */ - if (!view_torch_grids) c_ptr->info &= ~(CAVE_MARK); + if (!view_torch_grids) g_ptr->info &= ~(CAVE_MARK); note_spot(y, x); } /* Process affected monsters */ - if (c_ptr->m_idx) + if (g_ptr->m_idx) { - update_monster(c_ptr->m_idx, FALSE); + update_monster(g_ptr->m_idx, FALSE); } lite_spot(y, x); @@ -2402,16 +2402,16 @@ static int next_to_walls_adj(POSITION cy, POSITION cx, bool (*pass_bold)(POSITIO */ static void cave_temp_room_aux(POSITION y, POSITION x, bool only_room, bool (*pass_bold)(POSITION, POSITION)) { - grid_type *c_ptr; + grid_type *g_ptr; /* Get the grid */ - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Avoid infinite recursion */ - if (c_ptr->info & (CAVE_TEMP)) return; + if (g_ptr->info & (CAVE_TEMP)) return; /* Do not "leave" the current room */ - if (!(c_ptr->info & (CAVE_ROOM))) + if (!(g_ptr->info & (CAVE_ROOM))) { if (only_room) return; @@ -2438,7 +2438,7 @@ static void cave_temp_room_aux(POSITION y, POSITION x, bool only_room, bool (*pa if (temp_n == TEMP_MAX) return; /* Mark the grid as "seen" */ - c_ptr->info |= (CAVE_TEMP); + g_ptr->info |= (CAVE_TEMP); /* Add it to the "seen" set */ temp_y[temp_n] = y; @@ -2891,7 +2891,7 @@ bool fire_blast(EFFECT_ID typ, DIRECTION dir, DICE_NUMBER dd, DICE_SID ds, int n bool teleport_swap(DIRECTION dir) { POSITION tx, ty; - grid_type* c_ptr; + grid_type* g_ptr; monster_type* m_ptr; monster_race* r_ptr; @@ -2905,7 +2905,7 @@ bool teleport_swap(DIRECTION dir) tx = p_ptr->x + ddx[dir]; ty = p_ptr->y + ddy[dir]; } - c_ptr = &grid_array[ty][tx]; + g_ptr = &grid_array[ty][tx]; if (p_ptr->anti_tele) { @@ -2913,22 +2913,22 @@ bool teleport_swap(DIRECTION dir) return FALSE; } - if (!c_ptr->m_idx || (c_ptr->m_idx == p_ptr->riding)) + if (!g_ptr->m_idx || (g_ptr->m_idx == p_ptr->riding)) { msg_print(_("それとは場所を交換できません。", "You can't trade places with that!")); return FALSE; } - if ((c_ptr->info & CAVE_ICKY) || (distance(ty, tx, p_ptr->y, p_ptr->x) > p_ptr->lev * 3 / 2 + 10)) + if ((g_ptr->info & CAVE_ICKY) || (distance(ty, tx, p_ptr->y, p_ptr->x) > p_ptr->lev * 3 / 2 + 10)) { msg_print(_("失敗した。", "Failed to swap.")); return FALSE; } - m_ptr = &m_list[c_ptr->m_idx]; + m_ptr = &m_list[g_ptr->m_idx]; r_ptr = &r_info[m_ptr->r_idx]; - (void)set_monster_csleep(c_ptr->m_idx, 0); + (void)set_monster_csleep(g_ptr->m_idx, 0); if (r_ptr->flagsr & RFR_RES_TELE) { @@ -4607,7 +4607,7 @@ bool_hack vampirism(void) DIRECTION dir; POSITION x, y; int dummy; - grid_type *c_ptr; + grid_type *g_ptr; if (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MELEE) { @@ -4619,11 +4619,11 @@ 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 = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; stop_mouth(); - if (!(c_ptr->m_idx)) + if (!(g_ptr->m_idx)) { msg_print(_("何もない場所に噛みついた!", "You bite into thin air!")); return FALSE; @@ -4969,8 +4969,8 @@ void hayagake(player_type *creature_ptr) } else { - grid_type *c_ptr = &grid_array[creature_ptr->y][creature_ptr->x]; - feature_type *f_ptr = &f_info[c_ptr->feat]; + grid_type *g_ptr = &grid_array[creature_ptr->y][creature_ptr->x]; + feature_type *f_ptr = &f_info[g_ptr->feat]; if (!have_flag(f_ptr->flags, FF_PROJECT) || (!creature_ptr->levitation && have_flag(f_ptr->flags, FF_DEEP))) @@ -5098,17 +5098,17 @@ bool sword_dancing(player_type *creature_ptr) DIRECTION dir; POSITION y = 0, x = 0; int i; - grid_type *c_ptr; + grid_type *g_ptr; for (i = 0; i < 6; i++) { dir = randint0(8); y = creature_ptr->y + ddy_ddd[dir]; x = creature_ptr->x + ddx_ddd[dir]; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Hack -- attack monsters */ - if (c_ptr->m_idx) + if (g_ptr->m_idx) py_attack(y, x, 0); else { diff --git a/src/spells3.c b/src/spells3.c index c7597926a..ba0e2825d 100644 --- a/src/spells3.c +++ b/src/spells3.c @@ -1377,7 +1377,7 @@ void brand_weapon(int brand_type) static bool vanish_dungeon(void) { POSITION y, x; - grid_type *c_ptr; + grid_type *g_ptr; feature_type *f_ptr; monster_type *m_ptr; GAME_TEXT m_name[MAX_NLEN]; @@ -1393,21 +1393,21 @@ static bool vanish_dungeon(void) { for (x = 1; x < cur_wid - 1; x++) { - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Seeing true feature code (ignore mimic) */ - f_ptr = &f_info[c_ptr->feat]; + f_ptr = &f_info[g_ptr->feat]; /* Lose room and vault */ - c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY); + g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY); - m_ptr = &m_list[c_ptr->m_idx]; + m_ptr = &m_list[g_ptr->m_idx]; /* Awake monster */ - if (c_ptr->m_idx && MON_CSLEEP(m_ptr)) + if (g_ptr->m_idx && MON_CSLEEP(m_ptr)) { /* Reset sleep counter */ - (void)set_monster_csleep(c_ptr->m_idx, 0); + (void)set_monster_csleep(g_ptr->m_idx, 0); /* Notice the "waking up" */ if (m_ptr->ml) @@ -1425,68 +1425,68 @@ static bool vanish_dungeon(void) /* Special boundary walls -- Top and bottom */ for (x = 0; x < cur_wid; x++) { - c_ptr = &grid_array[0][x]; - f_ptr = &f_info[c_ptr->mimic]; + g_ptr = &grid_array[0][x]; + f_ptr = &f_info[g_ptr->mimic]; /* Lose room and vault */ - c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY); + g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY); /* Set boundary mimic if needed */ - if (c_ptr->mimic && have_flag(f_ptr->flags, FF_HURT_DISI)) + if (g_ptr->mimic && have_flag(f_ptr->flags, FF_HURT_DISI)) { - c_ptr->mimic = feat_state(c_ptr->mimic, FF_HURT_DISI); + g_ptr->mimic = feat_state(g_ptr->mimic, FF_HURT_DISI); /* Check for change to boring grid */ - if (!have_flag(f_info[c_ptr->mimic].flags, FF_REMEMBER)) c_ptr->info &= ~(CAVE_MARK); + if (!have_flag(f_info[g_ptr->mimic].flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK); } - c_ptr = &grid_array[cur_hgt - 1][x]; - f_ptr = &f_info[c_ptr->mimic]; + g_ptr = &grid_array[cur_hgt - 1][x]; + f_ptr = &f_info[g_ptr->mimic]; /* Lose room and vault */ - c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY); + g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY); /* Set boundary mimic if needed */ - if (c_ptr->mimic && have_flag(f_ptr->flags, FF_HURT_DISI)) + if (g_ptr->mimic && have_flag(f_ptr->flags, FF_HURT_DISI)) { - c_ptr->mimic = feat_state(c_ptr->mimic, FF_HURT_DISI); + g_ptr->mimic = feat_state(g_ptr->mimic, FF_HURT_DISI); /* Check for change to boring grid */ - if (!have_flag(f_info[c_ptr->mimic].flags, FF_REMEMBER)) c_ptr->info &= ~(CAVE_MARK); + if (!have_flag(f_info[g_ptr->mimic].flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK); } } /* Special boundary walls -- Left and right */ for (y = 1; y < (cur_hgt - 1); y++) { - c_ptr = &grid_array[y][0]; - f_ptr = &f_info[c_ptr->mimic]; + g_ptr = &grid_array[y][0]; + f_ptr = &f_info[g_ptr->mimic]; /* Lose room and vault */ - c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY); + g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY); /* Set boundary mimic if needed */ - if (c_ptr->mimic && have_flag(f_ptr->flags, FF_HURT_DISI)) + if (g_ptr->mimic && have_flag(f_ptr->flags, FF_HURT_DISI)) { - c_ptr->mimic = feat_state(c_ptr->mimic, FF_HURT_DISI); + g_ptr->mimic = feat_state(g_ptr->mimic, FF_HURT_DISI); /* Check for change to boring grid */ - if (!have_flag(f_info[c_ptr->mimic].flags, FF_REMEMBER)) c_ptr->info &= ~(CAVE_MARK); + if (!have_flag(f_info[g_ptr->mimic].flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK); } - c_ptr = &grid_array[y][cur_wid - 1]; - f_ptr = &f_info[c_ptr->mimic]; + g_ptr = &grid_array[y][cur_wid - 1]; + f_ptr = &f_info[g_ptr->mimic]; /* Lose room and vault */ - c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY); + g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY); /* Set boundary mimic if needed */ - if (c_ptr->mimic && have_flag(f_ptr->flags, FF_HURT_DISI)) + if (g_ptr->mimic && have_flag(f_ptr->flags, FF_HURT_DISI)) { - c_ptr->mimic = feat_state(c_ptr->mimic, FF_HURT_DISI); + g_ptr->mimic = feat_state(g_ptr->mimic, FF_HURT_DISI); /* Check for change to boring grid */ - if (!have_flag(f_info[c_ptr->mimic].flags, FF_REMEMBER)) c_ptr->info &= ~(CAVE_MARK); + if (!have_flag(f_info[g_ptr->mimic].flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK); } } @@ -1505,17 +1505,17 @@ static bool vanish_dungeon(void) void call_the_(void) { int i; - grid_type *c_ptr; + grid_type *g_ptr; bool do_call = TRUE; for (i = 0; i < 9; i++) { - c_ptr = &grid_array[p_ptr->y + ddy_ddd[i]][p_ptr->x + ddx_ddd[i]]; + g_ptr = &grid_array[p_ptr->y + ddy_ddd[i]][p_ptr->x + ddx_ddd[i]]; - if (!cave_have_flag_grid(c_ptr, FF_PROJECT)) + if (!cave_have_flag_grid(g_ptr, FF_PROJECT)) { - if (!c_ptr->mimic || !have_flag(f_info[c_ptr->mimic].flags, FF_PROJECT) || - !permanent_wall(&f_info[c_ptr->feat])) + if (!g_ptr->mimic || !have_flag(f_info[g_ptr->mimic].flags, FF_PROJECT) || + !permanent_wall(&f_info[g_ptr->feat])) { do_call = FALSE; break; @@ -1588,7 +1588,7 @@ void fetch(DIRECTION dir, WEIGHT wgt, bool require_los) { POSITION ty, tx; OBJECT_IDX i; - grid_type *c_ptr; + grid_type *g_ptr; object_type *o_ptr; GAME_TEXT o_name[MAX_NLEN]; @@ -1611,17 +1611,17 @@ void fetch(DIRECTION dir, WEIGHT wgt, bool require_los) return; } - c_ptr = &grid_array[ty][tx]; + g_ptr = &grid_array[ty][tx]; /* We need an item to fetch */ - if (!c_ptr->o_idx) + if (!g_ptr->o_idx) { msg_print(_("そこには何もありません。", "There is no object at this place.")); return; } /* No fetching from vault */ - if (c_ptr->info & CAVE_ICKY) + if (g_ptr->info & CAVE_ICKY) { msg_print(_("アイテムがコントロールを外れて落ちた。", "The item slips from your control.")); return; @@ -1650,15 +1650,15 @@ void fetch(DIRECTION dir, WEIGHT wgt, bool require_los) { ty += ddy[dir]; tx += ddx[dir]; - c_ptr = &grid_array[ty][tx]; + g_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; } - while (!c_ptr->o_idx); + while (!g_ptr->o_idx); } - o_ptr = &o_list[c_ptr->o_idx]; + o_ptr = &o_list[g_ptr->o_idx]; if (o_ptr->weight > wgt) { @@ -1667,8 +1667,8 @@ void fetch(DIRECTION dir, WEIGHT wgt, bool require_los) return; } - i = c_ptr->o_idx; - c_ptr->o_idx = o_ptr->next_o_idx; + i = g_ptr->o_idx; + g_ptr->o_idx = o_ptr->next_o_idx; grid_array[p_ptr->y][p_ptr->x].o_idx = i; /* 'move' it */ o_ptr->next_o_idx = 0; @@ -4141,18 +4141,18 @@ static MONRACE_IDX poly_r_idx(MONRACE_IDX r_idx) */ bool polymorph_monster(POSITION y, POSITION x) { - grid_type *c_ptr = &grid_array[y][x]; - monster_type *m_ptr = &m_list[c_ptr->m_idx]; + grid_type *g_ptr = &grid_array[y][x]; + monster_type *m_ptr = &m_list[g_ptr->m_idx]; bool polymorphed = FALSE; MONRACE_IDX new_r_idx; MONRACE_IDX old_r_idx = m_ptr->r_idx; - bool targeted = (target_who == c_ptr->m_idx) ? TRUE : FALSE; - bool health_tracked = (p_ptr->health_who == c_ptr->m_idx) ? TRUE : FALSE; + bool targeted = (target_who == g_ptr->m_idx) ? TRUE : FALSE; + bool health_tracked = (p_ptr->health_who == g_ptr->m_idx) ? TRUE : FALSE; monster_type back_m; if (p_ptr->inside_arena || p_ptr->inside_battle) return (FALSE); - if ((p_ptr->riding == c_ptr->m_idx) || (m_ptr->mflag2 & MFLAG2_KAGE)) return (FALSE); + if ((p_ptr->riding == g_ptr->m_idx) || (m_ptr->mflag2 & MFLAG2_KAGE)) return (FALSE); /* Memorize the monster before polymorphing */ back_m = *m_ptr; @@ -4176,7 +4176,7 @@ bool polymorph_monster(POSITION y, POSITION x) m_ptr->hold_o_idx = 0; /* "Kill" the "old" monster */ - delete_monster_idx(c_ptr->m_idx); + delete_monster_idx(g_ptr->m_idx); /* Create a new monster (no groups) */ if (place_monster_aux(0, y, x, new_r_idx, mode)) @@ -4579,7 +4579,7 @@ bool eat_magic(int power) void massacre(void) { POSITION x, y; - grid_type *c_ptr; + grid_type *g_ptr; monster_type *m_ptr; DIRECTION dir; @@ -4587,11 +4587,11 @@ void massacre(void) { y = p_ptr->y + ddy_ddd[dir]; x = p_ptr->x + ddx_ddd[dir]; - c_ptr = &grid_array[y][x]; - m_ptr = &m_list[c_ptr->m_idx]; + g_ptr = &grid_array[y][x]; + m_ptr = &m_list[g_ptr->m_idx]; /* Hack -- attack monsters */ - if (c_ptr->m_idx && (m_ptr->ml || cave_have_flag_bold(y, x, FF_PROJECT))) + if (g_ptr->m_idx && (m_ptr->ml || cave_have_flag_bold(y, x, FF_PROJECT))) py_attack(y, x, 0); } } @@ -4599,16 +4599,16 @@ void massacre(void) bool eat_lock(void) { POSITION x, y; - grid_type *c_ptr; + grid_type *g_ptr; feature_type *f_ptr, *mimic_f_ptr; DIRECTION dir; if (!get_direction(&dir, FALSE, FALSE)) return FALSE; y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - c_ptr = &grid_array[y][x]; - f_ptr = &f_info[c_ptr->feat]; - mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)]; + g_ptr = &grid_array[y][x]; + f_ptr = &f_info[g_ptr->feat]; + mimic_f_ptr = &f_info[get_feat_mimic(g_ptr)]; stop_mouth(); @@ -4620,9 +4620,9 @@ bool eat_lock(void) { msg_format(_("いてっ!この%sはあなたの歯より硬い!", "Ouch! This %s is harder than your teeth!"), f_name + mimic_f_ptr->name); } - else if (c_ptr->m_idx) + else if (g_ptr->m_idx) { - monster_type *m_ptr = &m_list[c_ptr->m_idx]; + monster_type *m_ptr = &m_list[g_ptr->m_idx]; msg_print(_("何かが邪魔しています!", "There's something in the way!")); if (!m_ptr->ml || !is_pet(m_ptr)) py_attack(y, x, 0); diff --git a/src/store.c b/src/store.c index ef30ed00a..4d5755bfc 100644 --- a/src/store.c +++ b/src/store.c @@ -5749,7 +5749,7 @@ void do_cmd_store(void) int which; int maintain_num; int i; - grid_type *c_ptr; + grid_type *g_ptr; bool need_redraw_store_inv; /* To redraw missiles damage and prices in store */ TERM_LEN w, h; @@ -5761,17 +5761,17 @@ void do_cmd_store(void) store_bottom = MIN_STOCK + xtra_stock; /* Access the player grid */ - c_ptr = &grid_array[p_ptr->y][p_ptr->x]; + g_ptr = &grid_array[p_ptr->y][p_ptr->x]; /* Verify a store */ - if (!cave_have_flag_grid(c_ptr, FF_STORE)) + if (!cave_have_flag_grid(g_ptr, FF_STORE)) { msg_print(_("ここには店がありません。", "You see no store here.")); return; } /* Extract the store code */ - which = f_info[c_ptr->feat].subtype; + which = f_info[g_ptr->feat].subtype; old_town_num = p_ptr->town_num; if ((which == STORE_HOME) || (which == STORE_MUSEUM)) p_ptr->town_num = 1; @@ -5821,7 +5821,7 @@ void do_cmd_store(void) cur_store_num = which; /* Hack -- save the store feature */ - cur_store_feat = c_ptr->feat; + cur_store_feat = g_ptr->feat; /* Save the store and owner pointers */ st_ptr = &town_info[p_ptr->town_num].store[cur_store_num]; diff --git a/src/trap.c b/src/trap.c index 8a9f41872..465dcfa55 100644 --- a/src/trap.c +++ b/src/trap.c @@ -82,17 +82,17 @@ FEAT_IDX choose_random_trap(void) */ void disclose_grid(POSITION y, POSITION x) { - grid_type *c_ptr = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; - if (cave_have_flag_grid(c_ptr, FF_SECRET)) + if (cave_have_flag_grid(g_ptr, FF_SECRET)) { /* No longer hidden */ cave_alter_feat(y, x, FF_SECRET); } - else if (c_ptr->mimic) + else if (g_ptr->mimic) { /* No longer hidden */ - c_ptr->mimic = 0; + g_ptr->mimic = 0; note_spot(y, x); lite_spot(y, x); @@ -111,7 +111,7 @@ void disclose_grid(POSITION y, POSITION x) */ void place_trap(POSITION y, POSITION x) { - grid_type *c_ptr = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; /* Paranoia -- verify location */ if (!in_bounds(y, x)) return; @@ -120,8 +120,8 @@ void place_trap(POSITION y, POSITION x) if (!cave_clean_bold(y, x)) return; /* Place an invisible trap */ - c_ptr->mimic = c_ptr->feat; - c_ptr->feat = choose_random_trap(); + g_ptr->mimic = g_ptr->feat; + g_ptr->feat = choose_random_trap(); } @@ -303,8 +303,8 @@ void hit_trap(bool break_trap) POSITION x = p_ptr->x, y = p_ptr->y; /* Get the grid */ - grid_type *c_ptr = &grid_array[y][x]; - feature_type *f_ptr = &f_info[c_ptr->feat]; + grid_type *g_ptr = &grid_array[y][x]; + feature_type *f_ptr = &f_info[g_ptr->feat]; int trap_feat_type = have_flag(f_ptr->flags, FF_TRAP) ? f_ptr->subtype : NOT_TRAP; concptr name = _("トラップ", "a trap"); @@ -565,7 +565,7 @@ void hit_trap(bool break_trap) } } - if (break_trap && is_trap(c_ptr->feat)) + if (break_trap && is_trap(g_ptr->feat)) { cave_alter_feat(y, x, FF_DISARM); msg_print(_("トラップを粉砕した。", "You destroyed the trap.")); diff --git a/src/view-mainwindow.c b/src/view-mainwindow.c index c09c4361b..ab15518cf 100644 --- a/src/view-mainwindow.c +++ b/src/view-mainwindow.c @@ -1695,9 +1695,9 @@ void print_monster_list(TERM_LEN x, TERM_LEN y, TERM_LEN max_lines){ int i; for(i=0;im_idx || !m_list[c_ptr->m_idx].ml)continue;//no mons or cannot look - m_ptr = &m_list[c_ptr->m_idx]; + grid_type* g_ptr = &grid_array[temp_y[i]][temp_x[i]]; + if(!g_ptr->m_idx || !m_list[g_ptr->m_idx].ml)continue;//no mons or cannot look + m_ptr = &m_list[g_ptr->m_idx]; if(is_pet(m_ptr))continue;//pet if(!m_ptr->r_idx)continue;//dead? { diff --git a/src/wild.c b/src/wild.c index f253a5e98..d2090a486 100644 --- a/src/wild.c +++ b/src/wild.c @@ -449,7 +449,7 @@ static border_type border; void wilderness_gen(void) { int i, y, x, lim; - grid_type *c_ptr; + grid_type *g_ptr; feature_type *f_ptr; /* Big town */ @@ -567,41 +567,41 @@ void wilderness_gen(void) for (x = 0; x < cur_wid; x++) { /* Get the grid */ - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; if (is_daytime()) { /* Assume lit */ - c_ptr->info |= (CAVE_GLOW); + g_ptr->info |= (CAVE_GLOW); /* Hack -- Memorize lit grids if allowed */ - if (view_perma_grids) c_ptr->info |= (CAVE_MARK); + if (view_perma_grids) g_ptr->info |= (CAVE_MARK); } else { /* Feature code (applying "mimic" field) */ - f_ptr = &f_info[get_feat_mimic(c_ptr)]; + f_ptr = &f_info[get_feat_mimic(g_ptr)]; - if (!is_mirror_grid(c_ptr) && !have_flag(f_ptr->flags, FF_QUEST_ENTER) && + if (!is_mirror_grid(g_ptr) && !have_flag(f_ptr->flags, FF_QUEST_ENTER) && !have_flag(f_ptr->flags, FF_ENTRANCE)) { /* Assume dark */ - c_ptr->info &= ~(CAVE_GLOW); + g_ptr->info &= ~(CAVE_GLOW); /* Darken "boring" features */ if (!have_flag(f_ptr->flags, FF_REMEMBER)) { /* Forget the grid */ - c_ptr->info &= ~(CAVE_MARK); + g_ptr->info &= ~(CAVE_MARK); } } else if (have_flag(f_ptr->flags, FF_ENTRANCE)) { /* Assume lit */ - c_ptr->info |= (CAVE_GLOW); + g_ptr->info |= (CAVE_GLOW); /* Hack -- Memorize lit grids if allowed */ - if (view_perma_grids) c_ptr->info |= (CAVE_MARK); + if (view_perma_grids) g_ptr->info |= (CAVE_MARK); } } } @@ -614,16 +614,16 @@ void wilderness_gen(void) for (x = 0; x < cur_wid; x++) { /* Get the grid */ - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Seeing true feature code (ignore mimic) */ - f_ptr = &f_info[c_ptr->feat]; + f_ptr = &f_info[g_ptr->feat]; if (have_flag(f_ptr->flags, FF_BLDG)) { if ((f_ptr->subtype == 4) || ((p_ptr->town_num == 1) && (f_ptr->subtype == 0))) { - if (c_ptr->m_idx) delete_monster_idx(c_ptr->m_idx); + if (g_ptr->m_idx) delete_monster_idx(g_ptr->m_idx); p_ptr->oldpy = (s16b)y; p_ptr->oldpx = (s16b)x; } @@ -640,11 +640,11 @@ void wilderness_gen(void) for (x = 0; x < cur_wid; x++) { /* Get the grid */ - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; - if (cave_have_flag_grid(c_ptr, FF_ENTRANCE)) + if (cave_have_flag_grid(g_ptr, FF_ENTRANCE)) { - if (c_ptr->m_idx) delete_monster_idx(c_ptr->m_idx); + if (g_ptr->m_idx) delete_monster_idx(g_ptr->m_idx); p_ptr->oldpy = (s16b)y; p_ptr->oldpx = (s16b)x; } diff --git a/src/wizard2.c b/src/wizard2.c index 72e26e4f3..5fbcbc98c 100644 --- a/src/wizard2.c +++ b/src/wizard2.c @@ -1573,7 +1573,7 @@ static void do_cmd_wiz_create_feature(void) { static int prev_feat = 0; static int prev_mimic = 0; - grid_type *c_ptr; + grid_type *g_ptr; feature_type *f_ptr; char tmp_val[160]; IDX tmp_feat, tmp_mimic; @@ -1581,7 +1581,7 @@ static void do_cmd_wiz_create_feature(void) if (!tgt_pt(&x, &y)) return; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Default */ sprintf(tmp_val, "%d", prev_feat); @@ -1606,15 +1606,15 @@ static void do_cmd_wiz_create_feature(void) else if (tmp_mimic >= max_f_idx) tmp_mimic = max_f_idx - 1; cave_set_feat(y, x, tmp_feat); - c_ptr->mimic = (s16b)tmp_mimic; + g_ptr->mimic = (s16b)tmp_mimic; - f_ptr = &f_info[get_feat_mimic(c_ptr)]; + f_ptr = &f_info[get_feat_mimic(g_ptr)]; if (have_flag(f_ptr->flags, FF_GLYPH) || have_flag(f_ptr->flags, FF_MINOR_GLYPH)) - c_ptr->info |= (CAVE_OBJECT); + g_ptr->info |= (CAVE_OBJECT); else if (have_flag(f_ptr->flags, FF_MIRROR)) - c_ptr->info |= (CAVE_GLOW | CAVE_OBJECT); + g_ptr->info |= (CAVE_GLOW | CAVE_OBJECT); note_spot(y, x); lite_spot(y, x); diff --git a/src/xtra2.c b/src/xtra2.c index 6fd0def35..5fc65ae79 100644 --- a/src/xtra2.c +++ b/src/xtra2.c @@ -728,7 +728,7 @@ static POSITION_IDX target_pick(POSITION y1, POSITION x1, POSITION dy, POSITION */ static bool target_set_accept(POSITION y, POSITION x) { - grid_type *c_ptr; + grid_type *g_ptr; OBJECT_IDX this_o_idx, next_o_idx = 0; /* Bounds */ @@ -741,19 +741,19 @@ static bool target_set_accept(POSITION y, POSITION x) if (p_ptr->image) return (FALSE); /* Examine the grid */ - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Visible monsters */ - if (c_ptr->m_idx) + if (g_ptr->m_idx) { - monster_type *m_ptr = &m_list[c_ptr->m_idx]; + monster_type *m_ptr = &m_list[g_ptr->m_idx]; /* Visible monsters */ if (m_ptr->ml) return (TRUE); } /* Scan all objects in the grid */ - for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) + for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) { object_type *o_ptr; o_ptr = &o_list[this_o_idx]; @@ -766,13 +766,13 @@ static bool target_set_accept(POSITION y, POSITION x) } /* Interesting memorized features */ - if (c_ptr->info & (CAVE_MARK)) + if (g_ptr->info & (CAVE_MARK)) { /* Notice object features */ - if (c_ptr->info & CAVE_OBJECT) return (TRUE); + if (g_ptr->info & CAVE_OBJECT) return (TRUE); /* Feature code (applying "mimic" field) */ - if (have_flag(f_info[get_feat_mimic(c_ptr)].flags, FF_NOTICE)) return TRUE; + if (have_flag(f_info[get_feat_mimic(g_ptr)].flags, FF_NOTICE)) return TRUE; } return (FALSE); @@ -814,17 +814,17 @@ static void target_set_prepare(BIT_FLAGS mode) { for (x = min_wid; x <= max_wid; x++) { - grid_type *c_ptr; + grid_type *g_ptr; /* Require "interesting" contents */ if (!target_set_accept(y, x)) continue; - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Require target_able monsters for "TARGET_KILL" */ - if ((mode & (TARGET_KILL)) && !target_able(c_ptr->m_idx)) continue; + if ((mode & (TARGET_KILL)) && !target_able(g_ptr->m_idx)) continue; - if ((mode & (TARGET_KILL)) && !target_pet && is_pet(&m_list[c_ptr->m_idx])) continue; + if ((mode & (TARGET_KILL)) && !target_pet && is_pet(&m_list[g_ptr->m_idx])) continue; /* Save the location */ temp_x[temp_n] = x; @@ -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 = &grid_array[y][x]; + grid_type *g_ptr = &grid_array[y][x]; OBJECT_IDX this_o_idx, next_o_idx = 0; concptr s1 = "", s2 = "", s3 = "", x_info = ""; bool boring = TRUE; @@ -1012,9 +1012,9 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, concptr info) /* Actual monsters */ - if (c_ptr->m_idx && m_list[c_ptr->m_idx].ml) + if (g_ptr->m_idx && m_list[g_ptr->m_idx].ml) { - monster_type *m_ptr = &m_list[c_ptr->m_idx]; + monster_type *m_ptr = &m_list[g_ptr->m_idx]; monster_race *ap_r_ptr = &r_info[m_ptr->ap_r_idx]; GAME_TEXT m_name[MAX_NLEN]; bool recall = FALSE; @@ -1024,7 +1024,7 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, concptr info) monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE); monster_race_track(m_ptr->ap_r_idx); - health_track(c_ptr->m_idx); + health_track(g_ptr->m_idx); handle_stuff(); /* Interact */ @@ -1233,7 +1233,7 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, concptr info) } /* Get the object being moved. */ - o_idx = c_ptr->o_idx; + o_idx = g_ptr->o_idx; /* Only rotate a pile of two or more objects. */ if (!(o_idx && o_list[o_idx].next_o_idx)) continue; @@ -1242,7 +1242,7 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, concptr info) excise_object_idx(o_idx); /* Find end of the list. */ - i = c_ptr->o_idx; + i = g_ptr->o_idx; while (o_list[i].next_o_idx) i = o_list[i].next_o_idx; @@ -1257,7 +1257,7 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, concptr info) } /* Scan all objects in the grid */ - for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) + for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) { object_type *o_ptr; o_ptr = &o_list[this_o_idx]; @@ -1310,10 +1310,10 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, concptr info) /* Feature code (applying "mimic" field) */ - feat = get_feat_mimic(c_ptr); + feat = get_feat_mimic(g_ptr); /* Require knowledge about grid, or ability to see grid */ - if (!(c_ptr->info & CAVE_MARK) && !player_can_see_bold(y, x)) + if (!(g_ptr->info & CAVE_MARK) && !player_can_see_bold(y, x)) { /* Forget feature */ feat = feat_none; @@ -1337,7 +1337,7 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, concptr info) for (j = 0; j < 10; j++) quest_text[j][0] = '\0'; quest_text_line = 0; - p_ptr->inside_quest = c_ptr->special; + p_ptr->inside_quest = g_ptr->special; /* Get the quest text */ init_flags = INIT_NAME_ONLY; @@ -1345,7 +1345,7 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, concptr info) process_dungeon_file("q_info.txt", 0, 0, 0, 0); name = format(_("クエスト「%s」(%d階相当)", "the entrance to the quest '%s'(level %d)"), - quest[c_ptr->special].name, quest[c_ptr->special].level); + quest[g_ptr->special].name, quest[g_ptr->special].level); /* Reset the old quest number */ p_ptr->inside_quest = old_quest; @@ -1358,11 +1358,11 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, concptr info) } else if (have_flag(f_ptr->flags, FF_ENTRANCE)) { - name = format(_("%s(%d階相当)", "%s(level %d)"), d_text + d_info[c_ptr->special].text, d_info[c_ptr->special].mindepth); + name = format(_("%s(%d階相当)", "%s(level %d)"), d_text + d_info[g_ptr->special].text, d_info[g_ptr->special].mindepth); } else if (have_flag(f_ptr->flags, FF_TOWN)) { - name = town_info[c_ptr->special].name; + name = town_info[g_ptr->special].name; } else if (p_ptr->wild_mode && (feat == feat_floor)) { @@ -1410,12 +1410,12 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, concptr info) if (p_ptr->wizard) { char f_idx_str[32]; - if (c_ptr->mimic) sprintf(f_idx_str, "%d/%d", c_ptr->feat, c_ptr->mimic); - else sprintf(f_idx_str, "%d", c_ptr->feat); + if (g_ptr->mimic) sprintf(f_idx_str, "%d/%d", g_ptr->feat, g_ptr->mimic); + else sprintf(f_idx_str, "%d", g_ptr->feat); #ifdef JP - sprintf(out_val, "%s%s%s%s[%s] %x %s %d %d %d (%d,%d) %d", s1, name, s2, s3, info, (unsigned int)c_ptr->info, f_idx_str, c_ptr->dist, c_ptr->cost, c_ptr->when, (int)y, (int)x, travel.cost[y][x]); + sprintf(out_val, "%s%s%s%s[%s] %x %s %d %d %d (%d,%d) %d", s1, name, s2, s3, info, (unsigned int)g_ptr->info, f_idx_str, g_ptr->dist, g_ptr->cost, g_ptr->when, (int)y, (int)x, travel.cost[y][x]); #else - sprintf(out_val, "%s%s%s%s [%s] %x %s %d %d %d (%d,%d)", s1, s2, s3, name, info, c_ptr->info, f_idx_str, c_ptr->dist, c_ptr->cost, c_ptr->when, (int)y, (int)x); + sprintf(out_val, "%s%s%s%s [%s] %x %s %d %d %d (%d,%d)", s1, s2, s3, name, info, g_ptr->info, f_idx_str, g_ptr->dist, g_ptr->cost, g_ptr->when, (int)y, (int)x); #endif } else @@ -1493,7 +1493,7 @@ bool target_set(BIT_FLAGS mode) char query; char info[80]; char same_key; - grid_type *c_ptr; + grid_type *g_ptr; TERM_LEN wid, hgt; get_screen_size(&wid, &hgt); @@ -1531,10 +1531,10 @@ bool target_set(BIT_FLAGS mode) if (!(mode & TARGET_LOOK)) prt_path(y, x); /* Access */ - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Allow target */ - if (target_able(c_ptr->m_idx)) + if (target_able(g_ptr->m_idx)) { strcpy(info, _("q止 t決 p自 o現 +次 -前", "q,t,p,o,+,-,")); } @@ -1582,10 +1582,10 @@ bool target_set(BIT_FLAGS mode) case '5': case '0': { - if (target_able(c_ptr->m_idx)) + if (target_able(g_ptr->m_idx)) { - health_track(c_ptr->m_idx); - target_who = c_ptr->m_idx; + health_track(g_ptr->m_idx); + target_who = g_ptr->m_idx; target_row = y; target_col = x; done = TRUE; @@ -1768,7 +1768,7 @@ bool target_set(BIT_FLAGS mode) if (!(mode & TARGET_LOOK)) prt_path(y, x); /* Access */ - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Default prompt */ strcpy(info, _("q止 t決 p自 m近 +次 -前", "q,t,p,m,+,-,")); @@ -2366,7 +2366,7 @@ bool get_rep_dir(DIRECTION *dp, bool under) */ static bool tgt_pt_accept(POSITION y, POSITION x) { - grid_type *c_ptr; + grid_type *g_ptr; /* Bounds */ if (!(in_bounds(y, x))) return (FALSE); @@ -2378,18 +2378,18 @@ static bool tgt_pt_accept(POSITION y, POSITION x) if (p_ptr->image) return (FALSE); /* Examine the grid */ - c_ptr = &grid_array[y][x]; + g_ptr = &grid_array[y][x]; /* Interesting memorized features */ - if (c_ptr->info & (CAVE_MARK)) + if (g_ptr->info & (CAVE_MARK)) { /* Notice stairs */ - if (cave_have_flag_grid(c_ptr, FF_LESS)) return (TRUE); - if (cave_have_flag_grid(c_ptr, FF_MORE)) return (TRUE); + if (cave_have_flag_grid(g_ptr, FF_LESS)) return (TRUE); + if (cave_have_flag_grid(g_ptr, FF_MORE)) return (TRUE); /* Notice quest features */ - if (cave_have_flag_grid(c_ptr, FF_QUEST_ENTER)) return (TRUE); - if (cave_have_flag_grid(c_ptr, FF_QUEST_EXIT)) return (TRUE); + if (cave_have_flag_grid(g_ptr, FF_QUEST_ENTER)) return (TRUE); + if (cave_have_flag_grid(g_ptr, FF_QUEST_EXIT)) return (TRUE); } return (FALSE); @@ -2494,10 +2494,10 @@ bool tgt_pt(POSITION *x_ptr, POSITION *y_ptr) /* Skip stairs which have defferent distance */ for (; n < temp_n; ++ n) { - grid_type *c_ptr = &grid_array[temp_y[n]][temp_x[n]]; + grid_type *g_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)) + if (cave_have_flag_grid(g_ptr, FF_STAIRS) && + cave_have_flag_grid(g_ptr, ch == '>' ? FF_MORE : FF_LESS)) { /* Found */ break; diff --git a/src/z-term.c b/src/z-term.c index 76a167ee3..3d4a8756a 100644 --- a/src/z-term.c +++ b/src/z-term.c @@ -2228,7 +2228,7 @@ errr Term_redraw_section(TERM_LEN x1, TERM_LEN y1, TERM_LEN x2, TERM_LEN y2) { int i, j; - char *c_ptr; + char *g_ptr; /* Bounds checking */ if (y2 >= Term->hgt) y2 = Term->hgt - 1; @@ -2260,25 +2260,25 @@ errr Term_redraw_section(TERM_LEN x1, TERM_LEN y1, TERM_LEN x2, TERM_LEN y2) Term->x1[i] = (byte_hack)x1j; Term->x2[i] = (byte_hack)x2j; - c_ptr = Term->old->c[i]; + g_ptr = Term->old->c[i]; /* Clear the section so it is redrawn */ for (j = x1j; j <= x2j; j++) { /* Hack - set the old character to "none" */ - c_ptr[j] = 0; + g_ptr[j] = 0; } #else Term->x1[i] = x1; Term->x2[i] = x2; - c_ptr = Term->old->c[i]; + g_ptr = Term->old->c[i]; /* Clear the section so it is redrawn */ for (j = x1; j <= x2; j++) { /* Hack - set the old character to "none" */ - c_ptr[j] = 0; + g_ptr[j] = 0; } #endif } -- 2.11.0