/*! * @brief 階段移動先のフロアが生成できない時に簡単な行き止まりマップを作成する / Builds the dead end * @return なし */ static void build_dead_end(void) { int x,y; /* Clear and empty the cave */ clear_cave(); /* Fill the arrays of floors and walls in the good proportions */ set_floor_and_wall(0); /* Smallest area */ cur_hgt = SCREEN_HGT; cur_wid = SCREEN_WID; /* Filled with permanent walls */ for (y = 0; y < MAX_HGT; y++) { for (x = 0; x < MAX_WID; x++) { /* Create "solid" perma-wall */ place_solid_perm_bold(y, x); } } /* Place at center of the floor */ p_ptr->y = cur_hgt / 2; p_ptr->x = cur_wid / 2; /* Give one square */ place_floor_bold(p_ptr->y, p_ptr->x); wipe_generate_cave_flags(); }
/* * Generate a quest level */ static void quest_gen(void) { int x, y; /* Start with perm walls */ for (y = 0; y < cur_hgt; y++) { for (x = 0; x < cur_wid; x++) { place_solid_perm_bold(y, x); } } /* Set the quest level */ base_level = quest[p_ptr->inside_quest].level; dun_level = base_level; object_level = base_level; monster_level = base_level; if (record_stair) do_cmd_write_nikki(NIKKI_TO_QUEST, p_ptr->inside_quest, NULL); /* Prepare allocation table */ get_mon_num_prep(get_monster_hook(), NULL); init_flags = INIT_CREATE_DUNGEON | INIT_ASSIGN; process_dungeon_file("q_info.txt", 0, 0, MAX_HGT, MAX_WID); }
/* * Town logic flow for generation of arena -KMW- */ static void battle_gen(void) { int y, x, i; int qy = 0; int qx = 0; /* Start with solid walls */ for (y = 0; y < MAX_HGT; y++) { for (x = 0; x < MAX_WID; x++) { /* Create "solid" perma-wall */ place_solid_perm_bold(y, x); /* Illuminate and memorize the walls */ cave[y][x].info |= (CAVE_GLOW | CAVE_MARK); } } /* Then place some floors */ for (y = qy + 1; y < qy + SCREEN_HGT - 1; y++) { for (x = qx + 1; x < qx + SCREEN_WID - 1; x++) { /* Create empty floor */ cave[y][x].feat = feat_floor; } } build_battle(); for(i=0;i<4;i++) { place_monster_aux(0, py + 8 + (i/2)*4, px - 2 + (i%2)*4, battle_mon[i], (PM_NO_KAGE | PM_NO_PET)); set_friendly(&m_list[cave[py+8+(i/2)*4][px-2+(i%2)*4].m_idx]); } for(i = 1; i < m_max; i++) { monster_type *m_ptr = &m_list[i]; if (!m_ptr->r_idx) continue; /* Hack -- Detect monster */ m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW); /* Update the monster */ update_mon(i, FALSE); } }
/*! * @brief 闘技場への入場処理 / Town logic flow for generation of arena -KMW- * @return なし */ static void arena_gen(void) { int y, x; int qy = 0; int qx = 0; /* Smallest area */ cur_hgt = SCREEN_HGT; cur_wid = SCREEN_WID; /* Start with solid walls */ for (y = 0; y < MAX_HGT; y++) { for (x = 0; x < MAX_WID; x++) { /* Create "solid" perma-wall */ place_solid_perm_bold(y, x); /* Illuminate and memorize the walls */ cave[y][x].info |= (CAVE_GLOW | CAVE_MARK); } } /* Then place some floors */ for (y = qy + 1; y < qy + SCREEN_HGT - 1; y++) { for (x = qx + 1; x < qx + SCREEN_WID - 1; x++) { /* Create empty floor */ cave[y][x].feat = feat_floor; } } build_arena(); if(!place_monster_aux(0, p_ptr->y + 5, p_ptr->x, arena_info[p_ptr->arena_number].r_idx, (PM_NO_KAGE | PM_NO_PET))) { p_ptr->exit_bldg = TRUE; p_ptr->arena_number++; #ifdef JP msg_print("相手は欠場した。あなたの不戦勝だ。"); #else msg_print("The enemy is unable appear. You won by default."); #endif } }
/* * Town logic flow for generation of arena -KMW- */ static void arena_gen(void) { int y, x; int qy = 0; int qx = 0; /* Smallest area */ cur_hgt = SCREEN_HGT; cur_wid = SCREEN_WID; /* Start with solid walls */ for (y = 0; y < MAX_HGT; y++) { for (x = 0; x < MAX_WID; x++) { /* Create "solid" perma-wall */ place_solid_perm_bold(y, x); /* Illuminate and memorize the walls */ cave[y][x].info |= (CAVE_GLOW | CAVE_MARK | CAVE_AWARE); } } /* Then place some floors */ for (y = qy + 1; y < qy + SCREEN_HGT - 1; y++) { for (x = qx + 1; x < qx + SCREEN_WID - 1; x++) { /* Create empty floor */ cave[y][x].feat = feat_floor; } } build_arena(); place_monster_aux(0, py + 5, px, arena_info[p_ptr->arena_number].r_idx, (PM_NO_KAGE | PM_NO_PET)); }