#include "quest.h"
#include "wild.h"
#include "spells-floor.h"
+#include "monster-status.h"
static FLOOR_IDX new_floor_id; /*!<次のフロアのID / floor_id of the destination */
if (p_ptr->riding)
{
- monster_type *m_ptr = &m_list[p_ptr->riding];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[p_ptr->riding];
/* Pet of other pet don't follow. */
if (m_ptr->parent_m_idx)
{
for (i = m_max - 1, num = 1; (i >= 1 && num < MAX_PARTY_MON); i--)
{
- monster_type *m_ptr = &m_list[i];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
- if (!m_ptr->r_idx) continue;
+ if (!monster_is_valid(m_ptr)) continue;
if (!is_pet(m_ptr)) continue;
if (i == p_ptr->riding) continue;
}
}
- (void)COPY(&party_mon[num], &m_list[i], monster_type);
+ (void)COPY(&party_mon[num], ¤t_floor_ptr->m_list[i], monster_type);
num++;
{
for (i = m_max - 1; i >=1; i--)
{
- monster_type *m_ptr = &m_list[i];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
GAME_TEXT m_name[MAX_NLEN];
- if (!m_ptr->r_idx) continue;
+ if (!monster_is_valid(m_ptr)) continue;
if (!is_pet(m_ptr)) continue;
if (!m_ptr->nickname) continue;
if (p_ptr->riding == i) continue;
/* Pet of other pet may disappear. */
for (i = m_max - 1; i >=1; i--)
{
- monster_type *m_ptr = &m_list[i];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
/* Are there its parent? */
- if (m_ptr->parent_m_idx && !m_list[m_ptr->parent_m_idx].r_idx)
+ if (m_ptr->parent_m_idx && !current_floor_ptr->m_list[m_ptr->parent_m_idx].r_idx)
{
/* Its parent have gone, it also goes away. */
m_ptr = &party_mon[i];
/* Skip empty monsters */
- if (!m_ptr->r_idx) continue;
+ if (!monster_is_valid(m_ptr)) continue;
/* Hack -- Increase the racial counter */
real_r_ptr(m_ptr)->cur_num++;
if (m_idx)
{
- monster_type *m_ptr = &m_list[m_idx];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
monster_race *r_ptr;
current_floor_ptr->grid_array[cy][cx].m_idx = m_idx;
for (i = 1; i < m_max; i++)
{
monster_race *r_ptr;
- monster_type *m_ptr = &m_list[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;
/* Extract real monster race */
r_ptr = real_r_ptr(m_ptr);
/*** It's a good place ***/
- m_ptr = &m_list[m_idx];
+ m_ptr = ¤t_floor_ptr->m_list[m_idx];
/* Update the old location */
current_floor_ptr->grid_array[oy][ox].m_idx = 0;
for (i = 1; i < m_max; i++)
{
monster_race *r_ptr;
- monster_type *m_ptr = &m_list[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;
/* Only maintain quest monsters */
if (quest_r_idx != m_ptr->r_idx) continue;
/* Get out of the my way! */
get_out_monster();
- /* Record the last visit turn of current floor */
- sf_ptr->last_visit = turn;
+ /* Record the last visit current_world_ptr->game_turn of current floor */
+ sf_ptr->last_visit = current_world_ptr->game_turn;
forget_lite();
forget_view();
panel_col_max = 0;
/* Mega-Hack -- not ambushed on the wildness? */
- ambush_flag = FALSE;
+ p_ptr->ambush_flag = FALSE;
/* No saved floors (On the surface etc.) */
if (!(change_floor_mode & CFM_SAVE_FLOORS) &&
int alloc_chance = d_info[p_ptr->dungeon_idx].max_m_alloc_chance;
GAME_TURN alloc_times;
- while (tmp_last_visit > turn) tmp_last_visit -= TURNS_PER_TICK * TOWN_DAWN;
- absence_ticks = (turn - tmp_last_visit) / TURNS_PER_TICK;
+ while (tmp_last_visit > current_world_ptr->game_turn) tmp_last_visit -= TURNS_PER_TICK * TOWN_DAWN;
+ absence_ticks = (current_world_ptr->game_turn - tmp_last_visit) / TURNS_PER_TICK;
/* Maintain monsters */
for (i = 1; i < m_max; i++)
{
monster_race *r_ptr;
- monster_type *m_ptr = &m_list[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;
if (!is_pet(m_ptr))
{
generate_random_floor();
}
- /* Record last visit turn */
- sf_ptr->last_visit = turn;
+ /* Record last visit current_world_ptr->game_turn */
+ sf_ptr->last_visit = current_world_ptr->game_turn;
/* Set correct current_floor_ptr->dun_level value */
sf_ptr->dun_level = current_floor_ptr->dun_level;
/*
* Update visit mark
*
- * The "turn" is not always different number because
- * the level teleport doesn't take any turn. Use
- * visit mark instead of last visit turn to find the
+ * The "current_world_ptr->game_turn" is not always different number because
+ * the level teleport doesn't take any current_world_ptr->game_turn. Use
+ * visit mark instead of last visit current_world_ptr->game_turn to find the
* oldest saved floor.
*/
sf_ptr->visit_mark = latest_visit_mark++;
wiz_lite((bool)(p_ptr->pclass == CLASS_NINJA));
/* Remember when this level was "created" */
- old_turn = turn;
+ current_floor_ptr->generated_turn = current_world_ptr->game_turn;
/* No dungeon feeling yet */
- p_ptr->feeling_turn = old_turn;
+ p_ptr->feeling_turn = current_floor_ptr->generated_turn;
p_ptr->feeling = 0;
/* Clear all flags */