if (!target_set(TARGET_KILL)) return FALSE;
m_idx = caster_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx;
if (!m_idx) break;
- if (!player_has_los_bold(target_row, target_col)) break;
+ if (!player_has_los_bold(p_ptr, target_row, target_col)) break;
if (!projectable(caster_ptr->y, caster_ptr->x, target_row, target_col)) break;
dispel_monster_status(m_idx);
break;
if (!target_set(TARGET_KILL)) return FALSE;
if (!caster_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx) break;
- if (!player_has_los_bold(target_row, target_col)) break;
+ if (!player_has_los_bold(p_ptr, target_row, target_col)) break;
if (!projectable(caster_ptr->y, caster_ptr->x, target_row, target_col)) break;
m_ptr = &caster_ptr->current_floor_ptr->m_list[caster_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx];
r_ptr = &r_info[m_ptr->r_idx];
* when you or the pet can see the other.
*/
if (m_ptr->nickname &&
- ((player_has_los_bold(m_ptr->fy, m_ptr->fx) && projectable(p_ptr->y, p_ptr->x, m_ptr->fy, m_ptr->fx)) ||
+ ((player_has_los_bold(p_ptr, m_ptr->fy, m_ptr->fx) && projectable(p_ptr->y, p_ptr->x, m_ptr->fy, m_ptr->fx)) ||
(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))))
{
if (dis > 3) continue;
if (!cave_have_flag_grid(g_ptr, FF_MOVE) && !is_closed_door(g_ptr->feat)) continue;
/* Grid must not be blocked by walls from the character */
- if (!player_has_los_bold(y, x)) continue;
+ if (!player_has_los_bold(p_ptr, y, x)) continue;
/* Note grids that are too far away */
if (scent_adjust[i][j] == -1) continue;
*
* Note the use of comparison to zero to force a "boolean" result
*/
-#define player_has_los_bold(Y,X) \
- (((p_ptr->current_floor_ptr->grid_array[Y][X].info & (CAVE_VIEW)) != 0) || p_ptr->phase_out)
+#define player_has_los_bold(C,Y,X) \
+ ((((C)->current_floor_ptr->grid_array[Y][X].info & (CAVE_VIEW)) != 0) || (C)->phase_out)
/*
if (g_ptr->info & (CAVE_LITE | CAVE_MNLT)) return TRUE;
/* Require line of sight to the grid */
- if (!player_has_los_bold(y, x)) return FALSE;
+ if (!player_has_los_bold(p_ptr, y, x)) return FALSE;
/* Noctovision of Ninja */
if (p_ptr->see_nocto) return TRUE;
/*! 対象座標のマスの照明状態を更新する際の補助処理マクロ */
#define update_local_illumination_aux(Y, X) \
{ \
- if (player_has_los_bold((Y), (X))) \
+ if (player_has_los_bold(p_ptr, (Y), (X))) \
{ \
/* Update the monster */ \
if (p_ptr->current_floor_ptr->grid_array[(Y)][(X)].m_idx) update_monster(p_ptr->current_floor_ptr->grid_array[(Y)][(X)].m_idx, FALSE); \
* grid and maintains an array of all "CAVE_VIEW" grids.
*
* This set of grids is the complete set of all grids within line of sight
- * of the player, allowing the "player_has_los_bold()" macro to work very
+ * of the player, allowing the "player_has_los_bold(p_ptr, )" macro to work very
* quickly.
*
*
if (!target_set(TARGET_KILL)) return FALSE;
m_idx = caster_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx;
if (!m_idx) break;
- if (!player_has_los_bold(target_row, target_col)) break;
+ if (!player_has_los_bold(p_ptr, target_row, target_col)) break;
if (!projectable(caster_ptr->y, caster_ptr->x, target_row, target_col)) break;
dispel_monster_status(m_idx);
break;
m_idx = caster_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx;
if (!m_idx) break;
if (m_idx == caster_ptr->riding) break;
- if (!player_has_los_bold(target_row, target_col)) break;
+ if (!player_has_los_bold(p_ptr, target_row, target_col)) break;
if (!projectable(caster_ptr->y, caster_ptr->x, target_row, target_col)) break;
m_ptr = &caster_ptr->current_floor_ptr->m_list[m_idx];
monster_desc(m_name, m_ptr, 0);
x1 = m_ptr->fx;
/* Hack -- Player can see us, run towards him */
- if (player_has_los_bold(y1, x1) && projectable(p_ptr->y, p_ptr->x, y1, x1)) return (FALSE);
+ if (player_has_los_bold(p_ptr, y1, x1) && projectable(p_ptr->y, p_ptr->x, y1, x1)) return (FALSE);
/* Monster grid */
g_ptr = &p_ptr->current_floor_ptr->grid_array[y1][x1];
if (see_m)
{
if ((r_ptr->flags2 & RF2_CAN_SPEAK) && (m_ptr->r_idx != MON_GRIP) && (m_ptr->r_idx != MON_WOLF) && (m_ptr->r_idx != MON_FANG) &&
- player_has_los_bold(m_ptr->fy, m_ptr->fx) && projectable(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x))
+ player_has_los_bold(p_ptr, m_ptr->fy, m_ptr->fx) && projectable(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x))
{
msg_format(_("%^s「ピンチだ!退却させてもらう!」", "%^s says 'It is the pinch! I will retreat'."), m_name);
}
/* Some monsters can speak */
if ((ap_r_ptr->flags2 & RF2_CAN_SPEAK) && aware &&
one_in_(SPEAK_CHANCE) &&
- player_has_los_bold(oy, ox) &&
+ player_has_los_bold(p_ptr, oy, ox) &&
projectable(oy, ox, p_ptr->y, p_ptr->x))
{
GAME_TEXT m_name[MAX_NLEN];
did_kill_item = TRUE;
/* Describe observable situations */
- if (player_has_los_bold(ny, nx))
+ if (player_has_los_bold(p_ptr, ny, nx))
{
msg_format(_("%^sが%sを破壊した。", "%^s destroys %s."), m_name, o_name);
}
/* Handle "sight" and "aggravation" */
else if ((m_ptr->cdis <= MAX_SIGHT || p_ptr->phase_out) &&
- (player_has_los_bold(fy, fx) || (p_ptr->cursed & TRC_AGGRAVATE)))
+ (player_has_los_bold(p_ptr, fy, fx) || (p_ptr->cursed & TRC_AGGRAVATE)))
{
/* We can "see" or "feel" the player */
test = TRUE;
}
/* Handle "sight" and "aggravation" */
- else if ((m_ptr->cdis <= MAX_SIGHT) && (player_has_los_bold(m_ptr->fy, m_ptr->fx)))
+ else if ((m_ptr->cdis <= MAX_SIGHT) && (player_has_los_bold(p_ptr, m_ptr->fy, m_ptr->fx)))
{
/* We may wake up */
test = TRUE;
p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
current_world_ptr->timewalk_m_idx = 0;
- if (vs_player || (player_has_los_bold(m_ptr->fy, m_ptr->fx) && projectable(p_ptr->y, p_ptr->x, m_ptr->fy, m_ptr->fx)))
+ if (vs_player || (player_has_los_bold(p_ptr, m_ptr->fy, m_ptr->fx) && projectable(p_ptr->y, p_ptr->x, m_ptr->fy, m_ptr->fx)))
{
msg_print(_("「時は動きだす…」", "You feel time flowing around you once more."));
msg_print(NULL);
bool monster_is_valid(monster_type *m_ptr)
{
return (m_ptr->r_idx != 0);
-}
\ No newline at end of file
+}
}
/* Normal line of sight, and not blind */
- if (player_has_los_bold(fy, fx) && !p_ptr->blind)
+ if (player_has_los_bold(p_ptr, fy, fx) && !p_ptr->blind)
{
bool do_invisible = FALSE;
bool do_cold_blood = FALSE;
/* Extract the "see-able-ness" */
bool seen = (!p_ptr->blind && m_ptr->ml);
- bool maneable = player_has_los_bold(m_ptr->fy, m_ptr->fx);
+ bool maneable = player_has_los_bold(p_ptr, m_ptr->fy, m_ptr->fx);
/* Check "projectable" */
bool direct;
u32b f4, f5, f6;
bool see_m = is_seen(m_ptr);
- bool maneable = player_has_los_bold(m_ptr->fy, m_ptr->fx);
+ bool maneable = player_has_los_bold(p_ptr, m_ptr->fy, m_ptr->fx);
bool pet = is_pet(m_ptr);
bool in_no_magic_dungeon = (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && p_ptr->current_floor_ptr->dun_level
if (!target_set(TARGET_KILL)) return FALSE;
m_idx = p_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx;
if (!m_idx) break;
- if (!player_has_los_bold(target_row, target_col)) break;
+ if (!player_has_los_bold(p_ptr, target_row, target_col)) break;
if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
dispel_monster_status(m_idx);
break;
if (!target_set(TARGET_KILL)) return FALSE;
if (!p_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx) break;
- if (!player_has_los_bold(target_row, target_col)) break;
+ if (!player_has_los_bold(p_ptr, target_row, target_col)) break;
if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
m_ptr = &p_ptr->current_floor_ptr->m_list[p_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx];
r_ptr = &r_info[m_ptr->r_idx];
/* Extract the "see-able-ness" */
bool seen = (!p_ptr->blind && m_ptr->ml);
- bool maneable = player_has_los_bold(m_ptr->fy, m_ptr->fx);
+ bool maneable = player_has_los_bold(p_ptr, m_ptr->fy, m_ptr->fx);
return (seen && maneable && !current_world_ptr->timewalk_m_idx);
}
feature_type *f_ptr = &f_info[g_ptr->feat];
bool obvious = FALSE;
- bool known = player_has_los_bold(y, x);
+ bool known = player_has_los_bold(p_ptr, y, x);
who = who ? who : 0;
}
/* Remove "unsafe" flag if player is not blind */
- if (!p_ptr->blind && player_has_los_bold(y, x))
+ if (!p_ptr->blind && player_has_los_bold(p_ptr, y, x))
{
g_ptr->info &= ~(CAVE_UNSAFE);
lite_spot(y, x);
}
/* Remove "unsafe" flag if player is not blind */
- if (!p_ptr->blind && player_has_los_bold(y, x))
+ if (!p_ptr->blind && player_has_los_bold(p_ptr, y, x))
{
g_ptr->info &= ~(CAVE_UNSAFE);
lite_spot(y, x);
OBJECT_IDX this_o_idx, next_o_idx = 0;
bool obvious = FALSE;
- bool known = player_has_los_bold(y, x);
+ bool known = player_has_los_bold(p_ptr, y, x);
BIT_FLAGS flgs[TR_FLAG_SIZE];
if (!blind && !(flg & (PROJECT_HIDE)))
{
/* Only do visuals if the player can "see" the bolt */
- if (panel_contains(y, x) && player_has_los_bold(y, x))
+ if (panel_contains(y, x) && player_has_los_bold(p_ptr, y, x))
{
u16b p;
if (!blind && !(flg & (PROJECT_HIDE)))
{
/* Only do visuals if the player can "see" the bolt */
- if (panel_contains(y, x) && player_has_los_bold(y, x))
+ if (panel_contains(y, x) && player_has_los_bold(p_ptr, y, x))
{
u16b p;
if (!blind && !(flg & (PROJECT_HIDE | PROJECT_FAST)))
{
/* Only do visuals if the player can "see" the bolt */
- if (panel_contains(y, x) && player_has_los_bold(y, x))
+ if (panel_contains(y, x) && player_has_los_bold(p_ptr, y, x))
{
u16b p;
x = gx[i];
/* Only do visuals if the player can "see" the blast */
- if (panel_contains(y, x) && player_has_los_bold(y, x))
+ if (panel_contains(y, x) && player_has_los_bold(p_ptr, y, x))
{
u16b p;
x = gx[i];
/* Hack -- Erase if needed */
- if (panel_contains(y, x) && player_has_los_bold(y, x))
+ if (panel_contains(y, x) && player_has_los_bold(p_ptr, y, x))
{
lite_spot(y, x);
}
if (is_mirror_grid(&p_ptr->current_floor_ptr->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) &&
+ player_has_los_bold(p_ptr, y, x) &&
projectable(p_ptr->y, p_ptr->x, y, x)
) {
mirror_y[mirror_num] = y;
centersign*((point_x[2] - x)*(point_y[0] - y)
- (point_y[2] - y)*(point_x[0] - x)) >= 0)
{
- if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
+ if (player_has_los_bold(p_ptr, y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
/* Visual effects */
if (!(p_ptr->blind)
&& panel_contains(y, x)) {
centersign*((point_x[2] - x)*(point_y[0] - y)
- (point_y[2] - y)*(point_x[0] - x)) >= 0)
{
- if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
+ if (player_has_los_bold(p_ptr, y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
(void)project_f(p_ptr->current_floor_ptr, 0, 0, y, x, dam, GF_MANA);
}
}
centersign*((point_x[2] - x)*(point_y[0] - y)
- (point_y[2] - y)*(point_x[0] - x)) >= 0)
{
- if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
+ if (player_has_los_bold(p_ptr, y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
(void)project_o(0, 0, y, x, dam, GF_MANA);
}
}
centersign*((point_x[2] - x)*(point_y[0] - y)
- (point_y[2] - y)*(point_x[0] - x)) >= 0)
{
- if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
+ if (player_has_los_bold(p_ptr, y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
(void)project_m(0, 0, y, x, dam, GF_MANA,
(PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), TRUE);
}
x = m_ptr->fx;
/* Require line of sight */
- if (!player_has_los_bold(y, x) || !projectable(p_ptr->y, p_ptr->x, y, x)) continue;
+ if (!player_has_los_bold(p_ptr, y, x) || !projectable(p_ptr->y, p_ptr->x, y, x)) continue;
/* Mark the monster */
m_ptr->mflag |= (MFLAG_LOS);
}
/* Speed up monsters in line of sight */
- if (player_has_los_bold(m_ptr->fy, m_ptr->fx))
+ if (player_has_los_bold(p_ptr, m_ptr->fy, m_ptr->fx))
{
if (!is_pet(m_ptr))
{
if (!monster_is_valid(m_ptr)) continue;
/* Require line of sight */
- if (!player_has_los_bold(m_ptr->fy, m_ptr->fx)) continue;
+ if (!player_has_los_bold(p_ptr, m_ptr->fy, m_ptr->fx)) continue;
/* Probe visible monsters */
if (m_ptr->ml)
if (!target_set(TARGET_KILL)) return FALSE;
target_m_idx = p_ptr->current_floor_ptr->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 (!player_has_los_bold(p_ptr, target_row, target_col)) return TRUE;
if (!projectable(creature_ptr->y, creature_ptr->x, target_row, target_col)) return TRUE;
m_ptr = &p_ptr->current_floor_ptr->m_list[target_m_idx];
r_ptr = &r_info[m_ptr->r_idx];
/* We need to see the item */
if (require_los)
{
- if (!player_has_los_bold(ty, tx))
+ if (!player_has_los_bold(p_ptr, ty, tx))
{
msg_print(_("そこはあなたの視界に入っていません。", "You have no direct line of sight to that location."));
return;