#include "rooms.h"
#include "floor-streams.h"
#include "trap.h"
+#include "monster.h"
+#include "quest.h"
int dun_tun_rnd;
int dun_tun_chg;
/* Fill the arrays of floors and walls in the good proportions */
set_floor_and_wall(dungeon_type);
-
- /* Prepare allocation table */
get_mon_num_prep(get_monster_hook(), NULL);
/* Randomize the dungeon creation values */
/* Hack -- Add some rivers */
if (one_in_(3) && (randint1(dun_level) > 5))
{
- IDX feat1 = 0, feat2 = 0;
+ FEAT_IDX feat1 = 0, feat2 = 0;
- /* Choose water or lava */
+ /* Choose water mainly */
if ((randint1(MAX_DEPTH * 2) - 1 > dun_level) && (d_info[dungeon_type].flags1 & DF1_WATER_RIVER))
{
feat1 = feat_deep_water;
feat2 = feat_shallow_water;
}
- else if (d_info[dungeon_type].flags1 & DF1_LAVA_RIVER)
+ else /* others */
{
- feat1 = feat_deep_lava;
- feat2 = feat_shallow_lava;
+ FEAT_IDX select_deep_feat[10];
+ FEAT_IDX select_shallow_feat[10];
+ int select_id_max = 0, selected;
+
+ if (d_info[dungeon_type].flags1 & DF1_LAVA_RIVER)
+ {
+ select_deep_feat[select_id_max] = feat_deep_lava;
+ select_shallow_feat[select_id_max] = feat_shallow_lava;
+ select_id_max++;
+ }
+ if (d_info[dungeon_type].flags1 & DF1_POISONOUS_RIVER)
+ {
+ select_deep_feat[select_id_max] = feat_deep_poisonous_puddle;
+ select_shallow_feat[select_id_max] = feat_shallow_poisonous_puddle;
+ select_id_max++;
+ }
+ if (d_info[dungeon_type].flags1 & DF1_ACID_RIVER)
+ {
+ select_deep_feat[select_id_max] = feat_deep_acid_puddle;
+ select_shallow_feat[select_id_max] = feat_shallow_acid_puddle;
+ select_id_max++;
+ }
+
+ selected = randint0(select_id_max);
+ feat1 = select_deep_feat[selected];
+ feat2 = select_shallow_feat[selected];
}
- else feat1 = 0;
if (feat1)
{
for(i = 0; i < 4; i++)
{
- place_monster_aux(0, p_ptr->y + 8 + (i/2)*4, p_ptr->x - 2 + (i%2)*4, battle_mon[i],
- (PM_NO_KAGE | PM_NO_PET));
+ place_monster_aux(0, p_ptr->y + 8 + (i/2)*4, p_ptr->x - 2 + (i%2)*4, battle_mon[i], (PM_NO_KAGE | PM_NO_PET));
set_friendly(&m_list[cave[p_ptr->y+8+(i/2)*4][p_ptr->x-2+(i%2)*4].m_idx]);
}
for(i = 1; i < m_max; i++)
if (!m_ptr->r_idx) continue;
- /* Hack -- Detect monster */
m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
update_monster(i, FALSE);
}
{
POSITION x, y;
-
/* Start with perm walls */
for (y = 0; y < cur_hgt; y++)
{
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;
* @brief ダンジョン時のランダムフロア生成 / Make a real level
* @return フロアの生成に成功したらTRUE
*/
-static bool level_gen(cptr *why)
+static bool level_gen(concptr *why)
{
int level_height, level_width;
level_height = randint1(MAX_HGT/SCREEN_HGT);
level_width = randint1(MAX_WID/SCREEN_WID);
}
- while ((level_height == MAX_HGT/SCREEN_HGT) &&
- (level_width == MAX_WID/SCREEN_WID));
+ while ((level_height == MAX_HGT/SCREEN_HGT) && (level_width == MAX_WID/SCREEN_WID));
}
cur_hgt = level_height * SCREEN_HGT;
/* Make a dungeon */
if (!cave_gen())
{
-#ifdef JP
-*why = "ダンジョン生成に失敗";
-#else
- *why = "could not place player";
-#endif
-
+ *why = _("ダンジョン生成に失敗", "could not place player");
return FALSE;
}
else return TRUE;
for (x = 0; x < MAX_WID; x++)
{
cave_type *c_ptr = &cave[y][x];
-
- /* No flags */
c_ptr->info = 0;
-
- /* No features */
c_ptr->feat = 0;
-
- /* No objects */
c_ptr->o_idx = 0;
-
- /* No monsters */
c_ptr->m_idx = 0;
-
- /* No special */
c_ptr->special = 0;
-
- /* No mimic */
c_ptr->mimic = 0;
-
- /* No flow */
c_ptr->cost = 0;
c_ptr->dist = 0;
c_ptr->when = 0;
{
bool okay = TRUE;
- cptr why = NULL;
+ concptr why = NULL;
/* Clear and empty the cave */
clear_cave();
if (why) msg_format(_("生成やり直し(%s)", "Generation restarted (%s)"), why);
- /* Wipe the objects */
wipe_o_list();
-
- /* Wipe the monsters */
wipe_m_list();
}