* @brief 階段移動先のフロアが生成できない時に簡単な行き止まりマップを作成する / Builds the dead end
* @return なし
*/
-static void build_dead_end(void)
+static void build_dead_end(floor_type *floor_ptr)
{
POSITION x, y;
- /* Clear and empty the current_floor_ptr->grid_array */
- clear_cave();
+ clear_cave(floor_ptr);
/* Fill the arrays of floors and walls in the good proportions */
set_floor_and_wall(0);
/* Smallest area */
- current_floor_ptr->height = SCREEN_HGT;
- current_floor_ptr->width = SCREEN_WID;
+ floor_ptr->height = SCREEN_HGT;
+ floor_ptr->width = SCREEN_WID;
/* Filled with permanent walls */
for (y = 0; y < MAX_HGT; y++)
}
/* Place at center of the floor */
- p_ptr->y = current_floor_ptr->height / 2;
- p_ptr->x = current_floor_ptr->width / 2;
+ p_ptr->y = floor_ptr->height / 2;
+ p_ptr->x = floor_ptr->width / 2;
/* Give one square */
place_floor_bold(p_ptr->y, p_ptr->x);
- wipe_generate_random_floor_flags();
+ wipe_generate_random_floor_flags(floor_ptr);
}
* @brief 移動先のフロアに伴ったペットを配置する / Place preserved pet monsters on new floor
* @return なし
*/
-static void place_pet(void)
+static void place_pet(player_type *master_ptr)
{
int i;
- int max_num = p_ptr->wild_mode ? 1 : MAX_PARTY_MON;
+ int max_num = master_ptr->wild_mode ? 1 : MAX_PARTY_MON;
for (i = 0; i < max_num; i++)
{
if (i == 0)
{
m_idx = m_pop();
- p_ptr->riding = m_idx;
+ master_ptr->riding = m_idx;
if (m_idx)
{
- cy = p_ptr->y;
- cx = p_ptr->x;
+ cy = master_ptr->y;
+ cx = master_ptr->x;
}
}
else
{
for (j = 1000; j > 0; j--)
{
- scatter(&cy, &cx, p_ptr->y, p_ptr->x, d, 0);
+ scatter(&cy, &cx, master_ptr->y, master_ptr->x, d, 0);
if (monster_can_enter(cy, cx, &r_info[party_mon[i].r_idx], 0)) break;
}
if (j) break;
if (record_named_pet && m_ptr->nickname)
{
monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
- exe_write_diary(p_ptr, NIKKI_NAMED_PET, RECORD_NAMED_PET_LOST_SIGHT, m_name);
+ exe_write_diary(master_ptr, NIKKI_NAMED_PET, RECORD_NAMED_PET_LOST_SIGHT, m_name);
}
/* Pre-calculated in precalc_cur_num_of_pet(), but need to decrease */
forget_lite();
forget_view();
- clear_mon_lite();
+ clear_mon_lite(current_floor_ptr);
/* Save current floor */
if (!save_floor(sf_ptr, 0))
!(floor_mode & CFM_FIRST_FLOOR))
{
/* Create current_floor_ptr->grid_array */
- generate_random_floor();
+ generate_random_floor(current_floor_ptr);
/* Paranoia -- No new saved floor */
new_floor_id = 0;
msg_print(_("階段は行き止まりだった。", "The staircases come to a dead end..."));
/* Create simple dead end */
- build_dead_end();
+ build_dead_end(current_floor_ptr);
/* Break connection */
if (floor_mode & CFM_UP)
else
{
/* Newly create current_floor_ptr->grid_array */
- generate_random_floor();
+ generate_random_floor(current_floor_ptr);
}
/* Record last visit current_world_ptr->game_turn */
}
/* Place preserved pet monsters */
- place_pet();
+ place_pet(p_ptr);
/* Reset travel target place */
forget_travel_flow();
/* Hack -- Munchkin characters always get whole map */
if (p_ptr->pseikaku == SEIKAKU_MUNCHKIN)
- wiz_lite((bool)(p_ptr->pclass == CLASS_NINJA));
+ wiz_lite(p_ptr, (bool)(p_ptr->pclass == CLASS_NINJA));
/* Remember when this level was "created" */
current_floor_ptr->generated_turn = current_world_ptr->game_turn;
/* Clear all flags */
floor_mode = 0L;
- select_floor_music();
+ select_floor_music(p_ptr);
p_ptr->change_floor_mode = 0;
}