From 67cbd7ec7637054540c4f8a547c92790a6a5ba9c Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 10 Jan 2010 12:24:09 -0600 Subject: give doors a smaller chance to be removed --- crawl-ref/source/dungeon.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/dungeon.cc') diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index b2c91cb99f..09949dca20 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -7744,8 +7744,8 @@ static void _ruin_level() for (rectangle_iterator ri(1); ri; ++ri) { - /* only try to replace wall tiles */ - if (!feat_is_wall(grd(*ri))) + /* only try to replace wall and door tiles */ + if (!feat_is_wall(grd(*ri)) && !feat_is_door(grd(*ri))) { continue; } @@ -7753,7 +7753,7 @@ static void _ruin_level() int floor_count = 0; for (adjacent_iterator ai(*ri); ai; ++ai) { - if (!feat_is_wall(grd(*ai))) + if (!feat_is_wall(grd(*ai)) && !feat_is_door(grd(*ai))) { floor_count++; } @@ -7771,9 +7771,12 @@ static void _ruin_level() it != to_replace.end(); ++it) { + /* only remove some doors, to preserve tactical options */ /* XXX: should this pick a random adjacent floor type, rather than * just hardcoding DNGN_FLOOR? */ - grd(*it) = DNGN_FLOOR; + if (feat_is_wall(grd(*it)) || (coinflip() && feat_is_door(grd(*it)))) { + grd(*it) = DNGN_FLOOR; + } /* replace some ruined walls with plants/fungi */ if (one_chance_in(5)) { -- cgit v1.2.3-54-g00ecf