#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;
if ((r_ptr->flags3 & (RF3_EVIL | RF3_GOOD)) == (RF3_EVIL | RF3_GOOD)) align = _("善悪", "good&evil");
else if (r_ptr->flags3 & RF3_EVIL) align = _("邪悪", "evil");
else if (r_ptr->flags3 & RF3_GOOD) align = _("善良", "good");
- else if ((m_ptr->sub_align & (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) == (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) _(align = "中立(善悪)", "neutral(good&evil)");
+ else if ((m_ptr->sub_align & (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) == (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) align = _("中立(善悪)", "neutral(good&evil)");
else if (m_ptr->sub_align & SUB_ALIGN_EVIL) align = _("中立(邪悪)", "neutral(evil)");
else if (m_ptr->sub_align & SUB_ALIGN_GOOD) align = _("中立(善良)", "neutral(good)");
else align = _("中立", "neutral");
{
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 */
* @details
* <pre>
*
- * This will current_world_ptr->game_turn some walls into floors and some floors into walls.
+ * This will turn some walls into floors and some floors into walls.
*
* The player will take damage and "jump" into a safe grid if possible,
* otherwise, he will "tunnel" through the rubble instantaneously.
* Note that thus the player and monsters (except eaters of walls and
* passers through walls) will never occupy the same grid as a wall.
* Note that as of now (2.7.8) no monster may occupy a "wall" grid, even
- * for a single current_world_ptr->game_turn, unless that monster can pass_walls or kill_walls.
+ * for a single turn, unless that monster can pass_walls or kill_walls.
* This has allowed massive simplification of the "monster" code.
* </pre>
*/
/* 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
{
GAME_TEXT m_name[MAX_NLEN];
monster_desc(m_name, m_ptr, 0x00);
- msg_format(_("%sは爆破されるのを嫌がり、勝手に自分の世界へと帰った。", "%^s resists to be blasted, and run away."), m_name);
+ msg_format(_("%sは爆破されるのを嫌がり、勝手に自分の世界へと帰った。", "%^s resists being blasted and runs away."), m_name);
delete_monster_idx(i);
continue;
}
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;
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)
{
- msg_print(_("ダンジョンが光を吸収した。", "The darkness of this dungeon absorb your light."));
+ msg_print(_("ダンジョンが光を吸収した。", "The darkness of this dungeon absorbs your light."));
return FALSE;
}
{
BIT_FLAGS flg = PROJECT_GRID | PROJECT_KILL;
- /* Hack -- Message */
if (!p_ptr->blind)
{
msg_print(_("暗闇が辺りを覆った。", "Darkness surrounds you."));
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MELEE)
{
- msg_print(_("なぜか攻撃することができない。", "Something prevent you from attacking."));
+ msg_print(_("なぜか攻撃することができない。", "Something prevents you from attacking."));
return FALSE;
}
bool comvert_hp_to_mp(player_type *creature_ptr)
{
- int gain_sp = take_hit(DAMAGE_USELIFE, creature_ptr->lev, _("HPからMPへの無謀な変換", "thoughtless convertion from HP to SP"), -1) / 5;
+ int gain_sp = take_hit(DAMAGE_USELIFE, creature_ptr->lev, _("HPからMPへの無謀な変換", "thoughtless conversion from HP to SP"), -1) / 5;
if (gain_sp)
{
creature_ptr->csp += gain_sp;
{
if (total_friends)
{
- msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
+ msg_print(_("今はペットを操ることに集中していないと。", "Your pets demand all of your attention."));
return FALSE;
}
if (is_mirror_grid(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x]))
}
else
{
- msg_print(_("鏡の上でないと集中できない!", "Here are not any mirrors!"));
+ msg_print(_("鏡の上でないと集中できない!", "There's no mirror here!"));
}
return TRUE;
}
}
else
{
- msg_format(_("%sに振り落とされた!", "You have thrown off by %s."), m_name);
+ msg_format(_("%sに振り落とされた!", "You have been thrown off by %s."), m_name);
rakuba(1, TRUE);
-
- /* Paranoia */
/* 落馬処理に失敗してもとにかく乗馬解除 */
creature_ptr->riding = 0;
}
{
if (total_friends)
{
- msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
+ msg_print(_("今はペットを操ることに集中していないと。", "Your pets demand all of your attention."));
return FALSE;
}
msg_print(_("少し頭がハッキリした。", "You feel your head clear a little."));
if (total_friends)
{
- msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
+ msg_print(_("今はペットを操ることに集中していないと。", "Your pets demand all of your attention."));
return FALSE;
}
if (creature_ptr->special_defense & KATA_MASK)
{
- msg_print(_("今は構えに集中している。", "You need concentration on your form."));
+ msg_print(_("今は構えに集中している。", "You're already concentrating on your stance."));
return FALSE;
}
msg_print(_("精神を集中して気合いを溜めた。", "You concentrate to charge your power."));