{
OBJECT_IDX this_o_idx, next_o_idx = 0;
grid_type *g_ptr;
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Invisible trap */
if (g_ptr->mimic && is_trap(g_ptr->feat))
for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
- o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[this_o_idx];
next_o_idx = o_ptr->next_o_idx;
if (o_ptr->tval != TV_CHEST) continue;
if (!chest_traps[o_ptr->pval]) continue;
object_type *o_ptr;
- o_ptr = ¤t_floor_ptr->o_list[o_idx];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[o_idx];
#ifdef JP
object_desc(old_name, o_ptr, OD_NAME_ONLY);
*/
void carry(bool pickup)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
- o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[this_o_idx];
#ifdef ALLOW_EASY_SENSE /* TNB */
*/
bool pattern_seq(player_type *creature_ptr, POSITION c_y, POSITION c_x, POSITION n_y, POSITION n_x)
{
- feature_type *cur_f_ptr = &f_info[current_floor_ptr->grid_array[c_y][c_x].feat];
- feature_type *new_f_ptr = &f_info[current_floor_ptr->grid_array[n_y][n_x].feat];
+ feature_type *cur_f_ptr = &f_info[p_ptr->current_floor_ptr->grid_array[c_y][c_x].feat];
+ feature_type *new_f_ptr = &f_info[p_ptr->current_floor_ptr->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 = creature_ptr->y;
POSITION ox = creature_ptr->x;
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[ny][nx];
- grid_type *oc_ptr = ¤t_floor_ptr->grid_array[oy][ox];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[ny][nx];
+ grid_type *oc_ptr = &p_ptr->current_floor_ptr->grid_array[oy][ox];
feature_type *f_ptr = &f_info[g_ptr->feat];
feature_type *of_ptr = &f_info[oc_ptr->feat];
if (om_idx > 0) /* Monster on old spot (or creature_ptr->riding) */
{
- monster_type *om_ptr = ¤t_floor_ptr->m_list[om_idx];
+ monster_type *om_ptr = &p_ptr->current_floor_ptr->m_list[om_idx];
om_ptr->fy = ny;
om_ptr->fx = nx;
update_monster(om_idx, TRUE);
if (nm_idx > 0) /* Monster on new spot */
{
- monster_type *nm_ptr = ¤t_floor_ptr->m_list[nm_idx];
+ monster_type *nm_ptr = &p_ptr->current_floor_ptr->m_list[nm_idx];
nm_ptr->fy = oy;
nm_ptr->fx = ox;
update_monster(nm_idx, TRUE);
if ((!creature_ptr->blind && !no_lite()) || !is_trap(g_ptr->feat)) g_ptr->info &= ~(CAVE_UNSAFE);
/* For get everything when requested hehe I'm *NASTY* */
- if (current_floor_ptr->dun_level && (d_info[creature_ptr->dungeon_idx].flags1 & DF1_FORGET)) wiz_dark();
+ if (p_ptr->current_floor_ptr->dun_level && (d_info[creature_ptr->dungeon_idx].flags1 & DF1_FORGET)) wiz_dark();
if (mpe_mode & MPE_HANDLE_STUFF) handle_stuff();
if (creature_ptr->pclass == CLASS_NINJA)
leave_quest_check();
creature_ptr->inside_quest = g_ptr->special;
- current_floor_ptr->dun_level = 0;
+ p_ptr->current_floor_ptr->dun_level = 0;
creature_ptr->oldpx = 0;
creature_ptr->oldpy = 0;
POSITION x = creature_ptr->x + ddx[dir];
/* Examine the destination */
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
feature_type *f_ptr = &f_info[g_ptr->feat];
monster_type *m_ptr;
- monster_type *riding_m_ptr = ¤t_floor_ptr->m_list[creature_ptr->riding];
+ monster_type *riding_m_ptr = &p_ptr->current_floor_ptr->m_list[creature_ptr->riding];
monster_race *riding_r_ptr = &r_info[creature_ptr->riding ? riding_m_ptr->r_idx : 0];
GAME_TEXT m_name[MAX_NLEN];
bool do_past = FALSE;
/* Exit the area */
- if (!current_floor_ptr->dun_level && !creature_ptr->wild_mode &&
+ if (!p_ptr->current_floor_ptr->dun_level && !creature_ptr->wild_mode &&
((x == 0) || (x == MAX_WID - 1) ||
(y == 0) || (y == MAX_HGT - 1)))
{
{
creature_ptr->wilderness_y--;
creature_ptr->wilderness_x--;
- creature_ptr->oldpy = current_floor_ptr->height - 2;
- creature_ptr->oldpx = current_floor_ptr->width - 2;
+ creature_ptr->oldpy = p_ptr->current_floor_ptr->height - 2;
+ creature_ptr->oldpx = p_ptr->current_floor_ptr->width - 2;
creature_ptr->ambush_flag = FALSE;
}
{
creature_ptr->wilderness_y--;
creature_ptr->wilderness_x++;
- creature_ptr->oldpy = current_floor_ptr->height - 2;
+ creature_ptr->oldpy = p_ptr->current_floor_ptr->height - 2;
creature_ptr->oldpx = 1;
creature_ptr->ambush_flag = FALSE;
}
creature_ptr->wilderness_y++;
creature_ptr->wilderness_x--;
creature_ptr->oldpy = 1;
- creature_ptr->oldpx = current_floor_ptr->width - 2;
+ creature_ptr->oldpx = p_ptr->current_floor_ptr->width - 2;
creature_ptr->ambush_flag = FALSE;
}
else if (y == 0)
{
creature_ptr->wilderness_y--;
- creature_ptr->oldpy = current_floor_ptr->height - 2;
+ creature_ptr->oldpy = p_ptr->current_floor_ptr->height - 2;
creature_ptr->oldpx = x;
creature_ptr->ambush_flag = FALSE;
}
else if (x == 0)
{
creature_ptr->wilderness_x--;
- creature_ptr->oldpx = current_floor_ptr->width - 2;
+ creature_ptr->oldpx = p_ptr->current_floor_ptr->width - 2;
creature_ptr->oldpy = y;
creature_ptr->ambush_flag = FALSE;
}
p_can_enter = FALSE;
}
- m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
if (creature_ptr->inventory_list[INVEN_RARM].name1 == ART_STORMBRINGER) stormbringer = TRUE;
if (creature_ptr->inventory_list[INVEN_LARM].name1 == ART_STORMBRINGER) stormbringer = TRUE;
py_attack(p_ptr, y, x, 0);
oktomove = FALSE;
}
- else if (monster_can_cross_terrain(current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat, r_ptr, 0))
+ else if (monster_can_cross_terrain(p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_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(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name);
+ msg_format(_("%sから上がれない。", "Can't land."), f_name + f_info[get_feat_mimic(&p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name);
free_turn(creature_ptr);
oktomove = FALSE;
disturb(p_ptr, FALSE, TRUE);
if (!in_bounds2(y, x)) return (FALSE);
/* Access grid */
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->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 (current_floor_ptr->grid_array[y][x].info & (CAVE_MARK)) return (FALSE);
+ if (p_ptr->current_floor_ptr->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 && !(current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_IN_DETECT))
+ && p_ptr->dtrap && !(p_ptr->current_floor_ptr->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 (!(current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_UNSAFE))
+ if (!(p_ptr->current_floor_ptr->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 = ¤t_floor_ptr->grid_array[row][col];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[row][col];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(g_ptr);
/* Visible monsters abort running */
if (g_ptr->m_idx)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
/* Visible monster */
if (m_ptr->ml) return (TRUE);
for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
- o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[this_o_idx];
next_o_idx = o_ptr->next_o_idx;
/* Visible object */
/* break run when leaving trap detected region */
if ((disturb_trap_detect || alert_trap_detect)
- && p_ptr->dtrap && !(current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_IN_DETECT))
+ && p_ptr->dtrap && !(p_ptr->current_floor_ptr->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 (!(current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_UNSAFE))
+ if (!(p_ptr->current_floor_ptr->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 = ¤t_floor_ptr->grid_array[row][col];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[row][col];
/* Visible monsters abort running */
if (g_ptr->m_idx)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
/* Visible monster */
if (m_ptr->ml) return (0);
if (!new_dir) return (0);
/* Access newly move grid */
- g_ptr = ¤t_floor_ptr->grid_array[p_ptr->y+ddy[new_dir]][p_ptr->x+ddx[new_dir]];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[p_ptr->y+ddy[new_dir]][p_ptr->x+ddx[new_dir]];
/* Close door abort traveling */
if (!easy_open && is_closed_door(g_ptr->feat)) return (0);
{
POSITION x, y;
/* Check the entire dungeon / Forget the old data */
- for (y = 0; y < current_floor_ptr->height; y++)
+ for (y = 0; y < p_ptr->current_floor_ptr->height; y++)
{
- for (x = 0; x < current_floor_ptr->width; x++)
+ for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
{
travel.cost[y][x] = MAX_SHORT;
*/
static int travel_flow_cost(POSITION y, POSITION x)
{
- feature_type *f_ptr = &f_info[current_floor_ptr->grid_array[y][x].feat];
+ feature_type *f_ptr = &f_info[p_ptr->current_floor_ptr->grid_array[y][x].feat];
int cost = 1;
/* Avoid obstacles (ex. trees) */
}
/* Detected traps and doors */
- if (current_floor_ptr->grid_array[y][x].info & (CAVE_MARK))
+ if (p_ptr->current_floor_ptr->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 = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
feature_type *f_ptr = &f_info[g_ptr->feat];
int old_head = flow_head;
int add_cost = 1;
int cost;
/* Ignore out of bounds */
- if (!in_bounds(y, x)) return;
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x)) return;
/* Ignore unknown grid except in wilderness */
- if (current_floor_ptr->dun_level > 0 && !(g_ptr->info & CAVE_KNOWN)) return;
+ if (p_ptr->current_floor_ptr->dun_level > 0 && !(g_ptr->info & CAVE_KNOWN)) return;
/* 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) && current_floor_ptr->grid_array[y][x].mimic) ||
+ (have_flag(f_ptr->flags, FF_DOOR) && p_ptr->current_floor_ptr->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[current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].feat];
+ feature_type *f_ptr = &f_info[p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].feat];
/* Reset the "queue" */
flow_head = flow_tail = 0;
* @brief トラベル処理のメインルーチン
* @return なし
*/
-void do_cmd_travel(void)
+void do_cmd_travel(player_type *creature_ptr)
{
POSITION x, y;
int i;
}
else if (!tgt_pt(&x, &y)) return;
- if ((x == p_ptr->x) && (y == p_ptr->y))
+ if ((x == creature_ptr->x) && (y == creature_ptr->y))
{
msg_print(_("すでにそこにいます!", "You are already there!!"));
return;
}
- f_ptr = &f_info[current_floor_ptr->grid_array[y][x].feat];
+ f_ptr = &f_info[p_ptr->current_floor_ptr->grid_array[y][x].feat];
- if ((current_floor_ptr->grid_array[y][x].info & CAVE_MARK) &&
+ if ((p_ptr->current_floor_ptr->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) && current_floor_ptr->grid_array[y][x].mimic)))
+ (have_flag(f_ptr->flags, FF_DOOR) && p_ptr->current_floor_ptr->grid_array[y][x].mimic)))
{
msg_print(_("そこには行くことができません!", "You cannot travel there!"));
return;
travel.dir = 0;
/* Decides first direction */
- dx = abs(p_ptr->x - x);
- dy = abs(p_ptr->y - y);
- sx = ((x == p_ptr->x) || (dx < dy)) ? 0 : ((x > p_ptr->x) ? 1 : -1);
- sy = ((y == p_ptr->y) || (dy < dx)) ? 0 : ((y > p_ptr->y) ? 1 : -1);
+ dx = abs(creature_ptr->x - x);
+ dy = abs(creature_ptr->y - y);
+ sx = ((x == creature_ptr->x) || (dx < dy)) ? 0 : ((x > creature_ptr->x) ? 1 : -1);
+ sy = ((y == creature_ptr->y) || (dy < dx)) ? 0 : ((y > creature_ptr->y) ? 1 : -1);
for (i = 1; i <= 9; i++)
{