diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-08-01 23:58:56 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-08-02 01:14:00 -0400 |
commit | 6f6660eea0976e648064d117ecbc6a7710c80dff (patch) | |
tree | 1fac8df4c5713977b453c13799484b3353748728 | |
parent | d4b779af619a8643968600a41d38d85fc82bd2b7 (diff) | |
download | crawl-ref-6f6660eea0976e648064d117ecbc6a7710c80dff.tar.gz crawl-ref-6f6660eea0976e648064d117ecbc6a7710c80dff.zip |
add map view command to find the next explore target
This is useful for when you get the "Partly explored, can't reach some
places." message, but have no idea where the part that's unexplored
actually is (because it's in a corner behind a plant or something). It's
also useful if you don't actually want to use autoexplore (because there
are dangerous monsters out of line of sight, for instance), but you do
want to know which part of the level you still need to (carefully)
explore.
-rw-r--r-- | crawl-ref/source/cmd-keys.h | 1 | ||||
-rw-r--r-- | crawl-ref/source/dat/database/help.txt | 1 | ||||
-rw-r--r-- | crawl-ref/source/dat/descript/commands.txt | 8 | ||||
-rw-r--r-- | crawl-ref/source/enum.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/viewmap.cc | 18 |
5 files changed, 30 insertions, 0 deletions
diff --git a/crawl-ref/source/cmd-keys.h b/crawl-ref/source/cmd-keys.h index d5b71d4bad..7f99d5f6e3 100644 --- a/crawl-ref/source/cmd-keys.h +++ b/crawl-ref/source/cmd-keys.h @@ -331,6 +331,7 @@ {',', CMD_MAP_GOTO_TARGET}, {';', CMD_MAP_GOTO_TARGET}, {'!', CMD_MAP_ANNOTATE_LEVEL}, +{'o', CMD_MAP_EXPLORE}, {ESCAPE, CMD_MAP_EXIT_MAP}, #ifdef CLUA_BINDINGS {CONTROL('I'), CMD_AUTOFIGHT}, diff --git a/crawl-ref/source/dat/database/help.txt b/crawl-ref/source/dat/database/help.txt index f767bbff4e..7bbd3e65a2 100644 --- a/crawl-ref/source/dat/database/help.txt +++ b/crawl-ref/source/dat/database/help.txt @@ -148,6 +148,7 @@ level-map (Moves cursor to the last travel destination if still on @.) <w>[</w> or <w>]</w> : Examine the next higher or lower level <w>G</w> : Go to another level by branch and depth +<w>o</w> : Move the cursor to the next autoexplore target. <h>Travel exclusions</h> <w>e</w> : Create a travel exclusion, change its radius, or remove it. diff --git a/crawl-ref/source/dat/descript/commands.txt b/crawl-ref/source/dat/descript/commands.txt index 2faa785d19..cee243932d 100644 --- a/crawl-ref/source/dat/descript/commands.txt +++ b/crawl-ref/source/dat/descript/commands.txt @@ -216,6 +216,14 @@ CMD_MAP_GOTO_TARGET verbose Start travelling to the cursor's current location. %%%% +CMD_MAP_EXPLORE + +Find next autoexplore target +%%%% +CMD_MAP_EXPLORE verbose + +Move the map cursor to the next location that autoexplore will travel to. +%%%% CMD_MAP_ADD_WAYPOINT Add waypoint diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 6a3e535ade..73871c4d4d 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -913,6 +913,8 @@ enum command_type CMD_MAP_GOTO_TARGET, CMD_MAP_ANNOTATE_LEVEL, + CMD_MAP_EXPLORE, + CMD_MAP_WIZARD_TELEPORT, CMD_MAP_HELP, diff --git a/crawl-ref/source/viewmap.cc b/crawl-ref/source/viewmap.cc index daf05aa817..3c9b0cd925 100644 --- a/crawl-ref/source/viewmap.cc +++ b/crawl-ref/source/viewmap.cc @@ -1260,6 +1260,24 @@ bool show_map(level_pos &lpos, redraw_map = true; break; + case CMD_MAP_EXPLORE: + if (on_level && !player_in_branch(BRANCH_LABYRINTH)) + { + travel_pathfind tp; + tp.set_floodseed(you.pos(), true); + + coord_def whereto = tp.pathfind(Options.explore_greedy + ? RMODE_EXPLORE_GREEDY + : RMODE_EXPLORE); + _reset_travel_colours(features, on_level); + + if (!whereto.zero()) { + move_x = whereto.x - lpos.pos.x; + move_y = whereto.y - lpos.pos.y; + } + } + break; + #ifdef WIZARD case CMD_MAP_WIZARD_TELEPORT: if (!you.wizard || !on_level || !in_bounds(lpos.pos)) |