autopick_delayed_alter_aux(item);
/* Scan the pile of objects */
- item = grid_array[p_ptr->y][p_ptr->x].o_idx;
+ item = current_floor->grid_array[p_ptr->y][p_ptr->x].o_idx;
while (item)
{
OBJECT_IDX next = o_list[item].next_o_idx;
clear_bldg(4, 18);
/* Current quest of the building */
- q_index = grid_array[p_ptr->y][p_ptr->x].special;
+ q_index = current_floor->grid_array[p_ptr->y][p_ptr->x].special;
/* Is there a quest available at the building? */
if (!q_index)
leave_quest_check();
if (quest[p_ptr->inside_quest].type != QUEST_TYPE_RANDOM) dun_level = 1;
- p_ptr->inside_quest = grid_array[p_ptr->y][p_ptr->x].special;
+ p_ptr->inside_quest = current_floor->grid_array[p_ptr->y][p_ptr->x].special;
p_ptr->leaving = TRUE;
}
return;
}
- which = f_info[grid_array[p_ptr->y][p_ptr->x].feat].subtype;
+ which = f_info[current_floor->grid_array[p_ptr->y][p_ptr->x].feat].subtype;
bldg = &building[which];
if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
if (p_ptr->special_defense & KATA_MUSOU) set_action(ACTION_NONE);
}
target_pet = old_target_pet;
- if (grid_array[target_row][target_col].m_idx)
+ if (current_floor->grid_array[target_row][target_col].m_idx)
{
- m_ptr = &m_list[grid_array[target_row][target_col].m_idx];
+ m_ptr = &m_list[current_floor->grid_array[target_row][target_col].m_idx];
if (!is_pet(m_ptr))
{
if (!target_set(TARGET_KILL)) pet_t_m_idx = 0;
else
{
- grid_type *g_ptr = &grid_array[target_row][target_col];
+ grid_type *g_ptr = ¤t_floor->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;
+ pet_t_m_idx = current_floor->grid_array[target_row][target_col].m_idx;
p_ptr->pet_follow_distance = PET_DESTROY_DIST;
}
else pet_t_m_idx = 0;
y = p_ptr->y + ddy_ddd[i];
x = p_ptr->x + ddx_ddd[i];
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
if (g_ptr->m_idx) continue;
bool go_up = FALSE;
/* Player grid */
- grid_type *g_ptr = &grid_array[p_ptr->y][p_ptr->x];
+ grid_type *g_ptr = ¤t_floor->grid_array[p_ptr->y][p_ptr->x];
feature_type *f_ptr = &f_info[g_ptr->feat];
int up_num = 0;
void do_cmd_go_down(void)
{
/* Player grid */
- grid_type *g_ptr = &grid_array[p_ptr->y][p_ptr->x];
+ grid_type *g_ptr = ¤t_floor->grid_array[p_ptr->y][p_ptr->x];
feature_type *f_ptr = &f_info[g_ptr->feat];
bool fall_trap = FALSE;
*/
static OBJECT_IDX chest_check(POSITION y, POSITION x, bool trapped)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
/* Scan all objects in the grid */
yy = p_ptr->y + ddy_ddd[d];
xx = p_ptr->x + ddx_ddd[d];
- /* Get the grid_array */
- g_ptr = &grid_array[yy][xx];
+ /* Get the current_floor->grid_array */
+ g_ptr = ¤t_floor->grid_array[yy][xx];
/* Must have knowledge */
if (!(g_ptr->info & (CAVE_MARK))) continue;
int i, j;
/* Get requested grid */
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
feature_type *f_ptr = &f_info[g_ptr->feat];
bool more = FALSE;
x = p_ptr->x + ddx[dir];
/* Get requested grid */
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(g_ptr);
*/
static bool do_cmd_close_aux(POSITION y, POSITION x)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
FEAT_IDX old_feat = g_ptr->feat;
bool more = FALSE;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(g_ptr);
*/
static bool do_cmd_tunnel_test(POSITION y, POSITION x)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
/* Must have knowledge */
if (!(g_ptr->info & CAVE_MARK))
take_turn(p_ptr, 100);
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
f_ptr = &f_info[g_ptr->feat];
power = f_ptr->power;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(g_ptr);
{
int i, j;
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
feature_type *f_ptr = &f_info[g_ptr->feat];
/* Must be a closed door */
bool do_cmd_disarm_aux(POSITION y, POSITION x, DIRECTION dir)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
/* Get feature */
feature_type *f_ptr = &f_info[g_ptr->feat];
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(g_ptr);
*/
static bool do_cmd_bash_aux(POSITION y, POSITION x, DIRECTION dir)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
/* Get feature */
feature_type *f_ptr = &f_info[g_ptr->feat];
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(g_ptr);
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(g_ptr);
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(g_ptr);
if (!cave_have_flag_bold(ny[cur_dis], nx[cur_dis], FF_PROJECT))
{
hit_wall = TRUE;
- if ((q_ptr->tval == TV_FIGURINE) || object_is_potion(q_ptr) || !grid_array[ny[cur_dis]][nx[cur_dis]].m_idx) break;
+ if ((q_ptr->tval == TV_FIGURINE) || object_is_potion(q_ptr) || !current_floor->grid_array[ny[cur_dis]][nx[cur_dis]].m_idx) break;
}
/* The player can see the (on screen) missile */
cur_dis++;
/* Monster here, Try to hit it */
- if (grid_array[y][x].m_idx)
+ if (current_floor->grid_array[y][x].m_idx)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
monster_type *m_ptr = &m_list[g_ptr->m_idx];
/* Check the visibility */
if (potion_smash_effect(0, y, x, q_ptr->k_idx))
{
- monster_type *m_ptr = &m_list[grid_array[y][x].m_idx];
+ monster_type *m_ptr = &m_list[current_floor->grid_array[y][x].m_idx];
/* ToDo (Robert): fix the invulnerability */
- if (grid_array[y][x].m_idx &&
- is_friendly(&m_list[grid_array[y][x].m_idx]) &&
+ if (current_floor->grid_array[y][x].m_idx &&
+ is_friendly(&m_list[current_floor->grid_array[y][x].m_idx]) &&
!MON_INVULNER(m_ptr))
{
GAME_TEXT m_name[MAX_NLEN];
- monster_desc(m_name, &m_list[grid_array[y][x].m_idx], 0);
+ monster_desc(m_name, &m_list[current_floor->grid_array[y][x].m_idx], 0);
msg_format(_("%sは怒った!", "%^s gets angry!"), m_name);
- set_hostile(&m_list[grid_array[y][x].m_idx]);
+ set_hostile(&m_list[current_floor->grid_array[y][x].m_idx]);
}
}
do_drop = FALSE;
{
for (x = 0; x < cur_wid; x++)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
#define MAX_SAVED_FLOORS 20 /*!< 保存フロアの最大数 / Maximum number of saved floors. */
/*!
- * @brief プレイヤー用光源処理配列サイズ / Maximum size of the "lite" array (see "grid_array.c")
+ * @brief プレイヤー用光源処理配列サイズ / Maximum size of the "lite" array (see "current_floor->grid_array.c")
* @details Note that the "lite radius" will NEVER exceed 14, and we would
* never require more than 581 entries in the array for circular "lite".
*/
#define LITE_MAX 600
/*!
- * @brief モンスター用光源処理配列サイズ / Maximum size of the "mon_lite" array (see "grid_array.c")
+ * @brief モンスター用光源処理配列サイズ / Maximum size of the "mon_lite" array (see "current_floor->grid_array.c")
* @details Note that the "view radius" will NEVER exceed 20, monster illumination
* flags are dependent on CAVE_VIEW, and even if the "view" was octagonal,
* we would never require more than 1520 entries in the array.
#define MON_LITE_MAX 1536
/*!
- * @brief 視界処理配列サイズ / Maximum size of the "view" array (see "grid_array.c")
+ * @brief 視界処理配列サイズ / Maximum size of the "view" array (see "current_floor->grid_array.c")
* @details Note that the "view radius" will NEVER exceed 20, and even if the "view"
* was octagonal, we would never require more than 1520 entries in the array.
*/
#define VIEW_MAX 1536
/*!
- * @brief 視界及び光源の過渡処理配列サイズ / Maximum size of the "temp" array (see "grid_array.c")
+ * @brief 視界及び光源の過渡処理配列サイズ / Maximum size of the "temp" array (see "current_floor->grid_array.c")
* @details We must be as large as "VIEW_MAX" and "LITE_MAX" for proper functioning
* of "update_view()" and "update_lite()". We must also be as large as the
* largest illuminatable room, but no room is larger than 800 grids. We
#define TEMP_MAX 2298
/*!
- * @brief 再描画処理用配列サイズ / Maximum size of the "redraw" array (see "grid_array.c")
+ * @brief 再描画処理用配列サイズ / Maximum size of the "redraw" array (see "current_floor->grid_array.c")
* @details We must be large for proper functioning of delayed redrawing.
* We must also be as large as two times of the largest view area.
* Note that maximum view grids are 1149 entries.
#define CAVE_MNLT 0x0100 /*!< モンスターの光源によって照らされている / Illuminated by monster */
#define CAVE_MNDK 0x8000 /*!< モンスターの暗源によって暗闇になっている / Darken by monster */
-/* Used only while grid_array generation */
+/* Used only while current_floor->grid_array generation */
#define CAVE_FLOOR 0x0200 /*!< フロア属性のあるマス */
#define CAVE_EXTRA 0x0400
#define CAVE_INNER 0x0800
#define CAVE_VAULT 0x4000
#define CAVE_MASK (CAVE_FLOOR | CAVE_EXTRA | CAVE_INNER | CAVE_OUTER | CAVE_SOLID | CAVE_VAULT)
-/* Used only after grid_array generation */
+/* Used only after current_floor->grid_array generation */
#define CAVE_KNOWN 0x0200 /* Directly viewed or map detected flag */
#define CAVE_NOTE 0x0400 /* Flag for delayed visual update (needs note_spot()) */
#define CAVE_REDRAW 0x0800 /* Flag for delayed visual update (needs lite_spot()) */
* Grid based version of "player_bold()"
*/
#define player_grid(C) \
- ((C) == &grid_array[p_ptr->y][p_ptr->x])
+ ((C) == ¤t_floor->grid_array[p_ptr->y][p_ptr->x])
#define cave_have_flag_bold(Y,X,INDEX) \
- (have_flag(f_info[grid_array[(Y)][(X)].feat].flags, (INDEX)))
+ (have_flag(f_info[current_floor->grid_array[(Y)][(X)].feat].flags, (INDEX)))
#define cave_have_flag_grid(C,INDEX) \
* Determine if a "legal" grid supports "los"
*/
#define cave_los_bold(Y,X) \
- (feat_supports_los(grid_array[(Y)][(X)].feat))
+ (feat_supports_los(current_floor->grid_array[(Y)][(X)].feat))
#define cave_los_grid(C) \
(feat_supports_los((C)->feat))
*/
#define cave_clean_bold(Y,X) \
(cave_have_flag_bold((Y), (X), FF_FLOOR) && \
- !(grid_array[Y][X].info & CAVE_OBJECT) && \
- (grid_array[Y][X].o_idx == 0))
+ !(current_floor->grid_array[Y][X].info & CAVE_OBJECT) && \
+ (current_floor->grid_array[Y][X].o_idx == 0))
/*
*/
#define cave_drop_bold(Y,X) \
(cave_have_flag_bold((Y), (X), FF_DROP) && \
- !(grid_array[Y][X].info & CAVE_OBJECT))
+ !(current_floor->grid_array[Y][X].info & CAVE_OBJECT))
/*
*/
#define cave_empty_bold(Y,X) \
(cave_have_flag_bold((Y), (X), FF_PLACE) && \
- !(grid_array[Y][X].m_idx) && \
+ !(current_floor->grid_array[Y][X].m_idx) && \
!player_bold(Y,X))
*/
#define cave_naked_bold(Y,X) \
(cave_clean_bold(Y,X) && \
- !(grid_array[Y][X].m_idx) && \
+ !(current_floor->grid_array[Y][X].m_idx) && \
!player_bold(Y,X))
* Note the use of comparison to zero to force a "boolean" result
*/
#define player_has_los_bold(Y,X) \
- (((grid_array[Y][X].info & (CAVE_VIEW)) != 0) || p_ptr->inside_battle)
+ (((current_floor->grid_array[Y][X].info & (CAVE_VIEW)) != 0) || p_ptr->inside_battle)
/*
{
int to_ruin = 0;
POSITION r_y, r_x;
- int pattern_type = f_info[grid_array[p_ptr->y][p_ptr->x].feat].subtype;
+ int pattern_type = f_info[current_floor->grid_array[p_ptr->y][p_ptr->x].feat].subtype;
if (pattern_type == PATTERN_TILE_WRECKED)
{
scatter(&r_y, &r_x, p_ptr->y, p_ptr->x, 4, 0);
if (pattern_tile(r_y, r_x) &&
- (f_info[grid_array[r_y][r_x].feat].subtype != PATTERN_TILE_WRECKED))
+ (f_info[current_floor->grid_array[r_y][r_x].feat].subtype != PATTERN_TILE_WRECKED))
{
cave_set_feat(r_y, r_x, feat_pattern_corrupted);
}
wreck_the_pattern();
}
- pattern_type = f_info[grid_array[p_ptr->y][p_ptr->x].feat].subtype;
+ pattern_type = f_info[current_floor->grid_array[p_ptr->y][p_ptr->x].feat].subtype;
switch (pattern_type)
{
*/
static void process_world_aux_hp_and_sp(void)
{
- feature_type *f_ptr = &f_info[grid_array[p_ptr->y][p_ptr->x].feat];
+ feature_type *f_ptr = &f_info[current_floor->grid_array[p_ptr->y][p_ptr->x].feat];
bool cave_no_regen = FALSE;
int upkeep_factor = 0;
{
if (!dun_level && !p_ptr->resist_lite && !IS_INVULN() && is_daytime())
{
- if ((grid_array[p_ptr->y][p_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
+ if ((current_floor->grid_array[p_ptr->y][p_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
{
msg_print(_("日光があなたのアンデッドの肉体を焼き焦がした!", "The sun's rays scorch your undead flesh!"));
take_hit(DAMAGE_NOESCAPE, 1, _("日光", "sunlight"), -1);
{
msg_print(_("熱で火傷した!", "The heat burns you!"));
take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
- f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name), -1);
+ f_name + f_info[get_feat_mimic(¤t_floor->grid_array[p_ptr->y][p_ptr->x])].name), -1);
}
else
{
- concptr name = f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name;
+ concptr name = f_name + f_info[get_feat_mimic(¤t_floor->grid_array[p_ptr->y][p_ptr->x])].name;
msg_format(_("%sで火傷した!", "The %s burns you!"), name);
take_hit(DAMAGE_NOESCAPE, damage, name, -1);
}
{
msg_print(_("冷気に覆われた!", "The cold engulfs you!"));
take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
- f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name), -1);
+ f_name + f_info[get_feat_mimic(¤t_floor->grid_array[p_ptr->y][p_ptr->x])].name), -1);
}
else
{
- concptr name = f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name;
+ concptr name = f_name + f_info[get_feat_mimic(¤t_floor->grid_array[p_ptr->y][p_ptr->x])].name;
msg_format(_("%sに凍えた!", "The %s frostbites you!"), name);
take_hit(DAMAGE_NOESCAPE, damage, name, -1);
}
{
msg_print(_("電撃を受けた!", "The electric shocks you!"));
take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
- f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name), -1);
+ f_name + f_info[get_feat_mimic(¤t_floor->grid_array[p_ptr->y][p_ptr->x])].name), -1);
}
else
{
- concptr name = f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name;
+ concptr name = f_name + f_info[get_feat_mimic(¤t_floor->grid_array[p_ptr->y][p_ptr->x])].name;
msg_format(_("%sに感電した!", "The %s shocks you!"), name);
take_hit(DAMAGE_NOESCAPE, damage, name, -1);
}
{
msg_print(_("酸が飛び散った!", "The acid melt you!"));
take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
- f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name), -1);
+ f_name + f_info[get_feat_mimic(¤t_floor->grid_array[p_ptr->y][p_ptr->x])].name), -1);
}
else
{
- concptr name = f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name;
+ concptr name = f_name + f_info[get_feat_mimic(¤t_floor->grid_array[p_ptr->y][p_ptr->x])].name;
msg_format(_("%sに溶かされた!", "The %s melts you!"), name);
take_hit(DAMAGE_NOESCAPE, damage, name, -1);
}
{
msg_print(_("毒気を吸い込んだ!", "The gas poisons you!"));
take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
- f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name), -1);
+ f_name + f_info[get_feat_mimic(¤t_floor->grid_array[p_ptr->y][p_ptr->x])].name), -1);
if (p_ptr->resist_pois) (void)set_poisoned(p_ptr->poisoned + 1);
}
else
{
- concptr name = f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name;
+ concptr name = f_name + f_info[get_feat_mimic(¤t_floor->grid_array[p_ptr->y][p_ptr->x])].name;
msg_format(_("%sに毒された!", "The %s poisons you!"), name);
take_hit(DAMAGE_NOESCAPE, damage, name, -1);
if (p_ptr->resist_pois) (void)set_poisoned(p_ptr->poisoned + 3);
msg_print(NULL);
/* Absorb light from the current possition */
- if ((grid_array[p_ptr->y][p_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
+ if ((current_floor->grid_array[p_ptr->y][p_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
{
hp_player(10);
}
if (!in_bounds(ay, ax)) continue;
/* Count number of monsters */
- if (grid_array[ay][ax].m_idx > 0) count++;
+ if (current_floor->grid_array[ay][ax].m_idx > 0) count++;
}
return count;
for (i2 = 0; i2 < cur_wid; ++i2)
for (j2 = 0; j2 < cur_hgt; j2++)
{
- grid_type *g_ptr = &grid_array[j2][i2];
+ grid_type *g_ptr = ¤t_floor->grid_array[j2][i2];
if ((g_ptr->m_idx > 0) && (g_ptr->m_idx != p_ptr->riding))
{
if (place_monster_aux(0, y, x, r_idx, PM_NO_KAGE))
{
GAME_TEXT m_name[MAX_NLEN];
- monster_desc(m_name, &m_list[grid_array[y][x].m_idx], 0);
+ monster_desc(m_name, &m_list[current_floor->grid_array[y][x].m_idx], 0);
msg_format(_("%sが釣れた!", "You have a good catch!"), m_name);
success = TRUE;
}
/* Handle "quit and save" */
if (!p_ptr->playing && !p_ptr->is_dead) break;
- /* Erase the old grid_array */
+ /* Erase the old current_floor->grid_array */
wipe_o_list();
if (!p_ptr->is_dead) wipe_m_list();
{
if (!(p_ptr->special_defense & NINJA_S_STEALTH))
{
- if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_MNLT)
+ if (current_floor->grid_array[p_ptr->y][p_ptr->x].info & CAVE_MNLT)
{
msg_print(_("敵の目から薄い影の中に覆い隠された。", "You are mantled in weak shadow from ordinary eyes."));
p_ptr->monlite = p_ptr->old_monlite = TRUE;
extern byte angband_color_table[256][4];
extern const concptr angband_sound_name[SOUND_MAX];
extern const concptr angband_music_basic_name[MUSIC_BASIC_MAX];
-extern grid_type *grid_array[MAX_HGT];
+extern floor_type *current_floor;
extern saved_floor_type saved_floors[MAX_SAVED_FLOORS];
extern FLOOR_IDX max_floor_id;
extern u32b saved_floor_file_sign;
{
for (x = 0; x < cur_wid; x++)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
/* Assume lit */
g_ptr->info |= (CAVE_GLOW);
if (p_ptr->special_defense & NINJA_S_STEALTH)
{
- if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+ if (current_floor->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
}
}
{
for (x = 0; x < cur_wid; x++)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
/* Feature code (applying "mimic" field) */
feature_type *f_ptr = &f_info[get_feat_mimic(g_ptr)];
if (p_ptr->special_defense & NINJA_S_STEALTH)
{
- if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+ if (current_floor->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
}
}
{
for (y = 0; y < cur_hgt; ++y)
{
- MONSTER_IDX m_idx = grid_array[y][x].m_idx;
+ MONSTER_IDX m_idx = current_floor->grid_array[y][x].m_idx;
if (m_idx > 0 && is_hostile(&m_list[m_idx]))
{
*/
static bool alloc_stairs_aux(POSITION y, POSITION x, int walls)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
/* Require "naked" floor grid */
if (!is_floor_grid(g_ptr)) return FALSE;
if (!pick) break;
}
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Clear possible garbage of hidden trap */
g_ptr->mimic = 0;
y = randint0(cur_hgt);
x = randint0(cur_wid);
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Require "naked" floor grid */
if (!is_floor_grid(g_ptr) || g_ptr->o_idx || g_ptr->m_idx) continue;
if (player_bold(y, x)) continue;
/* Check for "room" */
- room = (grid_array[y][x].info & CAVE_ROOM) ? TRUE : FALSE;
+ room = (current_floor->grid_array[y][x].info & CAVE_ROOM) ? TRUE : FALSE;
/* Require corridor? */
if ((set == ALLOC_SET_CORR) && room) continue;
case ALLOC_TYP_RUBBLE:
{
place_rubble(y, x);
- grid_array[y][x].info &= ~(CAVE_FLOOR);
+ current_floor->grid_array[y][x].info &= ~(CAVE_FLOOR);
break;
}
case ALLOC_TYP_TRAP:
{
place_trap(y, x);
- grid_array[y][x].info &= ~(CAVE_FLOOR);
+ current_floor->grid_array[y][x].info &= ~(CAVE_FLOOR);
break;
}
y = randint0(cur_hgt);
x = randint0(cur_wid);
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->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;
{
dun->cavern = TRUE;
- /* make a large fractal grid_array in the middle of the dungeon */
+ /* make a large fractal current_floor->grid_array in the middle of the dungeon */
msg_print_wizard(CHEAT_DUNGEON, _("洞窟を生成。", "Cavern on level."));
build_cavern();
feature_type *f_ptr;
y = dun->tunn[j].y;
x = dun->tunn[j].x;
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
f_ptr = &f_info[g_ptr->feat];
/* Clear previous contents (if not a lake), add a floor */
grid_type *g_ptr;
y = dun->wall[j].y;
x = dun->wall[j].x;
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Clear mimic type */
g_ptr->mimic = 0;
/* Special boundary walls -- Top and bottom */
for (x = 0; x < cur_wid; x++)
{
- place_bound_perm_wall(&grid_array[0][x]);
- place_bound_perm_wall(&grid_array[cur_hgt - 1][x]);
+ place_bound_perm_wall(¤t_floor->grid_array[0][x]);
+ place_bound_perm_wall(¤t_floor->grid_array[cur_hgt - 1][x]);
}
/* Special boundary walls -- Left and right */
for (y = 1; y < (cur_hgt - 1); y++)
{
- place_bound_perm_wall(&grid_array[y][0]);
- place_bound_perm_wall(&grid_array[y][cur_wid - 1]);
+ place_bound_perm_wall(¤t_floor->grid_array[y][0]);
+ place_bound_perm_wall(¤t_floor->grid_array[y][cur_wid - 1]);
}
/* Determine the character location */
if (dun->empty_level && (!one_in_(DARK_EMPTY) || (randint1(100) > dun_level)) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
{
- /* Lite the grid_array */
+ /* Lite the current_floor->grid_array */
for (y = 0; y < cur_hgt; y++)
{
for (x = 0; x < cur_wid; x++)
{
- grid_array[y][x].info |= (CAVE_GLOW);
+ current_floor->grid_array[y][x].info |= (CAVE_GLOW);
}
}
}
for (j = x_left; j <= x_right; j++)
{
place_extra_perm_bold(i, j);
- grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor->grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
}
for (i = y_depth; i >= y_depth - 5; i--)
for (j = x_left; j <= x_right; j++)
{
place_extra_perm_bold(i, j);
- grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor->grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
}
for (j = x_left; j <= x_left + 17; j++)
for (i = y_height; i <= y_depth; i++)
{
place_extra_perm_bold(i, j);
- grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor->grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
}
for (j = x_right; j >= x_right - 17; j--)
for (i = y_height; i <= y_depth; i++)
{
place_extra_perm_bold(i, j);
- grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor->grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
}
place_extra_perm_bold(y_height+6, x_left+18);
- grid_array[y_height+6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor->grid_array[y_height+6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
place_extra_perm_bold(y_depth-6, x_left+18);
- grid_array[y_depth-6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor->grid_array[y_depth-6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
place_extra_perm_bold(y_height+6, x_right-18);
- grid_array[y_height+6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor->grid_array[y_height+6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
place_extra_perm_bold(y_depth-6, x_right-18);
- grid_array[y_depth-6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor->grid_array[y_depth-6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
i = y_height + 5;
j = xval;
- grid_array[i][j].feat = f_tag_to_index("ARENA_GATE");
- grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor->grid_array[i][j].feat = f_tag_to_index("ARENA_GATE");
+ current_floor->grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
player_place(i, j);
}
place_solid_perm_bold(y, x);
/* Illuminate and memorize the walls */
- grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor->grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
}
}
for (x = qx + 1; x < qx + SCREEN_WID - 1; x++)
{
/* Create empty floor */
- grid_array[y][x].feat = feat_floor;
+ current_floor->grid_array[y][x].feat = feat_floor;
}
}
for (j = x_left; j <= x_right; j++)
{
place_extra_perm_bold(i, j);
- grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor->grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
}
for (i = y_depth; i >= y_depth - 3; i--)
for (j = x_left; j <= x_right; j++)
{
place_extra_perm_bold(i, j);
- grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor->grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
}
for (j = x_left; j <= x_left + 17; j++)
for (i = y_height; i <= y_depth; i++)
{
place_extra_perm_bold(i, j);
- grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor->grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
}
for (j = x_right; j >= x_right - 17; j--)
for (i = y_height; i <= y_depth; i++)
{
place_extra_perm_bold(i, j);
- grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor->grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
}
place_extra_perm_bold(y_height+6, x_left+18);
- grid_array[y_height+6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor->grid_array[y_height+6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
place_extra_perm_bold(y_depth-4, x_left+18);
- grid_array[y_depth-4][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor->grid_array[y_depth-4][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
place_extra_perm_bold(y_height+6, x_right-18);
- grid_array[y_height+6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor->grid_array[y_height+6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
place_extra_perm_bold(y_depth-4, x_right-18);
- grid_array[y_depth-4][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor->grid_array[y_depth-4][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
for (i = y_height + 1; i <= y_height + 5; i++)
for (j = x_left + 20 + 2 * (y_height + 5 - i); j <= x_right - 20 - 2 * (y_height + 5 - i); j++)
{
- grid_array[i][j].feat = feat_permanent_glass_wall;
+ current_floor->grid_array[i][j].feat = feat_permanent_glass_wall;
}
i = y_height + 1;
j = xval;
- grid_array[i][j].feat = f_tag_to_index("BUILDING_3");
- grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor->grid_array[i][j].feat = f_tag_to_index("BUILDING_3");
+ current_floor->grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
player_place(i, j);
}
place_solid_perm_bold(y, x);
/* Illuminate and memorize the walls */
- grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor->grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
}
}
for (x = qx + 1; x < qx + SCREEN_WID - 1; x++)
{
/* Create empty floor */
- grid_array[y][x].feat = feat_floor;
+ current_floor->grid_array[y][x].feat = feat_floor;
}
}
for(i = 0; i < 4; i++)
{
place_monster_aux(0, p_ptr->y + 8 + (i/2)*4, p_ptr->x - 2 + (i%2)*4, battle_mon[i], (PM_NO_KAGE | PM_NO_PET));
- set_friendly(&m_list[grid_array[p_ptr->y+8+(i/2)*4][p_ptr->x-2+(i%2)*4].m_idx]);
+ set_friendly(&m_list[current_floor->grid_array[p_ptr->y+8+(i/2)*4][p_ptr->x-2+(i%2)*4].m_idx]);
}
for(i = 1; i < m_max; i++)
{
}
/*!
- * @brief フロアに存在する全マスの記憶状態を初期化する / Wipe all unnecessary flags after grid_array generation
+ * @brief フロアに存在する全マスの記憶状態を初期化する / Wipe all unnecessary flags after current_floor->grid_array generation
* @return なし
*/
void wipe_generate_random_floor_flags(void)
for (x = 0; x < cur_wid; x++)
{
/* Wipe unused flags */
- grid_array[y][x].info &= ~(CAVE_MASK);
+ current_floor->grid_array[y][x].info &= ~(CAVE_MASK);
}
}
for (x = 1; x < cur_wid - 1; x++)
{
/* There might be trap */
- grid_array[y][x].info |= CAVE_UNSAFE;
+ current_floor->grid_array[y][x].info |= CAVE_UNSAFE;
}
}
}
}
/*!
- * @brief フロアの全情報を初期化する / Clear and empty the grid_array
+ * @brief フロアの全情報を初期化する / Clear and empty the current_floor->grid_array
* @return なし
*/
void clear_cave(void)
precalc_cur_num_of_pet();
- /* Start with a blank grid_array */
+ /* Start with a blank current_floor->grid_array */
for (y = 0; y < MAX_HGT; y++)
{
for (x = 0; x < MAX_WID; x++)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
g_ptr->info = 0;
g_ptr->feat = 0;
g_ptr->o_idx = 0;
concptr why = NULL;
- /* Clear and empty the grid_array */
+ /* Clear and empty the current_floor->grid_array */
clear_cave();
/* Build the arena -KMW- */
/* Access the location */
- g_ptr = &grid_array[tmp_row][tmp_col];
+ g_ptr = ¤t_floor->grid_array[tmp_row][tmp_col];
/* Avoid "solid" walls */
if (is_solid_grid(g_ptr)) continue;
{
int i, j, dx, dy;
- grid_type *g_ptr = &grid_array[*y][*x];
+ grid_type *g_ptr = ¤t_floor->grid_array[*y][*x];
if (!in_bounds(*y, *x)) return TRUE;
}
/* Clear mimic type */
- grid_array[*y][*x].mimic = 0;
+ current_floor->grid_array[*y][*x].mimic = 0;
place_floor_bold(*y, *x);
y3 = (y1 + y2) / 2;
}
/* cache g_ptr */
- g_ptr = &grid_array[y3][x3];
+ g_ptr = ¤t_floor->grid_array[y3][x3];
if (is_solid_grid(g_ptr))
{
/* move midpoint a bit to avoid problem. */
}
y3 += dy;
x3 += dx;
- g_ptr = &grid_array[y3][x3];
+ g_ptr = ¤t_floor->grid_array[y3][x3];
}
if (is_floor_grid(g_ptr))
{
if (build_tunnel2(x1, y1, x3, y3, type, cutoff))
{
- if ((grid_array[y3][x3].info & CAVE_ROOM) || (randint1(100) > 95))
+ if ((current_floor->grid_array[y3][x3].info & CAVE_ROOM) || (randint1(100) > 95))
{
/* do second half only if works + if have hit a room */
retval = build_tunnel2(x3, y3, x2, y2, type, cutoff);
{
POSITION x, y;
- /* Clear and empty the grid_array */
+ /* Clear and empty the current_floor->grid_array */
clear_cave();
/* Fill the arrays of floors and walls in the good proportions */
monster_type *m_ptr = &m_list[m_idx];
monster_race *r_ptr;
- grid_array[cy][cx].m_idx = m_idx;
+ current_floor->grid_array[cy][cx].m_idx = m_idx;
m_ptr->r_idx = party_mon[i].r_idx;
POSITION dis = 1;
POSITION oy = p_ptr->y;
POSITION ox = p_ptr->x;
- MONSTER_IDX m_idx = grid_array[oy][ox].m_idx;
+ MONSTER_IDX m_idx = current_floor->grid_array[oy][ox].m_idx;
/* Nothing to do if no monster */
if (!m_idx) return;
if (!cave_empty_bold(ny, nx)) continue;
/* Hack -- no teleport onto glyph of warding */
- if (is_glyph_grid(&grid_array[ny][nx])) continue;
- if (is_explosive_rune_grid(&grid_array[ny][nx])) continue;
+ if (is_glyph_grid(¤t_floor->grid_array[ny][nx])) continue;
+ if (is_explosive_rune_grid(¤t_floor->grid_array[ny][nx])) continue;
/* ...nor onto the Pattern */
if (pattern_tile(ny, nx)) continue;
m_ptr = &m_list[m_idx];
/* Update the old location */
- grid_array[oy][ox].m_idx = 0;
+ current_floor->grid_array[oy][ox].m_idx = 0;
/* Update the new location */
- grid_array[ny][nx].m_idx = m_idx;
+ current_floor->grid_array[ny][nx].m_idx = m_idx;
/* Move the monster */
m_ptr->fy = ny;
{
for (x = 0; x < cur_wid; x++)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
feature_type *f_ptr = &f_info[g_ptr->feat];
bool ok = FALSE;
prepare_change_floor_mode(CFM_RAND_PLACE | CFM_NO_RETURN);
/* Mega Hack -- It's not the stairs you enter. Disable it. */
- if (!feat_uses_special(grid_array[p_ptr->y][p_ptr->x].feat)) grid_array[p_ptr->y][p_ptr->x].special = 0;
+ if (!feat_uses_special(current_floor->grid_array[p_ptr->y][p_ptr->x].feat)) current_floor->grid_array[p_ptr->y][p_ptr->x].special = 0;
}
else
{
if (change_floor_mode & CFM_SAVE_FLOORS)
{
/* Extract stair position */
- g_ptr = &grid_array[p_ptr->y][p_ptr->x];
+ g_ptr = ¤t_floor->grid_array[p_ptr->y][p_ptr->x];
f_ptr = &f_info[g_ptr->feat];
/* Get back to old saved floor? */
* @return なし
* @details
* If the floor is an old saved floor, it will be\n
- * restored from the temporal file. If the floor is new one, new grid_array\n
+ * restored from the temporal file. If the floor is new one, new current_floor->grid_array\n
* will be generated.\n
*/
void change_floor(void)
if (!(change_floor_mode & CFM_SAVE_FLOORS) &&
!(change_floor_mode & CFM_FIRST_FLOOR))
{
- /* Create grid_array */
+ /* Create current_floor->grid_array */
generate_random_floor();
/* Paranoia -- No new saved floor */
/* Forbid return stairs */
if (change_floor_mode & CFM_NO_RETURN)
{
- grid_type *g_ptr = &grid_array[p_ptr->y][p_ptr->x];
+ grid_type *g_ptr = ¤t_floor->grid_array[p_ptr->y][p_ptr->x];
if (!feat_uses_special(g_ptr->feat))
{
}
else
{
- /* Newly create grid_array */
+ /* Newly create current_floor->grid_array */
generate_random_floor();
}
if (!(change_floor_mode & CFM_NO_RETURN))
{
/* Extract stair position */
- grid_type *g_ptr = &grid_array[p_ptr->y][p_ptr->x];
+ grid_type *g_ptr = ¤t_floor->grid_array[p_ptr->y][p_ptr->x];
/*** Create connected stairs ***/
{
for (x = 0; x < cur_wid; x++)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
if (!g_ptr->special) continue;
if (feat_uses_special(g_ptr->feat)) continue;
/* Connect this stairs to the destination */
- grid_array[p_ptr->y][p_ptr->x].special = dest_floor_id;
+ current_floor->grid_array[p_ptr->y][p_ptr->x].special = dest_floor_id;
}
{
if (!in_bounds2(ty, tx)) continue;
- g_ptr = &grid_array[ty][tx];
+ g_ptr = ¤t_floor->grid_array[ty][tx];
if (g_ptr->feat == feat1) continue;
if (g_ptr->feat == feat2) continue;
if (!in_bounds2(ty, tx)) continue;
break;
}
- g_ptr = &grid_array[ty][tx];
+ g_ptr = ¤t_floor->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)))
for (j = y - 3; j < y + 4; j++)
{
if (!in_bounds(j, i)) continue;
- g_ptr = &grid_array[j][i];
+ g_ptr = ¤t_floor->grid_array[j][i];
if (g_ptr->info & CAVE_ICKY) continue;
if (g_ptr->o_idx) continue;
if ((distance(j, i, y, x) > 1) || (randint1(100) < 25))
{
if (randint1(100) < 75)
- grid_array[j][i].feat = feat_tree;
+ current_floor->grid_array[j][i].feat = feat_tree;
}
else
{
- grid_array[j][i].feat = feat_rubble;
+ current_floor->grid_array[j][i].feat = feat_rubble;
}
/* Clear garbage of hidden trap or door */
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);
+ if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) current_floor->grid_array[j][i].info |= (CAVE_GLOW | CAVE_ROOM);
}
}
}
if (!ironman_downward && one_in_(3))
{
/* up stair */
- grid_array[y][x].feat = feat_up_stair;
+ current_floor->grid_array[y][x].feat = feat_up_stair;
}
}
y = (POSITION)rand_range(1, cur_hgt - 2);
x = (POSITION)rand_range(1, cur_wid - 2);
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Must be a "naked" floor grid */
if (g_ptr->m_idx) continue;
grid_type *g_ptr;
/* Paranoia */
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
if (!is_floor_grid(g_ptr) || g_ptr->o_idx) return;
/* Town */
{
int tmp, type;
FEAT_IDX feat = feat_none;
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
/* Initialize mimic info */
g_ptr->mimic = 0;
cave_set_feat(y, x, feat);
/* Now it is not floor */
- grid_array[y][x].info &= ~(CAVE_MASK);
+ current_floor->grid_array[y][x].info &= ~(CAVE_MASK);
}
else
{
else
{
set_cave_feat(y, x, feat_locked_door_random((d_info[p_ptr->dungeon_idx].flags1 & DF1_GLASS_DOOR) ? DOOR_GLASS_DOOR : DOOR_DOOR));
- grid_array[y][x].info &= ~(CAVE_FLOOR);
+ current_floor->grid_array[y][x].info &= ~(CAVE_FLOOR);
delete_monster(y, x);
}
}
}
else
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
if (type == DOOR_DEFAULT)
{
/* Extract the location */
y = y1 + ddy_ddd[i];
x = x1 + ddx_ddd[i];
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Skip non floors */
if (cave_have_flag_grid(g_ptr, FF_WALL)) continue;
if (cave_have_flag_bold(y, x, FF_WALL)) return;
/* Ignore room grids */
- if (grid_array[y][x].info & (CAVE_ROOM)) return;
+ if (current_floor->grid_array[y][x].info & (CAVE_ROOM)) return;
/* Occasional door (if allowed) */
if ((randint0(100) < dun_tun_jct) && possible_doorway(y, x) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_DOORS))
}
/* Require "clean" floor space */
- g_ptr = &grid_array[j][k];
+ g_ptr = ¤t_floor->grid_array[j][k];
if (!is_floor_grid(g_ptr) || g_ptr->o_idx) continue;
if (randint0(100) < 75)
}
/* Require "naked" floor grids */
- g_ptr = &grid_array[y1][x1];
+ g_ptr = ¤t_floor->grid_array[y1][x1];
if (!is_floor_grid(g_ptr) || g_ptr->o_idx || g_ptr->m_idx) continue;
/* Place the trap */
scatter(&y, &x, y1, x1, d, 0);
/* Require "empty" floor grids */
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
if (!cave_empty_grid(g_ptr)) continue;
/* Place the monster (allow groups) */
return;
}
- if (grid_array[y][x].info & CAVE_ROOM)
+ if (current_floor->grid_array[y][x].info & CAVE_ROOM)
{
/* A room border don't touch. */
return;
#ifdef COMPLEX_WALL_ILLUMINATION /* COMPLEX_WALL_ILLUMINATION */
/* Check for "complex" illumination */
- if ((feat_supports_los(get_feat_mimic(&grid_array[yy][xx])) &&
- (grid_array[yy][xx].info & CAVE_GLOW)) ||
- (feat_supports_los(get_feat_mimic(&grid_array[y][xx])) &&
- (grid_array[y][xx].info & CAVE_GLOW)) ||
- (feat_supports_los(get_feat_mimic(&grid_array[yy][x])) &&
- (grid_array[yy][x].info & CAVE_GLOW)))
+ if ((feat_supports_los(get_feat_mimic(¤t_floor->grid_array[yy][xx])) &&
+ (current_floor->grid_array[yy][xx].info & CAVE_GLOW)) ||
+ (feat_supports_los(get_feat_mimic(¤t_floor->grid_array[y][xx])) &&
+ (current_floor->grid_array[y][xx].info & CAVE_GLOW)) ||
+ (feat_supports_los(get_feat_mimic(¤t_floor->grid_array[yy][x])) &&
+ (current_floor->grid_array[yy][x].info & CAVE_GLOW)))
{
return TRUE;
}
#else /* COMPLEX_WALL_ILLUMINATION */
/* Check for "simple" illumination */
- return (grid_array[yy][xx].info & CAVE_GLOW) ? TRUE : FALSE;
+ return (current_floor->grid_array[yy][xx].info & CAVE_GLOW) ? TRUE : FALSE;
#endif /* COMPLEX_WALL_ILLUMINATION */
}
if (player_has_los_bold((Y), (X))) \
{ \
/* Update the monster */ \
- if (grid_array[(Y)][(X)].m_idx) update_monster(grid_array[(Y)][(X)].m_idx, FALSE); \
+ if (current_floor->grid_array[(Y)][(X)].m_idx) update_monster(current_floor->grid_array[(Y)][(X)].m_idx, FALSE); \
\
/* Notice and redraw */ \
note_spot((Y), (X)); \
/* Blind players see nothing */
if (p_ptr->blind) return FALSE;
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Note that "torch-lite" yields "illumination" */
if (g_ptr->info & (CAVE_LITE | CAVE_MNLT)) return TRUE;
*/
bool cave_valid_bold(POSITION y, POSITION x)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
/* Forbid perma-grids */
* not any. If there were, they would have to set "shimmer_objects"\n
* when they were created, and then new "shimmer" code in "dungeon.c"\n
* would have to be created handle the "shimmer" effect, and the code\n
- * in "grid_array.c" would have to be updated to create the shimmer effect.\n
+ * in "current_floor->grid_array.c" would have to be updated to create the shimmer effect.\n
*\n
* Note the effects of hallucination. Objects always appear as random\n
* "objects", monsters as random "monsters", and normal grids occasionally\n
*/
void map_info(POSITION y, POSITION x, TERM_COLOR *ap, SYMBOL_CODE *cp, TERM_COLOR *tap, SYMBOL_CODE *tcp)
{
- /* Get the grid_array */
- grid_type *g_ptr = &grid_array[y][x];
+ /* Get the current_floor->grid_array */
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
*/
void note_spot(POSITION y, POSITION x)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
/* Blind players see nothing */
{
POSITION ny = GRID_Y(path_g[i]);
POSITION nx = GRID_X(path_g[i]);
- grid_type *g_ptr = &grid_array[ny][nx];
+ grid_type *g_ptr = ¤t_floor->grid_array[ny][nx];
if (panel_contains(ny, nx))
{
x = lite_x[i];
/* Forget "LITE" flag */
- grid_array[y][x].info &= ~(CAVE_LITE);
+ current_floor->grid_array[y][x].info &= ~(CAVE_LITE);
/* lite_spot(y, x); Perhaps don't need? */
}
*/
#define cave_lite_hack(Y,X) \
{\
- if (!(grid_array[Y][X].info & (CAVE_LITE))) \
+ if (!(current_floor->grid_array[Y][X].info & (CAVE_LITE))) \
{ \
- grid_array[Y][X].info |= (CAVE_LITE); \
+ current_floor->grid_array[Y][X].info |= (CAVE_LITE); \
lite_y[lite_n] = (Y); \
lite_x[lite_n++] = (X); \
} \
/* forget_lite(); Perhaps don't need? */
/* Add it to later visual update */
- cave_redraw_later(&grid_array[p_ptr->y][p_ptr->x], p_ptr->y, p_ptr->x);
+ cave_redraw_later(¤t_floor->grid_array[p_ptr->y][p_ptr->x], p_ptr->y, p_ptr->x);
}
#endif
x = lite_x[i];
/* Mark the grid as not "lite" */
- grid_array[y][x].info &= ~(CAVE_LITE);
+ current_floor->grid_array[y][x].info &= ~(CAVE_LITE);
/* Mark the grid as "seen" */
- grid_array[y][x].info |= (CAVE_TEMP);
+ current_floor->grid_array[y][x].info |= (CAVE_TEMP);
/* Add it to the "seen" set */
temp_y[temp_n] = y;
if (d > p) continue;
/* Viewable, nearby, grids get "torch lit" */
- if (grid_array[y][x].info & CAVE_VIEW)
+ if (current_floor->grid_array[y][x].info & CAVE_VIEW)
{
/* This grid is "torch lit" */
cave_lite_hack(y, x);
y = lite_y[i];
x = lite_x[i];
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Update fresh grids */
if (g_ptr->info & (CAVE_TEMP)) continue;
y = temp_y[i];
x = temp_x[i];
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* No longer in the array */
g_ptr->info &= ~(CAVE_TEMP);
/* We trust this grid is in bounds */
/* if (!in_bounds2(y, x)) return; */
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Want a unlit square in view of the player */
if ((g_ptr->info & (CAVE_MNLT | CAVE_VIEW)) != CAVE_VIEW) return;
/* We trust this grid is in bounds */
/* if (!in_bounds2(y, x)) return; */
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Want a unlit and undarkened square in view of the player */
if ((g_ptr->info & (CAVE_LITE | CAVE_MNLT | CAVE_MNDK | CAVE_VIEW)) != CAVE_VIEW) return;
for (i = 0; i < mon_lite_n; i++)
{
/* Point to grid */
- g_ptr = &grid_array[mon_lite_y[i]][mon_lite_x[i]];
+ g_ptr = ¤t_floor->grid_array[mon_lite_y[i]][mon_lite_x[i]];
/* Set temp or xtra flag */
g_ptr->info |= (g_ptr->info & CAVE_MNLT) ? CAVE_TEMP : CAVE_XTRA;
mon_fy = m_ptr->fy;
/* Is the monster visible? */
- mon_invis = !(grid_array[mon_fy][mon_fx].info & CAVE_VIEW);
+ mon_invis = !(current_floor->grid_array[mon_fy][mon_fx].info & CAVE_VIEW);
/* The square it is on */
add_mon_lite(mon_fy, mon_fx);
add_mon_lite(mon_fy + 2, mon_fx);
add_mon_lite(mon_fy + 2, mon_fx - 1);
- g_ptr = &grid_array[mon_fy + 2][mon_fx];
+ g_ptr = ¤t_floor->grid_array[mon_fy + 2][mon_fx];
/* Radius 3 */
if ((rad == 3) && cave_have_flag_grid(g_ptr, f_flag))
add_mon_lite(mon_fy - 2, mon_fx);
add_mon_lite(mon_fy - 2, mon_fx - 1);
- g_ptr = &grid_array[mon_fy - 2][mon_fx];
+ g_ptr = ¤t_floor->grid_array[mon_fy - 2][mon_fx];
/* Radius 3 */
if ((rad == 3) && cave_have_flag_grid(g_ptr, f_flag))
add_mon_lite(mon_fy, mon_fx + 2);
add_mon_lite(mon_fy - 1, mon_fx + 2);
- g_ptr = &grid_array[mon_fy][mon_fx + 2];
+ g_ptr = ¤t_floor->grid_array[mon_fy][mon_fx + 2];
/* Radius 3 */
if ((rad == 3) && cave_have_flag_grid(g_ptr, f_flag))
add_mon_lite(mon_fy, mon_fx - 2);
add_mon_lite(mon_fy - 1, mon_fx - 2);
- g_ptr = &grid_array[mon_fy][mon_fx - 2];
+ g_ptr = ¤t_floor->grid_array[mon_fy][mon_fx - 2];
/* Radius 3 */
if ((rad == 3) && cave_have_flag_grid(g_ptr, f_flag))
/* We trust this grid is in bounds */
/* Point to grid */
- g_ptr = &grid_array[fy][fx];
+ g_ptr = ¤t_floor->grid_array[fy][fx];
if (g_ptr->info & CAVE_TEMP) /* Pervious lit */
{
/* We trust this grid is in bounds */
/* Point to grid */
- g_ptr = &grid_array[fy][fx];
+ g_ptr = ¤t_floor->grid_array[fy][fx];
if (g_ptr->info & CAVE_MNLT) /* Lit */
{
{
/* We trust this grid is in bounds */
- grid_array[temp_y[i]][temp_x[i]].info &= ~(CAVE_TEMP | CAVE_XTRA);
+ current_floor->grid_array[temp_y[i]][temp_x[i]].info &= ~(CAVE_TEMP | CAVE_XTRA);
}
/* Finished with temp_n */
/* Mega-Hack -- Visual update later */
p_ptr->update |= (PU_DELAY_VIS);
- p_ptr->monlite = (grid_array[p_ptr->y][p_ptr->x].info & CAVE_MNLT) ? TRUE : FALSE;
+ p_ptr->monlite = (current_floor->grid_array[p_ptr->y][p_ptr->x].info & CAVE_MNLT) ? TRUE : FALSE;
if (p_ptr->special_defense & NINJA_S_STEALTH)
{
for (i = 0; i < mon_lite_n; i++)
{
/* Point to grid */
- g_ptr = &grid_array[mon_lite_y[i]][mon_lite_x[i]];
+ g_ptr = ¤t_floor->grid_array[mon_lite_y[i]][mon_lite_x[i]];
/* Clear monster illumination flag */
g_ptr->info &= ~(CAVE_MNLT | CAVE_MNDK);
{
POSITION y = view_y[i];
POSITION x = view_x[i];
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Forget that the grid is viewable */
g_ptr->info &= ~(CAVE_VIEW);
grid_type *g2_c_ptr;
/* Access the grids */
- g1_c_ptr = &grid_array[y1][x1];
- g2_c_ptr = &grid_array[y2][x2];
+ g1_c_ptr = ¤t_floor->grid_array[y1][x1];
+ g2_c_ptr = ¤t_floor->grid_array[y2][x2];
/* Check for walls */
/* Totally blocked by "unviewable neighbors" */
if (!v1 && !v2) return (TRUE);
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Check for walls */
{
y = view_y[n];
x = view_x[n];
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Mark the grid as not in "view" */
g_ptr->info &= ~(CAVE_VIEW);
/* Now start on the player */
y = p_ptr->y;
x = p_ptr->x;
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Assume the player grid is easily viewable */
g_ptr->info |= (CAVE_XTRA);
/* Scan south-east */
for (d = 1; d <= z; d++)
{
- g_ptr = &grid_array[y + d][x + d];
+ g_ptr = ¤t_floor->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++)
{
- g_ptr = &grid_array[y + d][x - d];
+ g_ptr = ¤t_floor->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++)
{
- g_ptr = &grid_array[y - d][x + d];
+ g_ptr = ¤t_floor->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++)
{
- g_ptr = &grid_array[y - d][x - d];
+ g_ptr = ¤t_floor->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 */
for (d = 1; d <= full; d++)
{
- g_ptr = &grid_array[y + d][x];
+ g_ptr = ¤t_floor->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;
/* Scan north */
for (d = 1; d <= full; d++)
{
- g_ptr = &grid_array[y - d][x];
+ g_ptr = ¤t_floor->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;
/* Scan east */
for (d = 1; d <= full; d++)
{
- g_ptr = &grid_array[y][x + d];
+ g_ptr = ¤t_floor->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;
/* Scan west */
for (d = 1; d <= full; d++)
{
- g_ptr = &grid_array[y][x - d];
+ g_ptr = ¤t_floor->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;
{
y = view_y[n];
x = view_x[n];
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Clear the "CAVE_XTRA" flag */
g_ptr->info &= ~(CAVE_XTRA);
{
y = temp_y[n];
x = temp_x[n];
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* No longer in the array */
g_ptr->info &= ~(CAVE_TEMP);
{
y = redraw_y[i];
x = redraw_x[i];
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Update only needed grids (prevent multiple updating) */
if (!(g_ptr->info & CAVE_REDRAW)) continue;
for (x = 0; x < cur_wid; x++)
{
/* Forget the old data */
- grid_array[y][x].dist = 0;
- grid_array[y][x].cost = 0;
- grid_array[y][x].when = 0;
+ current_floor->grid_array[y][x].dist = 0;
+ current_floor->grid_array[y][x].cost = 0;
+ current_floor->grid_array[y][x].when = 0;
}
}
}
if (running && in_bounds(flow_y, flow_x))
{
/* The way point is in sight - do not update. (Speedup) */
- if (grid_array[flow_y][flow_x].info & CAVE_VIEW) return;
+ if (current_floor->grid_array[flow_y][flow_x].info & CAVE_VIEW) return;
}
/* Erase all of the current flow information */
{
for (x = 0; x < cur_wid; x++)
{
- grid_array[y][x].cost = 0;
- grid_array[y][x].dist = 0;
+ current_floor->grid_array[y][x].cost = 0;
+ current_floor->grid_array[y][x].dist = 0;
}
}
for (d = 0; d < 8; d++)
{
int old_head = flow_head;
- byte_hack m = grid_array[ty][tx].cost + 1;
- byte_hack n = grid_array[ty][tx].dist + 1;
+ byte_hack m = current_floor->grid_array[ty][tx].cost + 1;
+ byte_hack n = current_floor->grid_array[ty][tx].dist + 1;
grid_type *g_ptr;
/* Child location */
/* Ignore player's grid */
if (player_bold(y, x)) continue;
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
if (is_closed_door(g_ptr->feat)) m += 3;
{
for (x = 0; x < cur_wid; x++)
{
- int w = grid_array[y][x].when;
- grid_array[y][x].when = (w > 128) ? (w - 128) : 0;
+ int w = current_floor->grid_array[y][x].when;
+ current_floor->grid_array[y][x].when = (w > 128) ? (w - 128) : 0;
}
}
/* Check Bounds */
if (!in_bounds(y, x)) continue;
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Walls, water, and lava cannot hold scent. */
if (!cave_have_flag_grid(g_ptr, FF_MOVE) && !is_closed_door(g_ptr->feat)) continue;
{
if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Memorize terrain of the grid */
g_ptr->info |= (CAVE_KNOWN);
/* Memorize known walls */
for (i = 0; i < 8; i++)
{
- g_ptr = &grid_array[y + ddy_ddd[i]][x + ddx_ddd[i]];
+ g_ptr = ¤t_floor->grid_array[y + ddy_ddd[i]][x + ddx_ddd[i]];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(g_ptr);
*/
void cave_set_feat(POSITION y, POSITION x, FEAT_IDX feat)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
feature_type *f_ptr = &f_info[feat];
bool old_los, old_mirror;
yy = y + ddy_ddd[i];
xx = x + ddx_ddd[i];
if (!in_bounds2(yy, xx)) continue;
- grid_array[yy][xx].info |= CAVE_GLOW;
+ current_floor->grid_array[yy][xx].info |= CAVE_GLOW;
}
}
yy = y + ddy_ddd[i];
xx = x + ddx_ddd[i];
if (!in_bounds2(yy, xx)) continue;
- cc_ptr = &grid_array[yy][xx];
+ cc_ptr = ¤t_floor->grid_array[yy][xx];
cc_ptr->info |= CAVE_GLOW;
if (player_has_los_grid(cc_ptr))
if (p_ptr->special_defense & NINJA_S_STEALTH)
{
- if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+ if (current_floor->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
}
}
}
void cave_alter_feat(POSITION y, POSITION x, int action)
{
/* Set old feature */
- FEAT_IDX oldfeat = grid_array[y][x].feat;
+ FEAT_IDX oldfeat = current_floor->grid_array[y][x].feat;
/* Get the new feat */
FEAT_IDX newfeat = feat_state(oldfeat, action);
/* Remove a mirror */
void remove_mirror(POSITION y, POSITION x)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
/* Remove the mirror */
g_ptr->info &= ~(CAVE_OBJECT);
{
for (x = 0; x < cur_wid; x++)
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Feature code (applying "mimic" field) */
yy = y + ddy_ddd[i];
xx = x + ddx_ddd[i];
if (!in_bounds2(yy, xx)) continue;
- grid_array[yy][xx].info |= CAVE_GLOW;
+ current_floor->grid_array[yy][xx].info |= CAVE_GLOW;
}
}
}
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 *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
feature_type *f_ptr = &f_info[g_ptr->feat];
/* Require "teleportable" space */
*/
bool cave_player_teleportable_bold(POSITION y, POSITION x, BIT_FLAGS mode)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
feature_type *f_ptr = &f_info[g_ptr->feat];
/* Require "teleportable" space */
/* Macros */
-#define set_cave_feat(Y,X,F) (grid_array[(Y)][(X)].feat = (F))
-#define add_cave_info(Y,X,I) (grid_array[(Y)][(X)].info |= (I))
+#define set_cave_feat(Y,X,F) (current_floor->grid_array[(Y)][(X)].feat = (F))
+#define add_cave_info(Y,X,I) (current_floor->grid_array[(Y)][(X)].info |= (I))
/* This should not be used */
-/*#define set_cave_info(Y,X,I) (grid_array[(Y)][(X)].info = (I)) */
+/*#define set_cave_info(Y,X,I) (current_floor->grid_array[(Y)][(X)].info = (I)) */
/*!
* @brief 指定座標が瓦礫かどうかを返す
* @param X 指定X座標
* @return FLOOR属性を持っているならばTRUE
*/
-#define is_floor_bold(Y,X) (grid_array[Y][X].info & CAVE_FLOOR)
-#define is_extra_bold(Y,X) (grid_array[Y][X].info & CAVE_EXTRA)
+#define is_floor_bold(Y,X) (current_floor->grid_array[Y][X].info & CAVE_FLOOR)
+#define is_extra_bold(Y,X) (current_floor->grid_array[Y][X].info & CAVE_EXTRA)
-#define is_inner_bold(Y,X) (grid_array[Y][X].info & CAVE_INNER)
-#define is_outer_bold(Y,X) (grid_array[Y][X].info & CAVE_OUTER)
-#define is_solid_bold(Y,X) (grid_array[Y][X].info & CAVE_SOLID)
+#define is_inner_bold(Y,X) (current_floor->grid_array[Y][X].info & CAVE_INNER)
+#define is_outer_bold(Y,X) (current_floor->grid_array[Y][X].info & CAVE_OUTER)
+#define is_solid_bold(Y,X) (current_floor->grid_array[Y][X].info & CAVE_SOLID)
#define is_floor_grid(C) ((C)->info & CAVE_FLOOR)
#define is_extra_grid(C) ((C)->info & CAVE_EXTRA)
#define place_floor_bold(Y, X) \
{ \
set_cave_feat(Y,X,feat_ground_type[randint0(100)]); \
- grid_array[Y][X].info &= ~(CAVE_MASK); \
+ current_floor->grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_FLOOR); \
delete_monster(Y, X); \
}
#define place_extra_bold(Y, X) \
{ \
set_cave_feat(Y,X,feat_wall_type[randint0(100)]); \
- grid_array[Y][X].info &= ~(CAVE_MASK); \
+ current_floor->grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_EXTRA); \
delete_monster(Y, X); \
}
#define place_extra_perm_bold(Y, X) \
{ \
set_cave_feat(Y,X,feat_permanent); \
- grid_array[Y][X].info &= ~(CAVE_MASK); \
+ current_floor->grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_EXTRA); \
delete_monster(Y, X); \
}
{ \
feature_type *_f_ptr; \
set_cave_feat(Y,X,feat_wall_type[randint0(100)]); \
- _f_ptr = &f_info[grid_array[Y][X].feat]; \
- if (permanent_wall(_f_ptr)) grid_array[Y][X].feat = feat_state(grid_array[Y][X].feat, FF_UNPERM); \
- grid_array[Y][X].info &= ~(CAVE_MASK); \
+ _f_ptr = &f_info[current_floor->grid_array[Y][X].feat]; \
+ if (permanent_wall(_f_ptr)) current_floor->grid_array[Y][X].feat = feat_state(current_floor->grid_array[Y][X].feat, FF_UNPERM); \
+ current_floor->grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_EXTRA); \
delete_monster(Y, X); \
}
#define place_inner_bold(Y, X) \
{ \
set_cave_feat(Y,X,feat_wall_inner); \
- grid_array[Y][X].info &= ~(CAVE_MASK); \
+ current_floor->grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_INNER); \
delete_monster(Y, X); \
}
#define place_inner_perm_bold(Y, X) \
{ \
set_cave_feat(Y,X,feat_permanent); \
- grid_array[Y][X].info &= ~(CAVE_MASK); \
+ current_floor->grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_INNER); \
delete_monster(Y, X); \
}
#define place_outer_bold(Y, X) \
{ \
set_cave_feat(Y,X,feat_wall_outer); \
- grid_array[Y][X].info &= ~(CAVE_MASK); \
+ current_floor->grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_OUTER); \
delete_monster(Y, X); \
}
#define place_outer_perm_bold(Y, X) \
{ \
set_cave_feat(Y,X,feat_permanent); \
- grid_array[Y][X].info &= ~(CAVE_MASK); \
+ current_floor->grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_OUTER); \
delete_monster(Y, X); \
}
feature_type *_f_ptr = &f_info[feat_wall_outer]; \
if (permanent_wall(_f_ptr)) set_cave_feat(Y, X, (s16b)feat_state(feat_wall_outer, FF_UNPERM)); \
else set_cave_feat(Y,X,feat_wall_outer); \
- grid_array[Y][X].info &= ~(CAVE_MASK); \
+ current_floor->grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,(CAVE_OUTER | CAVE_VAULT)); \
delete_monster(Y, X); \
}
#define place_solid_bold(Y, X) \
{ \
set_cave_feat(Y,X,feat_wall_solid); \
- grid_array[Y][X].info &= ~(CAVE_MASK); \
+ current_floor->grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_SOLID); \
delete_monster(Y, X); \
}
#define place_solid_perm_bold(Y, X) \
{ \
set_cave_feat(Y,X,feat_permanent); \
- grid_array[Y][X].info &= ~(CAVE_MASK); \
+ current_floor->grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_SOLID); \
delete_monster(Y, X); \
}
#define place_solid_noperm_bold(Y, X) \
{ \
feature_type *_f_ptr = &f_info[feat_wall_solid]; \
- if ((grid_array[Y][X].info & CAVE_VAULT) && permanent_wall(_f_ptr)) \
+ if ((current_floor->grid_array[Y][X].info & CAVE_VAULT) && permanent_wall(_f_ptr)) \
set_cave_feat(Y, X, feat_state(feat_wall_solid, FF_UNPERM)); \
else set_cave_feat(Y,X,feat_wall_solid); \
- grid_array[Y][X].info &= ~(CAVE_MASK); \
+ current_floor->grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_SOLID); \
delete_monster(Y, X); \
}
*/
static void drop_here(object_type *j_ptr, POSITION y, POSITION x)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
object_type *o_ptr;
OBJECT_IDX o_idx = o_pop();
return parse_line_feature(buf);
}
- /* Process "D:<dungeon>" -- info for the grid_array grids */
+ /* Process "D:<dungeon>" -- info for the current_floor->grid_array grids */
else if (buf[0] == 'D')
{
object_type object_type_body;
for (*x = xmin, i = 0; ((*x < xmax) && (i < len)); (*x)++, s++, i++)
{
- grid_type *g_ptr = &grid_array[*y][*x];
+ grid_type *g_ptr = ¤t_floor->grid_array[*y][*x];
int idx = s[0];
/* Allocate and Wipe the max dungeon level */
C_MAKE(max_dlv, max_d_idx, DEPTH);
- /* Allocate and wipe each line of the grid_array */
+ /* Allocate and wipe each line of the current_floor->grid_array */
for (i = 0; i < MAX_HGT; i++)
{
- /* Allocate one row of the grid_array */
- C_MAKE(grid_array[i], MAX_WID, grid_type);
+ /* Allocate one row of the current_floor->grid_array */
+ C_MAKE(current_floor->grid_array[i], MAX_WID, grid_type);
}
/* Apply the RLE info */
for (i = count; i > 0; i--)
{
- /* Access the grid_array */
- g_ptr = &grid_array[y][x];
+ /* Access the current_floor->grid_array */
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Extract "info" */
g_ptr->info = info;
/* Apply the RLE info */
for (i = count; i > 0; i--)
{
- /* Access the grid_array */
- g_ptr = &grid_array[y][x];
+ /* Access the current_floor->grid_array */
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Extract "feat" */
g_ptr->feat = (s16b)tmp8u;
/* Apply the RLE info */
for (i = count; i > 0; i--)
{
- /* Access the grid_array */
- g_ptr = &grid_array[y][x];
+ /* Access the current_floor->grid_array */
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Extract "mimic" */
g_ptr->mimic = (s16b)tmp8u;
/* Apply the RLE info */
for (i = count; i > 0; i--)
{
- /* Access the grid_array */
- g_ptr = &grid_array[y][x];
+ /* Access the current_floor->grid_array */
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Extract "feat" */
g_ptr->special = tmp16s;
}
}
- /* Convert grid_array data */
+ /* Convert current_floor->grid_array data */
if (z_older_than(11, 0, 99))
{
for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++)
{
/* Wipe old unused flags */
- grid_array[y][x].info &= ~(CAVE_MASK);
+ current_floor->grid_array[y][x].info &= ~(CAVE_MASK);
}
}
{
for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++)
{
- /* Access the grid_array */
- g_ptr = &grid_array[y][x];
+ /* Access the current_floor->grid_array */
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Very old */
if (g_ptr->feat == OLD_FEAT_INVIS)
{
for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++)
{
- /* Access the grid_array */
- g_ptr = &grid_array[y][x];
+ /* Access the current_floor->grid_array */
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Old CAVE_IN_MIRROR flag */
if (g_ptr->info & CAVE_OBJECT)
{
for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++)
{
- /* Access the grid_array */
- g_ptr = &grid_array[y][x];
+ /* Access the current_floor->grid_array */
+ g_ptr = ¤t_floor->grid_array[y][x];
if ((g_ptr->special == OLD_QUEST_WATER_CAVE) && !dun_level)
{
else
{
/* Access the item location */
- g_ptr = &grid_array[o_ptr->iy][o_ptr->ix];
+ g_ptr = ¤t_floor->grid_array[o_ptr->iy][o_ptr->ix];
/* Build a stack */
o_ptr->next_o_idx = g_ptr->o_idx;
/* Access grid */
- g_ptr = &grid_array[m_ptr->fy][m_ptr->fx];
+ g_ptr = ¤t_floor->grid_array[m_ptr->fy][m_ptr->fx];
/* Mark the location */
g_ptr->m_idx = m_idx;
cave_template_type *templates;
- /*** Wipe all grid_array ***/
+ /*** Wipe all current_floor->grid_array ***/
clear_cave();
/* Apply the RLE info */
for (i = count; i > 0; i--)
{
- /* Access the grid_array */
- grid_type *g_ptr = &grid_array[y][x];
+ /* Access the current_floor->grid_array */
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
- /* Extract grid_array data */
+ /* Extract current_floor->grid_array data */
g_ptr->info = templates[id].info;
g_ptr->feat = templates[id].feat;
g_ptr->mimic = templates[id].mimic;
{
for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++)
{
- /* Access the grid_array */
- grid_type *g_ptr = &grid_array[y][x];
+ /* Access the current_floor->grid_array */
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
if ((g_ptr->special == OLD_QUEST_WATER_CAVE) && !dun_level)
{
else
{
/* Access the item location */
- grid_type *g_ptr = &grid_array[o_ptr->iy][o_ptr->ix];
+ grid_type *g_ptr = ¤t_floor->grid_array[o_ptr->iy][o_ptr->ix];
/* Build a stack */
o_ptr->next_o_idx = g_ptr->o_idx;
/* Access grid */
- g_ptr = &grid_array[m_ptr->fy][m_ptr->fx];
+ g_ptr = ¤t_floor->grid_array[m_ptr->fy][m_ptr->fx];
/* Mark the location */
g_ptr->m_idx = m_idx;
MONSTER_IDX m_idx;
if (!target_set(TARGET_KILL)) return FALSE;
- m_idx = grid_array[target_row][target_col].m_idx;
+ m_idx = current_floor->grid_array[target_row][target_col].m_idx;
if (!m_idx) break;
if (!player_has_los_bold(target_row, target_col)) break;
if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
GAME_TEXT m_name[MAX_NLEN];
if (!target_set(TARGET_KILL)) return FALSE;
- if (!grid_array[target_row][target_col].m_idx) break;
+ if (!current_floor->grid_array[target_row][target_col].m_idx) break;
if (!player_has_los_bold(target_row, target_col)) break;
if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
- m_ptr = &m_list[grid_array[target_row][target_col].m_idx];
+ m_ptr = &m_list[current_floor->grid_array[target_row][target_col].m_idx];
r_ptr = &r_info[m_ptr->r_idx];
monster_desc(m_name, m_ptr, 0);
if (r_ptr->flagsr & RFR_RES_TELE)
}
msg_format(_("%sを引き戻した。", "You command %s to return."), m_name);
- teleport_monster_to(grid_array[target_row][target_col].m_idx, p_ptr->y, p_ptr->x, 100, TELEPORT_PASSIVE);
+ teleport_monster_to(current_floor->grid_array[target_row][target_col].m_idx, p_ptr->y, p_ptr->x, 100, TELEPORT_PASSIVE);
break;
}
case MS_TELE_AWAY:
int num = 0, bonus, chance, vir;
HIT_POINT k;
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
monster_type *m_ptr = &m_list[g_ptr->m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (do_quake)
{
earthquake(p_ptr->y, p_ptr->x, 10);
- if (!grid_array[y][x].m_idx) *mdeath = TRUE;
+ if (!current_floor->grid_array[y][x].m_idx) *mdeath = TRUE;
}
}
bool mdeath = FALSE;
bool stormbringer = FALSE;
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->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];
r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_RES_SHAR_MASK);
}
- if (is_mirror_grid(&grid_array[p_ptr->y][p_ptr->x]))
+ if (is_mirror_grid(¤t_floor->grid_array[p_ptr->y][p_ptr->x]))
{
teleport_player(10, 0L);
}
MONSTER_IDX m_idx;
if (!target_set(TARGET_KILL)) return FALSE;
- m_idx = grid_array[target_row][target_col].m_idx;
+ m_idx = current_floor->grid_array[target_row][target_col].m_idx;
if (!m_idx) break;
if (!player_has_los_bold(target_row, target_col)) break;
if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
int val = 0;
for (x = 0; x < cur_wid; x++) {
for (y = 0; y < cur_hgt; y++) {
- if (is_mirror_grid(&grid_array[y][x])) val++;
+ if (is_mirror_grid(¤t_floor->grid_array[y][x])) val++;
}
}
return val;
{
/* mirror of seeing */
case 0:
- tmp = is_mirror_grid(&grid_array[p_ptr->y][p_ptr->x]) ? 4 : 0;
+ tmp = is_mirror_grid(¤t_floor->grid_array[p_ptr->y][p_ptr->x]) ? 4 : 0;
if (plev + tmp > 4)detect_monsters_normal(DETECT_RAD_DEFAULT);
if (plev + tmp > 18)detect_monsters_invis(DETECT_RAD_DEFAULT);
if (plev + tmp > 28)set_tim_esp((TIME_EFFECT)plev, FALSE);
break;
case 2:
if (!get_aim_dir(&dir)) return FALSE;
- if (plev > 9 && is_mirror_grid(&grid_array[p_ptr->y][p_ptr->x])) {
+ if (plev > 9 && is_mirror_grid(¤t_floor->grid_array[p_ptr->y][p_ptr->x])) {
fire_beam(GF_LITE, dir, damroll(3 + ((plev - 1) / 5), 4));
}
else {
case 9:
for (x = 0; x < cur_wid; x++) {
for (y = 0; y < cur_hgt; y++) {
- if (is_mirror_grid(&grid_array[y][x])) {
+ if (is_mirror_grid(¤t_floor->grid_array[y][x])) {
project(0, 2, y, x, (HIT_POINT)plev, GF_OLD_SLEEP, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
}
}
break;
/* illusion light */
case 14:
- tmp = is_mirror_grid(&grid_array[p_ptr->y][p_ptr->x]) ? 4 : 3;
+ tmp = is_mirror_grid(¤t_floor->grid_array[p_ptr->y][p_ptr->x]) ? 4 : 3;
slow_monsters(plev);
stun_monsters(plev*tmp);
confuse_monsters(plev*tmp);
break;
/* mirror shift */
case 15:
- if (!is_mirror_grid(&grid_array[p_ptr->y][p_ptr->x])) {
+ if (!is_mirror_grid(¤t_floor->grid_array[p_ptr->y][p_ptr->x])) {
msg_print(_("鏡の国の場所がわからない!", "You cannot find out where is the world of mirror!"));
break;
}
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (!grid_array[y][x].m_idx)
+ if (!current_floor->grid_array[y][x].m_idx)
{
msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
return FALSE;
py_attack(y, x, 0);
- if (!player_can_enter(grid_array[y][x].feat, 0) || is_trap(grid_array[y][x].feat))
+ if (!player_can_enter(current_floor->grid_array[y][x].feat, 0) || is_trap(current_floor->grid_array[y][x].feat))
break;
y += ddy[dir];
x += ddx[dir];
- if (player_can_enter(grid_array[y][x].feat, 0) && !is_trap(grid_array[y][x].feat) && !grid_array[y][x].m_idx)
+ if (player_can_enter(current_floor->grid_array[y][x].feat, 0) && !is_trap(current_floor->grid_array[y][x].feat) && !current_floor->grid_array[y][x].m_idx)
{
msg_print(NULL);
(void)move_player_effect(y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
POSITION ty, tx;
if (!target_set(TARGET_KILL)) return FALSE;
- m_idx = grid_array[target_row][target_col].m_idx;
+ m_idx = current_floor->grid_array[target_row][target_col].m_idx;
if (!m_idx) break;
if (m_idx == p_ptr->riding) break;
if (!player_has_los_bold(target_row, target_col)) break;
{
POSITION ny = GRID_Y(path_g[i]);
POSITION nx = GRID_X(path_g[i]);
- grid_type *g_ptr = &grid_array[ny][nx];
+ grid_type *g_ptr = ¤t_floor->grid_array[ny][nx];
if (in_bounds(ny, nx) && cave_empty_bold(ny, nx) &&
!(g_ptr->info & CAVE_OBJECT) &&
}
}
/* Update the old location */
- grid_array[target_row][target_col].m_idx = 0;
+ current_floor->grid_array[target_row][target_col].m_idx = 0;
/* Update the new location */
- grid_array[ty][tx].m_idx = m_idx;
+ current_floor->grid_array[ty][tx].m_idx = m_idx;
/* Move the monster */
m_ptr->fy = ty;
break;
case MIND_MIRROR_MASTER:
/* Cast the spell */
- if( is_mirror_grid(&grid_array[p_ptr->y][p_ptr->x]) )on_mirror = TRUE;
+ if( is_mirror_grid(¤t_floor->grid_array[p_ptr->y][p_ptr->x]) )on_mirror = TRUE;
cast = cast_mirror_spell(n);
break;
case MIND_NINJUTSU:
if (projectable(y1, x1, p_ptr->y, p_ptr->x)) return (FALSE);
/* Set current grid cost */
- now_cost = grid_array[y1][x1].cost;
+ now_cost = current_floor->grid_array[y1][x1].cost;
if (now_cost == 0) now_cost = 999;
/* Can monster bash or open doors? */
/* Simply move to player */
if (player_bold(y, x)) return (FALSE);
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
cost = g_ptr->cost;
if (player_has_los_bold(y1, x1) && projectable(p_ptr->y, p_ptr->x, y1, x1)) return (FALSE);
/* Monster grid */
- g_ptr = &grid_array[y1][x1];
+ g_ptr = ¤t_floor->grid_array[y1][x1];
/* If we can hear noises, advance towards them */
if (g_ptr->cost)
else if (g_ptr->when)
{
/* Too old smell */
- if (grid_array[p_ptr->y][p_ptr->x].when - g_ptr->when > 127) return (FALSE);
+ if (current_floor->grid_array[p_ptr->y][p_ptr->x].when - g_ptr->when > 127) return (FALSE);
use_scent = TRUE;
best = 0;
/* Ignore locations off of edge */
if (!in_bounds2(y, x)) continue;
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* We're following a scent trail */
if (use_scent)
if (!in_bounds2(y, x)) continue;
/* Don't move toward player */
- /* if (grid_array[y][x].dist < 3) continue; */ /* Hmm.. Need it? */
+ /* if (current_floor->grid_array[y][x].dist < 3) continue; */ /* Hmm.. Need it? */
/* Calculate distance of this grid from our destination */
dis = distance(y, x, y1, x1);
/* Score this grid */
- s = 5000 / (dis + 3) - 500 / (grid_array[y][x].dist + 1);
+ s = 5000 / (dis + 3) - 500 / (current_floor->grid_array[y][x].dist + 1);
/* No negative scores */
if (s < 0) s = 0;
/* Skip illegal locations */
if (!in_bounds(y, x)) continue;
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Skip locations in a wall */
if (!monster_can_cross_terrain(g_ptr->feat, &r_info[m_ptr->r_idx], (m_idx == p_ptr->riding) ? CEM_RIDING : 0)) continue;
if (g_ptr->dist == 0) continue;
/* Ignore too-distant grids */
- if (g_ptr->dist > grid_array[fy][fx].dist + 2 * d) continue;
+ if (g_ptr->dist > current_floor->grid_array[fy][fx].dist + 2 * d) continue;
}
/* Check for absence of shot (more or less) */
bool done = FALSE;
bool will_run = mon_will_run(m_idx);
grid_type *g_ptr;
- bool no_flow = ((m_ptr->mflag2 & MFLAG2_NOFLOW) && (grid_array[m_ptr->fy][m_ptr->fx].cost > 2));
+ bool no_flow = ((m_ptr->mflag2 & MFLAG2_NOFLOW) && (current_floor->grid_array[m_ptr->fy][m_ptr->fx].cost > 2));
bool can_pass_wall = ((r_ptr->flags2 & RF2_PASS_WALL) && ((m_idx != p_ptr->riding) || p_ptr->pass_wall));
/* Counter attack to an enemy monster */
if (!will_run && m_ptr->target_y)
{
- int t_m_idx = grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
+ int t_m_idx = current_floor->grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
/* The monster must be an enemy, and in LOS */
if (t_m_idx &&
if (!done && !will_run && is_hostile(m_ptr) &&
(r_ptr->flags1 & RF1_FRIENDS) &&
((los(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x) && projectable(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)) ||
- (grid_array[m_ptr->fy][m_ptr->fx].dist < MAX_SIGHT / 2)))
+ (current_floor->grid_array[m_ptr->fy][m_ptr->fx].dist < MAX_SIGHT / 2)))
{
/*
* Animal packs try to get the player out of corridors
if (!in_bounds2(yy, xx)) continue;
- g_ptr = &grid_array[yy][xx];
+ g_ptr = ¤t_floor->grid_array[yy][xx];
/* Check grid */
if (monster_can_cross_terrain(g_ptr->feat, r_ptr, 0))
room++;
}
}
- if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_ROOM) room -= 2;
+ if (current_floor->grid_array[p_ptr->y][p_ptr->x].info & CAVE_ROOM) room -= 2;
if (!r_ptr->flags4 && !r_ptr->a_ability_flags1 && !r_ptr->a_ability_flags2) room -= 2;
/* Not in a room and strong player */
}
/* Monster groups try to surround the player */
- if (!done && (grid_array[m_ptr->fy][m_ptr->fx].dist < 3))
+ if (!done && (current_floor->grid_array[m_ptr->fy][m_ptr->fx].dist < 3))
{
int i;
{
/* Ignore locations off of edge */
if (!in_bounds2(y, x)) continue;
- if (grid_array[y][x].m_idx) k++;
+ if (current_floor->grid_array[y][x].m_idx) k++;
}
}
/* Give priority to counter attack? */
if (m_ptr->target_y)
{
- MONSTER_IDX t_m_idx = grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
+ MONSTER_IDX t_m_idx = current_floor->grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
/* The monster must be an enemy, and projectable */
if (t_m_idx && are_enemies(m_ptr, &m_list[t_m_idx]) &&
if (!in_bounds2(ny, nx)) continue;
/* Access that grid */
- g_ptr = &grid_array[ny][nx];
+ g_ptr = ¤t_floor->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);
else if ((r_ptr->flags2 & RF2_MOVE_BODY) && !(r_ptr->flags1 & RF1_NEVER_MOVE) &&
(r_ptr->mexp > z_ptr->mexp) &&
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))
+ monster_can_cross_terrain(current_floor->grid_array[m_ptr->fy][m_ptr->fx].feat, z_ptr, 0))
{
/* Allow movement */
do_move = TRUE;
if (!is_riding_mon)
{
/* Hack -- Update the old location */
- grid_array[oy][ox].m_idx = g_ptr->m_idx;
+ current_floor->grid_array[oy][ox].m_idx = g_ptr->m_idx;
/* Mega-Hack -- move the old monster, if any */
if (g_ptr->m_idx)
test = TRUE;
}
-#if 0 /* (grid_array[p_ptr->y][p_ptr->x].when == grid_array[fy][fx].when) is always FALSE... */
+#if 0 /* (current_floor->grid_array[p_ptr->y][p_ptr->x].when == current_floor->grid_array[fy][fx].when) is always FALSE... */
/* Hack -- Monsters can "smell" the player from far away */
/* Note that most monsters have "aaf" of "20" or so */
else if (!(m_ptr->mflag2 & MFLAG2_NOFLOW) &&
cave_have_flag_bold(p_ptr->y, p_ptr->x, FF_MOVE) &&
- (grid_array[p_ptr->y][p_ptr->x].when == grid_array[fy][fx].when) &&
- (grid_array[fy][fx].dist < MONSTER_FLOW_DEPTH) &&
- (grid_array[fy][fx].dist < r_ptr->aaf))
+ (current_floor->grid_array[p_ptr->y][p_ptr->x].when == current_floor->grid_array[fy][fx].when) &&
+ (current_floor->grid_array[fy][fx].dist < MONSTER_FLOW_DEPTH) &&
+ (current_floor->grid_array[fy][fx].dist < r_ptr->aaf))
{
/* We can "smell" the player */
test = TRUE;
*/
monsterrace_hook_type get_monster_hook2(POSITION y, POSITION x)
{
- feature_type *f_ptr = &f_info[grid_array[y][x].feat];
+ feature_type *f_ptr = &f_info[current_floor->grid_array[y][x].feat];
/* Set the monster list */
*/
bool monster_can_enter(POSITION y, POSITION x, monster_race *r_ptr, BIT_FLAGS16 mode)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
/* Player or other monster */
if (player_bold(y, x)) return FALSE;
if (p_ptr->riding == i) p_ptr->riding = 0;
/* Monster is gone */
- grid_array[y][x].m_idx = 0;
+ current_floor->grid_array[y][x].m_idx = 0;
for (this_o_idx = m_ptr->hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
{
if (!in_bounds(y, x)) return;
/* Check the grid */
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Delete the monster (if any) */
if (g_ptr->m_idx) delete_monster_idx(g_ptr->m_idx);
x = m_ptr->fx;
/* Cave grid */
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
- /* Update the grid_array */
+ /* Update the current_floor->grid_array */
g_ptr->m_idx = i2;
/* Repair objects being carried by monster */
if (!m_ptr->r_idx) continue;
/* Monster is gone */
- grid_array[m_ptr->fy][m_ptr->fx].m_idx = 0;
+ current_floor->grid_array[m_ptr->fy][m_ptr->fx].m_idx = 0;
/* Wipe the Monster */
(void)WIPE(m_ptr, monster_type);
if ((r_ptr->blow[0].method == RBM_EXPLODE) || (r_ptr->blow[1].method == RBM_EXPLODE) || (r_ptr->blow[2].method == RBM_EXPLODE) || (r_ptr->blow[3].method == RBM_EXPLODE))
return FALSE;
- if (!monster_can_cross_terrain(grid_array[m_ptr->fy][m_ptr->fx].feat, r_ptr, 0)) return FALSE;
+ if (!monster_can_cross_terrain(current_floor->grid_array[m_ptr->fy][m_ptr->fx].feat, r_ptr, 0)) return FALSE;
/* Not born */
if (!(old_r_ptr->flags7 & RF7_CHAMELEON))
if ((r_ptr->blow[0].method == RBM_EXPLODE) || (r_ptr->blow[1].method == RBM_EXPLODE) || (r_ptr->blow[2].method == RBM_EXPLODE) || (r_ptr->blow[3].method == RBM_EXPLODE))
return FALSE;
- if (!monster_can_cross_terrain(grid_array[m_ptr->fy][m_ptr->fx].feat, r_ptr, 0)) return FALSE;
+ if (!monster_can_cross_terrain(current_floor->grid_array[m_ptr->fy][m_ptr->fx].feat, r_ptr, 0)) return FALSE;
/* Not born */
if (!(old_r_ptr->flags7 & RF7_CHAMELEON))
static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode)
{
/* Access the location */
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
monster_type *m_ptr;
monster_race *r_ptr = &r_info[r_idx];
concptr name = (r_name + r_ptr->name);
/* Count all quest monsters */
for (i2 = 0; i2 < cur_wid; ++i2)
for (j2 = 0; j2 < cur_hgt; j2++)
- if (grid_array[j2][i2].m_idx > 0)
- if (m_list[grid_array[j2][i2].m_idx].r_idx == quest[hoge].r_idx)
+ if (current_floor->grid_array[j2][i2].m_idx > 0)
+ if (m_list[current_floor->grid_array[j2][i2].m_idx].r_idx == quest[hoge].r_idx)
number_mon++;
if(number_mon + quest[hoge].cur_num >= quest[hoge].max_num)
return FALSE;
if (attempts < 1) return FALSE;
- m_idx = grid_array[y][x].m_idx;
+ m_idx = current_floor->grid_array[y][x].m_idx;
if (m_list[m_idx].mflag2 & MFLAG2_CHAMELEON) r_ptr = &r_info[m_list[m_idx].r_idx];
ox = randint1(cur_wid - 4) + 2;
/* Is it a good spot ? */
- if (cave_empty_bold2(oy, ox) && monster_can_cross_terrain(grid_array[oy][ox].feat, &r_info[guardian], 0))
+ if (cave_empty_bold2(oy, ox) && monster_can_cross_terrain(current_floor->grid_array[oy][ox].feat, &r_info[guardian], 0))
{
/* Place the guardian */
if (place_monster_aux(0, oy, ox, guardian, (PM_ALLOW_GROUP | PM_NO_KAGE | PM_NO_PET))) return TRUE;
if (!los(y, x, yy, xx)) continue;
if (!projectable(y, x, yy, xx)) continue;
- g_ptr = &grid_array[yy][xx];
+ g_ptr = ¤t_floor->grid_array[yy][xx];
/* Scan the pile of objects */
for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
y = GRID_Y(grid_g[i]);
x = GRID_X(grid_g[i]);
- if ((grid_array[y][x].m_idx > 0) && !((y == y2) && (x == x2)))
+ if ((current_floor->grid_array[y][x].m_idx > 0) && !((y == y2) && (x == x2)))
{
- monster_type *m_ptr = &m_list[grid_array[y][x].m_idx];
+ monster_type *m_ptr = &m_list[current_floor->grid_array[y][x].m_idx];
if (is_friend == is_pet(m_ptr))
{
return (FALSE);
grid_type *g_ptr;
/* Access the next grid */
- g_ptr = &grid_array[next_y][next_x];
+ g_ptr = ¤t_floor->grid_array[next_y][next_x];
/* Skip this feature */
if (!cave_have_flag_grid(g_ptr, f_flag)) continue;
if (los(m_ptr->fy, m_ptr->fx, y_br_lite, x_br_lite))
{
- feature_type *f_ptr = &f_info[grid_array[y_br_lite][x_br_lite].feat];
+ feature_type *f_ptr = &f_info[current_floor->grid_array[y_br_lite][x_br_lite].feat];
if (!have_flag(f_ptr->flags, FF_LOS))
{
/* Check path */
if (projectable(m_ptr->fy, m_ptr->fx, y, x))
{
- feature_type *f_ptr = &f_info[grid_array[y][x].feat];
+ feature_type *f_ptr = &f_info[current_floor->grid_array[y][x].feat];
if (!have_flag(f_ptr->flags, FF_PROJECT))
{
if (y == y2 && x == x2)
hit2 = TRUE;
- else if (is_friend && grid_array[y][x].m_idx > 0 &&
- !are_enemies(m_ptr, &m_list[grid_array[y][x].m_idx]))
+ else if (is_friend && current_floor->grid_array[y][x].m_idx > 0 &&
+ !are_enemies(m_ptr, &m_list[current_floor->grid_array[y][x].m_idx]))
{
/* Friends don't shoot friends */
return FALSE;
/* Is there counter attack target? */
if (!target_idx && m_ptr->target_y)
{
- target_idx = grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
+ target_idx = current_floor->grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
if (target_idx)
{
MONSTER_IDX m_idx;
if (!target_set(TARGET_KILL)) return FALSE;
- m_idx = grid_array[target_row][target_col].m_idx;
+ m_idx = current_floor->grid_array[target_row][target_col].m_idx;
if (!m_idx) break;
if (!player_has_los_bold(target_row, target_col)) break;
if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
GAME_TEXT m_name[MAX_NLEN];
if (!target_set(TARGET_KILL)) return FALSE;
- if (!grid_array[target_row][target_col].m_idx) break;
+ if (!current_floor->grid_array[target_row][target_col].m_idx) break;
if (!player_has_los_bold(target_row, target_col)) break;
if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
- m_ptr = &m_list[grid_array[target_row][target_col].m_idx];
+ m_ptr = &m_list[current_floor->grid_array[target_row][target_col].m_idx];
r_ptr = &r_info[m_ptr->r_idx];
monster_desc(m_name, m_ptr, 0);
if (r_ptr->flagsr & RFR_RES_TELE)
}
}
msg_format(_("%sを引き戻した。", "You command %s to return."), m_name);
- teleport_monster_to(grid_array[target_row][target_col].m_idx, p_ptr->y, p_ptr->x, 100, TELEPORT_PASSIVE);
+ teleport_monster_to(current_floor->grid_array[target_row][target_col].m_idx, p_ptr->y, p_ptr->x, 100, TELEPORT_PASSIVE);
break;
}
case MS_TELE_AWAY:
if (p_ptr->inside_arena || p_ptr->inside_battle || !summon_possible(m_ptr->fy, m_ptr->fx))
return -1;
- delete_monster_idx(grid_array[m_ptr->fy][m_ptr->fx].m_idx);
+ delete_monster_idx(current_floor->grid_array[m_ptr->fy][m_ptr->fx].m_idx);
summon_named_creature(0, dummy_y, dummy_x, MON_BANOR, mode);
m_list[hack_m_idx_ii].hp = dummy_hp;
m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
if (!g_ptr->m_idx)
{
if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
if (!g_ptr->m_idx)
{
msg_print(_("あなたは何もない場所で手を振った。", "You wave your hands in the air."));
if (floor)
{
/* Scan all objects in the grid */
- for (this_o_idx = grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+ for (this_o_idx = current_floor->grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
o_ptr = &o_list[this_o_idx];
if (allow_floor)
{
/* Scan all objects in the grid */
- for (this_o_idx = grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+ for (this_o_idx = current_floor->grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
o_ptr = &o_list[this_o_idx];
* @param mode オプションフラグ
* @return 対象のマスに落ちているアイテム数
* @details
- * Return a list of o_list[] indexes of items at the given grid_array
+ * Return a list of o_list[] indexes of items at the given current_floor->grid_array
* location. Valid flags are:
*
* mode & 0x01 -- Item tester
if (!in_bounds(y, x)) return 0;
/* Scan all objects in the grid */
- for (this_o_idx = grid_array[y][x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+ for (this_o_idx = current_floor->grid_array[y][x].o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
o_ptr = &o_list[this_o_idx];
{
int i;
OBJECT_IDX o_idx;
- grid_type *g_ptr = &grid_array[p_ptr->y][p_ptr->x];
+ grid_type *g_ptr = ¤t_floor->grid_array[p_ptr->y][p_ptr->x];
if (command_wrk != (USE_FLOOR)) break;
int can_pickup = 0;
/* Scan the pile of objects */
- for (this_o_idx = grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+ for (this_o_idx = current_floor->grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
{
/* Access the object */
o_ptr = &o_list[this_o_idx];
POSITION y = j_ptr->iy;
POSITION x = j_ptr->ix;
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Scan all objects in the grid */
for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
/* Refuse "illegal" locations */
if (!in_bounds(y, x)) return;
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Scan all objects in the grid */
for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
x = o_ptr->ix;
/* Acquire grid */
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Repair grid */
if (g_ptr->o_idx == i1)
POSITION x = o_ptr->ix;
/* Access grid */
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Hack -- see above */
g_ptr->o_idx = 0;
OBJECT_IDX o_idx;
/* Acquire grid */
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
object_type forge;
object_type *q_ptr;
OBJECT_IDX o_idx;
/* Acquire grid */
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
object_type forge;
object_type *q_ptr;
if (!projectable(y, x, ty, tx)) continue;
/* Obtain grid */
- g_ptr = &grid_array[ty][tx];
+ g_ptr = ¤t_floor->grid_array[ty][tx];
/* Require floor space */
if (!cave_drop_bold(ty, tx)) continue;
}
- g_ptr = &grid_array[by][bx];
+ g_ptr = ¤t_floor->grid_array[by][bx];
/* Scan objects in that grid for combination */
for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
if (!in_bounds(my, mx) || (distance(my, mx, yy, xx) > WARNING_AWARE_RANGE)) continue;
- g_ptr = &grid_array[my][mx];
+ g_ptr = ¤t_floor->grid_array[my][mx];
if (!g_ptr->m_idx) continue;
}
else old_damage = old_damage / 2;
- g_ptr = &grid_array[yy][xx];
+ g_ptr = ¤t_floor->grid_array[yy][xx];
if (((!easy_disarm && is_trap(g_ptr->feat))
|| (g_ptr->mimic && is_trap(g_ptr->feat))) && !one_in_(13))
{
{
OBJECT_IDX this_o_idx, next_o_idx = 0;
grid_type *g_ptr;
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Invisible trap */
if (g_ptr->mimic && is_trap(g_ptr->feat))
*/
void carry(bool pickup)
{
- grid_type *g_ptr = &grid_array[p_ptr->y][p_ptr->x];
+ grid_type *g_ptr = ¤t_floor->grid_array[p_ptr->y][p_ptr->x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
*/
bool pattern_seq(POSITION c_y, POSITION c_x, POSITION n_y, POSITION n_x)
{
- feature_type *cur_f_ptr = &f_info[grid_array[c_y][c_x].feat];
- feature_type *new_f_ptr = &f_info[grid_array[n_y][n_x].feat];
+ feature_type *cur_f_ptr = &f_info[current_floor->grid_array[c_y][c_x].feat];
+ feature_type *new_f_ptr = &f_info[current_floor->grid_array[n_y][n_x].feat];
bool is_pattern_tile_cur = have_flag(cur_f_ptr->flags, FF_PATTERN);
bool is_pattern_tile_new = have_flag(new_f_ptr->flags, FF_PATTERN);
int pattern_type_cur, pattern_type_new;
{
POSITION oy = p_ptr->y;
POSITION ox = p_ptr->x;
- grid_type *g_ptr = &grid_array[ny][nx];
- grid_type *oc_ptr = &grid_array[oy][ox];
+ grid_type *g_ptr = ¤t_floor->grid_array[ny][nx];
+ grid_type *oc_ptr = ¤t_floor->grid_array[oy][ox];
feature_type *f_ptr = &f_info[g_ptr->feat];
feature_type *of_ptr = &f_info[oc_ptr->feat];
POSITION x = p_ptr->x + ddx[dir];
/* Examine the destination */
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
feature_type *f_ptr = &f_info[g_ptr->feat];
py_attack(y, x, 0);
oktomove = FALSE;
}
- else if (monster_can_cross_terrain(grid_array[p_ptr->y][p_ptr->x].feat, r_ptr, 0))
+ else if (monster_can_cross_terrain(current_floor->grid_array[p_ptr->y][p_ptr->x].feat, r_ptr, 0))
{
do_past = TRUE;
}
}
else if (!have_flag(f_ptr->flags, FF_WATER) && (riding_r_ptr->flags7 & RF7_AQUATIC))
{
- msg_format(_("%sから上がれない。", "Can't land."), f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name);
+ msg_format(_("%sから上がれない。", "Can't land."), f_name + f_info[get_feat_mimic(¤t_floor->grid_array[p_ptr->y][p_ptr->x])].name);
free_turn(p_ptr);
oktomove = FALSE;
disturb(FALSE, TRUE);
if (!in_bounds2(y, x)) return (FALSE);
/* Access grid */
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Must be known to the player */
if (g_ptr->info & (CAVE_MARK))
if (!in_bounds2(y, x)) return (TRUE);
/* Memorized grids are always known */
- if (grid_array[y][x].info & (CAVE_MARK)) return (FALSE);
+ if (current_floor->grid_array[y][x].info & (CAVE_MARK)) return (FALSE);
/* Viewable door/wall grids are known */
if (player_can_see_bold(y, x)) return (FALSE);
/* break run when leaving trap detected region */
if ((disturb_trap_detect || alert_trap_detect)
- && p_ptr->dtrap && !(grid_array[p_ptr->y][p_ptr->x].info & CAVE_IN_DETECT))
+ && p_ptr->dtrap && !(current_floor->grid_array[p_ptr->y][p_ptr->x].info & CAVE_IN_DETECT))
{
/* No duplicate warning */
p_ptr->dtrap = FALSE;
/* You are just on the edge */
- if (!(grid_array[p_ptr->y][p_ptr->x].info & CAVE_UNSAFE))
+ if (!(current_floor->grid_array[p_ptr->y][p_ptr->x].info & CAVE_UNSAFE))
{
if (alert_trap_detect)
{
col = p_ptr->x + ddx[new_dir];
/* Access grid */
- g_ptr = &grid_array[row][col];
+ g_ptr = ¤t_floor->grid_array[row][col];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(g_ptr);
/* break run when leaving trap detected region */
if ((disturb_trap_detect || alert_trap_detect)
- && p_ptr->dtrap && !(grid_array[p_ptr->y][p_ptr->x].info & CAVE_IN_DETECT))
+ && p_ptr->dtrap && !(current_floor->grid_array[p_ptr->y][p_ptr->x].info & CAVE_IN_DETECT))
{
/* No duplicate warning */
p_ptr->dtrap = FALSE;
/* You are just on the edge */
- if (!(grid_array[p_ptr->y][p_ptr->x].info & CAVE_UNSAFE))
+ if (!(current_floor->grid_array[p_ptr->y][p_ptr->x].info & CAVE_UNSAFE))
{
if (alert_trap_detect)
{
POSITION col = p_ptr->x + ddx[dir];
/* Access grid */
- g_ptr = &grid_array[row][col];
+ g_ptr = ¤t_floor->grid_array[row][col];
/* Visible monsters abort running */
if (g_ptr->m_idx)
if (!new_dir) return (0);
/* Access newly move grid */
- g_ptr = &grid_array[p_ptr->y+ddy[new_dir]][p_ptr->x+ddx[new_dir]];
+ g_ptr = ¤t_floor->grid_array[p_ptr->y+ddy[new_dir]][p_ptr->x+ddx[new_dir]];
/* Close door abort traveling */
if (!easy_open && is_closed_door(g_ptr->feat)) return (0);
*/
static int travel_flow_cost(POSITION y, POSITION x)
{
- feature_type *f_ptr = &f_info[grid_array[y][x].feat];
+ feature_type *f_ptr = &f_info[current_floor->grid_array[y][x].feat];
int cost = 1;
/* Avoid obstacles (ex. trees) */
}
/* Detected traps and doors */
- if (grid_array[y][x].info & (CAVE_MARK))
+ if (current_floor->grid_array[y][x].info & (CAVE_MARK))
{
if (have_flag(f_ptr->flags, FF_DOOR)) cost += 1;
if (have_flag(f_ptr->flags, FF_TRAP)) cost += 10;
*/
static void travel_flow_aux(POSITION y, POSITION x, int n, bool wall)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
feature_type *f_ptr = &f_info[g_ptr->feat];
int old_head = flow_head;
int add_cost = 1;
/* Ignore "walls" and "rubble" (include "secret doors") */
if (have_flag(f_ptr->flags, FF_WALL) ||
have_flag(f_ptr->flags, FF_CAN_DIG) ||
- (have_flag(f_ptr->flags, FF_DOOR) && grid_array[y][x].mimic) ||
+ (have_flag(f_ptr->flags, FF_DOOR) && current_floor->grid_array[y][x].mimic) ||
(!have_flag(f_ptr->flags, FF_MOVE) && have_flag(f_ptr->flags, FF_CAN_FLY) && !p_ptr->levitation))
{
if (!wall || !from_wall) return;
POSITION x, y;
DIRECTION d;
bool wall = FALSE;
- feature_type *f_ptr = &f_info[grid_array[p_ptr->y][p_ptr->x].feat];
+ feature_type *f_ptr = &f_info[current_floor->grid_array[p_ptr->y][p_ptr->x].feat];
/* Reset the "queue" */
flow_head = flow_tail = 0;
return;
}
- f_ptr = &f_info[grid_array[y][x].feat];
+ f_ptr = &f_info[current_floor->grid_array[y][x].feat];
- if ((grid_array[y][x].info & CAVE_MARK) &&
+ if ((current_floor->grid_array[y][x].info & CAVE_MARK) &&
(have_flag(f_ptr->flags, FF_WALL) ||
have_flag(f_ptr->flags, FF_CAN_DIG) ||
- (have_flag(f_ptr->flags, FF_DOOR) && grid_array[y][x].mimic)))
+ (have_flag(f_ptr->flags, FF_DOOR) && current_floor->grid_array[y][x].mimic)))
{
msg_print(_("そこには行くことができません!", "You cannot travel there!"));
return;
bool old_mighty_throw = p_ptr->mighty_throw;
/* Current feature under player. */
- feature_type *f_ptr = &f_info[grid_array[p_ptr->y][p_ptr->x].feat];
+ feature_type *f_ptr = &f_info[current_floor->grid_array[p_ptr->y][p_ptr->x].feat];
/* Save the old armor class */
ARMOUR_CLASS old_dis_ac = p_ptr->dis_ac;
if ((inventory[i].tval == TV_CRAFT_BOOK) && (inventory[i].sval == 2)) have_kabe = TRUE;
}
- for (this_o_idx = grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+ for (this_o_idx = current_floor->grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
{
o_ptr = &o_list[this_o_idx];
}
/* max radius is 14 (was 5) without rewriting other code -- */
- /* see grid_array.c:update_lite() and defines.h:LITE_MAX */
+ /* see current_floor->grid_array.c:update_lite() and defines.h:LITE_MAX */
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS && p_ptr->cur_lite > 1)
p_ptr->cur_lite = 1;
if (o_ptr->k_idx && check_book_realm(o_ptr->tval, o_ptr->sval)) return FALSE;
}
- for (i = grid_array[p_ptr->y][p_ptr->x].o_idx; i; i = o_ptr->next_o_idx)
+ for (i = current_floor->grid_array[p_ptr->y][p_ptr->x].o_idx; i; i = o_ptr->next_o_idx)
{
o_ptr = &o_list[i];
if (o_ptr->k_idx && (o_ptr->marked & OM_FOUND) && check_book_realm(o_ptr->tval, o_ptr->sval)) return FALSE;
bool player_place(POSITION y, POSITION x)
{
/* Paranoia XXX XXX */
- if (grid_array[y][x].m_idx != 0) return FALSE;
+ if (current_floor->grid_array[y][x].m_idx != 0) return FALSE;
/* Save player location */
p_ptr->y = y;
if (flg & (PROJECT_STOP))
{
if ((n > 0) &&
- (player_bold(y, x) || grid_array[y][x].m_idx != 0))
+ (player_bold(y, x) || current_floor->grid_array[y][x].m_idx != 0))
break;
}
if (flg & (PROJECT_STOP))
{
if ((n > 0) &&
- (player_bold(y, x) || grid_array[y][x].m_idx != 0))
+ (player_bold(y, x) || current_floor->grid_array[y][x].m_idx != 0))
break;
}
if (flg & (PROJECT_STOP))
{
if ((n > 0) &&
- (player_bold(y, x) || grid_array[y][x].m_idx != 0))
+ (player_bold(y, x) || current_floor->grid_array[y][x].m_idx != 0))
break;
}
POSITION ny, nx;
/* Stagger around */
- while (cave_perma_bold(y, x) || grid_array[y][x].o_idx || (grid_array[y][x].info & CAVE_OBJECT))
+ while (cave_perma_bold(y, x) || current_floor->grid_array[y][x].o_idx || (current_floor->grid_array[y][x].info & CAVE_OBJECT))
{
/* Pick a location */
scatter(&ny, &nx, y, x, 1, 0);
int dy = y + ddy_ddd[dir];
int dx = x + ddx_ddd[dir];
if (dir == 5) continue;
- if (grid_array[dy][dx].m_idx) flag = TRUE;
+ if (current_floor->grid_array[dy][dx].m_idx) flag = TRUE;
}
- if (!cave_empty_bold(y, x) || (grid_array[y][x].info & CAVE_ICKY) ||
+ if (!cave_empty_bold(y, x) || (current_floor->grid_array[y][x].info & CAVE_ICKY) ||
(distance(y, x, p_ptr->y, p_ptr->x) > plev + 2))
{
msg_print(_("そこには移動できない。", "Can not teleport to there."));
y = p_ptr->y + ddy_cdd[cdir];
x = p_ptr->x + ddx_cdd[cdir];
- if (grid_array[y][x].m_idx)
+ if (current_floor->grid_array[y][x].m_idx)
py_attack(y, x, 0);
else
msg_print(_("攻撃は空を切った。", "You attack the empty air."));
y = p_ptr->y + ddy_cdd[(cdir + 7) % 8];
x = p_ptr->x + ddx_cdd[(cdir + 7) % 8];
- if (grid_array[y][x].m_idx)
+ if (current_floor->grid_array[y][x].m_idx)
py_attack(y, x, 0);
else
msg_print(_("攻撃は空を切った。", "You attack the empty air."));
y = p_ptr->y + ddy_cdd[(cdir + 1) % 8];
x = p_ptr->x + ddx_cdd[(cdir + 1) % 8];
- if (grid_array[y][x].m_idx)
+ if (current_floor->grid_array[y][x].m_idx)
py_attack(y, x, 0);
else
msg_print(_("攻撃は空を切った。", "You attack the empty air."));
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (grid_array[y][x].m_idx)
+ if (current_floor->grid_array[y][x].m_idx)
py_attack(y, x, HISSATSU_FIRE);
else
{
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (grid_array[y][x].m_idx)
+ if (current_floor->grid_array[y][x].m_idx)
py_attack(y, x, HISSATSU_MINEUCHI);
else
{
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (!grid_array[y][x].m_idx)
+ if (!current_floor->grid_array[y][x].m_idx)
{
msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
return NULL;
py_attack(y, x, 0);
- if (!player_can_enter(grid_array[y][x].feat, 0) || is_trap(grid_array[y][x].feat))
+ if (!player_can_enter(current_floor->grid_array[y][x].feat, 0) || is_trap(current_floor->grid_array[y][x].feat))
break;
y += ddy[dir];
x += ddx[dir];
- if (player_can_enter(grid_array[y][x].feat, 0) && !is_trap(grid_array[y][x].feat) && !grid_array[y][x].m_idx)
+ if (player_can_enter(current_floor->grid_array[y][x].feat, 0) && !is_trap(current_floor->grid_array[y][x].feat) && !current_floor->grid_array[y][x].m_idx)
{
msg_print(NULL);
(void)move_player_effect(y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (grid_array[y][x].m_idx)
+ if (current_floor->grid_array[y][x].m_idx)
py_attack(y, x, HISSATSU_POISON);
else
{
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (grid_array[y][x].m_idx)
+ if (current_floor->grid_array[y][x].m_idx)
py_attack(y, x, HISSATSU_ZANMA);
else
{
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (grid_array[y][x].m_idx)
+ if (current_floor->grid_array[y][x].m_idx)
py_attack(y, x, 0);
else
{
{
return "";
}
- if (grid_array[y][x].m_idx)
+ if (current_floor->grid_array[y][x].m_idx)
{
int i;
POSITION ty = y, tx = x;
POSITION oy = y, ox = x;
- MONSTER_IDX m_idx = grid_array[y][x].m_idx;
+ MONSTER_IDX m_idx = current_floor->grid_array[y][x].m_idx;
monster_type *m_ptr = &m_list[m_idx];
GAME_TEXT m_name[MAX_NLEN];
if ((ty != oy) || (tx != ox))
{
msg_format(_("%sを吹き飛ばした!", "You blow %s away!"), m_name);
- grid_array[oy][ox].m_idx = 0;
- grid_array[ty][tx].m_idx = m_idx;
+ current_floor->grid_array[oy][ox].m_idx = 0;
+ current_floor->grid_array[ty][tx].m_idx = m_idx;
m_ptr->fy = ty;
m_ptr->fx = tx;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (grid_array[y][x].m_idx)
+ if (current_floor->grid_array[y][x].m_idx)
py_attack(y, x, HISSATSU_HAGAN);
if (!cave_have_flag_bold(y, x, FF_HURT_ROCK)) break;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (grid_array[y][x].m_idx)
+ if (current_floor->grid_array[y][x].m_idx)
py_attack(y, x, HISSATSU_COLD);
else
{
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (grid_array[y][x].m_idx)
+ if (current_floor->grid_array[y][x].m_idx)
py_attack(y, x, HISSATSU_KYUSHO);
else
{
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (grid_array[y][x].m_idx)
+ if (current_floor->grid_array[y][x].m_idx)
py_attack(y, x, HISSATSU_MAJIN);
else
{
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (grid_array[y][x].m_idx)
+ if (current_floor->grid_array[y][x].m_idx)
py_attack(y, x, HISSATSU_SUTEMI);
else
{
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (grid_array[y][x].m_idx)
+ if (current_floor->grid_array[y][x].m_idx)
py_attack(y, x, HISSATSU_ELEC);
else
{
{
y = p_ptr->y + ddy_ddd[dir];
x = p_ptr->x + ddx_ddd[dir];
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
m_ptr = &m_list[g_ptr->m_idx];
/* Hack -- attack monsters */
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (grid_array[y][x].m_idx)
+ if (current_floor->grid_array[y][x].m_idx)
py_attack(y, x, HISSATSU_QUAKE);
else
earthquake(p_ptr->y, p_ptr->x, 10);
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
if (g_ptr->m_idx)
py_attack(y, x, HISSATSU_3DAN);
}
g_ptr->m_idx = 0;
- grid_array[ny][nx].m_idx = m_idx;
+ current_floor->grid_array[ny][nx].m_idx = m_idx;
m_ptr->fy = ny;
m_ptr->fx = nx;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (grid_array[y][x].m_idx)
+ if (current_floor->grid_array[y][x].m_idx)
py_attack(y, x, HISSATSU_DRAIN);
else
{
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (grid_array[y][x].m_idx)
+ if (current_floor->grid_array[y][x].m_idx)
{
py_attack(y, x, 0);
- if (grid_array[y][x].m_idx)
+ if (current_floor->grid_array[y][x].m_idx)
{
handle_stuff();
py_attack(y, x, 0);
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (grid_array[y][x].m_idx)
+ if (current_floor->grid_array[y][x].m_idx)
py_attack(y, x, HISSATSU_UNDEAD);
else
{
* Town logic flow for generation of new town\n
* Originally from Vanilla 3.0.3\n
*\n
-* We start with a fully wiped grid_array of normal floors.\n
+* We start with a fully wiped current_floor->grid_array of normal floors.\n
*\n
* Note that town_gen_hack() plays games with the R.N.G.\n
*\n
{
for (x = 0; x < cur_wid; x++)
{
- if (grid_array[y][x].feat == FF_STORE)
+ if (current_floor->grid_array[y][x].feat == FF_STORE)
{
- prevent_bm = (f_info[grid_array[y][x].feat].subtype == STORE_BLACK);
+ prevent_bm = (f_info[current_floor->grid_array[y][x].feat].subtype == STORE_BLACK);
break;
}
}
#include "rooms-normal.h"
/*!
-* @brief タイプ9の部屋…フラクタルカーブによる洞窟生成 / Type 9 -- Driver routine to create fractal grid_array system
+* @brief タイプ9の部屋…フラクタルカーブによる洞窟生成 / Type 9 -- Driver routine to create fractal current_floor->grid_array system
* @return なし
*/
bool build_type9(void)
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->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++)
{
- g_ptr = &grid_array[y][x1 - 1];
+ g_ptr = ¤t_floor->grid_array[y][x1 - 1];
place_outer_grid(g_ptr);
- g_ptr = &grid_array[y][x2 + 1];
+ g_ptr = ¤t_floor->grid_array[y][x2 + 1];
place_outer_grid(g_ptr);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- g_ptr = &grid_array[y1 - 1][x];
+ g_ptr = ¤t_floor->grid_array[y1 - 1][x];
place_outer_grid(g_ptr);
- g_ptr = &grid_array[y2 + 1][x];
+ g_ptr = ¤t_floor->grid_array[y2 + 1][x];
place_outer_grid(g_ptr);
}
{
for (y = y1; y <= y2; y++)
{
- g_ptr = &grid_array[y][x1];
+ g_ptr = ¤t_floor->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 = ¤t_floor->grid_array[y][x2];
g_ptr->feat = feat_door[DOOR_CURTAIN].closed;
g_ptr->info &= ~(CAVE_MASK);
}
for (x = x1; x <= x2; x++)
{
- g_ptr = &grid_array[y1][x];
+ g_ptr = ¤t_floor->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 = ¤t_floor->grid_array[y2][x];
g_ptr->feat = feat_door[DOOR_CURTAIN].closed;
g_ptr->info &= ~(CAVE_MASK);
}
{
for (x = x1; x <= x2; x += 2)
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
place_inner_grid(g_ptr);
}
}
{
if ((y1 + 4 < y2) && (x1 + 4 < x2))
{
- g_ptr = &grid_array[y1 + 1][x1 + 1];
+ g_ptr = ¤t_floor->grid_array[y1 + 1][x1 + 1];
place_inner_grid(g_ptr);
- g_ptr = &grid_array[y1 + 1][x2 - 1];
+ g_ptr = ¤t_floor->grid_array[y1 + 1][x2 - 1];
place_inner_grid(g_ptr);
- g_ptr = &grid_array[y2 - 1][x1 + 1];
+ g_ptr = ¤t_floor->grid_array[y2 - 1][x1 + 1];
place_inner_grid(g_ptr);
- g_ptr = &grid_array[y2 - 1][x2 - 1];
+ g_ptr = ¤t_floor->grid_array[y2 - 1][x2 - 1];
place_inner_grid(g_ptr);
}
}
{
for (y = y1 + 2; y <= y2 - 2; y += 2)
{
- g_ptr = &grid_array[y][x1];
+ g_ptr = ¤t_floor->grid_array[y][x1];
place_inner_grid(g_ptr);
- g_ptr = &grid_array[y][x2];
+ g_ptr = ¤t_floor->grid_array[y][x2];
place_inner_grid(g_ptr);
}
for (x = x1 + 2; x <= x2 - 2; x += 2)
{
- g_ptr = &grid_array[y1][x];
+ g_ptr = ¤t_floor->grid_array[y1][x];
place_inner_grid(g_ptr);
- g_ptr = &grid_array[y2][x];
+ g_ptr = ¤t_floor->grid_array[y2][x];
place_inner_grid(g_ptr);
}
}
for (x = x1; x <= x2; x++)
{
place_inner_bold(yval, x);
- if (curtain2) grid_array[yval][x].feat = feat_door[DOOR_CURTAIN].closed;
+ if (curtain2) current_floor->grid_array[yval][x].feat = feat_door[DOOR_CURTAIN].closed;
}
/* Prevent edge of wall from being tunneled */
for (y = y1; y <= y2; y++)
{
place_inner_bold(y, xval);
- if (curtain2) grid_array[y][xval].feat = feat_door[DOOR_CURTAIN].closed;
+ if (curtain2) current_floor->grid_array[y][xval].feat = feat_door[DOOR_CURTAIN].closed;
}
/* Prevent edge of wall from being tunneled */
}
place_random_door(yval, xval, TRUE);
- if (curtain2) grid_array[yval][xval].feat = feat_door[DOOR_CURTAIN].closed;
+ if (curtain2) current_floor->grid_array[yval][xval].feat = feat_door[DOOR_CURTAIN].closed;
}
return TRUE;
{
for (x = x1a - 1; x <= x2a + 1; x++)
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
place_floor_grid(g_ptr);
g_ptr->info |= (CAVE_ROOM);
if (light) g_ptr->info |= (CAVE_GLOW);
{
for (x = x1b - 1; x <= x2b + 1; x++)
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
place_floor_grid(g_ptr);
g_ptr->info |= (CAVE_ROOM);
if (light) g_ptr->info |= (CAVE_GLOW);
/* Place the walls around room "a" */
for (y = y1a - 1; y <= y2a + 1; y++)
{
- g_ptr = &grid_array[y][x1a - 1];
+ g_ptr = ¤t_floor->grid_array[y][x1a - 1];
place_outer_grid(g_ptr);
- g_ptr = &grid_array[y][x2a + 1];
+ g_ptr = ¤t_floor->grid_array[y][x2a + 1];
place_outer_grid(g_ptr);
}
for (x = x1a - 1; x <= x2a + 1; x++)
{
- g_ptr = &grid_array[y1a - 1][x];
+ g_ptr = ¤t_floor->grid_array[y1a - 1][x];
place_outer_grid(g_ptr);
- g_ptr = &grid_array[y2a + 1][x];
+ g_ptr = ¤t_floor->grid_array[y2a + 1][x];
place_outer_grid(g_ptr);
}
/* Place the walls around room "b" */
for (y = y1b - 1; y <= y2b + 1; y++)
{
- g_ptr = &grid_array[y][x1b - 1];
+ g_ptr = ¤t_floor->grid_array[y][x1b - 1];
place_outer_grid(g_ptr);
- g_ptr = &grid_array[y][x2b + 1];
+ g_ptr = ¤t_floor->grid_array[y][x2b + 1];
place_outer_grid(g_ptr);
}
for (x = x1b - 1; x <= x2b + 1; x++)
{
- g_ptr = &grid_array[y1b - 1][x];
+ g_ptr = ¤t_floor->grid_array[y1b - 1][x];
place_outer_grid(g_ptr);
- g_ptr = &grid_array[y2b + 1][x];
+ g_ptr = ¤t_floor->grid_array[y2b + 1][x];
place_outer_grid(g_ptr);
}
{
for (x = x1a; x <= x2a; x++)
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
place_floor_grid(g_ptr);
}
}
{
for (x = x1b; x <= x2b; x++)
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
place_floor_grid(g_ptr);
}
}
{
for (x = x1a - 1; x <= x2a + 1; x++)
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
place_floor_grid(g_ptr);
g_ptr->info |= (CAVE_ROOM);
if (light) g_ptr->info |= (CAVE_GLOW);
{
for (x = x1b - 1; x <= x2b + 1; x++)
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
place_floor_grid(g_ptr);
g_ptr->info |= (CAVE_ROOM);
if (light) g_ptr->info |= (CAVE_GLOW);
/* Place the walls around room "a" */
for (y = y1a - 1; y <= y2a + 1; y++)
{
- g_ptr = &grid_array[y][x1a - 1];
+ g_ptr = ¤t_floor->grid_array[y][x1a - 1];
place_outer_grid(g_ptr);
- g_ptr = &grid_array[y][x2a + 1];
+ g_ptr = ¤t_floor->grid_array[y][x2a + 1];
place_outer_grid(g_ptr);
}
for (x = x1a - 1; x <= x2a + 1; x++)
{
- g_ptr = &grid_array[y1a - 1][x];
+ g_ptr = ¤t_floor->grid_array[y1a - 1][x];
place_outer_grid(g_ptr);
- g_ptr = &grid_array[y2a + 1][x];
+ g_ptr = ¤t_floor->grid_array[y2a + 1][x];
place_outer_grid(g_ptr);
}
/* Place the walls around room "b" */
for (y = y1b - 1; y <= y2b + 1; y++)
{
- g_ptr = &grid_array[y][x1b - 1];
+ g_ptr = ¤t_floor->grid_array[y][x1b - 1];
place_outer_grid(g_ptr);
- g_ptr = &grid_array[y][x2b + 1];
+ g_ptr = ¤t_floor->grid_array[y][x2b + 1];
place_outer_grid(g_ptr);
}
for (x = x1b - 1; x <= x2b + 1; x++)
{
- g_ptr = &grid_array[y1b - 1][x];
+ g_ptr = ¤t_floor->grid_array[y1b - 1][x];
place_outer_grid(g_ptr);
- g_ptr = &grid_array[y2b + 1][x];
+ g_ptr = ¤t_floor->grid_array[y2b + 1][x];
place_outer_grid(g_ptr);
}
{
for (x = x1a; x <= x2a; x++)
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
place_floor_grid(g_ptr);
}
}
{
for (x = x1b; x <= x2b; x++)
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
place_floor_grid(g_ptr);
}
}
{
for (x = x1a; x <= x2a; x++)
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
place_inner_grid(g_ptr);
}
}
/* Build the vault */
for (y = y1b; y <= y2b; y++)
{
- g_ptr = &grid_array[y][x1a];
+ g_ptr = ¤t_floor->grid_array[y][x1a];
place_inner_grid(g_ptr);
- g_ptr = &grid_array[y][x2a];
+ g_ptr = ¤t_floor->grid_array[y][x2a];
place_inner_grid(g_ptr);
}
for (x = x1a; x <= x2a; x++)
{
- g_ptr = &grid_array[y1b][x];
+ g_ptr = ¤t_floor->grid_array[y1b][x];
place_inner_grid(g_ptr);
- g_ptr = &grid_array[y2b][x];
+ g_ptr = ¤t_floor->grid_array[y2b][x];
place_inner_grid(g_ptr);
}
for (y = y1b; y <= y2b; y++)
{
if (y == yval) continue;
- g_ptr = &grid_array[y][x1a - 1];
+ g_ptr = ¤t_floor->grid_array[y][x1a - 1];
place_inner_grid(g_ptr);
- g_ptr = &grid_array[y][x2a + 1];
+ g_ptr = ¤t_floor->grid_array[y][x2a + 1];
place_inner_grid(g_ptr);
}
for (x = x1a; x <= x2a; x++)
{
if (x == xval) continue;
- g_ptr = &grid_array[y1b - 1][x];
+ g_ptr = ¤t_floor->grid_array[y1b - 1][x];
place_inner_grid(g_ptr);
- g_ptr = &grid_array[y2b + 1][x];
+ g_ptr = ¤t_floor->grid_array[y2b + 1][x];
place_inner_grid(g_ptr);
}
/* Occasionally put a "plus" in the center */
else if (one_in_(3))
{
- g_ptr = &grid_array[yval][xval];
+ g_ptr = ¤t_floor->grid_array[yval][xval];
place_inner_grid(g_ptr);
- g_ptr = &grid_array[y1b][xval];
+ g_ptr = ¤t_floor->grid_array[y1b][xval];
place_inner_grid(g_ptr);
- g_ptr = &grid_array[y2b][xval];
+ g_ptr = ¤t_floor->grid_array[y2b][xval];
place_inner_grid(g_ptr);
- g_ptr = &grid_array[yval][x1a];
+ g_ptr = ¤t_floor->grid_array[yval][x1a];
place_inner_grid(g_ptr);
- g_ptr = &grid_array[yval][x2a];
+ g_ptr = ¤t_floor->grid_array[yval][x2a];
place_inner_grid(g_ptr);
}
/* Occasionally put a pillar in the center */
else if (one_in_(3))
{
- g_ptr = &grid_array[yval][xval];
+ g_ptr = ¤t_floor->grid_array[yval][xval];
place_inner_grid(g_ptr);
}
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->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++)
{
- g_ptr = &grid_array[y][x1 - 1];
+ g_ptr = ¤t_floor->grid_array[y][x1 - 1];
place_outer_grid(g_ptr);
- g_ptr = &grid_array[y][x2 + 1];
+ g_ptr = ¤t_floor->grid_array[y][x2 + 1];
place_outer_grid(g_ptr);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- g_ptr = &grid_array[y1 - 1][x];
+ g_ptr = ¤t_floor->grid_array[y1 - 1][x];
place_outer_grid(g_ptr);
- g_ptr = &grid_array[y2 + 1][x];
+ g_ptr = ¤t_floor->grid_array[y2 + 1][x];
place_outer_grid(g_ptr);
}
/* The inner walls */
for (y = y1 - 1; y <= y2 + 1; y++)
{
- g_ptr = &grid_array[y][x1 - 1];
+ g_ptr = ¤t_floor->grid_array[y][x1 - 1];
place_inner_grid(g_ptr);
- g_ptr = &grid_array[y][x2 + 1];
+ g_ptr = ¤t_floor->grid_array[y][x2 + 1];
place_inner_grid(g_ptr);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- g_ptr = &grid_array[y1 - 1][x];
+ g_ptr = ¤t_floor->grid_array[y1 - 1][x];
place_inner_grid(g_ptr);
- g_ptr = &grid_array[y2 + 1][x];
+ g_ptr = ¤t_floor->grid_array[y2 + 1][x];
place_inner_grid(g_ptr);
}
for (x = xval - 1; x <= xval + 1; x++)
{
if ((x == xval) && (y == yval)) continue;
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
place_inner_grid(g_ptr);
}
}
{
for (x = xval - 1; x <= xval + 1; x++)
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
place_inner_grid(g_ptr);
}
}
{
for (x = xval - 5 - tmp; x <= xval - 3 - tmp; x++)
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
place_inner_grid(g_ptr);
}
for (x = xval + 3 + tmp; x <= xval + 5 + tmp; x++)
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
place_inner_grid(g_ptr);
}
}
/* Long horizontal walls */
for (x = xval - 5; x <= xval + 5; x++)
{
- g_ptr = &grid_array[yval - 1][x];
+ g_ptr = ¤t_floor->grid_array[yval - 1][x];
place_inner_grid(g_ptr);
- g_ptr = &grid_array[yval + 1][x];
+ g_ptr = ¤t_floor->grid_array[yval + 1][x];
place_inner_grid(g_ptr);
}
/* Close off the left/right edges */
- g_ptr = &grid_array[yval][xval - 5];
+ g_ptr = ¤t_floor->grid_array[yval][xval - 5];
place_inner_grid(g_ptr);
- g_ptr = &grid_array[yval][xval + 5];
+ g_ptr = ¤t_floor->grid_array[yval][xval + 5];
place_inner_grid(g_ptr);
/* Secret doors (random top/bottom) */
{
if (0x1 & (x + y))
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
place_inner_grid(g_ptr);
}
}
/* Inner "cross" */
for (y = y1; y <= y2; y++)
{
- g_ptr = &grid_array[y][xval];
+ g_ptr = ¤t_floor->grid_array[y][xval];
place_inner_grid(g_ptr);
}
for (x = x1; x <= x2; x++)
{
- g_ptr = &grid_array[yval][x];
+ g_ptr = ¤t_floor->grid_array[yval][x];
place_inner_grid(g_ptr);
}
for (y = y0 - rad; y <= y0 + rad; y++)
{
/* clear room flag */
- grid_array[y][x].info &= ~(CAVE_ROOM);
+ current_floor->grid_array[y][x].info &= ~(CAVE_ROOM);
if (dist2(y0, x0, y, x, h1, h2, h3, h4) <= rad - 1)
{
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->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++)
{
- g_ptr = &grid_array[y][x1 - 1];
+ g_ptr = ¤t_floor->grid_array[y][x1 - 1];
place_outer_grid(g_ptr);
- g_ptr = &grid_array[y][x2 + 1];
+ g_ptr = ¤t_floor->grid_array[y][x2 + 1];
place_outer_grid(g_ptr);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- g_ptr = &grid_array[y1 - 1][x];
+ g_ptr = ¤t_floor->grid_array[y1 - 1][x];
place_outer_grid(g_ptr);
- g_ptr = &grid_array[y2 + 1][x];
+ g_ptr = ¤t_floor->grid_array[y2 + 1][x];
place_outer_grid(g_ptr);
}
/* The inner walls */
for (y = y1 - 1; y <= y2 + 1; y++)
{
- g_ptr = &grid_array[y][x1 - 1];
+ g_ptr = ¤t_floor->grid_array[y][x1 - 1];
place_inner_grid(g_ptr);
- g_ptr = &grid_array[y][x2 + 1];
+ g_ptr = ¤t_floor->grid_array[y][x2 + 1];
place_inner_grid(g_ptr);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- g_ptr = &grid_array[y1 - 1][x];
+ g_ptr = ¤t_floor->grid_array[y1 - 1][x];
place_inner_grid(g_ptr);
- g_ptr = &grid_array[y2 + 1][x];
+ g_ptr = ¤t_floor->grid_array[y2 + 1][x];
place_inner_grid(g_ptr);
}
for (y = y1; y <= y2; y++)
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->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++)
{
- g_ptr = &grid_array[y][x1 - 1];
+ g_ptr = ¤t_floor->grid_array[y][x1 - 1];
place_outer_grid(g_ptr);
- g_ptr = &grid_array[y][x2 + 1];
+ g_ptr = ¤t_floor->grid_array[y][x2 + 1];
place_outer_grid(g_ptr);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- g_ptr = &grid_array[y1 - 1][x];
+ g_ptr = ¤t_floor->grid_array[y1 - 1][x];
place_outer_grid(g_ptr);
- g_ptr = &grid_array[y2 + 1][x];
+ g_ptr = ¤t_floor->grid_array[y2 + 1][x];
place_outer_grid(g_ptr);
}
/* The inner walls */
for (y = y1 - 1; y <= y2 + 1; y++)
{
- g_ptr = &grid_array[y][x1 - 1];
+ g_ptr = ¤t_floor->grid_array[y][x1 - 1];
place_inner_grid(g_ptr);
- g_ptr = &grid_array[y][x2 + 1];
+ g_ptr = ¤t_floor->grid_array[y][x2 + 1];
place_inner_grid(g_ptr);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- g_ptr = &grid_array[y1 - 1][x];
+ g_ptr = ¤t_floor->grid_array[y1 - 1][x];
place_inner_grid(g_ptr);
- g_ptr = &grid_array[y2 + 1][x];
+ g_ptr = ¤t_floor->grid_array[y2 + 1][x];
place_inner_grid(g_ptr);
}
for (y = y1; y <= y2; y++)
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->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++)
{
- g_ptr = &grid_array[yval - 2][x];
+ g_ptr = ¤t_floor->grid_array[yval - 2][x];
place_floor_grid(g_ptr);
add_cave_info(yval - 2, x, CAVE_ICKY);
- g_ptr = &grid_array[yval + 2][x];
+ g_ptr = ¤t_floor->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++)
{
- g_ptr = &grid_array[yval - 3][x];
+ g_ptr = ¤t_floor->grid_array[yval - 3][x];
place_floor_grid(g_ptr);
add_cave_info(yval - 3, x, CAVE_ICKY);
- g_ptr = &grid_array[yval + 3][x];
+ g_ptr = ¤t_floor->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++)
{
- g_ptr = &grid_array[yval][x];
+ g_ptr = ¤t_floor->grid_array[yval][x];
place_floor_grid(g_ptr);
- g_ptr = &grid_array[y1][x];
+ g_ptr = ¤t_floor->grid_array[y1][x];
place_floor_grid(g_ptr);
- g_ptr = &grid_array[y2][x];
+ g_ptr = ¤t_floor->grid_array[y2][x];
place_floor_grid(g_ptr);
}
/* Place the outer walls */
for (y = y1 - 1; y <= y2 + 1; y++)
{
- g_ptr = &grid_array[y][x1 - 1];
+ g_ptr = ¤t_floor->grid_array[y][x1 - 1];
place_outer_grid(g_ptr);
- g_ptr = &grid_array[y][x2 + 1];
+ g_ptr = ¤t_floor->grid_array[y][x2 + 1];
place_outer_grid(g_ptr);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- g_ptr = &grid_array[y1 - 1][x];
+ g_ptr = ¤t_floor->grid_array[y1 - 1][x];
place_outer_grid(g_ptr);
- g_ptr = &grid_array[y2 + 1][x];
+ g_ptr = ¤t_floor->grid_array[y2 + 1][x];
place_outer_grid(g_ptr);
}
}
/* Place the wall open trap */
- grid_array[yval][xval].mimic = grid_array[yval][xval].feat;
- grid_array[yval][xval].feat = feat_trap_open;
+ current_floor->grid_array[yval][xval].mimic = current_floor->grid_array[yval][xval].feat;
+ current_floor->grid_array[yval][xval].feat = feat_trap_open;
/* Sort the entries */
for (i = 0; i < 16 - 1; i++)
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
place_floor_grid(g_ptr);
g_ptr->feat = feat_glass_floor;
g_ptr->info |= (CAVE_ROOM);
/* Walls around the room */
for (y = y1 - 1; y <= y2 + 1; y++)
{
- g_ptr = &grid_array[y][x1 - 1];
+ g_ptr = ¤t_floor->grid_array[y][x1 - 1];
place_outer_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
- g_ptr = &grid_array[y][x2 + 1];
+ g_ptr = ¤t_floor->grid_array[y][x2 + 1];
place_outer_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- g_ptr = &grid_array[y1 - 1][x];
+ g_ptr = ¤t_floor->grid_array[y1 - 1][x];
place_outer_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
- g_ptr = &grid_array[y2 + 1][x];
+ g_ptr = ¤t_floor->grid_array[y2 + 1][x];
place_outer_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
}
/* Walls around the breather */
for (dir2 = 0; dir2 < 8; dir2++)
{
- g_ptr = &grid_array[y + ddy_ddd[dir2]][x + ddx_ddd[dir2]];
+ g_ptr = ¤t_floor->grid_array[y + ddy_ddd[dir2]][x + ddx_ddd[dir2]];
place_inner_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
}
{
y = yval + 2 * ddy_ddd[dir1];
x = xval + 2 * ddx_ddd[dir1];
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->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);
+ current_floor->grid_array[yval + ddy_ddd[dir1]][xval + ddx_ddd[dir1]].info |= (CAVE_ICKY);
}
/* Glass door */
y = yval + 2 * ddy_ddd[dir1];
x = xval + 2 * ddx_ddd[dir1];
place_secret_door(y, x, DOOR_GLASS_DOOR);
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->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;
place_object(yval, xval, AM_NO_FIXED_ART);
- grid_array[yval][xval].info |= (CAVE_ICKY);
+ current_floor->grid_array[yval][xval].info |= (CAVE_ICKY);
}
break;
DIRECTION dir1;
/* Pillars */
- g_ptr = &grid_array[y1 + 1][x1 + 1];
+ g_ptr = ¤t_floor->grid_array[y1 + 1][x1 + 1];
place_inner_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
- g_ptr = &grid_array[y1 + 1][x2 - 1];
+ g_ptr = ¤t_floor->grid_array[y1 + 1][x2 - 1];
place_inner_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
- g_ptr = &grid_array[y2 - 1][x1 + 1];
+ g_ptr = ¤t_floor->grid_array[y2 - 1][x1 + 1];
place_inner_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
- g_ptr = &grid_array[y2 - 1][x2 - 1];
+ g_ptr = ¤t_floor->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);
/* Walls around the breather */
for (dir1 = 0; dir1 < 8; dir1++)
{
- g_ptr = &grid_array[yval + ddy_ddd[dir1]][xval + ddx_ddd[dir1]];
+ g_ptr = ¤t_floor->grid_array[yval + ddy_ddd[dir1]][xval + ddx_ddd[dir1]];
place_inner_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
}
/* Place an object */
place_object(yval, xval, AM_NO_FIXED_ART);
- grid_array[yval][xval].info |= (CAVE_ICKY);
+ current_floor->grid_array[yval][xval].info |= (CAVE_ICKY);
}
break;
/* Walls around the potion */
for (y = yval - 2; y <= yval + 2; y++)
{
- g_ptr = &grid_array[y][xval - 3];
+ g_ptr = ¤t_floor->grid_array[y][xval - 3];
place_inner_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
- g_ptr = &grid_array[y][xval + 3];
+ g_ptr = ¤t_floor->grid_array[y][xval + 3];
place_inner_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
}
for (x = xval - 2; x <= xval + 2; x++)
{
- g_ptr = &grid_array[yval - 3][x];
+ g_ptr = ¤t_floor->grid_array[yval - 3][x];
place_inner_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
- g_ptr = &grid_array[yval + 3][x];
+ g_ptr = ¤t_floor->grid_array[yval + 3][x];
place_inner_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
}
for (dir1 = 4; dir1 < 8; dir1++)
{
- g_ptr = &grid_array[yval + 2 * ddy_ddd[dir1]][xval + 2 * ddx_ddd[dir1]];
+ g_ptr = ¤t_floor->grid_array[yval + 2 * ddy_ddd[dir1]][xval + 2 * ddx_ddd[dir1]];
place_inner_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
}
for (y = yval - 2; y <= yval + 2; y++)
for (x = xval - 2; x <= xval + 2; x++)
- grid_array[y][x].info |= (CAVE_ICKY);
+ current_floor->grid_array[y][x].info |= (CAVE_ICKY);
}
break;
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->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++)
{
- g_ptr = &grid_array[y][x1 - 1];
+ g_ptr = ¤t_floor->grid_array[y][x1 - 1];
place_outer_grid(g_ptr);
- g_ptr = &grid_array[y][x2 + 1];
+ g_ptr = ¤t_floor->grid_array[y][x2 + 1];
place_outer_grid(g_ptr);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- g_ptr = &grid_array[y1 - 1][x];
+ g_ptr = ¤t_floor->grid_array[y1 - 1][x];
place_outer_grid(g_ptr);
- g_ptr = &grid_array[y2 + 1][x];
+ g_ptr = ¤t_floor->grid_array[y2 + 1][x];
place_outer_grid(g_ptr);
}
trap = feat_trap_armageddon;
/* Place a special trap */
- g_ptr = &grid_array[rand_spread(yval, ysize / 4)][rand_spread(xval, xsize / 4)];
+ g_ptr = ¤t_floor->grid_array[rand_spread(yval, ysize / 4)][rand_spread(xval, xsize / 4)];
g_ptr->mimic = g_ptr->feat;
g_ptr->feat = trap;
int side_x = x0 - xhsize + i;
place_outer_noperm_bold(y0 - yhsize + 0, side_x);
- grid_array[y0 - yhsize + 0][side_x].info |= (CAVE_ROOM | CAVE_ICKY);
+ current_floor->grid_array[y0 - yhsize + 0][side_x].info |= (CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(y0 - yhsize + ysize - 1, side_x);
- grid_array[y0 - yhsize + ysize - 1][side_x].info |= (CAVE_ROOM | CAVE_ICKY);
+ current_floor->grid_array[y0 - yhsize + ysize - 1][side_x].info |= (CAVE_ROOM | CAVE_ICKY);
}
/* Left and right boundaries */
int side_y = y0 - yhsize + i;
place_outer_noperm_bold(side_y, x0 - xhsize + 0);
- grid_array[side_y][x0 - xhsize + 0].info |= (CAVE_ROOM | CAVE_ICKY);
+ current_floor->grid_array[side_y][x0 - xhsize + 0].info |= (CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(side_y, x0 - xhsize + xsize - 1);
- grid_array[side_y][x0 - xhsize + xsize - 1].info |= (CAVE_ROOM | CAVE_ICKY);
+ current_floor->grid_array[side_y][x0 - xhsize + xsize - 1].info |= (CAVE_ROOM | CAVE_ICKY);
}
/* Fill in middle with bubbles */
}
/* clean up rest of flags */
- grid_array[y0 - yhsize + y][x0 - xhsize + x].info |= (CAVE_ROOM | CAVE_ICKY);
+ current_floor->grid_array[y0 - yhsize + y][x0 - xhsize + x].info |= (CAVE_ROOM | CAVE_ICKY);
}
}
POSITION y = y0 - yhsize + y1;
place_extra_bold(y, x);
- grid_array[y][x].info &= (~CAVE_ICKY);
+ current_floor->grid_array[y][x].info &= (~CAVE_ICKY);
}
}
}
-/* Create a random vault out of a fractal grid_array */
+/* Create a random vault out of a fractal current_floor->grid_array */
static void build_cave_vault(POSITION x0, POSITION y0, POSITION xsiz, POSITION ysiz)
{
int grd, roug, cutoff;
{
for (y = 0; y <= ysize; y++)
{
- grid_array[y0 - yhsize + y][x0 - xhsize + x].info |= CAVE_ICKY;
+ current_floor->grid_array[y0 - yhsize + y][x0 - xhsize + x].info |= CAVE_ICKY;
}
}
/* Hack -- skip "non-grids" */
if (*t == ' ') continue;
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Lay down a floor */
place_floor_grid(g_ptr);
for (y = y0 - rad; y <= y0 + rad; y++)
{
/* clear room flag */
- grid_array[y][x].info &= ~(CAVE_ROOM);
+ current_floor->grid_array[y][x].info &= ~(CAVE_ROOM);
/* Vault - so is "icky" */
- grid_array[y][x].info |= CAVE_ICKY;
+ current_floor->grid_array[y][x].info |= CAVE_ICKY;
if (dist2(y0, x0, y, x, h1, h2, h3, h4) <= rad - 1)
{
{
for (y = 0; y <= ysize; y++)
{
- grid_array[y0 - yhsize + y][x0 - xhsize + x].info |= CAVE_ICKY;
+ current_floor->grid_array[y0 - yhsize + y][x0 - xhsize + x].info |= CAVE_ICKY;
}
}
{
if (!in_bounds(y1 - 2, x)) break;
- grid_array[y1 - 2][x].info |= (CAVE_ROOM | CAVE_ICKY);
+ current_floor->grid_array[y1 - 2][x].info |= (CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(y1 - 2, x);
}
{
if (!in_bounds(y2 + 2, x)) break;
- grid_array[y2 + 2][x].info |= (CAVE_ROOM | CAVE_ICKY);
+ current_floor->grid_array[y2 + 2][x].info |= (CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(y2 + 2, x);
}
{
if (!in_bounds(y, x1 - 2)) break;
- grid_array[y][x1 - 2].info |= (CAVE_ROOM | CAVE_ICKY);
+ current_floor->grid_array[y][x1 - 2].info |= (CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(y, x1 - 2);
}
{
if (!in_bounds(y, x2 + 2)) break;
- grid_array[y][x2 + 2].info |= (CAVE_ROOM | CAVE_ICKY);
+ current_floor->grid_array[y][x2 + 2].info |= (CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(y, x2 + 2);
}
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
g_ptr->info |= (CAVE_ROOM | CAVE_ICKY);
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- grid_array[y][x].info |= (CAVE_ROOM | CAVE_ICKY);
+ current_floor->grid_array[y][x].info |= (CAVE_ROOM | CAVE_ICKY);
/* Make everything a floor */
place_floor_bold(y, x);
}
}
/* Clear mimic type */
- grid_array[y0][x0].mimic = 0;
+ current_floor->grid_array[y0][x0].mimic = 0;
/* Add inner open space */
place_floor_bold(y0, x0);
/*!
* @brief
* 指定範囲に通路が通っていることを確認した上で床で埋める
- * This function tunnels around a room if it will cut off part of a grid_array system.
+ * This function tunnels around a room if it will cut off part of a current_floor->grid_array system.
* @param x1 範囲の左端
* @param y1 範囲の上端
* @param x2 範囲の右端
static fill_data_type fill_data;
-/* Store routine for the fractal grid_array generator */
+/* Store routine for the fractal current_floor->grid_array generator */
/* this routine probably should be an inline function or a macro. */
static void store_height(POSITION x, POSITION y, FEAT_IDX val)
{
(val <= fill_data.c1)) val = fill_data.c1 + 1;
/* store the value in height-map format */
- grid_array[y][x].feat = val;
+ current_floor->grid_array[y][x].feat = val;
return;
}
*
* How fractal caves are made:
*
-* When the map is complete, a cut-off value is used to create a grid_array.
+* When the map is complete, a cut-off value is used to create a current_floor->grid_array.
* Heights below this value are "floor", and heights above are "wall".
* This also can be used to create lakes, by adding more height levels
* representing shallow and deep water/ lava etc.
* The grd variable affects the width of passages.
* The roug variable affects the roughness of those passages
*
-* The tricky part is making sure the created grid_array is connected. This
+* The tricky part is making sure the created current_floor->grid_array is connected. This
* is done by 'filling' from the inside and only keeping the 'filled'
* floor. Walls bounding the 'filled' floor are also kept. Everything
* else is converted to the normal _extra_.
/*
- * Note that this uses the grid_array.feat array in a very hackish way
+ * Note that this uses the current_floor->grid_array.feat array in a very hackish way
* the values are first set to zero, and then each array location
* is used as a "heightmap"
* The heightmap then needs to be converted back into the "feat" format.
* grd=level at which fractal turns on. smaller gives more mazelike caves
* roug=roughness level. 16=normal. higher values make things more convoluted
* small values are good for smooth walls.
- * size=length of the side of the square grid_array system.
+ * size=length of the side of the square current_floor->grid_array system.
*/
void generate_hmap(POSITION y0, POSITION x0, POSITION xsiz, POSITION ysiz, int grd, int roug, int cutoff)
{
for (j = 0; j <= ysize; j++)
{
/* -1 is a flag for "not done yet" */
- grid_array[(int)(fill_data.ymin + j)][(int)(fill_data.xmin + i)].feat = -1;
- /* Clear icky flag because may be redoing the grid_array */
- grid_array[(int)(fill_data.ymin + j)][(int)(fill_data.xmin + i)].info &= ~(CAVE_ICKY);
+ current_floor->grid_array[(int)(fill_data.ymin + j)][(int)(fill_data.xmin + i)].feat = -1;
+ /* Clear icky flag because may be redoing the current_floor->grid_array */
+ current_floor->grid_array[(int)(fill_data.ymin + j)][(int)(fill_data.xmin + i)].info &= ~(CAVE_ICKY);
}
}
/* Boundaries are walls */
- grid_array[fill_data.ymin][fill_data.xmin].feat = (s16b)maxsize;
- grid_array[fill_data.ymax][fill_data.xmin].feat = (s16b)maxsize;
- grid_array[fill_data.ymin][fill_data.xmax].feat = (s16b)maxsize;
- grid_array[fill_data.ymax][fill_data.xmax].feat = (s16b)maxsize;
+ current_floor->grid_array[fill_data.ymin][fill_data.xmin].feat = (s16b)maxsize;
+ current_floor->grid_array[fill_data.ymax][fill_data.xmin].feat = (s16b)maxsize;
+ current_floor->grid_array[fill_data.ymin][fill_data.xmax].feat = (s16b)maxsize;
+ current_floor->grid_array[fill_data.ymax][fill_data.xmax].feat = (s16b)maxsize;
/* Set the middle square to be an open area. */
- grid_array[y0][x0].feat = 0;
+ current_floor->grid_array[y0][x0].feat = 0;
/* Initialize the step sizes */
xstep = xhstep = xsize * 256;
jj = j / 256 + fill_data.ymin;
/* Test square */
- if (grid_array[jj][ii].feat == -1)
+ if (current_floor->grid_array[jj][ii].feat == -1)
{
if (xhstep2 > grd)
{
{
/* Average of left and right points +random bit */
store_height(ii, jj,
- (grid_array[jj][fill_data.xmin + (i - xhstep) / 256].feat
- + grid_array[jj][fill_data.xmin + (i + xhstep) / 256].feat) / 2
+ (current_floor->grid_array[jj][fill_data.xmin + (i - xhstep) / 256].feat
+ + current_floor->grid_array[jj][fill_data.xmin + (i + xhstep) / 256].feat) / 2
+ (randint1(xstep2) - xhstep2) * roug / 16);
}
}
jj = j / 256 + fill_data.ymin;
/* Test square */
- if (grid_array[jj][ii].feat == -1)
+ if (current_floor->grid_array[jj][ii].feat == -1)
{
if (xhstep2 > grd)
{
{
/* Average of up and down points +random bit */
store_height(ii, jj,
- (grid_array[fill_data.ymin + (j - yhstep) / 256][ii].feat
- + grid_array[fill_data.ymin + (j + yhstep) / 256][ii].feat) / 2
+ (current_floor->grid_array[fill_data.ymin + (j - yhstep) / 256][ii].feat
+ + current_floor->grid_array[fill_data.ymin + (j + yhstep) / 256][ii].feat) / 2
+ (randint1(ystep2) - yhstep2) * roug / 16);
}
}
jj = j / 256 + fill_data.ymin;
/* Test square */
- if (grid_array[jj][ii].feat == -1)
+ if (current_floor->grid_array[jj][ii].feat == -1)
{
if (xhstep2 > grd)
{
* reduce the effect of the square grid on the shape of the fractal
*/
store_height(ii, jj,
- (grid_array[ym][xm].feat + grid_array[yp][xm].feat
- + grid_array[ym][xp].feat + grid_array[yp][xp].feat) / 4
+ (current_floor->grid_array[ym][xm].feat + current_floor->grid_array[yp][xm].feat
+ + current_floor->grid_array[ym][xp].feat + current_floor->grid_array[yp][xp].feat) / 4
+ (randint1(xstep2) - xhstep2) * (diagsize / 16) / 256 * roug);
}
}
{
/*
* function used to convert from height-map back to the
- * normal angband grid_array format
+ * normal angband current_floor->grid_array format
*/
- if (grid_array[y][x].info & CAVE_ICKY)
+ if (current_floor->grid_array[y][x].info & CAVE_ICKY)
{
/* already done */
return FALSE;
else
{
/* Show that have looked at this square */
- grid_array[y][x].info|= (CAVE_ICKY);
+ current_floor->grid_array[y][x].info|= (CAVE_ICKY);
/* Use cutoffs c1-c3 to allocate regions of floor /water/ lava etc. */
- if (grid_array[y][x].feat <= c1)
+ if (current_floor->grid_array[y][x].feat <= c1)
{
/* 25% of the time use the other tile : it looks better this way */
if (randint1(100) < 75)
{
- grid_array[y][x].feat = feat1;
- grid_array[y][x].info &= ~(CAVE_MASK);
- grid_array[y][x].info |= info1;
+ current_floor->grid_array[y][x].feat = feat1;
+ current_floor->grid_array[y][x].info &= ~(CAVE_MASK);
+ current_floor->grid_array[y][x].info |= info1;
return TRUE;
}
else
{
- grid_array[y][x].feat = feat2;
- grid_array[y][x].info &= ~(CAVE_MASK);
- grid_array[y][x].info |= info2;
+ current_floor->grid_array[y][x].feat = feat2;
+ current_floor->grid_array[y][x].info &= ~(CAVE_MASK);
+ current_floor->grid_array[y][x].info |= info2;
return TRUE;
}
}
- else if (grid_array[y][x].feat <= c2)
+ else if (current_floor->grid_array[y][x].feat <= c2)
{
/* 25% of the time use the other tile : it looks better this way */
if (randint1(100) < 75)
{
- grid_array[y][x].feat = feat2;
- grid_array[y][x].info &= ~(CAVE_MASK);
- grid_array[y][x].info |= info2;
+ current_floor->grid_array[y][x].feat = feat2;
+ current_floor->grid_array[y][x].info &= ~(CAVE_MASK);
+ current_floor->grid_array[y][x].info |= info2;
return TRUE;
}
else
{
- grid_array[y][x].feat = feat1;
- grid_array[y][x].info &= ~(CAVE_MASK);
- grid_array[y][x].info |= info1;
+ current_floor->grid_array[y][x].feat = feat1;
+ current_floor->grid_array[y][x].info &= ~(CAVE_MASK);
+ current_floor->grid_array[y][x].info |= info1;
return TRUE;
}
}
- else if (grid_array[y][x].feat <= c3)
+ else if (current_floor->grid_array[y][x].feat <= c3)
{
- grid_array[y][x].feat = feat3;
- grid_array[y][x].info &= ~(CAVE_MASK);
- grid_array[y][x].info |= info3;
+ current_floor->grid_array[y][x].feat = feat3;
+ current_floor->grid_array[y][x].info &= ~(CAVE_MASK);
+ current_floor->grid_array[y][x].info |= info3;
return TRUE;
}
/* if greater than cutoff then is a wall */
/*
* Quick and nasty fill routine used to find the connected region
- * of floor in the middle of the grid_array
+ * of floor in the middle of the current_floor->grid_array
*/
static void cave_fill(POSITION y, POSITION x)
{
j = ty + ddy_ddd[d];
i = tx + ddx_ddd[d];
- /* Paranoia Don't leave the grid_array */
+ /* Paranoia Don't leave the current_floor->grid_array */
if (!in_bounds(j, i))
{
/* affect boundary */
- grid_array[j][i].info |= CAVE_ICKY;
+ current_floor->grid_array[j][i].info |= CAVE_ICKY;
/* return; */
}
}
else
{
- /* keep tally of size of grid_array system */
+ /* keep tally of size of current_floor->grid_array system */
(fill_data.amount)++;
}
}
else
{
/* affect boundary */
- grid_array[j][i].info |= CAVE_ICKY;
+ current_floor->grid_array[j][i].info |= CAVE_ICKY;
}
}
}
/*
- * select region connected to center of grid_array system
+ * select region connected to center of current_floor->grid_array system
* this gets rid of alot of isolated one-sqaures that
* can make teleport traps instadeaths...
*/
for (y = 0; y <= ysize; ++y)
{
place_extra_bold(y0 + y - yhsize, x0 + x - xhsize);
- grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
+ current_floor->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
}
}
return FALSE;
for (i = 0; i <= xsize; ++i)
{
/* top boundary */
- if ((grid_array[0 + y0 - yhsize][i + x0 - xhsize].info & CAVE_ICKY) && (room))
+ if ((current_floor->grid_array[0 + y0 - yhsize][i + x0 - xhsize].info & CAVE_ICKY) && (room))
{
/* Next to a 'filled' region? - set to be room walls */
place_outer_bold(y0 + 0 - yhsize, x0 + i - xhsize);
- if (light) grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info |= (CAVE_GLOW);
- grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info |= (CAVE_ROOM);
+ if (light) current_floor->grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info |= (CAVE_GLOW);
+ current_floor->grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info |= (CAVE_ROOM);
place_outer_bold(y0 + 0 - yhsize, x0 + i - xhsize);
}
else
}
/* bottom boundary */
- if ((grid_array[ysize + y0 - yhsize][i + x0 - xhsize].info & CAVE_ICKY) && (room))
+ if ((current_floor->grid_array[ysize + y0 - yhsize][i + x0 - xhsize].info & CAVE_ICKY) && (room))
{
/* Next to a 'filled' region? - set to be room walls */
place_outer_bold(y0 + ysize - yhsize, x0 + i - xhsize);
- if (light) grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info|=(CAVE_GLOW);
- grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info|=(CAVE_ROOM);
+ if (light) current_floor->grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info|=(CAVE_GLOW);
+ current_floor->grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info|=(CAVE_ROOM);
place_outer_bold(y0 + ysize - yhsize, x0 + i - xhsize);
}
else
}
/* clear the icky flag-don't need it any more */
- grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
- grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
+ current_floor->grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
+ current_floor->grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
}
/* Do the left and right boundaries minus the corners (done above) */
for (i = 1; i < ysize; ++i)
{
/* left boundary */
- if ((grid_array[i + y0 - yhsize][0 + x0 - xhsize].info & CAVE_ICKY) && room)
+ if ((current_floor->grid_array[i + y0 - yhsize][0 + x0 - xhsize].info & CAVE_ICKY) && room)
{
/* room boundary */
place_outer_bold(y0 + i - yhsize, x0 + 0 - xhsize);
- if (light) grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info |= (CAVE_GLOW);
- grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info |= (CAVE_ROOM);
+ if (light) current_floor->grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info |= (CAVE_GLOW);
+ current_floor->grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info |= (CAVE_ROOM);
place_outer_bold(y0 + i - yhsize, x0 + 0 - xhsize);
}
else
place_extra_bold(y0 + i - yhsize, x0 + 0 - xhsize);
}
/* right boundary */
- if ((grid_array[i + y0 - yhsize][xsize + x0 - xhsize].info & CAVE_ICKY) && room)
+ if ((current_floor->grid_array[i + y0 - yhsize][xsize + x0 - xhsize].info & CAVE_ICKY) && room)
{
/* room boundary */
place_outer_bold(y0 + i - yhsize, x0 + xsize - xhsize);
- if (light) grid_array[y0 + i - yhsize][x0 + xsize - xhsize].info |= (CAVE_GLOW);
- grid_array[y0 + i - yhsize][x0 + xsize - xhsize].info |= (CAVE_ROOM);
+ if (light) current_floor->grid_array[y0 + i - yhsize][x0 + xsize - xhsize].info |= (CAVE_GLOW);
+ current_floor->grid_array[y0 + i - yhsize][x0 + xsize - xhsize].info |= (CAVE_ROOM);
place_outer_bold(y0 + i - yhsize, x0 + xsize - xhsize);
}
else
}
/* clear icky flag -done with it */
- grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info &= ~(CAVE_ICKY);
- grid_array[y0 + i - yhsize][x0 + xsize - xhsize].info &= ~(CAVE_ICKY);
+ current_floor->grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info &= ~(CAVE_ICKY);
+ current_floor->grid_array[y0 + i - yhsize][x0 + xsize - xhsize].info &= ~(CAVE_ICKY);
}
for (y = 1; y < ysize; ++y)
{
if (is_floor_bold(y0 + y - yhsize, x0 + x - xhsize) &&
- (grid_array[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY))
+ (current_floor->grid_array[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY))
{
/* Clear the icky flag in the filled region */
- grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~CAVE_ICKY;
+ current_floor->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~CAVE_ICKY;
/* Set appropriate flags */
- if (light) grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_GLOW);
- if (room) grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_ROOM);
+ if (light) current_floor->grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_GLOW);
+ if (room) current_floor->grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_ROOM);
}
else if (is_outer_bold(y0 + y - yhsize, x0 + x - xhsize) &&
- (grid_array[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY))
+ (current_floor->grid_array[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY))
{
/* Walls */
- grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY);
- if (light) grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_GLOW);
+ current_floor->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY);
+ if (light) current_floor->grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_GLOW);
if (room)
{
- grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_ROOM);
+ current_floor->grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_ROOM);
}
else
{
place_extra_bold(y0 + y - yhsize, x0 + x - xhsize);
- grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ROOM);
+ current_floor->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ROOM);
}
}
else
{
/* Clear the unconnected regions */
place_extra_bold(y0 + y - yhsize, x0 + x - xhsize);
- grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
+ current_floor->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
}
}
}
#ifdef ALLOW_CAVERNS_AND_LAKES
/*
- * Builds a grid_array system in the center of the dungeon.
+ * Builds a current_floor->grid_array system in the center of the dungeon.
*/
void build_cavern(void)
{
light = done = FALSE;
if ((dun_level <= randint1(50)) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) light = TRUE;
- /* Make a grid_array the size of the dungeon */
+ /* Make a current_floor->grid_array the size of the dungeon */
xsize = cur_wid - 1;
ysize = cur_hgt - 1;
x0 = xsize / 2;
feat2 = feat_shallow_water;
feat3 = feat_ground_type[randint0(100)];
break;
- case LAKE_T_CAVE: /* Collapsed grid_array */
+ case LAKE_T_CAVE: /* Collapsed current_floor->grid_array */
feat1 = feat_ground_type[randint0(100)];
feat2 = feat_ground_type[randint0(100)];
feat3 = feat_rubble;
}
/*
- * select region connected to center of grid_array system
+ * select region connected to center of current_floor->grid_array system
* this gets rid of alot of isolated one-sqaures that
* can make teleport traps instadeaths...
*/
/* number of filled squares */
fill_data.amount = 0;
- /* select region connected to center of grid_array system
+ /* select region connected to center of current_floor->grid_array system
* this gets rid of alot of isolated one-sqaures that
* can make teleport traps instadeaths... */
cave_fill((byte)y0, (byte)x0);
for (y = 0; y <= ysize; ++y)
{
place_floor_bold(y0 + y - yhsize, x0 + x - xhsize);
- grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY);
+ current_floor->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY);
}
}
return FALSE;
place_extra_bold(y0 + ysize - yhsize, x0 + i - xhsize);
/* clear the icky flag-don't need it any more */
- grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
- grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
+ current_floor->grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
+ current_floor->grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
}
/* Do the left and right boundaries minus the corners (done above) */
place_extra_bold(y0 + i - yhsize, x0 + xsize - xhsize);
/* clear icky flag -done with it */
- grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info &= ~(CAVE_ICKY);
- grid_array[y0 + i - yhsize][x0 + xsize - xhsize].info &= ~(CAVE_ICKY);
+ current_floor->grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info &= ~(CAVE_ICKY);
+ current_floor->grid_array[y0 + i - yhsize][x0 + xsize - xhsize].info &= ~(CAVE_ICKY);
}
for (y = 1; y < ysize; ++y)
{
/* Fill unconnected regions with granite */
- if ((!(grid_array[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY)) ||
+ if ((!(current_floor->grid_array[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY)) ||
is_outer_bold(y0 + y - yhsize, x0 + x - xhsize))
place_extra_bold(y0 + y - yhsize, x0 + x - xhsize);
/* turn off icky flag (no longer needed.) */
- grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
+ current_floor->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
/* Light lava */
if (cave_have_flag_bold(y0 + y - yhsize, x0 + x - xhsize, FF_LAVA))
{
- if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= CAVE_GLOW;
+ if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) current_floor->grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= CAVE_GLOW;
}
}
}
/*
- * makes a lake/collapsed grid_array system in the center of the dungeon
+ * makes a lake/collapsed current_floor->grid_array system in the center of the dungeon
*/
void build_lake(int type)
{
for (i = 0; i <= xsize; i++)
{
place_outer_noperm_bold(y1, x1 + i);
- grid_array[y1][x1 + i].info |= (CAVE_ROOM | CAVE_ICKY);
+ current_floor->grid_array[y1][x1 + i].info |= (CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(y2, x1 + i);
- grid_array[y2][x1 + i].info |= (CAVE_ROOM | CAVE_ICKY);
+ current_floor->grid_array[y2][x1 + i].info |= (CAVE_ROOM | CAVE_ICKY);
}
/* Left and right boundaries */
for (i = 1; i < ysize; i++)
{
place_outer_noperm_bold(y1 + i, x1);
- grid_array[y1 + i][x1].info|=(CAVE_ROOM | CAVE_ICKY);
+ current_floor->grid_array[y1 + i][x1].info|=(CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(y1 + i, x2);
- grid_array[y1 + i][x2].info|=(CAVE_ROOM | CAVE_ICKY);
+ current_floor->grid_array[y1 + i][x2].info|=(CAVE_ROOM | CAVE_ICKY);
}
/* Middle */
{
/* clear the untouched region */
place_floor_bold(y1 + y, x1 + x);
- grid_array[y1 + y][x1 + x].info |= (CAVE_ROOM | CAVE_ICKY);
+ current_floor->grid_array[y1 + y][x1 + x].info |= (CAVE_ROOM | CAVE_ICKY);
}
else
{
/* make it a room- but don't touch */
- grid_array[y1 + y][x1 + x].info |= (CAVE_ROOM | CAVE_ICKY);
+ current_floor->grid_array[y1 + y][x1 + x].info |= (CAVE_ROOM | CAVE_ICKY);
}
}
}
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->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))
if (!in_bounds(y, x)) return;
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* hack- check to see if square has been visited before
* if so, then exit (use room flag to do this) */
for (x = x1; x <= x2; x++)
{
/* Point to grid */
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
place_floor_grid(g_ptr);
g_ptr->info |= (CAVE_ROOM);
if (light) g_ptr->info |= (CAVE_GLOW);
/* Limit number of rooms */
int dun_rooms = DUN_ROOMS_MAX * area_size / 100;
- /* Assume normal grid_array */
+ /* Assume normal current_floor->grid_array */
room_info_type *room_info_ptr = room_info_normal;
/*
MOVE_PLIST(ROOM_T_INNER_FEAT, ROOM_T_OVAL);
}
- /*! @details ダンジョンにCAVEフラグがある場合、NORMALの生成枠がFRACAVEに与えられる。/ CAVE dungeon (Orc grid_array etc.) */
+ /*! @details ダンジョンにCAVEフラグがある場合、NORMALの生成枠がFRACAVEに与えられる。/ CAVE dungeon (Orc current_floor->grid_array etc.) */
else if (d_info[p_ptr->dungeon_idx].flags1 & DF1_CAVE)
{
MOVE_PLIST(ROOM_T_FRACAVE, ROOM_T_NORMAL);
#define ROOM_T_PIT 5 /*!<部屋型ID:モンスターPIT / Monster pit (33x11) */
#define ROOM_T_LESSER_VAULT 6 /*!<部屋型ID:小型VAULT / Lesser vault (33x22) */
#define ROOM_T_GREATER_VAULT 7 /*!<部屋型ID:大型VAULT / Greater vault (66x44) */
-#define ROOM_T_FRACAVE 8 /*!<部屋型ID:フラクタル地形 / Fractal grid_array (42x24) */
+#define ROOM_T_FRACAVE 8 /*!<部屋型ID:フラクタル地形 / Fractal current_floor->grid_array (42x24) */
#define ROOM_T_RANDOM_VAULT 9 /*!<部屋型ID:ランダムVAULT / Random vault (44x22) */
#define ROOM_T_OVAL 10 /*!<部屋型ID:円形部屋 / Circular rooms (22x22) */
#define ROOM_T_CRYPT 11 /*!<部屋型ID:聖堂 / Crypts (22x22) */
/*!
- * @brief フロア保存時のgrid_array情報テンプレートをソートするための比較処理
- * @param u grid_arrayテンプレートの参照ポインタ
+ * @brief フロア保存時のcurrent_floor->grid_array情報テンプレートをソートするための比較処理
+ * @param u current_floor->grid_arrayテンプレートの参照ポインタ
* @param v 未使用
* @param a スワップするモンスター種族のID1
* @param b スワップするモンスター種族のID2
/*!
- * @brief フロア保存時のgrid_array情報テンプレートをソートするためのスワップ処理 / Sorting hook -- Swap function
- * @param u grid_arrayテンプレートの参照ポインタ
+ * @brief フロア保存時のcurrent_floor->grid_array情報テンプレートをソートするためのスワップ処理 / Sorting hook -- Swap function
+ * @param u current_floor->grid_arrayテンプレートの参照ポインタ
* @param v 未使用
* @param a スワップするモンスター種族のID1
* @param b スワップするモンスター種族のID2
{
for (x = 0; x < cur_wid; x++)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
for (i = 0; i < num_temp; i++)
{
- /*** "Run-Length-Encoding" of grid_array ***/
+ /*** "Run-Length-Encoding" of current_floor->grid_array ***/
/* Note that this will induce two wasted bytes */
count = 0;
prev_u16b = 0;
- /* Dump the grid_array */
+ /* Dump the current_floor->grid_array */
for (y = 0; y < cur_hgt; y++)
{
for (x = 0; x < cur_wid; x++)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
for (i = 0; i < num_temp; i++)
{
/* Shatter Arrow */
if (snipe_type == SP_KILL_WALL)
{
- g_ptr = &grid_array[ny][nx];
+ g_ptr = ¤t_floor->grid_array[ny][nx];
if (cave_have_flag_grid(g_ptr, FF_HURT_ROCK) && !g_ptr->m_idx)
{
}
/* Stopped by walls/doors */
- if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && !grid_array[ny][nx].m_idx) break;
+ if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && !current_floor->grid_array[ny][nx].m_idx) break;
/* Advance the distance */
cur_dis++;
/* Sniper */
if (snipe_type == SP_LITE)
{
- grid_array[ny][nx].info |= (CAVE_GLOW);
+ current_floor->grid_array[ny][nx].info |= (CAVE_GLOW);
note_spot(ny, nx);
lite_spot(ny, nx);
}
/* Sniper */
if (snipe_type == SP_EVILNESS)
{
- grid_array[ny][nx].info &= ~(CAVE_GLOW | CAVE_MARK);
+ current_floor->grid_array[ny][nx].info &= ~(CAVE_GLOW | CAVE_MARK);
note_spot(ny, nx);
lite_spot(ny, nx);
}
y = ny;
/* Monster here, Try to hit it */
- if (grid_array[y][x].m_idx)
+ if (current_floor->grid_array[y][x].m_idx)
{
- grid_type *c_mon_ptr = &grid_array[y][x];
+ grid_type *c_mon_ptr = ¤t_floor->grid_array[y][x];
monster_type *m_ptr = &m_list[c_mon_ptr->m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
/* Sniper */
if (snipe_type == SP_HOLYNESS)
{
- grid_array[ny][nx].info |= (CAVE_GLOW);
+ current_floor->grid_array[ny][nx].info |= (CAVE_GLOW);
note_spot(ny, nx);
lite_spot(ny, nx);
}
if (!in_bounds2(ny, nx)) break;
/* Stopped by walls/doors */
- if (!player_can_enter(grid_array[ny][nx].feat, 0)) break;
+ if (!player_can_enter(current_floor->grid_array[ny][nx].feat, 0)) break;
/* Stopped by monsters */
if (!cave_empty_bold(ny, nx)) break;
- grid_array[ny][nx].m_idx = m_idx;
- grid_array[oy][ox].m_idx = 0;
+ current_floor->grid_array[ny][nx].m_idx = m_idx;
+ current_floor->grid_array[oy][ox].m_idx = 0;
m_ptr->fx = nx;
m_ptr->fy = ny;
if (stick_to)
{
- MONSTER_IDX m_idx = grid_array[y][x].m_idx;
+ MONSTER_IDX m_idx = current_floor->grid_array[y][x].m_idx;
monster_type *m_ptr = &m_list[m_idx];
OBJECT_IDX o_idx = o_pop();
/* Scan all normal grids */
for (x = 1; x < cur_wid - 1; x++)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
/* Memorize terrain of the grid */
g_ptr->info |= (CAVE_KNOWN);
{
POSITION yy = y + ddy_ddd[i];
POSITION xx = x + ddx_ddd[i];
- g_ptr = &grid_array[yy][xx];
+ g_ptr = ¤t_floor->grid_array[yy][xx];
/* Feature code (applying "mimic" field) */
f_ptr = &f_info[get_feat_mimic(g_ptr)];
if (p_ptr->special_defense & NINJA_S_STEALTH)
{
- if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+ if (current_floor->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
}
}
{
for (x = 1; x < cur_wid - 1; x++)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
/* Process the grid */
g_ptr->info &= ~(CAVE_MARK | CAVE_IN_DETECT | CAVE_KNOWN);
/* Forget every grid on horizontal edge */
for (x = 0; x < cur_wid; x++)
{
- grid_array[0][x].info &= ~(CAVE_MARK);
- grid_array[cur_hgt - 1][x].info &= ~(CAVE_MARK);
+ current_floor->grid_array[0][x].info &= ~(CAVE_MARK);
+ current_floor->grid_array[cur_hgt - 1][x].info &= ~(CAVE_MARK);
}
/* Forget every grid on vertical edge */
for (y = 1; y < (cur_hgt - 1); y++)
{
- grid_array[y][0].info &= ~(CAVE_MARK);
- grid_array[y][cur_wid - 1].info &= ~(CAVE_MARK);
+ current_floor->grid_array[y][0].info &= ~(CAVE_MARK);
+ current_floor->grid_array[y][cur_wid - 1].info &= ~(CAVE_MARK);
}
/* Forget all objects */
if (!get_rep_dir(&dir, FALSE)) return FALSE;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
if (!have_flag(f_info[get_feat_mimic(g_ptr)].flags, FF_CAN_DIG))
{
msg_print(_("そこは水辺ではない。", "There is no fishing place."));
return FALSE;
}
- else if (grid_array[y][x].m_idx)
+ else if (current_floor->grid_array[y][x].m_idx)
{
GAME_TEXT m_name[MAX_NLEN];
- monster_desc(m_name, &m_list[grid_array[y][x].m_idx], 0);
+ monster_desc(m_name, &m_list[current_floor->grid_array[y][x].m_idx], 0);
msg_format(_("%sが邪魔だ!", "%^s is stand in your way."), m_name);
free_turn(creature_ptr);
return FALSE;
{
for (y = 0; y < cur_hgt; y++)
{
- if (is_mirror_grid(&grid_array[y][x])) {
+ if (is_mirror_grid(¤t_floor->grid_array[y][x])) {
mirror_y[mirror_num] = y;
mirror_x[mirror_num] = x;
mirror_num++;
*/
static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
feature_type *f_ptr = &f_info[g_ptr->feat];
bool obvious = FALSE;
if (in_bounds2(by, bx))
{
- grid_type *cc_ptr = &grid_array[by][bx];
+ grid_type *cc_ptr = ¤t_floor->grid_array[by][bx];
if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
{
*/
static bool project_o(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
{
int tmp;
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
monster_type *m_ptr = &m_list[g_ptr->m_idx];
monster_type *caster_ptr = (who > 0) ? &m_list[who] : NULL;
x = m_ptr->fx;
/* Hack -- get new grid */
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
}
/* Fear */
}
}
if (project_o(0, 0, y, x, dam, GF_SEEKER))notice = TRUE;
- if (is_mirror_grid(&grid_array[y][x]))
+ if (is_mirror_grid(¤t_floor->grid_array[y][x]))
{
/* The target of monsterspell becomes tha mirror(broken) */
monster_target_y = y;
x = GRID_X(path_g[j]);
if (project_m(0, 0, y, x, dam, GF_SEEKER, flg, TRUE)) notice = TRUE;
if (!who && (project_m_n == 1) && !jump) {
- if (grid_array[project_m_y][project_m_x].m_idx > 0) {
- monster_type *m_ptr = &m_list[grid_array[project_m_y][project_m_x].m_idx];
+ if (current_floor->grid_array[project_m_y][project_m_x].m_idx > 0) {
+ monster_type *m_ptr = &m_list[current_floor->grid_array[project_m_y][project_m_x].m_idx];
if (m_ptr->ml)
{
if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
- health_track(grid_array[project_m_y][project_m_x].m_idx);
+ health_track(current_floor->grid_array[project_m_y][project_m_x].m_idx);
}
}
}
if (project_m(0, 0, py, px, dam, GF_SEEKER, flg, TRUE))
notice = TRUE;
if (!who && (project_m_n == 1) && !jump) {
- if (grid_array[project_m_y][project_m_x].m_idx > 0)
+ if (current_floor->grid_array[project_m_y][project_m_x].m_idx > 0)
{
- monster_type *m_ptr = &m_list[grid_array[project_m_y][project_m_x].m_idx];
+ monster_type *m_ptr = &m_list[current_floor->grid_array[project_m_y][project_m_x].m_idx];
if (m_ptr->ml)
{
if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
- health_track(grid_array[project_m_y][project_m_x].m_idx);
+ health_track(current_floor->grid_array[project_m_y][project_m_x].m_idx);
}
}
}
if( second_step )continue;
break;
}
- if( is_mirror_grid(&grid_array[y][x]) && !second_step )
+ if( is_mirror_grid(¤t_floor->grid_array[y][x]) && !second_step )
{
/* The target of monsterspell becomes tha mirror(broken) */
monster_target_y = y;
px = GRID_X(path_g[i]);
(void)project_m(0, 0, py, px, dam, GF_SUPER_RAY, flg, TRUE);
if(!who && (project_m_n == 1) && !jump){
- if(grid_array[project_m_y][project_m_x].m_idx >0 ){
- monster_type *m_ptr = &m_list[grid_array[project_m_y][project_m_x].m_idx];
+ if(current_floor->grid_array[project_m_y][project_m_x].m_idx >0 ){
+ monster_type *m_ptr = &m_list[current_floor->grid_array[project_m_y][project_m_x].m_idx];
if (m_ptr->ml)
{
if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
- health_track(grid_array[project_m_y][project_m_x].m_idx);
+ health_track(current_floor->grid_array[project_m_y][project_m_x].m_idx);
}
}
}
/* A single bolt may be reflected */
if (grids <= 1)
{
- monster_type *m_ptr = &m_list[grid_array[y][x].m_idx];
+ monster_type *m_ptr = &m_list[current_floor->grid_array[y][x].m_idx];
monster_race *ref_ptr = &r_info[m_ptr->r_idx];
- if ((flg & PROJECT_REFLECTABLE) && grid_array[y][x].m_idx && (ref_ptr->flags2 & RF2_REFLECTING) &&
- ((grid_array[y][x].m_idx != p_ptr->riding) || !(flg & PROJECT_PLAYER)) &&
+ if ((flg & PROJECT_REFLECTABLE) && current_floor->grid_array[y][x].m_idx && (ref_ptr->flags2 & RF2_REFLECTING) &&
+ ((current_floor->grid_array[y][x].m_idx != p_ptr->riding) || !(flg & PROJECT_PLAYER)) &&
(!who || dist_hack > 1) && !one_in_(10))
{
POSITION t_y, t_x;
else flg |= PROJECT_PLAYER;
/* The bolt is reflected */
- project(grid_array[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
+ project(current_floor->grid_array[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
/* Don't affect the monster any longer */
continue;
y = project_m_y;
/* Track if possible */
- if (grid_array[y][x].m_idx > 0)
+ if (current_floor->grid_array[y][x].m_idx > 0)
{
- monster_type *m_ptr = &m_list[grid_array[y][x].m_idx];
+ monster_type *m_ptr = &m_list[current_floor->grid_array[y][x].m_idx];
if (m_ptr->ml)
{
if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
- health_track(grid_array[y][x].m_idx);
+ health_track(current_floor->grid_array[y][x].m_idx);
}
}
}
{
for (y = 0; y < cur_hgt; y++)
{
- if (is_mirror_grid(&grid_array[y][x]) &&
+ if (is_mirror_grid(¤t_floor->grid_array[y][x]) &&
distance(p_ptr->y, p_ptr->x, y, x) <= MAX_RANGE &&
distance(p_ptr->y, p_ptr->x, y, x) != 0 &&
player_has_los_bold(y, x) &&
{
for (y = 0; y < cur_hgt; y++)
{
- if (is_mirror_grid(&grid_array[y][x]))
+ if (is_mirror_grid(¤t_floor->grid_array[y][x]))
{
if (project_m(0, 0, y, x, dam, GF_GENOCIDE,
(PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), TRUE))
{
- if (!grid_array[y][x].m_idx)
+ if (!current_floor->grid_array[y][x].m_idx)
{
remove_mirror(y, x);
}
{
int dist = distance(p_ptr->y, p_ptr->x, y, x);
if (dist > range) continue;
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Hack -- Safe */
if (flag == FF_TRAP)
/* Stay in the circle of death */
if (k > r) continue;
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Lose room and vault */
g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
/* Stay in the circle of death */
if (k > r) continue;
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
if (is_mirror_grid(g_ptr)) g_ptr->info |= CAVE_GLOW;
else if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
yy = y + ddy_ddd[i];
xx = x + ddx_ddd[i];
if (!in_bounds2(yy, xx)) continue;
- cc_ptr = &grid_array[yy][xx];
+ cc_ptr = ¤t_floor->grid_array[yy][xx];
if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
{
g_ptr->info |= CAVE_GLOW;
if (p_ptr->special_defense & NINJA_S_STEALTH)
{
- if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+ if (current_floor->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
}
}
/* Skip distant grids */
if (distance(cy, cx, yy, xx) > r) continue;
- g_ptr = &grid_array[yy][xx];
+ g_ptr = ¤t_floor->grid_array[yy][xx];
/* Lose room and vault / Lose light and knowledge */
g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY | CAVE_UNSAFE);
/* Important -- Skip "quake" grids */
if (map[16+y-cy][16+x-cx]) continue;
- if (grid_array[y][x].m_idx) continue;
+ if (current_floor->grid_array[y][x].m_idx) continue;
/* Count "safe" grids */
sn++;
{
case 1:
{
- msg_print(_("ダンジョンの壁が崩れた!", "The grid_array ceiling collapses!"));
+ msg_print(_("ダンジョンの壁が崩れた!", "The current_floor->grid_array ceiling collapses!"));
break;
}
case 2:
{
- msg_print(_("ダンジョンの床が不自然にねじ曲がった!", "The grid_array floor twists in an unnatural way!"));
+ msg_print(_("ダンジョンの床が不自然にねじ曲がった!", "The current_floor->grid_array floor twists in an unnatural way!"));
break;
}
default:
{
- msg_print(_("ダンジョンが揺れた!崩れた岩が頭に降ってきた!", "The grid_array quakes! You are pummeled with debris!"));
+ msg_print(_("ダンジョンが揺れた!崩れた岩が頭に降ってきた!", "The current_floor->grid_array quakes! You are pummeled with debris!"));
break;
}
}
/* Skip unaffected grids */
if (!map[16+yy-cy][16+xx-cx]) continue;
- g_ptr = &grid_array[yy][xx];
+ g_ptr = ¤t_floor->grid_array[yy][xx];
if (g_ptr->m_idx == p_ptr->riding) continue;
if (!cave_empty_bold(y, x)) continue;
/* Hack -- no safety on glyph of warding */
- if (is_glyph_grid(&grid_array[y][x])) continue;
- if (is_explosive_rune_grid(&grid_array[y][x])) continue;
+ if (is_glyph_grid(¤t_floor->grid_array[y][x])) continue;
+ if (is_explosive_rune_grid(¤t_floor->grid_array[y][x])) continue;
/* ... nor on the Pattern */
if (pattern_tile(y, x)) continue;
/* Important -- Skip "quake" grids */
if (map[16+y-cy][16+x-cx]) continue;
- if (grid_array[y][x].m_idx) continue;
+ if (current_floor->grid_array[y][x].m_idx) continue;
if (player_bold(y, x)) continue;
/* Count "safe" grids */
/* Hack -- Escape from the rock */
if (sn)
{
- IDX m_idx_aux = grid_array[yy][xx].m_idx;
+ IDX m_idx_aux = current_floor->grid_array[yy][xx].m_idx;
/* Update the old location */
- grid_array[yy][xx].m_idx = 0;
+ current_floor->grid_array[yy][xx].m_idx = 0;
/* Update the new location */
- grid_array[sy][sx].m_idx = m_idx_aux;
+ current_floor->grid_array[sy][sx].m_idx = m_idx_aux;
/* Move the monster */
m_ptr->fy = sy;
/* Skip unaffected grids */
if (!map[16+yy-cy][16+xx-cx]) continue;
- g_ptr = &grid_array[yy][xx];
+ g_ptr = ¤t_floor->grid_array[yy][xx];
/* Paranoia -- never affect player */
/* if (player_bold(yy, xx)) continue; */
/* Skip distant grids */
if (distance(cy, cx, yy, xx) > r) continue;
- g_ptr = &grid_array[yy][xx];
+ g_ptr = ¤t_floor->grid_array[yy][xx];
if (is_mirror_grid(g_ptr)) g_ptr->info |= CAVE_GLOW;
else if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
yyy = yy + ddy_ddd[ii];
xxx = xx + ddx_ddd[ii];
if (!in_bounds2(yyy, xxx)) continue;
- cc_ptr = &grid_array[yyy][xxx];
+ cc_ptr = ¤t_floor->grid_array[yyy][xxx];
if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
{
g_ptr->info |= CAVE_GLOW;
if (p_ptr->special_defense & NINJA_S_STEALTH)
{
- if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+ if (current_floor->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
}
/* Success */
POSITION y = temp_y[i];
POSITION x = temp_x[i];
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
/* No longer in the array */
g_ptr->info &= ~(CAVE_TEMP);
POSITION x = temp_x[i];
int j;
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
bool do_dark = !is_mirror_grid(g_ptr);
/* No longer in the array */
if (in_bounds2(by, bx))
{
- grid_type *cc_ptr = &grid_array[by][bx];
+ grid_type *cc_ptr = ¤t_floor->grid_array[by][bx];
if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
{
static void cave_temp_room_aux(POSITION y, POSITION x, bool only_room, bool (*pass_bold)(POSITION, POSITION))
{
grid_type *g_ptr;
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Avoid infinite recursion */
if (g_ptr->info & (CAVE_TEMP)) return;
if (p_ptr->special_defense & NINJA_S_STEALTH)
{
- if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+ if (current_floor->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
}
}
tx = p_ptr->x + ddx[dir];
ty = p_ptr->y + ddy[dir];
}
- g_ptr = &grid_array[ty][tx];
+ g_ptr = ¤t_floor->grid_array[ty][tx];
if (p_ptr->anti_tele)
{
ty = target_row;
}
- if (in_bounds(ty, tx)) tm_idx = grid_array[ty][tx].m_idx;
+ if (in_bounds(ty, tx)) tm_idx = current_floor->grid_array[ty][tx].m_idx;
path_n = project_path(path_g, project_length, p_ptr->y, p_ptr->x, ty, tx, PROJECT_STOP | PROJECT_KILL);
project_length = 0;
int ny = GRID_Y(path_g[i]);
int nx = GRID_X(path_g[i]);
- if (cave_empty_bold(ny, nx) && player_can_enter(grid_array[ny][nx].feat, 0))
+ if (cave_empty_bold(ny, nx) && player_can_enter(current_floor->grid_array[ny][nx].feat, 0))
{
ty = ny;
tx = nx;
continue;
}
- if (!grid_array[ny][nx].m_idx)
+ if (!current_floor->grid_array[ny][nx].m_idx)
{
if (tm_idx)
{
/* Move player before updating the monster */
if (!player_bold(ty, tx)) teleport_player_to(ty, tx, TELEPORT_NONMAGICAL);
- update_monster(grid_array[ny][nx].m_idx, TRUE);
+ update_monster(current_floor->grid_array[ny][nx].m_idx, TRUE);
/* Found a monster */
- m_ptr = &m_list[grid_array[ny][nx].m_idx];
+ m_ptr = &m_list[current_floor->grid_array[ny][nx].m_idx];
- if (tm_idx != grid_array[ny][nx].m_idx)
+ if (tm_idx != current_floor->grid_array[ny][nx].m_idx)
{
#ifdef JP
msg_format("%s%sが立ちふさがっている!", tm_idx ? "別の" : "", m_ptr->ml ? "モンスター" : "何か");
{
for (y = 0; y < cur_hgt; y++)
{
- if (is_mirror_grid(&grid_array[y][x]))
+ if (is_mirror_grid(¤t_floor->grid_array[y][x]))
{
remove_mirror(y, x);
if (explode)
if (!cave_have_flag_bold(ny, nx, FF_PROJECT)) break;
/* Stopped by monsters */
- if ((dir != 5) && grid_array[ny][nx].m_idx != 0) break;
+ if ((dir != 5) && current_floor->grid_array[ny][nx].m_idx != 0) break;
/* Save the new location */
x = nx;
if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
stop_mouth();
if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (grid_array[y][x].m_idx)
+ if (current_floor->grid_array[y][x].m_idx)
{
py_attack(y, x, 0);
if (randint0(p_ptr->skill_dis) < 7)
}
else
{
- grid_type *g_ptr = &grid_array[creature_ptr->y][creature_ptr->x];
+ grid_type *g_ptr = ¤t_floor->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) ||
if (!get_rep_dir(&dir, FALSE)) return FALSE;
y = creature_ptr->y + ddy[dir];
x = creature_ptr->x + ddx[dir];
- if (grid_array[y][x].m_idx)
+ if (current_floor->grid_array[y][x].m_idx)
{
if (one_in_(3))
msg_print(_("あーたたたたたたたたたたたたたたたたたたたたたた!!!",
"Oraoraoraoraoraoraoraoraoraoraoraoraoraoraoraoraora!!!!"));
py_attack(y, x, 0);
- if (grid_array[y][x].m_idx)
+ if (current_floor->grid_array[y][x].m_idx)
{
handle_stuff();
py_attack(y, x, 0);
msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
return FALSE;
}
- if (is_mirror_grid(&grid_array[creature_ptr->y][creature_ptr->x]))
+ if (is_mirror_grid(¤t_floor->grid_array[creature_ptr->y][creature_ptr->x]))
{
msg_print(_("少し頭がハッキリした。", "You feel your head clear a little."));
dir = randint0(8);
y = creature_ptr->y + ddy_ddd[dir];
x = creature_ptr->x + ddx_ddd[dir];
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Hack -- attack monsters */
if (g_ptr->m_idx)
/* No teleporting into vaults and such */
if (!(p_ptr->inside_quest || p_ptr->inside_arena))
- if (grid_array[ny][nx].info & CAVE_ICKY) continue;
+ if (current_floor->grid_array[ny][nx].info & CAVE_ICKY) continue;
/* This grid looks good */
look = FALSE;
sound(SOUND_TPOTHER);
/* Update the old location */
- grid_array[oy][ox].m_idx = 0;
+ current_floor->grid_array[oy][ox].m_idx = 0;
/* Update the new location */
- grid_array[ny][nx].m_idx = m_idx;
+ current_floor->grid_array[ny][nx].m_idx = m_idx;
/* Move the monster */
m_ptr->fy = ny;
if (!cave_monster_teleportable_bold(m_idx, ny, nx, mode)) continue;
/* No teleporting into vaults and such */
- /* if (grid_array[ny][nx].info & (CAVE_ICKY)) continue; */
+ /* if (current_floor->grid_array[ny][nx].info & (CAVE_ICKY)) continue; */
/* This grid looks good */
look = FALSE;
sound(SOUND_TPOTHER);
/* Update the old location */
- grid_array[oy][ox].m_idx = 0;
+ current_floor->grid_array[oy][ox].m_idx = 0;
/* Update the new location */
- grid_array[ny][nx].m_idx = m_idx;
+ current_floor->grid_array[ny][nx].m_idx = m_idx;
/* Move the monster */
m_ptr->fy = ny;
{
for (yy = -1; yy < 2; yy++)
{
- MONSTER_IDX tmp_m_idx = grid_array[oy+yy][ox+xx].m_idx;
+ MONSTER_IDX tmp_m_idx = current_floor->grid_array[oy+yy][ox+xx].m_idx;
/* A monster except your mount may follow */
if (tmp_m_idx && (p_ptr->riding != tmp_m_idx))
{
for (yy = -1; yy < 2; yy++)
{
- MONSTER_IDX tmp_m_idx = grid_array[oy+yy][ox+xx].m_idx;
+ MONSTER_IDX tmp_m_idx = current_floor->grid_array[oy+yy][ox+xx].m_idx;
/* A monster except your mount or caster may follow */
if (tmp_m_idx && (p_ptr->riding != tmp_m_idx) && (m_idx != tmp_m_idx))
}
/* Accept any grid when wizard mode */
- if (p_ptr->wizard && !(mode & TELEPORT_PASSIVE) && (!grid_array[y][x].m_idx || (grid_array[y][x].m_idx == p_ptr->riding))) break;
+ if (p_ptr->wizard && !(mode & TELEPORT_PASSIVE) && (!current_floor->grid_array[y][x].m_idx || (current_floor->grid_array[y][x].m_idx == p_ptr->riding))) break;
/* Accept teleportable floor grids */
if (cave_player_teleportable_bold(y, x, mode)) break;
GAME_TEXT m_name[MAX_NLEN];
if (!target_set(TARGET_KILL)) return FALSE;
- target_m_idx = grid_array[target_row][target_col].m_idx;
+ target_m_idx = current_floor->grid_array[target_row][target_col].m_idx;
if (!target_m_idx) return TRUE;
if (!player_has_los_bold(target_row, target_col)) return TRUE;
if (!projectable(creature_ptr->y, creature_ptr->x, target_row, target_col)) return TRUE;
{
for (x = 1; x < cur_wid - 1; x++)
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Seeing true feature code (ignore mimic) */
f_ptr = &f_info[g_ptr->feat];
/* Special boundary walls -- Top and bottom */
for (x = 0; x < cur_wid; x++)
{
- g_ptr = &grid_array[0][x];
+ g_ptr = ¤t_floor->grid_array[0][x];
f_ptr = &f_info[g_ptr->mimic];
/* Lose room and vault */
if (!have_flag(f_info[g_ptr->mimic].flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK);
}
- g_ptr = &grid_array[cur_hgt - 1][x];
+ g_ptr = ¤t_floor->grid_array[cur_hgt - 1][x];
f_ptr = &f_info[g_ptr->mimic];
/* Lose room and vault */
/* Special boundary walls -- Left and right */
for (y = 1; y < (cur_hgt - 1); y++)
{
- g_ptr = &grid_array[y][0];
+ g_ptr = ¤t_floor->grid_array[y][0];
f_ptr = &f_info[g_ptr->mimic];
/* Lose room and vault */
if (!have_flag(f_info[g_ptr->mimic].flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK);
}
- g_ptr = &grid_array[y][cur_wid - 1];
+ g_ptr = ¤t_floor->grid_array[y][cur_wid - 1];
f_ptr = &f_info[g_ptr->mimic];
/* Lose room and vault */
for (i = 0; i < 9; i++)
{
- g_ptr = &grid_array[p_ptr->y + ddy_ddd[i]][p_ptr->x + ddx_ddd[i]];
+ g_ptr = ¤t_floor->grid_array[p_ptr->y + ddy_ddd[i]][p_ptr->x + ddx_ddd[i]];
if (!cave_have_flag_grid(g_ptr, FF_PROJECT))
{
GAME_TEXT o_name[MAX_NLEN];
/* Check to see if an object is already there */
- if (grid_array[p_ptr->y][p_ptr->x].o_idx)
+ if (current_floor->grid_array[p_ptr->y][p_ptr->x].o_idx)
{
msg_print(_("自分の足の下にある物は取れません。", "You can't fetch when you're already standing on something."));
return;
return;
}
- g_ptr = &grid_array[ty][tx];
+ g_ptr = ¤t_floor->grid_array[ty][tx];
/* We need an item to fetch */
if (!g_ptr->o_idx)
{
ty += ddy[dir];
tx += ddx[dir];
- g_ptr = &grid_array[ty][tx];
+ g_ptr = ¤t_floor->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;
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 */
+ current_floor->grid_array[p_ptr->y][p_ptr->x].o_idx = i; /* 'move' it */
o_ptr->next_o_idx = 0;
o_ptr->iy = p_ptr->y;
}
/* Create a glyph */
- grid_array[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
- grid_array[p_ptr->y][p_ptr->x].mimic = feat_glyph;
+ current_floor->grid_array[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
+ current_floor->grid_array[p_ptr->y][p_ptr->x].mimic = feat_glyph;
note_spot(p_ptr->y, p_ptr->x);
lite_spot(p_ptr->y, p_ptr->x);
}
/* Create a mirror */
- grid_array[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
- grid_array[p_ptr->y][p_ptr->x].mimic = feat_mirror;
+ current_floor->grid_array[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
+ current_floor->grid_array[p_ptr->y][p_ptr->x].mimic = feat_mirror;
/* Turn on the light */
- grid_array[p_ptr->y][p_ptr->x].info |= CAVE_GLOW;
+ current_floor->grid_array[p_ptr->y][p_ptr->x].info |= CAVE_GLOW;
note_spot(p_ptr->y, p_ptr->x);
lite_spot(p_ptr->y, p_ptr->x);
}
/* Create a glyph */
- grid_array[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
- grid_array[p_ptr->y][p_ptr->x].mimic = feat_explosive_rune;
+ current_floor->grid_array[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
+ current_floor->grid_array[p_ptr->y][p_ptr->x].mimic = feat_explosive_rune;
note_spot(p_ptr->y, p_ptr->x);
lite_spot(p_ptr->y, p_ptr->x);
*/
bool polymorph_monster(POSITION y, POSITION x)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
monster_type *m_ptr = &m_list[g_ptr->m_idx];
bool polymorphed = FALSE;
MONRACE_IDX new_r_idx;
{
y = p_ptr->y + ddy_ddd[dir];
x = p_ptr->x + ddx_ddd[dir];
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
m_ptr = &m_list[g_ptr->m_idx];
/* Hack -- attack monsters */
if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
f_ptr = &f_info[g_ptr->feat];
mimic_f_ptr = &f_info[get_feat_mimic(g_ptr)];
x = p_ptr->x + ddx[dir];
dam = damroll(8 + ((plev - 5) / 4) + boost / 12, 8);
fire_beam(GF_MISSILE, dir, dam);
- if (grid_array[y][x].m_idx)
+ if (current_floor->grid_array[y][x].m_idx)
{
int i;
POSITION ty = y, tx = x;
POSITION oy = y, ox = x;
- MONSTER_IDX m_idx = grid_array[y][x].m_idx;
+ MONSTER_IDX m_idx = current_floor->grid_array[y][x].m_idx;
monster_type *m_ptr = &m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
GAME_TEXT m_name[MAX_NLEN];
if ((ty != oy) || (tx != ox))
{
msg_format(_("%sを吹き飛ばした!", "You blow %s away!"), m_name);
- grid_array[oy][ox].m_idx = 0;
- grid_array[ty][tx].m_idx = m_idx;
+ current_floor->grid_array[oy][ox].m_idx = 0;
+ current_floor->grid_array[ty][tx].m_idx = m_idx;
m_ptr->fy = ty;
m_ptr->fx = tx;
void blood_curse_to_enemy(MONSTER_IDX m_idx)
{
monster_type *m_ptr = &m_list[m_idx];
- grid_type *g_ptr = &grid_array[m_ptr->fy][m_ptr->fx];
+ grid_type *g_ptr = ¤t_floor->grid_array[m_ptr->fy][m_ptr->fx];
BIT_FLAGS curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
int count = 0;
do
store_bottom = MIN_STOCK + xtra_stock;
/* Access the player grid */
- g_ptr = &grid_array[p_ptr->y][p_ptr->x];
+ g_ptr = ¤t_floor->grid_array[p_ptr->y][p_ptr->x];
/* Verify a store */
if (!cave_have_flag_grid(g_ptr, FF_STORE))
*/
void disclose_grid(POSITION y, POSITION x)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
if (cave_have_flag_grid(g_ptr, FF_SECRET))
{
*/
void place_trap(POSITION y, POSITION x)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
/* Paranoia -- verify location */
if (!in_bounds(y, x)) return;
{
int i, num, dam;
POSITION x = p_ptr->x, y = p_ptr->y;
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->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");
/*
* A single "grid" in a Cave
*
- * Note that several aspects of the code restrict the actual grid_array
+ * Note that several aspects of the code restrict the actual current_floor->grid_array
* to a max size of 256 by 256. In partcular, locations are often
* saved as bytes, limiting each coordinate to the 0-255 range.
*
struct grid_type
{
- BIT_FLAGS info; /* Hack -- grid_array flags */
+ BIT_FLAGS info; /* Hack -- current_floor->grid_array flags */
FEAT_IDX feat; /* Hack -- feature type */
OBJECT_IDX o_idx; /* Object in this grid */
MONSTER_IDX m_idx; /* Monster in this grid */
- /*! 地形の特別な情報を保存する / Special grid_array info
+ /*! 地形の特別な情報を保存する / Special current_floor->grid_array info
* 具体的な使用一覧はクエスト行き階段の移行先クエストID、
* 各ダンジョン入口の移行先ダンジョンID、
*
int type;
concptr name;
} dragonbreath_type;
+
+typedef struct {
+ grid_type *grid_array[MAX_HGT];
+} floor_type;
\ No newline at end of file
char savefile[1024];
char savefile_base[40];
-POSITION_IDX lite_n; //!< Array of grids lit by player lite (see "grid_array.c")
+POSITION_IDX lite_n; //!< Array of grids lit by player lite (see "current_floor->grid_array.c")
POSITION lite_y[LITE_MAX];
POSITION lite_x[LITE_MAX];
-POSITION_IDX mon_lite_n; //!< Array of grids lit by player lite (see "grid_array.c")
+POSITION_IDX mon_lite_n; //!< Array of grids lit by player lite (see "current_floor->grid_array.c")
POSITION mon_lite_y[MON_LITE_MAX];
POSITION mon_lite_x[MON_LITE_MAX];
-POSITION_IDX view_n; //!< Array of grids viewable to the player (see "grid_array.c")
+POSITION_IDX view_n; //!< Array of grids viewable to the player (see "current_floor->grid_array.c")
POSITION view_y[VIEW_MAX];
POSITION view_x[VIEW_MAX];
-POSITION_IDX temp_n; //!< Array of grids for use by various functions (see "grid_array.c")
+POSITION_IDX temp_n; //!< Array of grids for use by various functions (see "current_floor->grid_array.c")
POSITION temp_y[TEMP_MAX];
POSITION temp_x[TEMP_MAX];
-POSITION_IDX redraw_n = 0; //!< Array of grids for delayed visual updating (see "grid_array.c")
+POSITION_IDX redraw_n = 0; //!< Array of grids for delayed visual updating (see "current_floor->grid_array.c")
POSITION redraw_y[REDRAW_MAX];
POSITION redraw_x[REDRAW_MAX];
/*
- * The array of "grid_array grids" [MAX_WID][MAX_HGT].
+ * The array of "current_floor->grid_array grids" [MAX_WID][MAX_HGT].
* Not completely allocated, that would be inefficient
* Not completely hardcoded, that would overflow memory
*/
-grid_type *grid_array[MAX_HGT];
+floor_type floor;
+floor_type *current_floor = &floor;
+
/*
int i;
for(i=0;i<temp_n;i++){
- grid_type* g_ptr = &grid_array[temp_y[i]][temp_x[i]];
+ grid_type* g_ptr = ¤t_floor->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 (avg > depth_max) avg = depth_max;
/* Set the new value. */
- grid_array[ymid][xmid].feat = (FEAT_IDX)avg;
+ current_floor->grid_array[ymid][xmid].feat = (FEAT_IDX)avg;
}
if (avg > depth_max) avg = depth_max;
/* Set the new value. */
- grid_array[ymid][xmid].feat = (FEAT_IDX)avg;
+ current_floor->grid_array[ymid][xmid].feat = (FEAT_IDX)avg;
}
/* Are we done? */
if (x1 + 1 == x2) return;
- perturb_point_mid(grid_array[y1][x1].feat, grid_array[y2][x1].feat, grid_array[y1][x2].feat,
- grid_array[y2][x2].feat, xmid, ymid, rough, depth_max);
+ perturb_point_mid(current_floor->grid_array[y1][x1].feat, current_floor->grid_array[y2][x1].feat, current_floor->grid_array[y1][x2].feat,
+ current_floor->grid_array[y2][x2].feat, xmid, ymid, rough, depth_max);
- perturb_point_end(grid_array[y1][x1].feat, grid_array[y1][x2].feat, grid_array[ymid][xmid].feat,
+ perturb_point_end(current_floor->grid_array[y1][x1].feat, current_floor->grid_array[y1][x2].feat, current_floor->grid_array[ymid][xmid].feat,
xmid, y1, rough, depth_max);
- perturb_point_end(grid_array[y1][x2].feat, grid_array[y2][x2].feat, grid_array[ymid][xmid].feat,
+ perturb_point_end(current_floor->grid_array[y1][x2].feat, current_floor->grid_array[y2][x2].feat, current_floor->grid_array[ymid][xmid].feat,
x2, ymid, rough, depth_max);
- perturb_point_end(grid_array[y2][x2].feat, grid_array[y2][x1].feat, grid_array[ymid][xmid].feat,
+ perturb_point_end(current_floor->grid_array[y2][x2].feat, current_floor->grid_array[y2][x1].feat, current_floor->grid_array[ymid][xmid].feat,
xmid, y2, rough, depth_max);
- perturb_point_end(grid_array[y2][x1].feat, grid_array[y1][x1].feat, grid_array[ymid][xmid].feat,
+ perturb_point_end(current_floor->grid_array[y2][x1].feat, current_floor->grid_array[y1][x1].feat, current_floor->grid_array[ymid][xmid].feat,
x1, ymid, rough, depth_max);
{
for (x1 = 0; x1 < MAX_WID; x1++)
{
- grid_array[y1][x1].feat = feat_permanent;
+ current_floor->grid_array[y1][x1].feat = feat_permanent;
}
}
{
for (x1 = 0; x1 < MAX_WID; x1++)
{
- grid_array[y1][x1].feat = table_size / 2;
+ current_floor->grid_array[y1][x1].feat = table_size / 2;
}
}
}
* ToDo: calculate the medium height of the adjacent
* terrains for every corner.
*/
- grid_array[1][1].feat = (s16b)randint0(table_size);
- grid_array[MAX_HGT-2][1].feat = (s16b)randint0(table_size);
- grid_array[1][MAX_WID-2].feat = (s16b)randint0(table_size);
- grid_array[MAX_HGT-2][MAX_WID-2].feat = (s16b)randint0(table_size);
+ current_floor->grid_array[1][1].feat = (s16b)randint0(table_size);
+ current_floor->grid_array[MAX_HGT-2][1].feat = (s16b)randint0(table_size);
+ current_floor->grid_array[1][MAX_WID-2].feat = (s16b)randint0(table_size);
+ current_floor->grid_array[MAX_HGT-2][MAX_WID-2].feat = (s16b)randint0(table_size);
if (!corner)
{
/* Hack -- preserve four corners */
- s16b north_west = grid_array[1][1].feat;
- s16b south_west = grid_array[MAX_HGT - 2][1].feat;
- s16b north_east = grid_array[1][MAX_WID - 2].feat;
- s16b south_east = grid_array[MAX_HGT - 2][MAX_WID - 2].feat;
+ s16b north_west = current_floor->grid_array[1][1].feat;
+ s16b south_west = current_floor->grid_array[MAX_HGT - 2][1].feat;
+ s16b north_east = current_floor->grid_array[1][MAX_WID - 2].feat;
+ s16b south_east = current_floor->grid_array[MAX_HGT - 2][MAX_WID - 2].feat;
/* x1, y1, x2, y2, num_depths, roughness */
plasma_recursive(1, 1, MAX_WID-2, MAX_HGT-2, table_size-1, roughness);
/* Hack -- copyback four corners */
- grid_array[1][1].feat = north_west;
- grid_array[MAX_HGT - 2][1].feat = south_west;
- grid_array[1][MAX_WID - 2].feat = north_east;
- grid_array[MAX_HGT - 2][MAX_WID - 2].feat = south_east;
+ current_floor->grid_array[1][1].feat = north_west;
+ current_floor->grid_array[MAX_HGT - 2][1].feat = south_west;
+ current_floor->grid_array[1][MAX_WID - 2].feat = north_east;
+ current_floor->grid_array[MAX_HGT - 2][MAX_WID - 2].feat = south_east;
for (y1 = 1; y1 < MAX_HGT - 1; y1++)
{
for (x1 = 1; x1 < MAX_WID - 1; x1++)
{
- grid_array[y1][x1].feat = terrain_table[terrain][grid_array[y1][x1].feat];
+ current_floor->grid_array[y1][x1].feat = terrain_table[terrain][current_floor->grid_array[y1][x1].feat];
}
}
}
else /* Hack -- only four corners */
{
- grid_array[1][1].feat = terrain_table[terrain][grid_array[1][1].feat];
- grid_array[MAX_HGT - 2][1].feat = terrain_table[terrain][grid_array[MAX_HGT - 2][1].feat];
- grid_array[1][MAX_WID - 2].feat = terrain_table[terrain][grid_array[1][MAX_WID - 2].feat];
- grid_array[MAX_HGT - 2][MAX_WID - 2].feat = terrain_table[terrain][grid_array[MAX_HGT - 2][MAX_WID - 2].feat];
+ current_floor->grid_array[1][1].feat = terrain_table[terrain][current_floor->grid_array[1][1].feat];
+ current_floor->grid_array[MAX_HGT - 2][1].feat = terrain_table[terrain][current_floor->grid_array[MAX_HGT - 2][1].feat];
+ current_floor->grid_array[1][MAX_WID - 2].feat = terrain_table[terrain][current_floor->grid_array[1][MAX_WID - 2].feat];
+ current_floor->grid_array[MAX_HGT - 2][MAX_WID - 2].feat = terrain_table[terrain][current_floor->grid_array[MAX_HGT - 2][MAX_WID - 2].feat];
}
/* Hack -- Restore the RNG state */
*/
if (wilderness[y][x].road)
{
- grid_array[MAX_HGT/2][MAX_WID/2].feat = feat_floor;
+ current_floor->grid_array[MAX_HGT/2][MAX_WID/2].feat = feat_floor;
if (wilderness[y-1][x].road)
{
for (y1 = 1; y1 < MAX_HGT/2; y1++)
{
x1 = MAX_WID/2;
- grid_array[y1][x1].feat = feat_floor;
+ current_floor->grid_array[y1][x1].feat = feat_floor;
}
}
for (y1 = MAX_HGT/2; y1 < MAX_HGT - 1; y1++)
{
x1 = MAX_WID/2;
- grid_array[y1][x1].feat = feat_floor;
+ current_floor->grid_array[y1][x1].feat = feat_floor;
}
}
for (x1 = MAX_WID/2; x1 < MAX_WID - 1; x1++)
{
y1 = MAX_HGT/2;
- grid_array[y1][x1].feat = feat_floor;
+ current_floor->grid_array[y1][x1].feat = feat_floor;
}
}
for (x1 = 1; x1 < MAX_WID/2; x1++)
{
y1 = MAX_HGT/2;
- grid_array[y1][x1].feat = feat_floor;
+ current_floor->grid_array[y1][x1].feat = feat_floor;
}
}
}
dy = rand_range(6, cur_hgt - 6);
dx = rand_range(6, cur_wid - 6);
- grid_array[dy][dx].feat = feat_entrance;
- grid_array[dy][dx].special = wilderness[y][x].entrance;
+ current_floor->grid_array[dy][dx].feat = feat_entrance;
+ current_floor->grid_array[dy][dx].special = wilderness[y][x].entrance;
/* Hack -- Restore the RNG state */
Rand_state_restore(state_backup);
for (i = 1; i < MAX_WID - 1; i++)
{
- border.north[i] = grid_array[MAX_HGT - 2][i].feat;
+ border.north[i] = current_floor->grid_array[MAX_HGT - 2][i].feat;
}
/* South border */
for (i = 1; i < MAX_WID - 1; i++)
{
- border.south[i] = grid_array[1][i].feat;
+ border.south[i] = current_floor->grid_array[1][i].feat;
}
/* West border */
for (i = 1; i < MAX_HGT - 1; i++)
{
- border.west[i] = grid_array[i][MAX_WID - 2].feat;
+ border.west[i] = current_floor->grid_array[i][MAX_WID - 2].feat;
}
/* East border */
for (i = 1; i < MAX_HGT - 1; i++)
{
- border.east[i] = grid_array[i][1].feat;
+ border.east[i] = current_floor->grid_array[i][1].feat;
}
/* North west corner */
generate_area(y - 1, x - 1, FALSE, TRUE);
- border.north_west = grid_array[MAX_HGT - 2][MAX_WID - 2].feat;
+ border.north_west = current_floor->grid_array[MAX_HGT - 2][MAX_WID - 2].feat;
/* North east corner */
generate_area(y - 1, x + 1, FALSE, TRUE);
- border.north_east = grid_array[MAX_HGT - 2][1].feat;
+ border.north_east = current_floor->grid_array[MAX_HGT - 2][1].feat;
/* South west corner */
generate_area(y + 1, x - 1, FALSE, TRUE);
- border.south_west = grid_array[1][MAX_WID - 2].feat;
+ border.south_west = current_floor->grid_array[1][MAX_WID - 2].feat;
/* South east corner */
generate_area(y + 1, x + 1, FALSE, TRUE);
- border.south_east = grid_array[1][1].feat;
+ border.south_east = current_floor->grid_array[1][1].feat;
/* Create terrain of the current area */
/* Special boundary walls -- North */
for (i = 0; i < MAX_WID; i++)
{
- grid_array[0][i].feat = feat_permanent;
- grid_array[0][i].mimic = border.north[i];
+ current_floor->grid_array[0][i].feat = feat_permanent;
+ current_floor->grid_array[0][i].mimic = border.north[i];
}
/* Special boundary walls -- South */
for (i = 0; i < MAX_WID; i++)
{
- grid_array[MAX_HGT - 1][i].feat = feat_permanent;
- grid_array[MAX_HGT - 1][i].mimic = border.south[i];
+ current_floor->grid_array[MAX_HGT - 1][i].feat = feat_permanent;
+ current_floor->grid_array[MAX_HGT - 1][i].mimic = border.south[i];
}
/* Special boundary walls -- West */
for (i = 0; i < MAX_HGT; i++)
{
- grid_array[i][0].feat = feat_permanent;
- grid_array[i][0].mimic = border.west[i];
+ current_floor->grid_array[i][0].feat = feat_permanent;
+ current_floor->grid_array[i][0].mimic = border.west[i];
}
/* Special boundary walls -- East */
for (i = 0; i < MAX_HGT; i++)
{
- grid_array[i][MAX_WID - 1].feat = feat_permanent;
- grid_array[i][MAX_WID - 1].mimic = border.east[i];
+ current_floor->grid_array[i][MAX_WID - 1].feat = feat_permanent;
+ current_floor->grid_array[i][MAX_WID - 1].mimic = border.east[i];
}
/* North west corner */
- grid_array[0][0].mimic = border.north_west;
+ current_floor->grid_array[0][0].mimic = border.north_west;
/* North east corner */
- grid_array[0][MAX_WID - 1].mimic = border.north_east;
+ current_floor->grid_array[0][MAX_WID - 1].mimic = border.north_east;
/* South west corner */
- grid_array[MAX_HGT - 1][0].mimic = border.south_west;
+ current_floor->grid_array[MAX_HGT - 1][0].mimic = border.south_west;
/* South east corner */
- grid_array[MAX_HGT - 1][MAX_WID - 1].mimic = border.south_east;
+ current_floor->grid_array[MAX_HGT - 1][MAX_WID - 1].mimic = border.south_east;
/* Light up or darken the area */
for (y = 0; y < cur_hgt; y++)
{
for (x = 0; x < cur_wid; x++)
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
if (is_daytime())
{
{
for (x = 0; x < cur_wid; x++)
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Seeing true feature code (ignore mimic) */
f_ptr = &f_info[g_ptr->feat];
{
for (x = 0; x < cur_wid; x++)
{
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
if (cave_have_flag_grid(g_ptr, FF_ENTRANCE))
{
for (i = 0; i < MAX_WID; i++)
for (j = 0; j < MAX_HGT; j++)
{
- grid_array[j][i].feat = feat_permanent;
+ current_floor->grid_array[j][i].feat = feat_permanent;
}
/* Init the wilderness */
{
if (wilderness[j][i].town && (wilderness[j][i].town != NO_TOWN))
{
- grid_array[j][i].feat = (s16b)feat_town;
- grid_array[j][i].special = (s16b)wilderness[j][i].town;
+ current_floor->grid_array[j][i].feat = (s16b)feat_town;
+ current_floor->grid_array[j][i].special = (s16b)wilderness[j][i].town;
}
- else if (wilderness[j][i].road) grid_array[j][i].feat = feat_floor;
+ else if (wilderness[j][i].road) current_floor->grid_array[j][i].feat = feat_floor;
else if (wilderness[j][i].entrance && (p_ptr->total_winner || !(d_info[wilderness[j][i].entrance].flags1 & DF1_WINNER)))
{
- grid_array[j][i].feat = feat_entrance;
- grid_array[j][i].special = (byte)wilderness[j][i].entrance;
+ current_floor->grid_array[j][i].feat = feat_entrance;
+ current_floor->grid_array[j][i].special = (byte)wilderness[j][i].entrance;
}
- else grid_array[j][i].feat = conv_terrain2feat[wilderness[j][i].terrain];
+ else current_floor->grid_array[j][i].feat = conv_terrain2feat[wilderness[j][i].terrain];
- grid_array[j][i].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor->grid_array[j][i].info |= (CAVE_GLOW | CAVE_MARK);
}
cur_hgt = (s16b) max_wild_y;
if (!tgt_pt(&x, &y)) return;
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Default */
sprintf(tmp_val, "%d", prev_feat);
{
for (x = 0; x < cur_wid; x++)
{
- grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor->grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
}
}
wiz_lite(FALSE);
{
POSITION *x = (POSITION*)(u);
POSITION *y = (POSITION*)(v);
- grid_type *ca_ptr = &grid_array[y[a]][x[a]];
- grid_type *cb_ptr = &grid_array[y[b]][x[b]];
+ grid_type *ca_ptr = ¤t_floor->grid_array[y[a]][x[a]];
+ grid_type *cb_ptr = ¤t_floor->grid_array[y[b]][x[b]];
monster_type *ma_ptr = &m_list[ca_ptr->m_idx];
monster_type *mb_ptr = &m_list[cb_ptr->m_idx];
monster_race *ap_ra_ptr, *ap_rb_ptr;
}
/* An object get higher priority */
- if (grid_array[y[a]][x[a]].o_idx && !grid_array[y[b]][x[b]].o_idx) return TRUE;
- if (!grid_array[y[a]][x[a]].o_idx && grid_array[y[b]][x[b]].o_idx) return FALSE;
+ if (current_floor->grid_array[y[a]][x[a]].o_idx && !current_floor->grid_array[y[b]][x[b]].o_idx) return TRUE;
+ if (!current_floor->grid_array[y[a]][x[a]].o_idx && current_floor->grid_array[y[b]][x[b]].o_idx) return FALSE;
/* Priority from the terrain */
if (f_info[ca_ptr->feat].priority > f_info[cb_ptr->feat].priority) return TRUE;
if (p_ptr->image) return (FALSE);
/* Examine the grid */
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Visible monsters */
if (g_ptr->m_idx)
/* Require "interesting" contents */
if (!target_set_accept(y, x)) continue;
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Require target_able monsters for "TARGET_KILL" */
if ((mode & (TARGET_KILL)) && !target_able(g_ptr->m_idx)) continue;
*/
static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, concptr info)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor->grid_array[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
concptr s1 = "", s2 = "", s3 = "", x_info = "";
bool boring = TRUE;
if (!(mode & TARGET_LOOK)) prt_path(y, x);
/* Access */
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Allow target */
if (target_able(g_ptr->m_idx))
if (!(mode & TARGET_LOOK)) prt_path(y, x);
/* Access */
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Default prompt */
strcpy(info, _("q止 t決 p自 m近 +次 -前", "q,t,p,m,+,-,<dir>"));
if (p_ptr->image) return (FALSE);
/* Examine the grid */
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor->grid_array[y][x];
/* Interesting memorized features */
if (g_ptr->info & (CAVE_MARK))
/* Skip stairs which have defferent distance */
for (; n < temp_n; ++ n)
{
- grid_type *g_ptr = &grid_array[temp_y[n]][temp_x[n]];
+ grid_type *g_ptr = ¤t_floor->grid_array[temp_y[n]][temp_x[n]];
if (cave_have_flag_grid(g_ptr, FF_STAIRS) &&
cave_have_flag_grid(g_ptr, ch == '>' ? FF_MORE : FF_LESS))