diff options
author | Darshan Shaligram <dshaligram@users.sourceforge.net> | 2010-01-11 22:37:23 +0530 |
---|---|---|
committer | Darshan Shaligram <dshaligram@users.sourceforge.net> | 2010-01-11 22:37:23 +0530 |
commit | 04163afa8a2c64c15323834a89e2425cc7f4b126 (patch) | |
tree | 2851deaaf239cb718b1a453816d042155642d51c /crawl-ref/source/dgn-shoals.cc | |
parent | 4fd99e7de430294df85772878b1fe1ba5d521160 (diff) | |
download | crawl-ref-04163afa8a2c64c15323834a89e2425cc7f4b126.tar.gz crawl-ref-04163afa8a2c64c15323834a89e2425cc7f4b126.zip |
Set hard limit of 180 plants per Shoals level, reduce density of plant clusters.
Diffstat (limited to 'crawl-ref/source/dgn-shoals.cc')
-rw-r--r-- | crawl-ref/source/dgn-shoals.cc | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/crawl-ref/source/dgn-shoals.cc b/crawl-ref/source/dgn-shoals.cc index 4f7879b5e0..084403a9c0 100644 --- a/crawl-ref/source/dgn-shoals.cc +++ b/crawl-ref/source/dgn-shoals.cc @@ -62,6 +62,7 @@ const int CALL_TIDE_VELOCITY = 21; // The area around the user of a call tide spell that is subject to // local tide elevation. const int TIDE_CALL_RADIUS = 8; +const int MAX_SHOAL_PLANTS = 180; const int _shoals_margin = 6; @@ -85,6 +86,7 @@ static monsters *tide_caller = NULL; static coord_def tide_caller_pos; static long tide_called_turns = 0L; static int tide_called_peak = 0; +static int shoals_plant_quota = 0; static dungeon_feature_type _shoals_feature_by_height(int height) { @@ -582,9 +584,13 @@ static coord_def _shoals_pick_region( static void _shoals_make_plant_at(coord_def p) { - // [ds] Why is hostile_at() saddled with unnecessary parameters - // related to summoning? - mons_place(mgen_data::hostile_at(MONS_PLANT, "", false, 0, 0, p)); + if (shoals_plant_quota > 0) + { + // [ds] Why is hostile_at() saddled with unnecessary parameters + // related to summoning? + mons_place(mgen_data::hostile_at(MONS_PLANT, "", false, 0, 0, p)); + --shoals_plant_quota; + } } static bool _shoals_plantworthy_feat(dungeon_feature_type feat) @@ -596,6 +602,9 @@ static void _shoals_make_plant_near(coord_def c, int radius, dungeon_feature_type preferred_feat, grid_bool *verboten) { + if (shoals_plant_quota <= 0) + return; + const int ntries = 5; for (int i = 0; i < ntries; ++i) { @@ -627,7 +636,7 @@ static void _shoals_plant_supercluster(coord_def c, dungeon_feature_type favoured_feat, grid_bool *verboten = NULL) { - _shoals_plant_cluster(c, random_range(10, 25, 2), + _shoals_plant_cluster(c, random_range(10, 17, 2), random_range(3, 9), favoured_feat, verboten); @@ -637,7 +646,7 @@ static void _shoals_plant_supercluster(coord_def c, const coord_def satellite( _random_point_from(c, random_range(2, 12))); if (!satellite.origin()) - _shoals_plant_cluster(satellite, random_range(5, 23, 2), + _shoals_plant_cluster(satellite, random_range(5, 12, 2), random_range(2, 7), favoured_feat, verboten); @@ -752,6 +761,8 @@ static void _shoals_generate_flora() const int n_water_clusters = std::max(0, random_range(-1, 6, 2)); const int n_wind_clusters = std::max(0, random_range(-2, 2, 2)); + shoals_plant_quota = MAX_SHOAL_PLANTS; + if (n_water_clusters) { grid_short region_map(0); |