From 4d920561429d56eac9e2c3cbb0b35cf199e94f89 Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Sun, 6 Dec 2009 13:23:18 +1000 Subject: 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. --- crawl-ref/source/directn.cc | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/directn.cc') 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 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"; -- cgit v1.2.3-54-g00ecf