diff options
author | Matthew Cline <zelgadis@sourceforge.net> | 2009-10-25 00:23:09 -0700 |
---|---|---|
committer | Matthew Cline <zelgadis@sourceforge.net> | 2009-10-25 00:23:09 -0700 |
commit | a0ae32c8f8a04398b4b99880069eb31a26b43eff (patch) | |
tree | e619d8de305de18bb7c9fc1ead65ee33a1377f33 /crawl-ref/source/describe.cc | |
parent | 83d7fbfa11973abf823ed07f4c7b39956fc6aa4a (diff) | |
download | crawl-ref-a0ae32c8f8a04398b4b99880069eb31a26b43eff.tar.gz crawl-ref-a0ae32c8f8a04398b4b99880069eb31a26b43eff.zip |
Let markers change the description of any feature
Allow markers to change the short and/or long description of any
feature, not just portal vault entrances. The feature_description() and
feature_description_long() functions have been removed from the mapmark
classes and turned into ordinary properties. Also added the marker
property "door_description_suffix", which can be used to alter the short
description of (known) doors by appending a string to them.
Diffstat (limited to 'crawl-ref/source/describe.cc')
-rw-r--r-- | crawl-ref/source/describe.cc | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index bcce934a0c..482d467f2c 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -2008,18 +2008,6 @@ std::string get_item_description( const item_def &item, bool verbose, return description.str(); } -static std::string _marker_feature_description(const coord_def &pos) -{ - std::vector<map_marker*> markers = env.markers.get_markers_at(pos); - for (int i = 0, size = markers.size(); i < size; ++i) - { - const std::string desc = markers[i]->feature_description_long(); - if (!desc.empty()) - return (desc); - } - return (""); -} - static std::string _get_feature_description_wide(int feat) { return std::string(); @@ -2044,14 +2032,19 @@ void get_feature_desc(const coord_def &pos, describe_info &inf) bool custom_desc = false; - if (feat == DNGN_ENTER_PORTAL_VAULT) + const std::string marker_desc = + env.markers.property_at(pos, MAT_ANY, "feature_description_long"); + + if (!marker_desc.empty()) { - std::string _desc = _marker_feature_description(pos); - if (!_desc.empty()) - { - long_desc = _desc; - custom_desc = true; - } + long_desc = marker_desc; + custom_desc = true; + } + + if (feat == DNGN_ENTER_PORTAL_VAULT && !custom_desc) + { + long_desc = "UNDESCRIBE PORTAL VAULT ENTRANCE."; + custom_desc = true; } const CrawlHashTable &props = env.properties; |