From c0aa968809c8d8ef88048edd667b12b297a68602 Mon Sep 17 00:00:00 2001 From: Darshan Shaligram Date: Sat, 16 Jan 2010 22:50:34 +0530 Subject: Experimental level builder changes for Swamp. The Swamp now gets a border of trees and uses trees instead of walls. Swamp:5 vaults may need tweaking to fit in better. --- crawl-ref/source/dgn-shoals.cc | 52 +++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'crawl-ref/source/dgn-shoals.cc') 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 #include -typedef FixedArray grid_bool; typedef FixedArray 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(DNGN_STONE_STAIRS_DOWN_I + i)); - place_feature_at_random_floor_square( - static_cast(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"; -- cgit v1.2.3-54-g00ecf