#include "spells-floor.h"
#include "realm-hex.h"
#include "object-hook.h"
+#include "monster-status.h"
+#include "player-status.h"
/*!
* @brief プレイヤー周辺の地形を感知する
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
-
- /* Skip dead monsters */
- if (!m_ptr->r_idx) continue;
+ if (!monster_is_valid(m_ptr)) continue;
y = m_ptr->fy;
x = m_ptr->fx;
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
- /* Skip dead monsters */
- if (!m_ptr->r_idx) continue;
+ if (!monster_is_valid(m_ptr)) continue;
y = m_ptr->fy;
x = m_ptr->fx;
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
-
- /* Skip dead monsters */
- if (!m_ptr->r_idx) continue;
+ if (!monster_is_valid(m_ptr)) continue;
y = m_ptr->fy;
x = m_ptr->fx;
for (i = 1; i < m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
-
- /* Skip dead monsters */
- if (!m_ptr->r_idx) continue;
+ if (!monster_is_valid(m_ptr)) continue;
y = m_ptr->fy;
x = m_ptr->fx;
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
-
- /* Skip dead monsters */
- if (!m_ptr->r_idx) continue;
+ if (!monster_is_valid(m_ptr)) continue;
y = m_ptr->fy;
x = m_ptr->fx;
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
-
- /* Skip dead monsters */
- if (!m_ptr->r_idx) continue;
+ if (!monster_is_valid(m_ptr)) continue;
y = m_ptr->fy;
x = m_ptr->fx;
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
-
- /* Skip dead monsters */
- if (!m_ptr->r_idx) continue;
+ if (!monster_is_valid(m_ptr)) continue;
y = m_ptr->fy;
x = m_ptr->fx;
BIT_FLAGS flg = PROJECT_JUMP | PROJECT_KILL | PROJECT_HIDE;
bool obvious = FALSE;
-
/* Mark all (nearby) monsters */
for (i = 1; i < m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
-
- /* Paranoia -- Skip dead monsters */
- if (!m_ptr->r_idx) continue;
+ if (!monster_is_valid(m_ptr)) continue;
y = m_ptr->fy;
x = m_ptr->fx;
if (!player_has_los_bold(y, x) || !projectable(p_ptr->y, p_ptr->x, y, x)) continue;
/* Mark the monster */
- m_ptr->mflag |= (MFLAG_TEMP);
+ m_ptr->mflag |= (MFLAG_LOS);
}
/* Affect all marked monsters */
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
/* Skip unmarked monsters */
- if (!(m_ptr->mflag & (MFLAG_TEMP))) continue;
+ if (!(m_ptr->mflag & (MFLAG_LOS))) continue;
/* Remove mark */
- m_ptr->mflag &= ~(MFLAG_TEMP);
+ m_ptr->mflag &= ~(MFLAG_LOS);
y = m_ptr->fy;
x = m_ptr->fx;
for (i = 1; i < m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
-
- /* Paranoia -- Skip dead monsters */
- if (!m_ptr->r_idx) continue;
+ if (!monster_is_valid(m_ptr)) continue;
/* Skip aggravating monster (or player) */
if (i == who) continue;
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
-
- /* Paranoia -- Skip dead monsters */
- if (!m_ptr->r_idx) continue;
+ if (!monster_is_valid(m_ptr)) continue;
/* Skip "wrong" monsters */
if (r_ptr->d_char != typ) continue;
for (i = 1; i < m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
-
- /* Paranoia -- Skip dead monsters */
- if (!m_ptr->r_idx) continue;
+ if (!monster_is_valid(m_ptr)) continue;
/* Skip distant monsters */
if (m_ptr->cdis > MAX_SIGHT) continue;
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
-
- /* Paranoia -- Skip dead monsters */
- if (!m_ptr->r_idx) continue;
+ if (!monster_is_valid(m_ptr)) continue;
if (!(r_ptr->flags3 & RF3_UNDEAD)) continue;
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
-
- /* Paranoia -- Skip dead monsters */
- if (!m_ptr->r_idx) continue;
+ if (!monster_is_valid(m_ptr)) continue;
/* Require line of sight */
if (!player_has_los_bold(m_ptr->fy, m_ptr->fx)) continue;
{
object_type *o_ptr;
o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
-
- /* Acquire next object */
next_o_idx = o_ptr->next_o_idx;
/* Hack -- Preserve unknown artifacts */
/* Check around the player */
for (i = 0; i < 8; i++)
{
- /* Access the location */
y = p_ptr->y + ddy_ddd[i];
x = p_ptr->x + ddx_ddd[i];
{
GAME_TEXT m_name[MAX_NLEN];
monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
-
- /* Get the monster's real name */
- monster_desc(m_name, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
-
+ monster_desc(m_name, m_ptr, MD_WRONGDOER_NAME);
killer = format(_("%sの起こした地震", "an earthquake caused by %s"), m_name);
}
else
int i;
/* Clear them all */
- for (i = 0; i < temp_n; i++)
+ for (i = 0; i < tmp_pos.n; i++)
{
- POSITION y = temp_y[i];
- POSITION x = temp_x[i];
+ POSITION y = tmp_pos.y[i];
+ POSITION x = tmp_pos.x[i];
grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
/* Process affected monsters */
if (g_ptr->m_idx)
{
- int chance = 25;
+ PERCENTAGE chance = 25;
monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
update_monster(g_ptr->m_idx, FALSE);
}
/* None left */
- temp_n = 0;
+ tmp_pos.n = 0;
}
int i;
/* Clear them all */
- for (i = 0; i < temp_n; i++)
+ for (i = 0; i < tmp_pos.n; i++)
{
- POSITION y = temp_y[i];
- POSITION x = temp_x[i];
+ POSITION y = tmp_pos.y[i];
+ POSITION x = tmp_pos.x[i];
int j;
grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
}
/* None left */
- temp_n = 0;
+ tmp_pos.n = 0;
}
/*!
- * @brief 部屋内にある一点の周囲に該当する地形数かいくつあるかをグローバル変数temp_nに返す / Aux function -- see below
+ * @brief 部屋内にある一点の周囲に該当する地形数かいくつあるかをグローバル変数tmp_pos.nに返す / Aux function -- see below
* @param y 部屋内のy座標1点
* @param x 部屋内のx座標1点
* @param only_room 部屋内地形のみをチェック対象にするならば TRUE
}
/* Paranoia -- verify space */
- if (temp_n == TEMP_MAX) return;
+ if (tmp_pos.n == TEMP_MAX) return;
/* Mark the grid as "seen" */
g_ptr->info |= (CAVE_TEMP);
/* Add it to the "seen" set */
- temp_y[temp_n] = y;
- temp_x[temp_n] = x;
- temp_n++;
+ tmp_pos.y[tmp_pos.n] = y;
+ tmp_pos.x[tmp_pos.n] = x;
+ tmp_pos.n++;
}
/*!
}
/*!
- * @brief 部屋内にある一点の周囲がいくつ光を通すかをグローバル変数temp_nに返す / Aux function -- see below
+ * @brief 部屋内にある一点の周囲がいくつ光を通すかをグローバル変数tmp_pos.nに返す / Aux function -- see below
* @param y 指定Y座標
* @param x 指定X座標
* @return なし
/*!
- * @brief 部屋内にある一点の周囲がいくつ射線を通すかをグローバル変数temp_nに返す / Aux function -- see below
+ * @brief 部屋内にある一点の周囲がいくつ射線を通すかをグローバル変数tmp_pos.nに返す / Aux function -- see below
* @param y 指定Y座標
* @param x 指定X座標
* @return なし
cave_temp_lite_room_aux(y1, x1);
/* While grids are in the queue, add their neighbors */
- for (i = 0; i < temp_n; i++)
+ for (i = 0; i < tmp_pos.n; i++)
{
- x = temp_x[i], y = temp_y[i];
+ x = tmp_pos.x[i], y = tmp_pos.y[i];
/* Walls get lit, but stop light */
if (!cave_pass_lite_bold(y, x)) continue;
cave_temp_unlite_room_aux(y1, x1);
/* Spread, breadth first */
- for (i = 0; i < temp_n; i++)
+ for (i = 0; i < tmp_pos.n; i++)
{
- x = temp_x[i], y = temp_y[i];
+ x = tmp_pos.x[i], y = tmp_pos.y[i];
/* Walls get dark, but stop darkness */
if (!cave_pass_dark_bold(y, x)) continue;
{
BIT_FLAGS flg = PROJECT_GRID | PROJECT_KILL;
- /* Hack -- Message */
if (!p_ptr->blind)
{
msg_print(_("暗闇が辺りを覆った。", "Darkness surrounds you."));
{
msg_format(_("%sに振り落とされた!", "You have thrown off by %s."), m_name);
rakuba(1, TRUE);
-
- /* Paranoia */
/* 落馬処理に失敗してもとにかく乗馬解除 */
creature_ptr->riding = 0;
}