summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/terrain.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-10 16:07:30 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-10 16:07:30 +0000
commit9112dd81fb46fbeeec6f46fe40ecaf1bcae42da3 (patch)
tree42a9689b56051fccb17889328a4a542e6351cc64 /crawl-ref/source/terrain.cc
parent4fdf65ba2dcb33d11e73742fe31ce4f85a27baf2 (diff)
downloadcrawl-ref-9112dd81fb46fbeeec6f46fe40ecaf1bcae42da3.tar.gz
crawl-ref-9112dd81fb46fbeeec6f46fe40ecaf1bcae42da3.zip
Fix 1920778: mons_open_door() not respecting gates
Also fixed several cases where secret doors would be described as rock walls regardless of their actual type, and gates are now described correctly as well. This means that viewing them also prints, e.g. "An open gate." or "A closed large door." without further information since there are no database entries for these specific cases. (Not the entries for simple doors are any more exhaustive.) Fix 1910729: Yredelmnul's Drain Life not waking monsters, using ncampion's solution. Also default greedy_explore to true. (FR 1911112) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3584 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/terrain.cc')
-rw-r--r--crawl-ref/source/terrain.cc26
1 files changed, 26 insertions, 0 deletions
diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc
index 934e9e9b4f..4294d75d77 100644
--- a/crawl-ref/source/terrain.cc
+++ b/crawl-ref/source/terrain.cc
@@ -236,6 +236,32 @@ bool grid_is_branch_stairs( dungeon_feature_type grid )
|| (grid >= DNGN_ENTER_DIS && grid <= DNGN_ENTER_TARTARUS));
}
+// Find all connected cells containing ft, starting at d.
+void _find_connected_identical(coord_def d, dungeon_feature_type ft,
+ std::set<coord_def>& out)
+{
+ if (grd[d.x][d.y] != ft) return;
+ if (out.insert(d).second)
+ {
+ _find_connected_identical(coord_def(d.x+1, d.y), ft, out);
+ _find_connected_identical(coord_def(d.x-1, d.y), ft, out);
+ _find_connected_identical(coord_def(d.x, d.y+1), ft, out);
+ _find_connected_identical(coord_def(d.x, d.y-1), ft, out);
+ }
+}
+
+std::string get_door_noun(int door_count)
+{
+ switch (door_count)
+ {
+ case 0: return "buggy opening";
+ case 1: return "door";
+ case 2: return "large door";
+ case 3: return "gate";
+ default: return "huge gate";
+ }
+}
+
dungeon_feature_type grid_secret_door_appearance( int gx, int gy )
{
dungeon_feature_type ret = DNGN_FLOOR;