/* Fill the arrays of floors and walls in the good proportions */
set_floor_and_wall(floor_ptr->dungeon_idx);
- get_mon_num_prep(get_monster_hook(), NULL);
+ get_mon_num_prep(get_monster_hook(player_ptr), NULL);
/* Randomize the dungeon creation values */
dun_tun_rnd = rand_range(DUN_TUN_RND_MIN, DUN_TUN_RND_MAX);
floor_ptr->monster_level = floor_ptr->base_level;
if (record_stair) exe_write_diary(player_ptr, DIARY_TO_QUEST, floor_ptr->inside_quest, NULL);
- get_mon_num_prep(get_monster_hook(), NULL);
+ get_mon_num_prep(get_monster_hook(player_ptr), NULL);
init_flags = INIT_CREATE_DUNGEON;
extern void output_monster_spoiler(player_type *player_ptr, MONRACE_IDX r_idx, void(*roff_func)(TERM_COLOR attr, concptr str));
extern concptr extract_note_dies(MONRACE_IDX r_idx);
extern void monster_death(player_type *player_ptr, MONSTER_IDX m_idx, bool drop_item);
-extern monsterrace_hook_type get_monster_hook(void);
+extern monsterrace_hook_type get_monster_hook(player_type *player_ptr);
extern monsterrace_hook_type get_monster_hook2(POSITION y, POSITION x);
extern void set_friendly(monster_type *m_ptr);
extern void set_pet(monster_type *m_ptr);
* @brief プレイヤーの現在の広域マップ座標から得た地勢を元にモンスターの生成条件関数を返す
* @return 地勢にあったモンスターの生成条件関数
*/
-monsterrace_hook_type get_monster_hook(void)
+monsterrace_hook_type get_monster_hook(player_type *player_ptr)
{
- if (!p_ptr->current_floor_ptr->dun_level && !p_ptr->current_floor_ptr->inside_quest)
+ if (!player_ptr->current_floor_ptr->dun_level && !player_ptr->current_floor_ptr->inside_quest)
{
- switch (wilderness[p_ptr->wilderness_y][p_ptr->wilderness_x].terrain)
+ switch (wilderness[player_ptr->wilderness_y][player_ptr->wilderness_x].terrain)
{
case TERRAIN_TOWN:
return (monsterrace_hook_type)mon_hook_town;
if (monster_has_hostile_align(&floor_ptr->m_list[summon_specific_who], 0, 0, r_ptr)) return FALSE;
}
- return (*(get_monster_hook()))(r_idx);
+ return (*(get_monster_hook(p_ptr)))(r_idx);
}
/*!
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;
- return (*(get_monster_hook()))(r_idx);
+ return (*(get_monster_hook(p_ptr)))(r_idx);
}
bool place_monster(POSITION y, POSITION x, BIT_FLAGS mode)
{
MONRACE_IDX r_idx;
- get_mon_num_prep(get_monster_hook(), get_monster_hook2(y, x));
+ get_mon_num_prep(get_monster_hook(p_ptr), get_monster_hook2(y, x));
/* Pick a monster */
r_idx = get_mon_num(p_ptr->current_floor_ptr->monster_level);
int attempts = 1000;
POSITION cy = y;
POSITION cx = x;
- get_mon_num_prep(get_monster_hook(), get_monster_hook2(y, x));
+ get_mon_num_prep(get_monster_hook(p_ptr), get_monster_hook2(y, x));
floor_type *floor_ptr = p_ptr->current_floor_ptr;
while (--attempts)
process_dungeon_file(creature_ptr, "w_info.txt", 0, 0, current_world_ptr->max_wild_y, current_world_ptr->max_wild_x);
POSITION x = creature_ptr->wilderness_x;
POSITION y = creature_ptr->wilderness_y;
- get_mon_num_prep(get_monster_hook(), NULL);
+ get_mon_num_prep(get_monster_hook(creature_ptr), NULL);
/* North border */
generate_area(creature_ptr, y - 1, x, TRUE, FALSE);