summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/terrain.cc
diff options
context:
space:
mode:
authorpauldubois <pauldubois@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-15 23:47:33 +0000
committerpauldubois <pauldubois@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-15 23:47:33 +0000
commit636cb150289264fb06e4c3ad74da2ed385234567 (patch)
tree84148bfd54f605b81da592ae9dff9e1671dcf933 /crawl-ref/source/terrain.cc
parent80bb6d7dfc1d7fc620af3f77935dcfca9cce788a (diff)
downloadcrawl-ref-636cb150289264fb06e4c3ad74da2ed385234567.tar.gz
crawl-ref-636cb150289264fb06e4c3ad74da2ed385234567.zip
Changed door-open failure message to match the door-close message.
Added special case messages for doors already open or closed. Maybe there should be flavor messages for # gateways? We use the same noun (gate/gateway) for # and +++. Remove leading underscore from find_connected_identical() now that it's public. Change large door descriptions slightly: - "open/closed large door" -> "large open/closed door" - "There's a creature in the large doorway!" -> "... in the doorway" - Other messages read a bit better without the adjective, but if it's removed then almost all the flavor is gone. So I left them alone. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3664 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/terrain.cc')
-rw-r--r--crawl-ref/source/terrain.cc31
1 files changed, 17 insertions, 14 deletions
diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc
index 4294d75d77..6dc4224162 100644
--- a/crawl-ref/source/terrain.cc
+++ b/crawl-ref/source/terrain.cc
@@ -237,29 +237,32 @@ bool grid_is_branch_stairs( dungeon_feature_type grid )
}
// Find all connected cells containing ft, starting at d.
-void _find_connected_identical(coord_def d, dungeon_feature_type ft,
+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);
+ 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)
+void get_door_description(int door_size, const char** adjective, const char** noun)
{
- 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";
- }
+ const char* descriptions[] = {
+ "miniscule " , "buggy door",
+ "" , "door",
+ "large " , "door",
+ "" , "gate",
+ "huge " , "gate",
+ };
+
+ const unsigned int idx = MIN((unsigned int)door_size*2, ARRAYSIZE(descriptions)-2);
+ *adjective = descriptions[idx];
+ *noun = descriptions[idx+1];
}
dungeon_feature_type grid_secret_door_appearance( int gx, int gy )