summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/misc.cc
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-11-12 16:26:22 -0800
committerMatthew Cline <zelgadis@sourceforge.net>2009-11-12 16:26:22 -0800
commit4fcdab47681adf046474885058d0e3ff95995d86 (patch)
treec6661ddb62d13a57fa0176cbd24de51c4ff5c921 /crawl-ref/source/misc.cc
parentfcd9486498b25072cacd0ae8ef9ef0ae570b8104 (diff)
downloadcrawl-ref-4fcdab47681adf046474885058d0e3ff95995d86.tar.gz
crawl-ref-4fcdab47681adf046474885058d0e3ff95995d86.zip
New door Lua marker properties
door_description_prefix: String to prefix to door name. door_open_prompt: Prompt user if they really want to open the door.
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r--crawl-ref/source/misc.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index 43d9499ed5..944cf6aa98 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -3126,6 +3126,27 @@ void reveal_secret_door(const coord_def& p)
: DNGN_OPEN_DOOR;
viewwindow(false);
learned_something_new(TUT_SEEN_SECRET_DOOR, p);
+
+ // If a transparent secret door was forced open to preserve LOS,
+ // check if it had an opening prompt.
+ if (grd(p) == DNGN_OPEN_DOOR)
+ {
+ std::string door_open_prompt =
+ env.markers.property_at(p, MAT_ANY, "door_open_prompt");
+
+ if (!door_open_prompt.empty())
+ {
+ mprf("That secret door had a prompt on it:", MSGCH_PROMPT);
+ mprf(MSGCH_PROMPT, "%s", door_open_prompt.c_str());
+
+ if (!is_exclude_root(p))
+ {
+ if (yesno("Put travel exclusion on door? (Y/n)", true, 'y'))
+ // Zero radius exclusion right on top of door.
+ set_exclude(p, 0);
+ }
+ }
+ }
}
// A feeble attempt at Nethack-like completeness for cute messages.