summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/docs/develop/level_design.txt7
-rw-r--r--crawl-ref/source/terrain.cc5
-rw-r--r--crawl-ref/source/terrain.h1
-rw-r--r--crawl-ref/source/travel.cc32
-rw-r--r--crawl-ref/source/travel.h3
5 files changed, 47 insertions, 1 deletions
diff --git a/crawl-ref/docs/develop/level_design.txt b/crawl-ref/docs/develop/level_design.txt
index 785433b1e6..802d9b6624 100644
--- a/crawl-ref/docs/develop/level_design.txt
+++ b/crawl-ref/docs/develop/level_design.txt
@@ -1869,6 +1869,13 @@ dungeon cell which they are on:
* feature_description_long: What to use as the long description of the
cell's feature.
+* stop_explore: If set to anything, and placed on a cell with a statue
+ or orcish idol, will cause auto-explore to stop with the message
+ "Found <whatever>."
+
+* stop_explore_msg: Like stop_explore, but when auto-explore is stopped
+ the content of the property will be printed out as a message.
+
* veto_disintegrate: If this property is set to "veto" then the cell
will be immune to disintegration.
diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc
index ae5ed894db..8f8344380d 100644
--- a/crawl-ref/source/terrain.cc
+++ b/crawl-ref/source/terrain.cc
@@ -328,6 +328,11 @@ bool feat_is_secret_door(dungeon_feature_type feat)
return (feat == DNGN_SECRET_DOOR || feat == DNGN_DETECTED_SECRET_DOOR);
}
+bool feat_is_statue_or_idol(dungeon_feature_type feat)
+{
+ return (feat >= DNGN_ORCISH_IDOL && feat <= DNGN_STATUE_RESERVED);
+}
+
bool feat_is_rock(dungeon_feature_type feat)
{
return (feat == DNGN_ORCISH_IDOL
diff --git a/crawl-ref/source/terrain.h b/crawl-ref/source/terrain.h
index 1cceb40020..2c442ced2f 100644
--- a/crawl-ref/source/terrain.h
+++ b/crawl-ref/source/terrain.h
@@ -26,6 +26,7 @@ bool feat_is_opaque(dungeon_feature_type feat);
bool feat_is_solid(dungeon_feature_type feat);
bool feat_is_closed_door(dungeon_feature_type feat);
bool feat_is_secret_door(dungeon_feature_type feat);
+bool feat_is_statue_or_idol(dungeon_feature_type feat);
bool feat_is_rock(dungeon_feature_type feat);
bool feat_is_permarock(dungeon_feature_type feat);
bool feat_is_stone_stair(dungeon_feature_type feat);
diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc
index 6eeb0f632a..83ac8e9363 100644
--- a/crawl-ref/source/travel.cc
+++ b/crawl-ref/source/travel.cc
@@ -4191,6 +4191,27 @@ void explore_discoveries::found_feature(const coord_def &pos,
altars.push_back(altar);
es_flags |= ES_ALTAR;
}
+ // Would checking for a makrer for all discovered cells slow things
+ // down too much?
+ else if (feat_is_statue_or_idol(feat))
+ {
+ const std::string feat_stop_msg =
+ env.markers.property_at(pos, MAT_ANY, "stop_explore_msg");
+ if (!feat_stop_msg.empty())
+ {
+ marker_msgs.push_back(feat_stop_msg);
+ return;
+ }
+
+ const std::string feat_stop =
+ env.markers.property_at(pos, MAT_ANY, "stop_explore");
+ if (!feat_stop.empty())
+ {
+ std::string desc = lowercase_first(feature_description(pos));
+ marked_feats.push_back(desc);
+ return;
+ }
+ }
}
void explore_discoveries::add_stair(
@@ -4333,8 +4354,16 @@ std::vector<std::string> explore_discoveries::apply_quantities(
bool explore_discoveries::prompt_stop() const
{
+ const bool marker_stop = !marker_msgs.empty() || !marked_feats.empty();
+
+ for (unsigned int i = 0; i < marker_msgs.size(); i++)
+ mprf("%s", marker_msgs[i].c_str());
+
+ for (unsigned int i = 0; i < marked_feats.size(); i++)
+ mprf("Found %s", marked_feats[i].c_str());
+
if (!es_flags)
- return (false);
+ return (marker_stop);
say_any(items, "Found %s items.");
say_any(shops, "Found %s shops.");
@@ -4343,5 +4372,6 @@ bool explore_discoveries::prompt_stop() const
say_any(apply_quantities(stairs), "Found %s stairs.");
return ((Options.explore_stop_prompt & es_flags) != es_flags
+ || marker_stop
|| prompt_stop_explore(es_flags));
}
diff --git a/crawl-ref/source/travel.h b/crawl-ref/source/travel.h
index 51b5cfdf4d..e23c5a3c05 100644
--- a/crawl-ref/source/travel.h
+++ b/crawl-ref/source/travel.h
@@ -298,6 +298,9 @@ private:
std::vector< named_thing<int> > shops;
std::vector< named_thing<int> > altars;
+ std::vector<std::string> marker_msgs;
+ std::vector<std::string> marked_feats;
+
private:
template <class C> void say_any(const C &coll, const char *stub) const;
template <class citer> bool has_duplicates(citer, citer) const;