if (p_ptr->riding == i) p_ptr->riding = 0;
/* Monster is gone */
- cave[y][x].m_idx = 0;
+ grid_array[y][x].m_idx = 0;
for (this_o_idx = m_ptr->hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
{
*/
void delete_monster(POSITION y, POSITION x)
{
- cave_type *c_ptr;
+ grid_type *g_ptr;
/* Paranoia */
if (!in_bounds(y, x)) return;
/* Check the grid */
- c_ptr = &cave[y][x];
+ g_ptr = &grid_array[y][x];
/* Delete the monster (if any) */
- if (c_ptr->m_idx) delete_monster_idx(c_ptr->m_idx);
+ if (g_ptr->m_idx) delete_monster_idx(g_ptr->m_idx);
}
{
POSITION y, x;
int i;
- cave_type *c_ptr;
+ grid_type *g_ptr;
monster_type *m_ptr;
OBJECT_IDX this_o_idx, next_o_idx = 0;
x = m_ptr->fx;
/* Cave grid */
- c_ptr = &cave[y][x];
+ g_ptr = &grid_array[y][x];
- /* Update the cave */
- c_ptr->m_idx = i2;
+ /* Update the grid_array */
+ g_ptr->m_idx = i2;
/* Repair objects being carried by monster */
for (this_o_idx = m_ptr->hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
if (!m_ptr->r_idx) continue;
/* Monster is gone */
- cave[m_ptr->fy][m_ptr->fx].m_idx = 0;
+ grid_array[m_ptr->fy][m_ptr->fx].m_idx = 0;
/* Wipe the Monster */
(void)WIPE(m_ptr, monster_type);
*/
static bool restrict_monster_to_dungeon(MONRACE_IDX r_idx)
{
- dungeon_info_type *d_ptr = &d_info[dungeon_idx];
+ dungeon_type *d_ptr = &d_info[p_ptr->dungeon_idx];
monster_race *r_ptr = &r_info[r_idx];
byte a;
if (dun_level && (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest)) && !restrict_monster_to_dungeon(entry->index) && !p_ptr->inside_battle)
{
- int hoge = entry->prob2 * d_info[dungeon_idx].special_div;
+ int hoge = entry->prob2 * d_info[p_ptr->dungeon_idx].special_div;
entry->prob2 = hoge / 64;
if (randint0(64) < (hoge & 0x3f)) entry->prob2++;
}
pls_kakuritu = MAX(NASTY_MON_MAX, NASTY_MON_BASE - ((dungeon_turn / (TURNS_PER_TICK * 5000L) - delay / 10)));
pls_level = MIN(NASTY_MON_PLUS_MAX, 3 + dungeon_turn / (TURNS_PER_TICK * 40000L) - delay / 40 + MIN(5, level / 10)) ;
- if (d_info[dungeon_idx].flags1 & DF1_MAZE)
+ if (d_info[p_ptr->dungeon_idx].flags1 & DF1_MAZE)
{
pls_kakuritu = MIN(pls_kakuritu / 2, pls_kakuritu - 10);
if (pls_kakuritu < 2) pls_kakuritu = 2;
}
/* Boost the level */
- if (!p_ptr->inside_battle && !(d_info[dungeon_idx].flags1 & DF1_BEGINNER))
+ if (!p_ptr->inside_battle && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_BEGINNER))
{
/* Nightmare mode allows more out-of depth monsters */
if (ironman_nightmare && !randint0(pls_kakuritu))
if (p_ptr->image)
{
/* Something silly happens... */
-#ifdef JP
- msg_format("%s%sの顔を見てしまった!",
- funny_desc[randint0(MAX_SAN_FUNNY)], m_name);
-#else
- msg_format("You behold the %s visage of %s!",
+ msg_format(_("%s%sの顔を見てしまった!", "You behold the %s visage of %s!"),
funny_desc[randint0(MAX_SAN_FUNNY)], m_name);
-#endif
if (one_in_(3))
{
}
/* Something frightening happens... */
-#ifdef JP
- msg_format("%s%sの顔を見てしまった!",
- horror_desc[randint0(MAX_SAN_HORROR)], m_name);
-#else
- msg_format("You behold the %s visage of %s!",
+ msg_format(_("%s%sの顔を見てしまった!", "You behold the %s visage of %s!"),
horror_desc[randint0(MAX_SAN_HORROR)], m_name);
-#endif
r_ptr->r_flags2 |= RF2_ELDRITCH_HORROR;
bool easy = FALSE;
/* Non-Ninja player in the darkness */
- bool in_darkness = (d_info[dungeon_idx].flags1 & DF1_DARKNESS) && !p_ptr->see_nocto;
+ bool in_darkness = (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) && !p_ptr->see_nocto;
/* Do disturb? */
if (disturb_high)
if ((r_ptr->blow[0].method == RBM_EXPLODE) || (r_ptr->blow[1].method == RBM_EXPLODE) || (r_ptr->blow[2].method == RBM_EXPLODE) || (r_ptr->blow[3].method == RBM_EXPLODE))
return FALSE;
- if (!monster_can_cross_terrain(cave[m_ptr->fy][m_ptr->fx].feat, r_ptr, 0)) return FALSE;
+ if (!monster_can_cross_terrain(grid_array[m_ptr->fy][m_ptr->fx].feat, r_ptr, 0)) return FALSE;
/* Not born */
if (!(old_r_ptr->flags7 & RF7_CHAMELEON))
if ((r_ptr->blow[0].method == RBM_EXPLODE) || (r_ptr->blow[1].method == RBM_EXPLODE) || (r_ptr->blow[2].method == RBM_EXPLODE) || (r_ptr->blow[3].method == RBM_EXPLODE))
return FALSE;
- if (!monster_can_cross_terrain(cave[m_ptr->fy][m_ptr->fx].feat, r_ptr, 0)) return FALSE;
+ if (!monster_can_cross_terrain(grid_array[m_ptr->fy][m_ptr->fx].feat, r_ptr, 0)) return FALSE;
/* Not born */
if (!(old_r_ptr->flags7 & RF7_CHAMELEON))
else
level = dun_level;
- if (d_info[dungeon_idx].flags1 & DF1_CHAMELEON) level+= 2+randint1(3);
+ if (d_info[p_ptr->dungeon_idx].flags1 & DF1_CHAMELEON) level+= 2+randint1(3);
r_idx = get_mon_num(level);
r_ptr = &r_info[r_idx];
static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode)
{
/* Access the location */
- cave_type *c_ptr = &cave[y][x];
+ grid_type *g_ptr = &grid_array[y][x];
monster_type *m_ptr;
monster_race *r_ptr = &r_info[r_idx];
concptr name = (r_name + r_ptr->name);
/* Count all quest monsters */
for (i2 = 0; i2 < cur_wid; ++i2)
for (j2 = 0; j2 < cur_hgt; j2++)
- if (cave[j2][i2].m_idx > 0)
- if (m_list[cave[j2][i2].m_idx].r_idx == quest[hoge].r_idx)
+ if (grid_array[j2][i2].m_idx > 0)
+ if (m_list[grid_array[j2][i2].m_idx].r_idx == quest[hoge].r_idx)
number_mon++;
if(number_mon + quest[hoge].cur_num >= quest[hoge].max_num)
return FALSE;
}
}
- if (is_glyph_grid(c_ptr))
+ if (is_glyph_grid(g_ptr))
{
if (randint1(BREAK_GLYPH) < (r_ptr->level+20))
{
/* Describe observable breakage */
- if (c_ptr->info & CAVE_MARK)
+ if (g_ptr->info & CAVE_MARK)
{
msg_print(_("守りのルーンが壊れた!", "The rune of protection is broken!"));
}
/* Forget the rune */
- c_ptr->info &= ~(CAVE_MARK);
+ g_ptr->info &= ~(CAVE_MARK);
/* Break the rune */
- c_ptr->info &= ~(CAVE_OBJECT);
- c_ptr->mimic = 0;
+ g_ptr->info &= ~(CAVE_OBJECT);
+ g_ptr->mimic = 0;
note_spot(y, x);
}
if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL) || (r_ptr->level < 10)) mode &= ~PM_KAGE;
/* Make a new monster */
- c_ptr->m_idx = m_pop();
- hack_m_idx_ii = c_ptr->m_idx;
+ g_ptr->m_idx = m_pop();
+ hack_m_idx_ii = g_ptr->m_idx;
/* Mega-Hack -- catch "failure" */
- if (!c_ptr->m_idx) return (FALSE);
+ if (!g_ptr->m_idx) return (FALSE);
/* Get a new monster record */
- m_ptr = &m_list[c_ptr->m_idx];
+ m_ptr = &m_list[g_ptr->m_idx];
/* Save the race */
m_ptr->r_idx = r_idx;
if (r_ptr->flags7 & RF7_CHAMELEON)
{
- choose_new_monster(c_ptr->m_idx, TRUE, 0);
+ choose_new_monster(g_ptr->m_idx, TRUE, 0);
r_ptr = &r_info[m_ptr->r_idx];
m_ptr->mflag2 |= MFLAG2_CHAMELEON;
if ((mode & PM_ALLOW_SLEEP) && r_ptr->sleep && !ironman_nightmare)
{
int val = r_ptr->sleep;
- (void)set_monster_csleep(c_ptr->m_idx, (val * 2) + randint1(val * 10));
+ (void)set_monster_csleep(g_ptr->m_idx, (val * 2) + randint1(val * 10));
}
/* Assign maximal hitpoints */
/* Extract the monster base speed */
m_ptr->mspeed = get_mspeed(r_ptr);
- if (mode & PM_HASTE) (void)set_monster_fast(c_ptr->m_idx, 100);
+ if (mode & PM_HASTE) (void)set_monster_fast(g_ptr->m_idx, 100);
/* Give a random starting energy */
if (!ironman_nightmare)
}
/* Hack -- see "process_monsters()" */
- if (c_ptr->m_idx < hack_m_idx)
+ if (g_ptr->m_idx < hack_m_idx)
{
/* Monster is still being born */
m_ptr->mflag |= (MFLAG_BORN);
p_ptr->update |= (PU_MON_LITE);
else if ((r_ptr->flags7 & RF7_HAS_LD_MASK) && !MON_CSLEEP(m_ptr))
p_ptr->update |= (PU_MON_LITE);
- update_monster(c_ptr->m_idx, TRUE);
+ update_monster(g_ptr->m_idx, TRUE);
/* Count the monsters on the level */
}
}
- if (is_explosive_rune_grid(c_ptr))
+ if (is_explosive_rune_grid(g_ptr))
{
/* Break the ward */
if (randint1(BREAK_MINOR_GLYPH) > r_ptr->level)
{
/* Describe observable breakage */
- if (c_ptr->info & CAVE_MARK)
+ if (g_ptr->info & CAVE_MARK)
{
msg_print(_("ルーンが爆発した!", "The rune explodes!"));
project(0, 2, y, x, 2 * (p_ptr->lev + damroll(7, 7)), GF_MANA, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
}
/* Forget the rune */
- c_ptr->info &= ~(CAVE_MARK);
+ g_ptr->info &= ~(CAVE_MARK);
/* Break the rune */
- c_ptr->info &= ~(CAVE_OBJECT);
- c_ptr->mimic = 0;
+ g_ptr->info &= ~(CAVE_OBJECT);
+ g_ptr->mimic = 0;
note_spot(y, x);
lite_spot(y, x);
place_monster_m_idx = hack_m_idx_ii;
/* Reinforcement */
- for(i = 0; i < A_MAX; i++)
+ for(i = 0; i < 6; i++)
{
if(!r_ptr->reinforce_id[i]) break;
n = damroll(r_ptr->reinforce_dd[i], r_ptr->reinforce_ds[i]);
if (attempts < 1) return FALSE;
- m_idx = cave[y][x].m_idx;
+ m_idx = grid_array[y][x].m_idx;
if (m_list[m_idx].mflag2 & MFLAG2_CHAMELEON) r_ptr = &r_info[m_list[m_idx].r_idx];
*/
bool alloc_guardian(bool def_val)
{
- MONRACE_IDX guardian = d_info[dungeon_idx].final_guardian;
+ MONRACE_IDX guardian = d_info[p_ptr->dungeon_idx].final_guardian;
- if (guardian && (d_info[dungeon_idx].maxdepth == dun_level) && (r_info[guardian].cur_num < r_info[guardian].max_num))
+ if (guardian && (d_info[p_ptr->dungeon_idx].maxdepth == dun_level) && (r_info[guardian].cur_num < r_info[guardian].max_num))
{
- int oy;
- int ox;
+ POSITION oy;
+ POSITION ox;
int try_count = 4000;
/* Find a good position */
ox = randint1(cur_wid - 4) + 2;
/* Is it a good spot ? */
- if (cave_empty_bold2(oy, ox) && monster_can_cross_terrain(cave[oy][ox].feat, &r_info[guardian], 0))
+ if (cave_empty_bold2(oy, ox) && monster_can_cross_terrain(grid_array[oy][ox].feat, &r_info[guardian], 0))
{
/* Place the guardian */
if (place_monster_aux(0, oy, ox, guardian, (PM_ALLOW_GROUP | PM_NO_KAGE | PM_NO_PET))) return TRUE;
*/
bool alloc_monster(POSITION dis, BIT_FLAGS mode)
{
- int y = 0, x = 0;
+ POSITION y = 0, x = 0;
int attempts_left = 10000;
/* Put the Guardian */
monster_has_hostile_align(NULL, 10, -10, r_ptr))
return FALSE;
- if ((r_ptr->flags7 & RF7_CHAMELEON) && (d_info[dungeon_idx].flags1 & DF1_CHAMELEON)) return TRUE;
+ if ((r_ptr->flags7 & RF7_CHAMELEON) && (d_info[p_ptr->dungeon_idx].flags1 & DF1_CHAMELEON)) return TRUE;
return (summon_specific_aux(r_idx));
}
*/
bool multiply_monster(MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode)
{
- monster_type *m_ptr = &m_list[m_idx];
-
+ monster_type *m_ptr = &m_list[m_idx];
POSITION y, x;
if (!mon_scatter(m_ptr->r_idx, &y, &x, m_ptr->fy, m_ptr->fx, 1))
/*!
- * @brief プレイヤーを指定座標に配置する / Place the player in the dungeon XXX XXX
- * @param x 配置先X座標
- * @param y 配置先Y座標
- * @return 配置に成功したらTRUE
- */
-bool player_place(POSITION y, POSITION x)
-{
- /* Paranoia XXX XXX */
- if (cave[y][x].m_idx != 0) return FALSE;
-
- /* Save player location */
- p_ptr->y = y;
- p_ptr->x = x;
-
- /* Success */
- return TRUE;
-}
-
-
-/*!
* @brief モンスターが盗みや拾いで確保していたアイテムを全てドロップさせる / Drop all items carried by a monster
* @param m_ptr モンスター参照ポインタ
* @return なし