*/
#include "angband.h"
+#include "cmd-pet.h"
#include "grid.h"
#include "trap.h"
#include "monsterrace-hook.h"
#include "avatar.h"
#include "spells-status.h"
+#include "spells-floor.h"
+#include "realm-hex.h"
+#include "object-hook.h"
+#include "monster-status.h"
+#include "player-status.h"
/*!
* @brief プレイヤー周辺の地形を感知する
{
POSITION x, y;
bool detect = FALSE;
- cave_type *c_ptr;
+ grid_type *g_ptr;
- if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
+ 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;
- c_ptr = &cave[y][x];
+ g_ptr = ¤t_floor_ptr->grid_array[y][x];
/* Hack -- Safe */
if (flag == FF_TRAP)
/* Mark as detected */
if (dist <= range && known)
{
- if (dist <= range - 1) c_ptr->info |= (CAVE_IN_DETECT);
+ if (dist <= range - 1) g_ptr->info |= (CAVE_IN_DETECT);
- c_ptr->info &= ~(CAVE_UNSAFE);
+ g_ptr->info &= ~(CAVE_UNSAFE);
lite_spot(y, x);
}
}
/* Detect flags */
- if (cave_have_flag_grid(c_ptr, flag))
+ if (cave_have_flag_grid(g_ptr, flag))
{
/* Detect secrets */
disclose_grid(y, x);
/* Hack -- Memorize */
- c_ptr->info |= (CAVE_MARK);
+ g_ptr->info |= (CAVE_MARK);
lite_spot(y, x);
bool detect = FALSE;
- if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range2 /= 3;
+ if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range2 /= 3;
/* 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;
bool detect = FALSE;
- if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range2 /= 3;
+ if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range2 /= 3;
/* 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;
bool detect = FALSE;
- if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
+ if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
/* 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;
POSITION y, x;
bool flag = FALSE;
- if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
+ if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
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;
POSITION y, x;
bool flag = FALSE;
- if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
+ if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
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;
POSITION y, x;
bool flag = FALSE;
- if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
+ if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
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;
POSITION y, x;
bool flag = FALSE;
- if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
+ if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
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;
POSITION y, x;
bool flag = FALSE;
- if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
+ if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
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;
POSITION y, x;
bool flag = FALSE;
- if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
+ if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
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;
bool flag = FALSE;
concptr desc_monsters = _("変なモンスター", "weird monsters");
- if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
+ if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
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;
bool unleash_mana_storm(player_type *creature_ptr, bool powerful)
{
msg_print(_("強力な魔力が敵を引き裂いた!", "Mighty magics rend your enemies!"));
- project(0, (powerful ? 7 : 5), p_ptr->y, p_ptr->x,
+ project(0, (powerful ? 7 : 5), creature_ptr->y, creature_ptr->x,
(randint1(200) + (powerful ? 500 : 300)) * 2, GF_MANA, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID, -1);
- if ((p_ptr->pclass != CLASS_MAGE) && (p_ptr->pclass != CLASS_HIGH_MAGE) && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_MAGIC_EATER) && (p_ptr->pclass != CLASS_BLUE_MAGE))
+ if ((creature_ptr->pclass != CLASS_MAGE) && (creature_ptr->pclass != CLASS_HIGH_MAGE) && (creature_ptr->pclass != CLASS_SORCERER) && (creature_ptr->pclass != CLASS_MAGIC_EATER) && (creature_ptr->pclass != CLASS_BLUE_MAGE))
{
(void)take_hit(DAMAGE_NOESCAPE, 50, _("コントロールし難い強力な魔力の解放", "unleashing magics too mighty to control"), -1);
}
void aggravate_monsters(MONSTER_IDX who)
{
MONSTER_IDX i;
- bool sleep = FALSE;
- bool speed = FALSE;
+ bool sleep = FALSE;
+ bool speed = FALSE;
/* 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;
-
else
{
if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
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");
{
POSITION y, x;
int k, t;
- cave_type *c_ptr;
+ grid_type *g_ptr;
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;
- c_ptr = &cave[y][x];
+ g_ptr = ¤t_floor_ptr->grid_array[y][x];
/* Lose room and vault */
- c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
+ g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
/* Lose light and knowledge */
- c_ptr->info &= ~(CAVE_MARK | CAVE_GLOW | CAVE_KNOWN);
+ g_ptr->info &= ~(CAVE_MARK | CAVE_GLOW | CAVE_KNOWN);
if (!in_generate) /* Normal */
{
/* Lose unsafety */
- c_ptr->info &= ~(CAVE_UNSAFE);
+ g_ptr->info &= ~(CAVE_UNSAFE);
/* Hack -- Notice player affect */
if (player_bold(y, x))
/* Hack -- Skip the epicenter */
if ((y == y1) && (x == x1)) continue;
- if (c_ptr->m_idx)
+ if (g_ptr->m_idx)
{
- monster_type *m_ptr = &m_list[c_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 */
m_ptr->hp = m_ptr->maxhp;
/* Try to teleport away quest monsters */
- if (!teleport_away(c_ptr->m_idx, (r * 2) + 1, TELEPORT_DEC_VALOUR)) continue;
+ if (!teleport_away(g_ptr->m_idx, (r * 2) + 1, TELEPORT_DEC_VALOUR)) continue;
}
else
{
OBJECT_IDX this_o_idx, next_o_idx = 0;
/* Scan all objects in the grid */
- for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
+ 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 */
delete_object(y, x);
/* Destroy "non-permanent" grids */
- if (!cave_perma_grid(c_ptr))
+ if (!cave_perma_grid(g_ptr))
{
/* Wall (or floor) type */
t = randint0(200);
else
{
/* Create floor */
- cave_set_feat(y, x, floor_type[randint0(100)]);
+ cave_set_feat(y, x, feat_ground_type[randint0(100)]);
}
}
else /* In generation */
if (t < 20)
{
/* Create granite wall */
- place_extra_grid(c_ptr);
+ place_extra_grid(g_ptr);
}
else if (t < 70)
{
/* Create quartz vein */
- c_ptr->feat = feat_quartz_vein;
+ g_ptr->feat = feat_quartz_vein;
}
else if (t < 100)
{
/* Create magma vein */
- c_ptr->feat = feat_magma_vein;
+ g_ptr->feat = feat_magma_vein;
}
else
{
/* Create floor */
- place_floor_grid(c_ptr);
+ place_floor_grid(g_ptr);
}
/* Clear garbage of hidden trap or door */
- c_ptr->mimic = 0;
+ g_ptr->mimic = 0;
}
}
}
/* Stay in the circle of death */
if (k > r) continue;
- c_ptr = &cave[y][x];
+ g_ptr = ¤t_floor_ptr->grid_array[y][x];
- if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW;
- else if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS))
+ if (is_mirror_grid(g_ptr)) g_ptr->info |= CAVE_GLOW;
+ else if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
{
DIRECTION i;
POSITION yy, xx;
- cave_type *cc_ptr;
+ grid_type *cc_ptr;
for (i = 0; i < 9; i++)
{
yy = y + ddy_ddd[i];
xx = x + ddx_ddd[i];
if (!in_bounds2(yy, xx)) continue;
- cc_ptr = &cave[yy][xx];
+ cc_ptr = ¤t_floor_ptr->grid_array[yy][xx];
if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
{
- c_ptr->info |= CAVE_GLOW;
+ g_ptr->info |= CAVE_GLOW;
break;
}
}
if (p_ptr->special_defense & NINJA_S_STEALTH)
{
- if (cave[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);
}
}
int sn = 0;
POSITION sy = 0, sx = 0;
bool hurt = FALSE;
- cave_type *c_ptr;
+ grid_type *g_ptr;
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;
- c_ptr = &cave[yy][xx];
+ g_ptr = ¤t_floor_ptr->grid_array[yy][xx];
/* Lose room and vault / Lose light and knowledge */
- c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY | CAVE_UNSAFE);
- c_ptr->info &= ~(CAVE_GLOW | CAVE_MARK | CAVE_KNOWN);
+ g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY | CAVE_UNSAFE);
+ g_ptr->info &= ~(CAVE_GLOW | CAVE_MARK | CAVE_KNOWN);
/* Skip the epicenter */
if (!dx && !dy) continue;
/* 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 (cave[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 cave ceiling collapses!"));
+ msg_print(_("ダンジョンの壁が崩れた!", "The current_floor_ptr->grid_array ceiling collapses!"));
break;
}
case 2:
{
- msg_print(_("ダンジョンの床が不自然にねじ曲がった!", "The cave 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 cave 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;
- c_ptr = &cave[yy][xx];
+ g_ptr = ¤t_floor_ptr->grid_array[yy][xx];
- if (c_ptr->m_idx == p_ptr->riding) continue;
+ if (g_ptr->m_idx == p_ptr->riding) continue;
/* Process monsters */
- if (c_ptr->m_idx)
+ if (g_ptr->m_idx)
{
- monster_type *m_ptr = &m_list[c_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(&cave[y][x])) continue;
- if (is_explosive_rune_grid(&cave[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 (cave[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 */
damage = (sn ? damroll(4, 8) : (m_ptr->hp + 1));
/* Monster is certainly awake */
- (void)set_monster_csleep(c_ptr->m_idx, 0);
+ (void)set_monster_csleep(g_ptr->m_idx, 0);
/* Apply damage directly */
m_ptr->hp -= damage;
if (!ignore_unview || is_seen(m_ptr))
msg_format(_("%^sは岩石に埋もれてしまった!", "%^s is embedded in the rock!"), m_name);
- if (c_ptr->m_idx)
+ if (g_ptr->m_idx)
{
- if (record_named_pet && is_pet(&m_list[c_ptr->m_idx]) && m_list[c_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 = cave[yy][xx].m_idx;
+ IDX m_idx_aux = current_floor_ptr->grid_array[yy][xx].m_idx;
/* Update the old location */
- cave[yy][xx].m_idx = 0;
+ current_floor_ptr->grid_array[yy][xx].m_idx = 0;
/* Update the new location */
- cave[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;
- c_ptr = &cave[yy][xx];
+ g_ptr = ¤t_floor_ptr->grid_array[yy][xx];
/* Paranoia -- never affect player */
/* if (player_bold(yy, xx)) continue; */
else
{
/* Create floor */
- cave_set_feat(yy, xx, floor_type[randint0(100)]);
+ cave_set_feat(yy, xx, feat_ground_type[randint0(100)]);
}
}
}
/* Skip distant grids */
if (distance(cy, cx, yy, xx) > r) continue;
- c_ptr = &cave[yy][xx];
+ g_ptr = ¤t_floor_ptr->grid_array[yy][xx];
- if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW;
- else if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS))
+ if (is_mirror_grid(g_ptr)) g_ptr->info |= CAVE_GLOW;
+ else if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
{
DIRECTION ii;
POSITION yyy, xxx;
- cave_type *cc_ptr;
+ grid_type *cc_ptr;
for (ii = 0; ii < 9; ii++)
{
yyy = yy + ddy_ddd[ii];
xxx = xx + ddx_ddd[ii];
if (!in_bounds2(yyy, xxx)) continue;
- cc_ptr = &cave[yyy][xxx];
+ cc_ptr = ¤t_floor_ptr->grid_array[yyy][xxx];
if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
{
- c_ptr->info |= CAVE_GLOW;
+ g_ptr->info |= CAVE_GLOW;
break;
}
}
}
/* Mega-Hack -- Forget the view and lite */
- /* Update the health bar */
p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
p_ptr->redraw |= (PR_HEALTH | PR_UHEALTH | PR_MAP);
p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
if (p_ptr->special_defense & NINJA_S_STEALTH)
{
- if (cave[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];
- cave_type *c_ptr = &cave[y][x];
+ grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
/* No longer in the array */
- c_ptr->info &= ~(CAVE_TEMP);
+ g_ptr->info &= ~(CAVE_TEMP);
/* Update only non-CAVE_GLOW grids */
- /* if (c_ptr->info & (CAVE_GLOW)) continue; */
+ /* if (g_ptr->info & (CAVE_GLOW)) continue; */
/* Perma-Lite */
- c_ptr->info |= (CAVE_GLOW);
+ g_ptr->info |= (CAVE_GLOW);
/* Process affected monsters */
- if (c_ptr->m_idx)
+ if (g_ptr->m_idx)
{
- int chance = 25;
- monster_type *m_ptr = &m_list[c_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(c_ptr->m_idx, FALSE);
+ update_monster(g_ptr->m_idx, FALSE);
/* Stupid monsters rarely wake up */
if (r_ptr->flags2 & (RF2_STUPID)) chance = 10;
if (MON_CSLEEP(m_ptr) && (randint0(100) < chance))
{
/* Wake up! */
- (void)set_monster_csleep(c_ptr->m_idx, 0);
+ (void)set_monster_csleep(g_ptr->m_idx, 0);
/* Notice the "waking up" */
if (m_ptr->ml)
}
}
- /* Note */
note_spot(y, x);
-
lite_spot(y, x);
-
update_local_illumination(y, x);
}
/* 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;
- cave_type *c_ptr = &cave[y][x];
- bool do_dark = !is_mirror_grid(c_ptr);
+ grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ bool do_dark = !is_mirror_grid(g_ptr);
/* No longer in the array */
- c_ptr->info &= ~(CAVE_TEMP);
+ g_ptr->info &= ~(CAVE_TEMP);
/* 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++)
{
- int by = y + ddy_ddd[j];
- int bx = x + ddx_ddd[j];
+ POSITION by = y + ddy_ddd[j];
+ POSITION bx = x + ddx_ddd[j];
if (in_bounds2(by, bx))
{
- cave_type *cc_ptr = &cave[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))
{
if (!do_dark) continue;
}
- c_ptr->info &= ~(CAVE_GLOW);
+ g_ptr->info &= ~(CAVE_GLOW);
/* Hack -- Forget "boring" grids */
- if (!have_flag(f_info[get_feat_mimic(c_ptr)].flags, FF_REMEMBER))
+ if (!have_flag(f_info[get_feat_mimic(g_ptr)].flags, FF_REMEMBER))
{
/* Forget the grid */
- if (!view_torch_grids) c_ptr->info &= ~(CAVE_MARK);
-
+ if (!view_torch_grids) g_ptr->info &= ~(CAVE_MARK);
note_spot(y, x);
}
/* Process affected monsters */
- if (c_ptr->m_idx)
+ if (g_ptr->m_idx)
{
- update_monster(c_ptr->m_idx, FALSE);
+ update_monster(g_ptr->m_idx, FALSE);
}
lite_spot(y, x);
-
update_local_illumination(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
*/
static void cave_temp_room_aux(POSITION y, POSITION x, bool only_room, bool (*pass_bold)(POSITION, POSITION))
{
- cave_type *c_ptr;
-
- /* Get the grid */
- c_ptr = &cave[y][x];
+ grid_type *g_ptr;
+ g_ptr = ¤t_floor_ptr->grid_array[y][x];
/* Avoid infinite recursion */
- if (c_ptr->info & (CAVE_TEMP)) return;
+ if (g_ptr->info & (CAVE_TEMP)) return;
/* Do not "leave" the current room */
- if (!(c_ptr->info & (CAVE_ROOM)))
+ if (!(g_ptr->info & (CAVE_ROOM)))
{
if (only_room) return;
}
/* Paranoia -- verify space */
- if (temp_n == TEMP_MAX) return;
+ if (tmp_pos.n == TEMP_MAX) return;
/* Mark the grid as "seen" */
- c_ptr->info |= (CAVE_TEMP);
+ 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 (cave[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 (!player_bold(y, x)) break;
}
- project(0, 0, p_ptr->y, p_ptr->x, damroll(6 + p_ptr->lev / 8, 10), GF_LITE_WEAK,
+ project(0, 0, y, x, damroll(6 + p_ptr->lev / 8, 10), GF_LITE_WEAK,
(PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_KILL | PROJECT_LOS), -1);
}
return TRUE;
{
BIT_FLAGS flg = PROJECT_GRID | PROJECT_KILL;
- if (d_info[dungeon_type].flags1 & DF1_DARKNESS)
+ 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;
}
- /* Hack -- Message */
if (!p_ptr->blind)
{
msg_print(_("白い光が辺りを覆った。", "You are surrounded by a white light."));
/* Hook into the "project()" function */
(void)project(0, rad, p_ptr->y, p_ptr->x, dam, GF_LITE_WEAK, flg, -1);
- /* Lite up the room */
lite_room(p_ptr->y, p_ptr->x);
/* Assume seen */
{
BIT_FLAGS flg = PROJECT_GRID | PROJECT_KILL;
- /* Hack -- Message */
if (!p_ptr->blind)
{
msg_print(_("暗闇が辺りを覆った。", "Darkness surrounds you."));
/* Hook into the "project()" function */
(void)project(0, rad, p_ptr->y, p_ptr->x, dam, GF_DARK_WEAK, flg, -1);
- /* Lite up the room */
unlite_room(p_ptr->y, p_ptr->x);
/* Assume seen */
bool teleport_swap(DIRECTION dir)
{
POSITION tx, ty;
- cave_type* c_ptr;
+ grid_type* g_ptr;
monster_type* m_ptr;
monster_race* r_ptr;
tx = p_ptr->x + ddx[dir];
ty = p_ptr->y + ddy[dir];
}
- c_ptr = &cave[ty][tx];
+ g_ptr = ¤t_floor_ptr->grid_array[ty][tx];
if (p_ptr->anti_tele)
{
return FALSE;
}
- if (!c_ptr->m_idx || (c_ptr->m_idx == p_ptr->riding))
+ if (!g_ptr->m_idx || (g_ptr->m_idx == p_ptr->riding))
{
msg_print(_("それとは場所を交換できません。", "You can't trade places with that!"));
-
- /* Failure */
return FALSE;
}
- if ((c_ptr->info & CAVE_ICKY) || (distance(ty, tx, p_ptr->y, p_ptr->x) > p_ptr->lev * 3 / 2 + 10))
+ if ((g_ptr->info & CAVE_ICKY) || (distance(ty, tx, p_ptr->y, p_ptr->x) > p_ptr->lev * 3 / 2 + 10))
{
msg_print(_("失敗した。", "Failed to swap."));
-
- /* Failure */
return FALSE;
}
- m_ptr = &m_list[c_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(c_ptr->m_idx, 0);
+ (void)set_monster_csleep(g_ptr->m_idx, 0);
if (r_ptr->flagsr & RFR_RES_TELE)
{
msg_print(_("テレポートを邪魔された!", "Your teleportation is blocked!"));
-
if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
-
- /* Failure */
return FALSE;
}
bool wall_stone(void)
{
BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
-
bool dummy = (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_STONE_WALL, flg, -1));
-
p_ptr->update |= (PU_FLOW);
-
p_ptr->redraw |= (PR_MAP);
-
return dummy;
}
*/
bool activate_ty_curse(bool stop_ty, int *count)
{
- int i = 0;
-
+ int i = 0;
BIT_FLAGS flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
do
(*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');
return count;
}
-
-/*!
- * @brief サイバーデーモンの召喚
- * @param who 召喚主のモンスターID(0ならばプレイヤー)
- * @param y 召喚位置Y座標
- * @param x 召喚位置X座標
- * @return 作用が実際にあった場合TRUEを返す
- */
-int summon_cyber(MONSTER_IDX who, POSITION y, POSITION x)
-{
- int i;
- int max_cyber = (easy_band ? 1 : (dun_level / 50) + randint1(2));
- int count = 0;
- BIT_FLAGS mode = PM_ALLOW_GROUP;
-
- /* Summoned by a monster */
- if (who > 0)
- {
- monster_type *m_ptr = &m_list[who];
- if (is_pet(m_ptr)) mode |= PM_FORCE_PET;
- }
-
- if (max_cyber > 4) max_cyber = 4;
-
- for (i = 0; i < max_cyber; i++)
- {
- count += summon_specific(who, y, x, 100, SUMMON_CYBER, mode, '\0');
- }
-
- return count;
-}
-
/*!
* @brief 周辺破壊効果(プレイヤー中心)
* @return 作用が実際にあった場合TRUEを返す
ty = target_row;
}
- if (in_bounds(ty, tx)) tm_idx = cave[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(cave[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 (!cave[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(cave[ny][nx].m_idx, TRUE);
+ update_monster(current_floor_ptr->grid_array[ny][nx].m_idx, TRUE);
/* Found a monster */
- m_ptr = &m_list[cave[ny][nx].m_idx];
+ m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[ny][nx].m_idx];
- if (tm_idx != cave[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(&cave[y][x]))
+ if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x]))
{
remove_mirror(y, x);
if (explode)
case 3:
{
msg_print(_("あなたは強力なオーラに包み込まれた。", "You are surrounded by a powerful aura."));
-
- /* Dispel monsters */
dispel_monsters(1000);
-
break;
}
case 5:
case 6:
{
- /* Mana Ball */
fire_ball(GF_MANA, dir, 600, 3);
-
break;
}
case 9:
case 10:
{
- /* Mana Bolt */
fire_bolt(GF_MANA, dir, 500);
-
break;
}
}
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) && cave[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)
{
else if (die < 111)
{
msg_print(_("《審判》だ。", "It's the Judgement."));
- do_cmd_rerate(FALSE);
+ roll_hitdice(p_ptr, 0L);
lose_all_mutations();
}
else if (die < 120)
}
}
-bool_hack life_stream(bool_hack message, bool_hack virtue_change)
-{
- if(virtue_change)
- {
- chg_virtue(V_VITALITY, 1);
- chg_virtue(V_UNLIFE, -5);
- }
- if(message)
- {
- msg_print(_("体中に生命力が満ちあふれてきた!", "You feel life flow through your body!"));
- }
- restore_level();
- (void)set_poisoned(0);
- (void)set_blind(0);
- (void)set_confused(0);
- (void)set_image(0);
- (void)set_stun(0);
- (void)set_cut(0);
- (void)restore_all_status();
- (void)set_shero(0, TRUE);
- handle_stuff();
- hp_player(5000);
-
- return TRUE;
-}
-
-bool_hack heroism(int base)
-{
- bool_hack ident = FALSE;
- if(set_afraid(0)) ident = TRUE;
- if(set_hero(p_ptr->hero + randint1(base) + base, FALSE)) ident = TRUE;
- if(hp_player(10)) ident = TRUE;
- return ident;
-}
-
-bool_hack berserk(int base)
-{
- bool_hack ident = FALSE;
- if (set_afraid(0)) ident = TRUE;
- if (set_shero(p_ptr->hero + randint1(base) + base, FALSE)) ident = TRUE;
- if (hp_player(30)) ident = TRUE;
- return ident;
-}
-
-bool_hack cure_light_wounds(DICE_NUMBER dice, DICE_SID sides)
-{
- bool_hack ident = FALSE;
- if (hp_player(damroll(dice, sides))) ident = TRUE;
- if (set_blind(0)) ident = TRUE;
- if (set_cut(p_ptr->cut - 10)) ident = TRUE;
- if (set_shero(0, TRUE)) ident = TRUE;
- return ident;
-}
-
-bool_hack cure_serious_wounds(DICE_NUMBER dice, DICE_SID sides)
-{
- bool_hack ident = FALSE;
- if (hp_player(damroll(dice, sides))) ident = TRUE;
- if (set_blind(0)) ident = TRUE;
- if (set_confused(0)) ident = TRUE;
- if (set_cut((p_ptr->cut / 2) - 50)) ident = TRUE;
- if (set_shero(0, TRUE)) ident = TRUE;
- return ident;
-}
-
-bool_hack cure_critical_wounds(HIT_POINT pow)
-{
- bool_hack ident = FALSE;
- if (hp_player(pow)) ident = TRUE;
- if (set_blind(0)) ident = TRUE;
- if (set_confused(0)) ident = TRUE;
- if (set_poisoned(0)) ident = TRUE;
- if (set_stun(0)) ident = TRUE;
- if (set_cut(0)) ident = TRUE;
- if (set_shero(0, TRUE)) ident = TRUE;
- return ident;
-}
-
-bool_hack true_healing(HIT_POINT pow)
-{
- bool_hack ident = FALSE;
- if (hp_player(pow)) ident = TRUE;
- if (set_blind(0)) ident = TRUE;
- if (set_confused(0)) ident = TRUE;
- if (set_poisoned(0)) ident = TRUE;
- if (set_stun(0)) ident = TRUE;
- if (set_cut(0)) ident = TRUE;
- if (set_image(0)) ident = TRUE;
- return ident;
-}
-
-bool_hack restore_mana(bool_hack magic_eater)
-{
- bool_hack ident = FALSE;
-
- if (p_ptr->pclass == CLASS_MAGIC_EATER && magic_eater)
- {
- int i;
- for (i = 0; i < EATER_EXT * 2; i++)
- {
- p_ptr->magic_num1[i] += (p_ptr->magic_num2[i] < 10) ? EATER_CHARGE * 3 : p_ptr->magic_num2[i] * EATER_CHARGE / 3;
- if (p_ptr->magic_num1[i] > p_ptr->magic_num2[i] * EATER_CHARGE) p_ptr->magic_num1[i] = p_ptr->magic_num2[i] * EATER_CHARGE;
- }
- for (; i < EATER_EXT * 3; i++)
- {
- KIND_OBJECT_IDX k_idx = lookup_kind(TV_ROD, i - EATER_EXT * 2);
- p_ptr->magic_num1[i] -= ((p_ptr->magic_num2[i] < 10) ? EATER_ROD_CHARGE * 3 : p_ptr->magic_num2[i] * EATER_ROD_CHARGE / 3)*k_info[k_idx].pval;
- if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
- }
- msg_print(_("頭がハッキリとした。", "You feel your head clear."));
- p_ptr->window |= (PW_PLAYER);
- ident = TRUE;
- }
- else if (p_ptr->csp < p_ptr->msp)
- {
- p_ptr->csp = p_ptr->msp;
- p_ptr->csp_frac = 0;
- msg_print(_("頭がハッキリとした。", "You feel your head clear."));
- p_ptr->redraw |= (PR_MANA);
- p_ptr->window |= (PW_PLAYER);
- p_ptr->window |= (PW_SPELL);
- ident = TRUE;
- }
-
- return ident;
-}
-
-bool restore_all_status(void)
-{
- bool ident = FALSE;
- if (do_res_stat(A_STR)) ident = TRUE;
- if (do_res_stat(A_INT)) ident = TRUE;
- if (do_res_stat(A_WIS)) ident = TRUE;
- if (do_res_stat(A_DEX)) ident = TRUE;
- if (do_res_stat(A_CON)) ident = TRUE;
- if (do_res_stat(A_CHR)) ident = TRUE;
- return ident;
-}
-
/*!
* @brief 口を使う継続的な処理を中断する
* @return なし
*/
void stop_mouth(void)
{
- if (music_singing_any()) stop_singing();
+ if (music_singing_any()) stop_singing(p_ptr);
if (hex_spelling_any()) stop_hex_spell_all();
}
DIRECTION dir;
POSITION x, y;
int dummy;
- cave_type *c_ptr;
+ grid_type *g_ptr;
- if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
+ 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];
- c_ptr = &cave[y][x];
+ g_ptr = ¤t_floor_ptr->grid_array[y][x];
stop_mouth();
- if (!(c_ptr->m_idx))
+ if (!(g_ptr->m_idx))
{
msg_print(_("何もない場所に噛みついた!", "You bite into thin air!"));
return FALSE;
if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (cave[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)
bool psychometry(void)
{
OBJECT_IDX item;
- object_type *o_ptr;
+ object_type *o_ptr;
GAME_TEXT o_name[MAX_NLEN];
byte feel;
concptr q, s;
#endif
- /* We have "felt" it */
o_ptr->ident |= (IDENT_SENSE);
-
- /* "Inscribe" it */
o_ptr->feeling = feel;
-
- /* Player touches it */
o_ptr->marked |= OM_TOUCHED;
- /* Combine / Reorder the pack (later) */
p_ptr->update |= (PU_COMBINE | PU_REORDER);
-
p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
/* Valid "tval" codes */
}
else
{
- cave_type *c_ptr = &cave[creature_ptr->y][creature_ptr->x];
- feature_type *f_ptr = &f_info[c_ptr->feat];
+ 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) ||
(!creature_ptr->levitation && have_flag(f_ptr->flags, FF_DEEP)))
if (!get_rep_dir(&dir, FALSE)) return FALSE;
y = creature_ptr->y + ddy[dir];
x = creature_ptr->x + ddx[dir];
- if (cave[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 (cave[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;
{
msg_print(_("変換に失敗した。", "You failed to convert."));
}
- /* Redraw mana and hp */
creature_ptr->redraw |= (PR_HP | PR_MANA);
return TRUE;
}
return TRUE;
}
+bool mirror_concentration(player_type *creature_ptr)
+{
+ if (total_friends)
+ {
+ 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]))
+ {
+ msg_print(_("少し頭がハッキリした。", "You feel your head clear a little."));
+
+ creature_ptr->csp += (5 + creature_ptr->lev * creature_ptr->lev / 100);
+ if (creature_ptr->csp >= creature_ptr->msp)
+ {
+ creature_ptr->csp = creature_ptr->msp;
+ creature_ptr->csp_frac = 0;
+ }
+ creature_ptr->redraw |= (PR_MANA);
+ }
+ else
+ {
+ msg_print(_("鏡の上でないと集中できない!", "There's no mirror here!"));
+ }
+ return TRUE;
+}
+
+bool sword_dancing(player_type *creature_ptr)
+{
+ DIRECTION dir;
+ POSITION y = 0, x = 0;
+ int i;
+ grid_type *g_ptr;
+
+ for (i = 0; i < 6; i++)
+ {
+ dir = randint0(8);
+ y = creature_ptr->y + ddy_ddd[dir];
+ x = creature_ptr->x + ddx_ddd[dir];
+ g_ptr = ¤t_floor_ptr->grid_array[y][x];
+
+ /* Hack -- attack monsters */
+ if (g_ptr->m_idx)
+ py_attack(y, x, 0);
+ else
+ {
+ msg_print(_("攻撃が空をきった。", "You attack the empty air."));
+ }
+ }
+ return TRUE;
+}
+
+bool confusing_light(player_type *creature_ptr)
+{
+ msg_print(_("辺りを睨んだ...", "You glare nearby monsters..."));
+ slow_monsters(creature_ptr->lev);
+ stun_monsters(creature_ptr->lev * 4);
+ confuse_monsters(creature_ptr->lev * 4);
+ turn_monsters(creature_ptr->lev * 4);
+ stasis_monsters(creature_ptr->lev * 4);
+ return TRUE;
+}
+
+bool rodeo(player_type *creature_ptr)
+{
+ GAME_TEXT m_name[MAX_NLEN];
+ monster_type *m_ptr;
+ monster_race *r_ptr;
+ int rlev;
+
+ if (creature_ptr->riding)
+ {
+ msg_print(_("今は乗馬中だ。", "You ARE riding."));
+ return FALSE;
+ }
+ if (!do_riding(TRUE)) return TRUE;
+
+ 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);
+
+ if (is_pet(m_ptr)) return TRUE;
+
+ rlev = r_ptr->level;
+
+ if (r_ptr->flags1 & RF1_UNIQUE) rlev = rlev * 3 / 2;
+ if (rlev > 60) rlev = 60 + (rlev - 60) / 2;
+ if ((randint1(creature_ptr->skill_exp[GINOU_RIDING] / 120 + creature_ptr->lev * 2 / 3) > rlev)
+ && one_in_(2) && !creature_ptr->inside_arena && !creature_ptr->inside_battle
+ && !(r_ptr->flags7 & (RF7_GUARDIAN)) && !(r_ptr->flags1 & (RF1_QUESTOR))
+ && (rlev < creature_ptr->lev * 3 / 2 + randint0(creature_ptr->lev / 5)))
+ {
+ msg_format(_("%sを手なずけた。", "You tame %s."), m_name);
+ set_pet(m_ptr);
+ }
+ else
+ {
+ msg_format(_("%sに振り落とされた!", "You have been thrown off by %s."), m_name);
+ rakuba(1, TRUE);
+ /* 落馬処理に失敗してもとにかく乗馬解除 */
+ creature_ptr->riding = 0;
+ }
+ return TRUE;
+}
+
+bool clear_mind(player_type *creature_ptr)
+{
+ if (total_friends)
+ {
+ msg_print(_("今はペットを操ることに集中していないと。", "Your pets demand all of your attention."));
+ return FALSE;
+ }
+ msg_print(_("少し頭がハッキリした。", "You feel your head clear a little."));
+
+ creature_ptr->csp += (3 + creature_ptr->lev / 20);
+ if (creature_ptr->csp >= creature_ptr->msp)
+ {
+ creature_ptr->csp = creature_ptr->msp;
+ creature_ptr->csp_frac = 0;
+ }
+ creature_ptr->redraw |= (PR_MANA);
+ return TRUE;
+}
+
+bool concentration(player_type *creature_ptr)
+{
+ int max_csp = MAX(creature_ptr->msp * 4, creature_ptr->lev * 5 + 5);
+
+ if (total_friends)
+ {
+ msg_print(_("今はペットを操ることに集中していないと。", "Your pets demand all of your attention."));
+ return FALSE;
+ }
+ if (creature_ptr->special_defense & KATA_MASK)
+ {
+ msg_print(_("今は構えに集中している。", "You're already concentrating on your stance."));
+ return FALSE;
+ }
+ msg_print(_("精神を集中して気合いを溜めた。", "You concentrate to charge your power."));
+
+ creature_ptr->csp += creature_ptr->msp / 2;
+ if (creature_ptr->csp >= max_csp)
+ {
+ creature_ptr->csp = max_csp;
+ creature_ptr->csp_frac = 0;
+ }
+ creature_ptr->redraw |= (PR_MANA);
+ return TRUE;
+}