#include "spells-floor.h"
#include "realm-hex.h"
#include "object-hook.h"
+#include "monster-status.h"
+#include "player-status.h"
/*!
* @brief プレイヤー周辺の地形を感知する
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
/* Scan the current panel */
- for (y = 1; y < cur_hgt - 1; y++)
+ for (y = 1; y < current_floor_ptr->height - 1; y++)
{
- for (x = 1; x <= cur_wid - 1; x++)
+ for (x = 1; x <= current_floor_ptr->width - 1; x++)
{
int dist = distance(p_ptr->y, p_ptr->x, y, x);
if (dist > range) continue;
- g_ptr = ¤t_floor->grid_array[y][x];
+ g_ptr = ¤t_floor_ptr->grid_array[y][x];
/* Hack -- Safe */
if (flag == FF_TRAP)
/* Scan objects */
for (i = 1; i < o_max; i++)
{
- object_type *o_ptr = &o_list[i];
+ object_type *o_ptr = ¤t_floor_ptr->o_list[i];
/* Skip dead objects */
if (!o_ptr->k_idx) continue;
/* Scan objects */
for (i = 1; i < o_max; i++)
{
- object_type *o_ptr = &o_list[i];
+ object_type *o_ptr = ¤t_floor_ptr->o_list[i];
/* Skip dead objects */
if (!o_ptr->k_idx) continue;
/* Scan all objects */
for (i = 1; i < o_max; i++)
{
- object_type *o_ptr = &o_list[i];
+ object_type *o_ptr = ¤t_floor_ptr->o_list[i];
/* Skip dead objects */
if (!o_ptr->k_idx) continue;
for (i = 1; i < m_max; i++)
{
- monster_type *m_ptr = &m_list[i];
+ 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 = &m_list[i];
+ 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 = &m_list[i];
+ 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 = &m_list[i];
-
- /* Skip dead monsters */
- if (!m_ptr->r_idx) continue;
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
+ 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 = &m_list[i];
+ 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 = &m_list[i];
+ 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 = &m_list[i];
+ 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 = &m_list[i];
-
- /* Paranoia -- Skip dead monsters */
- if (!m_ptr->r_idx) continue;
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
+ 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 */
for (i = 1; i < m_max; i++)
{
- monster_type *m_ptr = &m_list[i];
+ 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;
/* Aggravate everyone nearby */
for (i = 1; i < m_max; i++)
{
- monster_type *m_ptr = &m_list[i];
-
- /* Paranoia -- Skip dead monsters */
- if (!m_ptr->r_idx) continue;
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
+ if (!monster_is_valid(m_ptr)) continue;
/* Skip aggravating monster (or player) */
if (i == who) continue;
bool genocide_aux(MONSTER_IDX m_idx, int power, bool player_cast, int dam_side, concptr spell_name)
{
int msec = delay_factor * delay_factor * delay_factor;
- monster_type *m_ptr = &m_list[m_idx];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
bool resist = FALSE;
if (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) resist = TRUE;
else if (r_ptr->flags7 & RF7_UNIQUE2) resist = TRUE;
else if (m_idx == p_ptr->riding) resist = TRUE;
- else if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle) resist = TRUE;
+ else if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle) resist = TRUE;
else if (player_cast && (r_ptr->level > randint0(power))) resist = TRUE;
else if (player_cast && (m_ptr->mflag2 & MFLAG2_NOGENO)) resist = TRUE;
bool result = FALSE;
/* Prevent genocide in quest levels */
- if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle)
+ if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle)
{
msg_print(_("何も起きないようだ……", "It seems nothing happen here..."));
return (FALSE);
/* Delete the monsters of that "type" */
for (i = 1; i < m_max; i++)
{
- monster_type *m_ptr = &m_list[i];
+ 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;
bool result = FALSE;
/* Prevent mass genocide in quest levels */
- if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle)
+ if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle)
{
return (FALSE);
}
/* Delete the (nearby) monsters */
for (i = 1; i < m_max; i++)
{
- monster_type *m_ptr = &m_list[i];
-
- /* Paranoia -- Skip dead monsters */
- if (!m_ptr->r_idx) continue;
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
+ if (!monster_is_valid(m_ptr)) continue;
/* Skip distant monsters */
if (m_ptr->cdis > MAX_SIGHT) continue;
bool result = FALSE;
/* Prevent mass genocide in quest levels */
- if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle)
+ if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle)
{
return (FALSE);
}
/* Delete the (nearby) monsters */
for (i = 1; i < m_max; i++)
{
- monster_type *m_ptr = &m_list[i];
+ 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;
/* Probe all (nearby) monsters */
for (i = 1; i < m_max; i++)
{
- monster_type *m_ptr = &m_list[i];
+ 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");
bool flag = FALSE;
/* Prevent destruction of quest levels and town */
- if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !dun_level)
+ if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !current_floor_ptr->dun_level)
{
return (FALSE);
}
/* Stay in the circle of death */
if (k > r) continue;
- g_ptr = ¤t_floor->grid_array[y][x];
+ g_ptr = ¤t_floor_ptr->grid_array[y][x];
/* Lose room and vault */
g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
if (g_ptr->m_idx)
{
- monster_type *m_ptr = &m_list[g_ptr->m_idx];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (in_generate) /* In generation */
for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
- o_ptr = &o_list[this_o_idx];
-
- /* Acquire next object */
+ o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
next_o_idx = o_ptr->next_o_idx;
/* Hack -- Preserve unknown artifacts */
/* Stay in the circle of death */
if (k > r) continue;
- g_ptr = ¤t_floor->grid_array[y][x];
+ g_ptr = ¤t_floor_ptr->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 = ¤t_floor->grid_array[yy][xx];
+ cc_ptr = ¤t_floor_ptr->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 (current_floor->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+ if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
}
}
bool map[32][32];
/* Prevent destruction of quest levels and town */
- if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !dun_level)
+ if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !current_floor_ptr->dun_level)
{
return (FALSE);
}
/* Skip distant grids */
if (distance(cy, cx, yy, xx) > r) continue;
- g_ptr = ¤t_floor->grid_array[yy][xx];
+ g_ptr = ¤t_floor_ptr->grid_array[yy][xx];
/* Lose room and vault / Lose light and knowledge */
g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY | CAVE_UNSAFE);
/* 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];
/* Important -- Skip "quake" grids */
if (map[16+y-cy][16+x-cx]) continue;
- if (current_floor->grid_array[y][x].m_idx) continue;
+ if (current_floor_ptr->grid_array[y][x].m_idx) continue;
/* Count "safe" grids */
sn++;
{
case 1:
{
- msg_print(_("ダンジョンの壁が崩れた!", "The current_floor->grid_array ceiling collapses!"));
+ msg_print(_("ダンジョンの壁が崩れた!", "The current_floor_ptr->grid_array ceiling collapses!"));
break;
}
case 2:
{
- msg_print(_("ダンジョンの床が不自然にねじ曲がった!", "The current_floor->grid_array floor twists in an unnatural way!"));
+ msg_print(_("ダンジョンの床が不自然にねじ曲がった!", "The current_floor_ptr->grid_array floor twists in an unnatural way!"));
break;
}
default:
{
- msg_print(_("ダンジョンが揺れた!崩れた岩が頭に降ってきた!", "The current_floor->grid_array quakes! You are pummeled with debris!"));
+ msg_print(_("ダンジョンが揺れた!崩れた岩が頭に降ってきた!", "The current_floor_ptr->grid_array quakes! You are pummeled with debris!"));
break;
}
}
if (m_idx)
{
GAME_TEXT m_name[MAX_NLEN];
- monster_type *m_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_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_desc(m_name, m_ptr, MD_WRONGDOER_NAME);
killer = format(_("%sの起こした地震", "an earthquake caused by %s"), m_name);
}
else
/* Skip unaffected grids */
if (!map[16+yy-cy][16+xx-cx]) continue;
- g_ptr = ¤t_floor->grid_array[yy][xx];
+ g_ptr = ¤t_floor_ptr->grid_array[yy][xx];
if (g_ptr->m_idx == p_ptr->riding) continue;
/* Process monsters */
if (g_ptr->m_idx)
{
- monster_type *m_ptr = &m_list[g_ptr->m_idx];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
/* Quest monsters */
if (!cave_empty_bold(y, x)) continue;
/* Hack -- no safety on glyph of warding */
- if (is_glyph_grid(¤t_floor->grid_array[y][x])) continue;
- if (is_explosive_rune_grid(¤t_floor->grid_array[y][x])) continue;
+ if (is_glyph_grid(¤t_floor_ptr->grid_array[y][x])) continue;
+ if (is_explosive_rune_grid(¤t_floor_ptr->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 (current_floor->grid_array[y][x].m_idx) continue;
+ if (current_floor_ptr->grid_array[y][x].m_idx) continue;
if (player_bold(y, x)) continue;
/* Count "safe" grids */
if (g_ptr->m_idx)
{
- if (record_named_pet && is_pet(&m_list[g_ptr->m_idx]) && m_list[g_ptr->m_idx].nickname)
+ if (record_named_pet && is_pet(¤t_floor_ptr->m_list[g_ptr->m_idx]) && current_floor_ptr->m_list[g_ptr->m_idx].nickname)
{
char m2_name[MAX_NLEN];
/* Hack -- Escape from the rock */
if (sn)
{
- IDX m_idx_aux = current_floor->grid_array[yy][xx].m_idx;
+ IDX m_idx_aux = current_floor_ptr->grid_array[yy][xx].m_idx;
/* Update the old location */
- current_floor->grid_array[yy][xx].m_idx = 0;
+ current_floor_ptr->grid_array[yy][xx].m_idx = 0;
/* Update the new location */
- current_floor->grid_array[sy][sx].m_idx = m_idx_aux;
+ current_floor_ptr->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 = ¤t_floor->grid_array[yy][xx];
+ g_ptr = ¤t_floor_ptr->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 = ¤t_floor->grid_array[yy][xx];
+ g_ptr = ¤t_floor_ptr->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 = ¤t_floor->grid_array[yyy][xxx];
+ cc_ptr = ¤t_floor_ptr->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 (current_floor->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+ if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
}
/* Success */
for (i = 1; i < m_max; i++)
{
- monster_type *m_ptr = &m_list[i];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
if (!m_ptr->r_idx || !is_pet(m_ptr)) continue;
if (m_ptr->nickname) okay = FALSE;
}
for (i = 1; i < m_max; i++)
{
HIT_POINT dam;
- monster_type *m_ptr = &m_list[i];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
monster_race *r_ptr;
if (!m_ptr->r_idx || !is_pet(m_ptr)) continue;
{
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->grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
/* No longer in the array */
g_ptr->info &= ~(CAVE_TEMP);
/* Process affected monsters */
if (g_ptr->m_idx)
{
- int chance = 25;
- monster_type *m_ptr = &m_list[g_ptr->m_idx];
+ 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->grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
bool do_dark = !is_mirror_grid(g_ptr);
/* No longer in the array */
/* Darken the grid */
if (do_dark)
{
- if (dun_level || !is_daytime())
+ if (current_floor_ptr->dun_level || !is_daytime())
{
for (j = 0; j < 9; j++)
{
if (in_bounds2(by, bx))
{
- grid_type *cc_ptr = ¤t_floor->grid_array[by][bx];
+ grid_type *cc_ptr = ¤t_floor_ptr->grid_array[by][bx];
if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
{
}
/* 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
static void cave_temp_room_aux(POSITION y, POSITION x, bool only_room, bool (*pass_bold)(POSITION, POSITION))
{
grid_type *g_ptr;
- g_ptr = ¤t_floor->grid_array[y][x];
+ g_ptr = ¤t_floor_ptr->grid_array[y][x];
/* Avoid infinite recursion */
if (g_ptr->info & (CAVE_TEMP)) return;
}
/* 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;
if (p_ptr->special_defense & NINJA_S_STEALTH)
{
- if (current_floor->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+ if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
}
}
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."));
tx = p_ptr->x + ddx[dir];
ty = p_ptr->y + ddy[dir];
}
- g_ptr = ¤t_floor->grid_array[ty][tx];
+ g_ptr = ¤t_floor_ptr->grid_array[ty][tx];
if (p_ptr->anti_tele)
{
return FALSE;
}
- m_ptr = &m_list[g_ptr->m_idx];
+ m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
r_ptr = &r_info[m_ptr->r_idx];
(void)set_monster_csleep(g_ptr->m_idx, 0);
(*count) += activate_hi_summon(p_ptr->y, p_ptr->x, FALSE);
if (!one_in_(6)) break;
case 7: case 8: case 9: case 18:
- (*count) += summon_specific(0, p_ptr->y, p_ptr->x, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET), '\0');
+ (*count) += summon_specific(0, p_ptr->y, p_ptr->x, current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET), '\0');
if (!one_in_(6)) break;
case 10: case 11: case 12:
msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away..."));
/*
* Only summon Cyberdemons deep in the dungeon.
*/
- if ((dun_level > 65) && !stop_ty)
+ if ((current_floor_ptr->dun_level > 65) && !stop_ty)
{
(*count) += summon_cyber(-1, p_ptr->y, p_ptr->x);
stop_ty = TRUE;
if (!pet) mode |= PM_NO_PET;
- summon_lev = (pet ? p_ptr->lev * 2 / 3 + randint1(p_ptr->lev / 2) : dun_level);
+ summon_lev = (pet ? p_ptr->lev * 2 / 3 + randint1(p_ptr->lev / 2) : current_floor_ptr->dun_level);
- for (i = 0; i < (randint1(7) + (dun_level / 40)); i++)
+ for (i = 0; i < (randint1(7) + (current_floor_ptr->dun_level / 40)); i++)
{
- switch (randint1(25) + (dun_level / 20))
+ switch (randint1(25) + (current_floor_ptr->dun_level / 20))
{
case 1: case 2:
count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANT, mode, '\0');
ty = target_row;
}
- if (in_bounds(ty, tx)) tm_idx = current_floor->grid_array[ty][tx].m_idx;
+ if (in_bounds(ty, tx)) tm_idx = current_floor_ptr->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(current_floor->grid_array[ny][nx].feat, 0))
+ if (cave_empty_bold(ny, nx) && player_can_enter(current_floor_ptr->grid_array[ny][nx].feat, 0))
{
ty = ny;
tx = nx;
continue;
}
- if (!current_floor->grid_array[ny][nx].m_idx)
+ if (!current_floor_ptr->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(current_floor->grid_array[ny][nx].m_idx, TRUE);
+ update_monster(current_floor_ptr->grid_array[ny][nx].m_idx, TRUE);
/* Found a monster */
- m_ptr = &m_list[current_floor->grid_array[ny][nx].m_idx];
+ m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[ny][nx].m_idx];
- if (tm_idx != current_floor->grid_array[ny][nx].m_idx)
+ if (tm_idx != current_floor_ptr->grid_array[ny][nx].m_idx)
{
#ifdef JP
msg_format("%s%sが立ちふさがっている!", tm_idx ? "別の" : "", m_ptr->ml ? "モンスター" : "何か");
{
POSITION x, y;
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
- if (is_mirror_grid(¤t_floor->grid_array[y][x]))
+ if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x]))
{
remove_mirror(y, x);
if (explode)
break;
case 27:
case 28:
- (void)gain_random_mutation(0);
+ (void)gain_mutation(p_ptr, 0);
break;
case 29:
case 30:
case 35:
while (counter++ < 8)
{
- (void)summon_specific(0, p_ptr->y, p_ptr->x, (dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET), '\0');
+ (void)summon_specific(0, p_ptr->y, p_ptr->x, (current_floor_ptr->dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET), '\0');
}
break;
case 36:
if (!cave_have_flag_bold(ny, nx, FF_PROJECT)) break;
/* Stopped by monsters */
- if ((dir != 5) && current_floor->grid_array[ny][nx].m_idx != 0) break;
+ if ((dir != 5) && current_floor_ptr->grid_array[ny][nx].m_idx != 0) break;
/* Save the new location */
x = nx;
msg_print(_("なんてこった!あなたの周りの地面から朽ちた人影が立ち上がってきた!",
"Oh no! Mouldering forms rise from the earth around you!"));
- (void)summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET), '\0');
+ (void)summon_specific(0, p_ptr->y, p_ptr->x, current_floor_ptr->dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET), '\0');
chg_virtue(V_UNLIFE, 1);
}
else if (die < 14)
else if (die < 14)
{
msg_print(_("なんてこった!《悪魔》だ!", "Oh no! It's the Devil!"));
- summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET), '\0');
+ summon_specific(0, p_ptr->y, p_ptr->x, current_floor_ptr->dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET), '\0');
}
else if (die < 18)
{
else if (die < 30)
{
msg_print(_("奇妙なモンスターの絵だ。", "It's the picture of a strange monster."));
- trump_summoning(1, FALSE, p_ptr->y, p_ptr->x, (dun_level * 3 / 2), (32 + randint1(6)), PM_ALLOW_GROUP | PM_ALLOW_UNIQUE);
+ trump_summoning(1, FALSE, p_ptr->y, p_ptr->x, (current_floor_ptr->dun_level * 3 / 2), (32 + randint1(6)), PM_ALLOW_GROUP | PM_ALLOW_UNIQUE);
}
else if (die < 33)
{
else if (die < 82)
{
msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
- trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (dun_level * 3 / 2), SUMMON_MOLD, 0L);
+ trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (current_floor_ptr->dun_level * 3 / 2), SUMMON_MOLD, 0L);
}
else if (die < 84)
{
msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
- trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (dun_level * 3 / 2), SUMMON_BAT, 0L);
+ trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (current_floor_ptr->dun_level * 3 / 2), SUMMON_BAT, 0L);
}
else if (die < 86)
{
msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
- trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (dun_level * 3 / 2), SUMMON_VORTEX, 0L);
+ trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (current_floor_ptr->dun_level * 3 / 2), SUMMON_VORTEX, 0L);
}
else if (die < 88)
{
msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
- trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (dun_level * 3 / 2), SUMMON_COIN_MIMIC, 0L);
+ trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (current_floor_ptr->dun_level * 3 / 2), SUMMON_COIN_MIMIC, 0L);
}
else if (die < 96)
{
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;
}
if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- g_ptr = ¤t_floor->grid_array[y][x];
+ g_ptr = ¤t_floor_ptr->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 (current_floor->grid_array[y][x].m_idx)
+ if (current_floor_ptr->grid_array[y][x].m_idx)
{
py_attack(y, x, 0);
if (randint0(p_ptr->skill_dis) < 7)
}
else
{
- grid_type *g_ptr = ¤t_floor->grid_array[creature_ptr->y][creature_ptr->x];
+ grid_type *g_ptr = ¤t_floor_ptr->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 (current_floor->grid_array[y][x].m_idx)
+ if (current_floor_ptr->grid_array[y][x].m_idx)
{
if (one_in_(3))
msg_print(_("あーたたたたたたたたたたたたたたたたたたたたたた!!!",
"Oraoraoraoraoraoraoraoraoraoraoraoraoraoraoraoraora!!!!"));
py_attack(y, x, 0);
- if (current_floor->grid_array[y][x].m_idx)
+ if (current_floor_ptr->grid_array[y][x].m_idx)
{
handle_stuff();
py_attack(y, x, 0);
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->grid_array[creature_ptr->y][creature_ptr->x]))
+ if (is_mirror_grid(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x]))
{
msg_print(_("少し頭がハッキリした。", "You feel your head clear a little."));
}
else
{
- msg_print(_("鏡の上でないと集中できない!", "Here are not any mirrors!"));
+ msg_print(_("鏡の上でないと集中できない!", "There's no mirror here!"));
}
return TRUE;
}
dir = randint0(8);
y = creature_ptr->y + ddy_ddd[dir];
x = creature_ptr->x + ddx_ddd[dir];
- g_ptr = ¤t_floor->grid_array[y][x];
+ g_ptr = ¤t_floor_ptr->grid_array[y][x];
/* Hack -- attack monsters */
if (g_ptr->m_idx)
}
if (!do_riding(TRUE)) return TRUE;
- m_ptr = &m_list[creature_ptr->riding];
+ m_ptr = ¤t_floor_ptr->m_list[creature_ptr->riding];
r_ptr = &r_info[m_ptr->r_idx];
monster_desc(m_name, m_ptr, 0);
msg_format(_("%sに乗った。", "You ride on %s."), m_name);
}
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."));