diff options
author | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-12 16:26:22 -0800 |
---|---|---|
committer | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-12 16:26:22 -0800 |
commit | 4fcdab47681adf046474885058d0e3ff95995d86 (patch) | |
tree | c6661ddb62d13a57fa0176cbd24de51c4ff5c921 /crawl-ref/source/acr.cc | |
parent | fcd9486498b25072cacd0ae8ef9ef0ae570b8104 (diff) | |
download | crawl-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/acr.cc')
-rw-r--r-- | crawl-ref/source/acr.cc | 52 |
1 files changed, 41 insertions, 11 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index f2a8328931..2f38866f39 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -3281,23 +3281,53 @@ static void _open_door(coord_def move, bool check_confused) const char *adj, *noun; get_door_description(all_door.size(), &adj, &noun); - int skill = you.dex - + (you.skills[SK_TRAPS_DOORS] + you.skills[SK_STEALTH]) / 2; - - if (is_exclude_root(doorpos) && !(check_confused && you.confused())) + if (!(check_confused && you.confused())) { - std::string prompt = - make_stringf("This %s%s is marked as excluded! Open it " - "anyway?", adj, noun); + std::string door_open_prompt = + env.markers.property_at(doorpos, MAT_ANY, "door_open_prompt"); + + bool ignore_exclude = false; - if (!yesno(prompt.c_str(), true, 'n', true, false)) + if (!door_open_prompt.empty()) { - canned_msg(MSG_OK); - interrupt_activity(AI_FORCE_INTERRUPT); - return; + door_open_prompt += " (y/N)"; + if (!yesno(door_open_prompt.c_str(), true, 'n', true, false)) + { + if (is_exclude_root(doorpos)) + canned_msg(MSG_OK); + else + { + if (yesno("Put travel exclusion on door? (Y/n)", + true, 'y')) + { + // Zero radius exclusion right on top of door. + set_exclude(doorpos, 0); + } + } + interrupt_activity(AI_FORCE_INTERRUPT); + return; + } + ignore_exclude = true; + } + + if (!ignore_exclude && is_exclude_root(doorpos)) + { + std::string prompt = + make_stringf("This %s%s is marked as excluded! Open it " + "anyway?", adj, noun); + + if (!yesno(prompt.c_str(), true, 'n', true, false)) + { + canned_msg(MSG_OK); + interrupt_activity(AI_FORCE_INTERRUPT); + return; + } } } + int skill = you.dex + + (you.skills[SK_TRAPS_DOORS] + you.skills[SK_STEALTH]) / 2; + if (you.berserk()) { // XXX: Better flavour for larger doors? |