summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/directn.cc
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.net>2009-12-06 13:23:18 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2009-12-06 13:23:18 +1000
commit4d920561429d56eac9e2c3cbb0b35cf199e94f89 (patch)
treea272ee251b1cbb67f132d91a38d11ab419148d6d /crawl-ref/source/directn.cc
parent5a3f1e9bbe266db7cbd0287ab5b0c7df8b1423e8 (diff)
downloadcrawl-ref-4d920561429d56eac9e2c3cbb0b35cf199e94f89.tar.gz
crawl-ref-4d920561429d56eac9e2c3cbb0b35cf199e94f89.zip
Add further door_XXX properties for opening, closing, etc.
See documentation. This is somewhat hackish (or at least, hackier), but I think there's a precendent for it at least.
Diffstat (limited to 'crawl-ref/source/directn.cc')
-rw-r--r--crawl-ref/source/directn.cc34
1 files changed, 29 insertions, 5 deletions
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index 1abc47b275..dbebce5637 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -2877,18 +2877,42 @@ std::string feature_description(const coord_def& where, bool bloody,
const std::string door_desc_suffix =
env.markers.property_at(where, MAT_ANY,
"door_description_suffix");
+ const std::string door_desc_noun =
+ env.markers.property_at(where, MAT_ANY,
+ "door_description_noun");
+ const std::string door_desc_adj =
+ env.markers.property_at(where, MAT_ANY,
+ "door_description_adjective");
+ const std::string door_desc_veto =
+ env.markers.property_at(where, MAT_ANY,
+ "door_description_veto");
std::set<coord_def> all_door;
find_connected_identical(where, grd(where), all_door);
const char *adj, *noun;
get_door_description(all_door.size(), &adj, &noun);
- std::string desc = adj;
- desc += (grid == DNGN_OPEN_DOOR) ? "open " : "closed ";
- if (grid == DNGN_DETECTED_SECRET_DOOR)
- desc += "detected secret ";
+ std::string desc;
+ if (!door_desc_adj.empty())
+ desc += door_desc_adj;
+ else
+ desc += adj;
+
+ if (door_desc_veto.empty() || door_desc_veto != "veto")
+ {
+ desc += (grid == DNGN_OPEN_DOOR) ? "open " : "closed ";
+ if (grid == DNGN_DETECTED_SECRET_DOOR)
+ desc += "detected secret ";
+ }
+
+ desc += door_desc_prefix;
+
+ if (!door_desc_noun.empty())
+ desc += door_desc_noun;
+ else
+ desc += noun;
- desc += door_desc_prefix + noun + door_desc_suffix;
+ desc += door_desc_suffix;
if (bloody)
desc += ", spattered with blood";