diff options
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/docs/options_guide.txt | 26 | ||||
-rw-r--r-- | crawl-ref/source/initfile.cc | 8 | ||||
-rw-r--r-- | crawl-ref/source/travel.cc | 44 | ||||
-rw-r--r-- | crawl-ref/source/travel.h | 21 |
4 files changed, 74 insertions, 25 deletions
diff --git a/crawl-ref/docs/options_guide.txt b/crawl-ref/docs/options_guide.txt index 02608f1020..ca6ed2ba1e 100644 --- a/crawl-ref/docs/options_guide.txt +++ b/crawl-ref/docs/options_guide.txt @@ -697,18 +697,32 @@ explore_greedy = true temporarily unable to pick up items (from uncontrolled levitation, for instance). -explore_stop = items,greedy_items,stairs,shops,altars,gates +explore_stop = items,greedy_pickup,stairs,shops,altars,gates Explore will stop for one of these conditions. Whatever you set this option to, anything that stops travel will also stop explore. Multiple explore_stop lines are cumulative if you use explore_stop += options, otherwise the last explore_stop = options line will override all previous explore_stop lines. - If you include greedy_items in your explore_stop, greedy - explore will stop and announce items that are eligible for - autopickup (greedy explore otherwise announces only items that - are not eligible for autopickup, since autopickup will produce - its own message and stop greedy explore anyway). + When using non-greedy explore, items causes explore to stop + when any new item comes into view. When using greedy explore, + the conditions act as follows: + + items: stop when items that aren't eligible for autopickup come + into view. + + greedy_items: stop when items that are eligible for autopickup + come into view. + + greedy_pickup: stop when you arrive at a square which contains + an item eligble for autopickup. + + glowing_items: like items, but only for items which are + glowing/runed/embroidered/etc. + + artefacts: like items, but only for artefacts. + + runes: like items, but only for runes. explore_improved = false If set to true explore will attempt to reduce zig-zagging during diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc index a21f306a7c..1eda3233f1 100644 --- a/crawl-ref/source/initfile.cc +++ b/crawl-ref/source/initfile.cc @@ -1509,6 +1509,14 @@ int game_options::read_explore_stop_conditions(const std::string &field) const conditions |= ES_ALTAR; else if (c == "greedy_item" || c == "greedy_items") conditions |= ES_GREEDY_ITEM; + else if (c == "glowing" || c == "glowing_item" + || c == "glowing_items") + conditions |= ES_GLOWING_ITEM; + else if (c == "artefact" || c == "artefacts" + || c == "artifact" || c == "artifacts") + conditions |= ES_ARTEFACT; + else if (c == "rune" || c == "runes") + conditions |= ES_RUNE; } return (conditions); } diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index 8eb88c5bff..866624b087 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -674,6 +674,10 @@ bool prompt_stop_explore(int es_why) } #define ES_item (Options.explore_stop & ES_ITEM) +#define ES_greedy (Options.explore_stop & ES_GREEDY_ITEM) +#define ES_glow (Options.explore_stop & ES_GLOWING_ITEM) +#define ES_art (Options.explore_stop & ES_ARTEFACT) +#define ES_rune (Options.explore_stop & ES_RUNE) #define ES_shop (Options.explore_stop & ES_SHOP) #define ES_stair (Options.explore_stop & ES_STAIR) #define ES_altar (Options.explore_stop & ES_ALTAR) @@ -687,7 +691,7 @@ inline static void _check_interesting_square(int x, int y, { const coord_def pos(x, y); - if (ES_item) + if (ES_item || ES_greedy || ES_glow || ES_art || ES_rune) { if (mgrd(pos) != NON_MONSTER) { @@ -1093,8 +1097,12 @@ command_type travel() if (lev && lev->needs_visit(new_x, new_y) && !lev->shop_needs_visit(new_x, new_y)) { - if ((Options.explore_stop & ES_ITEM) - && prompt_stop_explore(ES_ITEM)) + const int estop = + (you.running == RMODE_EXPLORE_GREEDY) ? + ES_GREEDY_PICKUP : ES_PICKUP; + + if ((Options.explore_stop & estop) + && prompt_stop_explore(estop)) { explore_stopped_pos = coord_def(new_x, new_y); stop_running(); @@ -3948,16 +3956,32 @@ void explore_discoveries::found_item(const coord_def &pos, const item_def &i) if (!current_level) current_level = StashTrack.find_current_level(); - if (current_level - && !(Options.explore_stop & ES_GREEDY_ITEM) - && _is_greed_inducing_square(current_level, pos)) - { - return; + if (current_level) + { + const bool greed_inducing = + _is_greed_inducing_square(current_level, pos); + + if (greed_inducing && (Options.explore_stop & ES_GREEDY_ITEM)) + ; // Stop for this conditions + else if (!greed_inducing + && ((Options.explore_stop & ES_ITEM) + || ((Options.explore_stop & ES_GLOWING_ITEM) + && (i.flags & ISFLAG_COSMETIC_MASK)) + || ((Options.explore_stop & ES_ARTEFACT) + && (i.flags & ISFLAG_ARTEFACT_MASK)) + || ((Options.explore_stop & ES_RUNE) + && is_rune(i)) )) + { + ; // More conditions to stop for + } + else + return; // No conditions met, don't stop for this item } - } + } // if (you.running == RMODE_EXPLORE_GREEDY) add_item(i); - es_flags |= ES_ITEM; + es_flags |= (you.running == RMODE_EXPLORE_GREEDY) ? ES_GREEDY_PICKUP : + ES_PICKUP; } // Expensive O(n^2) duplicate search, but we can live with that. diff --git a/crawl-ref/source/travel.h b/crawl-ref/source/travel.h index 864207d029..8fcf639a73 100644 --- a/crawl-ref/source/travel.h +++ b/crawl-ref/source/travel.h @@ -165,15 +165,18 @@ extern travel_distance_grid_t travel_point_distance; enum explore_stop_type { - ES_NONE = 0x00, - ES_ITEM = 0x01, - ES_PICKUP = 0x02, - ES_GREEDY_PICKUP = 0x04, - ES_GREEDY_ITEM = 0x08, - ES_STAIR = 0x10, - ES_SHOP = 0x20, - ES_ALTAR = 0x40, - ES_PORTAL = 0x80 + ES_NONE = 0x000, + ES_ITEM = 0x001, + ES_PICKUP = 0x002, + ES_GREEDY_PICKUP = 0x004, + ES_GREEDY_ITEM = 0x008, + ES_STAIR = 0x010, + ES_SHOP = 0x020, + ES_ALTAR = 0x040, + ES_PORTAL = 0x080, + ES_GLOWING_ITEM = 0x100, + ES_ARTEFACT = 0x200, + ES_RUNE = 0x400 }; //////////////////////////////////////////////////////////////////////////// |