diff options
author | Jesse Luehrs <doy@tozt.net> | 2010-01-10 02:26:13 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2010-01-10 02:26:13 -0600 |
commit | 958627e9c8f506c7183eac5dd05e89d41d62e759 (patch) | |
tree | d6c37025611656a60e23ef4261f44d84c489ea8d /crawl-ref/source/dungeon.cc | |
parent | 8c6033d18dd49a257b8dc3b505e8ba2d57c37221 (diff) | |
download | crawl-ref-958627e9c8f506c7183eac5dd05e89d41d62e759.tar.gz crawl-ref-958627e9c8f506c7183eac5dd05e89d41d62e759.zip |
place clumps of plants/fungi in lair levels too
Diffstat (limited to 'crawl-ref/source/dungeon.cc')
-rw-r--r-- | crawl-ref/source/dungeon.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index 7a83097832..7870c56f99 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -156,6 +156,7 @@ static bool _join_the_dots_rigorous(const coord_def &from, static void _build_river(dungeon_feature_type river_type); //mv static void _build_lake(dungeon_feature_type lake_type); //mv static void _ruin_level(); +static void _add_plant_clumps(); static void _bigger_room(); static void _plan_main(int level_number, int force_plan); @@ -1139,6 +1140,7 @@ static void _build_layout_skeleton(int level_number, int level_type, if (player_in_branch(BRANCH_LAIR)) { _ruin_level(); + _add_plant_clumps(); } } @@ -7783,6 +7785,29 @@ static void _ruin_level() } } +static void _add_plant_clumps() +{ + for (rectangle_iterator ri(1); ri; ++ri) + { + if (grd(*ri) != DNGN_FLOOR || !one_chance_in(500)) + { + continue; + } + mgen_data mg; + mg.cls = coinflip() ? MONS_PLANT : MONS_FUNGUS; + mg.pos = *ri; + mons_place(mgen_data(mg)); + for (adjacent_iterator ai(*ri); ai; ++ai) + { + if (grd(*ai) == DNGN_FLOOR && coinflip()) + { + mg.pos = *ai; + mons_place(mgen_data(mg)); + } + } + } +} + struct nearest_point { coord_def target; |