summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-30 15:53:09 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-30 15:53:09 +0000
commite2179589b89a1d9786aa3111286af81878d21219 (patch)
treedcde637281ec374d339bf6cbc5012176e9b3f269 /crawl-ref
parent19bba5a5ec358bc8821bc3118add964ff303f7a9 (diff)
downloadcrawl-ref-e2179589b89a1d9786aa3111286af81878d21219.tar.gz
crawl-ref-e2179589b89a1d9786aa3111286af81878d21219.zip
Introducing shortcut for searching the current level as
requested in FR 1801705. Also adding feedback when auto-travel fails to kick in. And trying to get out of a net no longer stops travel, only being caught in one does (FR 1800821). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2263 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/stash.cc37
-rw-r--r--crawl-ref/source/traps.cc3
-rw-r--r--crawl-ref/source/travel.cc9
3 files changed, 39 insertions, 10 deletions
diff --git a/crawl-ref/source/stash.cc b/crawl-ref/source/stash.cc
index 376fce0dd7..86dc1c27d4 100644
--- a/crawl-ref/source/stash.cc
+++ b/crawl-ref/source/stash.cc
@@ -7,6 +7,7 @@
*/
#include "AppHdr.h"
+#include "branch.h"
#include "chardump.h"
#include "cio.h"
#include "clua.h"
@@ -1369,15 +1370,14 @@ void StashTracker::search_stashes()
char prompt[200];
if (lastsearch.length())
snprintf(prompt, sizeof prompt,
- "Search for what [Enter for \"%s\"]?",
- lastsearch.c_str());
+ "Search for what [Enter for \"%s\"%s]?\n",
+ lastsearch.c_str(), lastsearch != "." ?
+ ", or press . for all items on level" : "");
else
snprintf(prompt, sizeof prompt,
- "Search for what?");
+ "Search for what [Press . for all items on level]?\n");
mpr(prompt, MSGCH_PROMPT);
- // Push the cursor down to the next line.
- mpr("", MSGCH_PROMPT);
char buf[400];
bool validline =
@@ -1387,6 +1387,30 @@ void StashTracker::search_stashes()
return;
std::string csearch = *buf? buf : lastsearch;
+ std::string help = lastsearch;
+ lastsearch = csearch;
+
+ if (csearch == ".")
+ {
+ if (you.level_type == LEVEL_DUNGEON)
+ {
+ snprintf(info, INFO_SIZE, "%s:%d",
+ branches[you.where_are_you].abbrevname, player_branch_depth());
+ csearch = info;
+ }
+ else if (you.level_type == LEVEL_PORTAL_VAULT)
+ csearch = "{Port}";
+ else if (you.level_type == LEVEL_PANDEMONIUM)
+ csearch = "{Pan}";
+ // items in Abyss and Labyrinths are not tracked
+ else if (you.level_type == LEVEL_ABYSS
+ || you.level_type == LEVEL_LABYRINTH)
+ {
+ mprf("Items in %s cannot be tracked.",
+ you.level_type == LEVEL_ABYSS ? "the Abyss" : "labyrinths");
+ return;
+ }
+ }
std::vector<stash_search_result> results;
base_pattern *search = NULL;
@@ -1402,11 +1426,10 @@ void StashTracker::search_stashes()
if (!search->valid())
{
mpr("Your search expression is invalid.", MSGCH_PLAIN);
+ lastsearch = help;
return ;
}
- lastsearch = csearch;
-
get_matching_stashes(*search, results);
if (results.empty())
diff --git a/crawl-ref/source/traps.cc b/crawl-ref/source/traps.cc
index 8f08fce842..0cff14c334 100644
--- a/crawl-ref/source/traps.cc
+++ b/crawl-ref/source/traps.cc
@@ -158,7 +158,8 @@ void player_caught_in_net()
{
you.attribute[ATTR_HELD] = 10;
mpr("You become entangled in the net!");
-
+ stop_running();
+
// I guess levitation works differently, keeping both you
// and the net hovering above the floor
if (you.flies() == FL_FLY)
diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc
index 2b9af1ac94..620d16068b 100644
--- a/crawl-ref/source/travel.cc
+++ b/crawl-ref/source/travel.cc
@@ -915,8 +915,7 @@ command_type travel()
command_type result = CMD_NO_CMD;
// Abort travel/explore if you're confused or a key was pressed.
- // Or if you got caught in a net.
- if (kbhit() || you.duration[DUR_CONF] || you.attribute[ATTR_HELD])
+ if (kbhit() || you.duration[DUR_CONF])
{
stop_running();
return CMD_NO_CMD;
@@ -2240,7 +2239,13 @@ void start_translevel_travel(const travel_target &pos)
return;
if (!can_travel_to(pos.p.id))
+ {
+ if (you.level_type != LEVEL_DUNGEON)
+ mpr("Sorry, you can't auto-travel out of here.");
+ else
+ mpr("Sorry, I don't know how to get there.");
return;
+ }
if (!can_travel_interlevel())
{