summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dgn-shoals.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/dgn-shoals.cc')
-rw-r--r--crawl-ref/source/dgn-shoals.cc52
1 files changed, 26 insertions, 26 deletions
diff --git a/crawl-ref/source/dgn-shoals.cc b/crawl-ref/source/dgn-shoals.cc
index 03dd0196d1..3f9637cbad 100644
--- a/crawl-ref/source/dgn-shoals.cc
+++ b/crawl-ref/source/dgn-shoals.cc
@@ -23,7 +23,6 @@
#include <vector>
#include <cmath>
-typedef FixedArray<bool, GXM, GYM> grid_bool;
typedef FixedArray<short, GXM, GYM> grid_short;
const char *ENVP_SHOALS_TIDE_KEY = "shoals-tide-height";
@@ -31,6 +30,8 @@ const char *ENVP_SHOALS_TIDE_VEL = "shoals-tide-velocity";
static dgn_island_plan _shoals_islands;
+const int SHOALS_ISLAND_COLLIDE_DIST2 = 5 * 5;
+
// The raw tide height / TIDE_MULTIPLIER is the actual tide height. The higher
// the tide multiplier, the slower the tide advances and recedes. A multiplier
// of X implies that the tide will advance visibly about once in X turns.
@@ -128,10 +129,31 @@ static void _shoals_init_heights()
dgn_initialise_heightmap(SHT_SHALLOW_WATER - 3);
}
+static dgn_island_plan _shoals_island_plan()
+{
+ dgn_island_plan plan;
+ plan.level_border_depth = _shoals_margin;
+ plan.n_aux_centres = int_range(0, 3);
+ plan.aux_centre_offset_range = int_range(2, 10);
+
+ plan.atoll_roll = 10;
+ plan.island_separation_dist2 = SHOALS_ISLAND_COLLIDE_DIST2;
+
+ plan.n_island_centre_delta_points = int_range(50, 60);
+ plan.island_centre_radius_range = int_range(3, 10);
+ plan.island_centre_point_height_increment = int_range(40, 60);
+
+ plan.n_island_aux_delta_points = int_range(25, 45);
+ plan.island_aux_radius_range = int_range(2, 7);
+ plan.island_aux_point_height_increment = int_range(25, 35);
+
+ return (plan);
+}
+
static void _shoals_init_islands(int depth)
{
const int nislands = 20 - depth * 2;
- _shoals_islands = dgn_island_plan::shoals_islands(_shoals_margin);
+ _shoals_islands = _shoals_island_plan();
_shoals_islands.build(nislands);
}
@@ -240,28 +262,6 @@ static coord_def _pick_shoals_island()
return _shoals_islands.pick_and_remove_random_island();
}
-void place_feature_at_random_floor_square(dungeon_feature_type feat,
- unsigned mask = MMT_VAULT)
-{
- const coord_def place =
- dgn_random_point_in_bounds(DNGN_FLOOR, mask, DNGN_FLOOR);
- if (place.origin())
- dgn_veto_level();
- else
- grd(place) = feat;
-}
-
-static void _shoals_place_stairs()
-{
- for (int i = 0; i < 3; ++i)
- {
- place_feature_at_random_floor_square(
- static_cast<dungeon_feature_type>(DNGN_STONE_STAIRS_DOWN_I + i));
- place_feature_at_random_floor_square(
- static_cast<dungeon_feature_type>(DNGN_STONE_STAIRS_UP_I + i));
- }
-}
-
static void _shoals_furniture(int margin)
{
if (at_branch_bottom())
@@ -302,7 +302,7 @@ static void _shoals_furniture(int margin)
}
}
- _shoals_place_stairs();
+ dgn_place_stone_stairs();
}
static void _shoals_deepen_edges()
@@ -665,7 +665,7 @@ static void _shoals_generate_flora()
}
}
-void prepare_shoals(int level_number)
+void dgn_build_shoals_level(int level_number)
{
dgn_Build_Method += make_stringf(" shoals+ [%d]", level_number);
dgn_Layout_Type = "shoals";