#define CAVE_IN_DETECT 0x4000 /* trap detected area (inner circle only) */
+/* Room types for generate_lake() */
+#define GEN_LAKE_TYPE_LAVA 1
+#define GEN_LAKE_TYPE_WATER 2
+#define GEN_LAKE_TYPE_CAVE 3
+#define GEN_LAKE_TYPE_EARTH_VAULT 4
+#define GEN_LAKE_TYPE_AIR_VAULT 5
+#define GEN_LAKE_TYPE_WATER_VAULT 6
+#define GEN_LAKE_TYPE_FIRE_VAULT 7
+
+
/* Room types for room_build() */
#define ROOM_BUILD_TYPE_NORMAL 1
#define ROOM_BUILD_TYPE_OVERLAP 2
destroyed = TRUE;
/* extra rubble around the place looks cool */
- build_lake(3+randint0(2));
+ build_lake(one_in_(2) ? GEN_LAKE_TYPE_CAVE : GEN_LAKE_TYPE_EARTH_VAULT);
}
/* Make a lake some of the time */
if (d_info[dungeon_type].flags1 & DF1_LAKE_LAVA)
{
/* Lake of Lava */
- if ((dun_level > 80) && (randint0(count) < 2)) laketype = 1;
+ if ((dun_level > 80) && (randint0(count) < 2)) laketype = GEN_LAKE_TYPE_LAVA;
count -= 2;
/* Lake of Lava2 */
- if (!laketype && (dun_level > 80) && one_in_(count)) laketype = 7;
+ if (!laketype && (dun_level > 80) && one_in_(count)) laketype = GEN_LAKE_TYPE_FIRE_VAULT;
count--;
}
if ((d_info[dungeon_type].flags1 & DF1_LAKE_WATER) && !laketype)
{
/* Lake of Water */
- if ((dun_level > 50) && randint0(count) < 2) laketype = 2;
+ if ((dun_level > 50) && randint0(count) < 2) laketype = GEN_LAKE_TYPE_WATER;
count -= 2;
/* Lake of Water2 */
- if (!laketype && (dun_level > 50) && one_in_(count)) laketype = 6;
+ if (!laketype && (dun_level > 50) && one_in_(count)) laketype = GEN_LAKE_TYPE_WATER_VAULT;
count--;
}
if ((d_info[dungeon_type].flags1 & DF1_LAKE_RUBBLE) && !laketype)
{
/* Lake of rubble */
- if ((dun_level > 35) && (randint0(count) < 2)) laketype = 3;
+ if ((dun_level > 35) && (randint0(count) < 2)) laketype = GEN_LAKE_TYPE_CAVE;
count -= 2;
/* Lake of rubble2 */
- if (!laketype && (dun_level > 35) && one_in_(count)) laketype = 4;
+ if (!laketype && (dun_level > 35) && one_in_(count)) laketype = GEN_LAKE_TYPE_EARTH_VAULT;
count--;
}
/* Lake of tree */
- if ((dun_level > 5) && (d_info[dungeon_type].flags1 & DF1_LAKE_TREE) && !laketype) laketype = 5;
+ if ((dun_level > 5) && (d_info[dungeon_type].flags1 & DF1_LAKE_TREE) && !laketype) laketype = GEN_LAKE_TYPE_AIR_VAULT;
- if (laketype != 0)
+ if (laketype)
{
if (cheat_room)
#ifdef JP
if ((dun_level > DUN_CAVERN) && !empty_level &&
(d_info[dungeon_type].flags1 & DF1_CAVERN) &&
- (laketype == 0) && !destroyed && (randint1(1000) < dun_level))
+ !laketype && !destroyed && (randint1(1000) < dun_level))
{
cavern = TRUE;
k = randint1(100);
/* No caves when a cavern exists: they look bad */
- if (((k < dun_level) || (d_info[dungeon_type].flags1 & DF1_CAVE)) && (!cavern) && (!empty_level) && (laketype == 0) && !(d_info[dungeon_type].flags1 & DF1_NO_CAVE))
+ if (((k < dun_level) || (d_info[dungeon_type].flags1 & DF1_CAVE))
+ && !cavern && !empty_level && !laketype
+ && !(d_info[dungeon_type].flags1 & DF1_NO_CAVE))
{
/* Type 9 -- Fractal cave */
if (room_build(y, x, ROOM_BUILD_TYPE_FRACAVE)) continue;
/* Only add river if matches lake type or if have no lake at all */
- if ((((laketype == 1) && (feat1 == FEAT_DEEP_LAVA)) ||
- ((laketype == 2) && (feat1 == FEAT_DEEP_WATER)) ||
- (laketype == 0)) && feat1)
+ if ((((laketype == GEN_LAKE_TYPE_LAVA) && (feat1 == FEAT_DEEP_LAVA)) ||
+ ((laketype == GEN_LAKE_TYPE_WATER) && (feat1 == FEAT_DEEP_WATER)) ||
+ !laketype) && feat1)
{
add_river(feat1, feat2);
}
/* Get features based on type */
switch (type)
{
- case 1: {
- /* Lava */
- feat1 = FEAT_DEEP_LAVA;
- feat2 = FEAT_SHAL_LAVA;
- feat3 = floor_type[randint0(100)];
- }; break;
- case 2:{
- /* Water */
- feat1 = FEAT_DEEP_WATER;
- feat2 = FEAT_SHAL_WATER;
- feat3 = floor_type[randint0(100)];
- }; break;
- case 3: {
- /* Collapsed cave */
- feat1 = floor_type[randint0(100)];
- feat2 = floor_type[randint0(100)];
- feat3 = FEAT_RUBBLE;
- }; break;
- case 4: {
- /* Earth vault */
- feat1 = FEAT_RUBBLE;
- feat2 = floor_type[randint0(100)];
- feat3 = FEAT_RUBBLE;
- }; break;
- case 5: {
- /* Air vault */
- feat1 = FEAT_GRASS;
- feat2 = FEAT_TREES;
- feat3 = FEAT_GRASS;
- }; break;
- case 6: {
- /* Water vault */
- feat1 = FEAT_SHAL_WATER;
- feat2 = FEAT_DEEP_WATER;
- feat3 = FEAT_SHAL_WATER;
- }; break;
- case 7: {
- /* Fire Vault */
- feat1 = FEAT_SHAL_LAVA;
- feat2 = FEAT_DEEP_LAVA;
- feat3 = FEAT_SHAL_LAVA;
- }; break;
+ case GEN_LAKE_TYPE_LAVA: /* Lava */
+ feat1 = FEAT_DEEP_LAVA;
+ feat2 = FEAT_SHAL_LAVA;
+ feat3 = floor_type[randint0(100)];
+ break;
+ case GEN_LAKE_TYPE_WATER: /* Water */
+ feat1 = FEAT_DEEP_WATER;
+ feat2 = FEAT_SHAL_WATER;
+ feat3 = floor_type[randint0(100)];
+ break;
+ case GEN_LAKE_TYPE_CAVE: /* Collapsed cave */
+ feat1 = floor_type[randint0(100)];
+ feat2 = floor_type[randint0(100)];
+ feat3 = FEAT_RUBBLE;
+ break;
+ case GEN_LAKE_TYPE_EARTH_VAULT: /* Earth vault */
+ feat1 = FEAT_RUBBLE;
+ feat2 = floor_type[randint0(100)];
+ feat3 = FEAT_RUBBLE;
+ break;
+ case GEN_LAKE_TYPE_AIR_VAULT: /* Air vault */
+ feat1 = FEAT_GRASS;
+ feat2 = FEAT_TREES;
+ feat3 = FEAT_GRASS;
+ break;
+ case GEN_LAKE_TYPE_WATER_VAULT: /* Water vault */
+ feat1 = FEAT_SHAL_WATER;
+ feat2 = FEAT_DEEP_WATER;
+ feat3 = FEAT_SHAL_WATER;
+ break;
+ case GEN_LAKE_TYPE_FIRE_VAULT: /* Fire Vault */
+ feat1 = FEAT_SHAL_LAVA;
+ feat2 = FEAT_DEEP_LAVA;
+ feat3 = FEAT_SHAL_LAVA;
+ break;
- /* Paranoia */
- default: return FALSE;
+ /* Paranoia */
+ default: return FALSE;
}
/*
* this gets rid of alot of isolated one-sqaures that
* can make teleport traps instadeaths...
*/
-
+
/* cutoffs */
fill_data.c1 = c1;
fill_data.c2 = c2;
int c1, c2, c3;
/* paranoia - exit if lake type out of range. */
- if ((type < 1) || (type > 7))
+ if ((type < GEN_LAKE_TYPE_LAVA) || (type > GEN_LAKE_TYPE_FIRE_VAULT))
{
msg_format("Invalid lake type (%d)", type);
return;
if (dun_level < 25)
{
/* Earth vault (Rubble) */
- type = 4;
+ type = GEN_LAKE_TYPE_EARTH_VAULT;
}
else if (dun_level < 50)
{
/* Air vault (Trees) */
- type = 5;
+ type = GEN_LAKE_TYPE_AIR_VAULT;
}
else if (dun_level < 75)
{
/* Water vault (shallow water) */
- type = 6;
+ type = GEN_LAKE_TYPE_WATER_VAULT;
}
else
{
/* Fire vault (shallow lava) */
- type = 7;
+ type = GEN_LAKE_TYPE_FIRE_VAULT;
}
while (!done)