diff options
author | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-22 00:19:13 -0800 |
---|---|---|
committer | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-22 00:21:14 -0800 |
commit | 722243eb20be246b6042a36deb016f48091bb6aa (patch) | |
tree | 65a90ded496dc817c25ba4ff88d4efb7e1a8cb24 | |
parent | 41814e9593b3364fd0bdfae7ecb19d7dbd3ebb98 (diff) | |
download | crawl-ref-722243eb20be246b6042a36deb016f48091bb6aa.tar.gz crawl-ref-722243eb20be246b6042a36deb016f48091bb6aa.zip |
explore_stop: new condition greedy_pickup_thrown
explore_stop condition greedy_pickup_smart no longer stops for items
which were thrown by the player. The new condition greedy_pickup_thrown
can be used by those who wish to stop auto-explore when thrown items are
auto-pickup'd.
-rw-r--r-- | crawl-ref/docs/options_guide.txt | 22 | ||||
-rw-r--r-- | crawl-ref/source/initfile.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/items.cc | 12 | ||||
-rw-r--r-- | crawl-ref/source/travel.h | 28 |
4 files changed, 43 insertions, 21 deletions
diff --git a/crawl-ref/docs/options_guide.txt b/crawl-ref/docs/options_guide.txt index f527db358b..85f32b25b0 100644 --- a/crawl-ref/docs/options_guide.txt +++ b/crawl-ref/docs/options_guide.txt @@ -846,14 +846,21 @@ explore_stop = items,greedy_pickup,stairs,shops,altars,gates come into view. greedy_pickup: stop after you automatically pick up any item - eligible for autopickup (except for gold). You can make - certain items *not* trigger this with the option - explore_stop_pickup_ignore + eligible for autopickup, excluding gold, but including + items thrown/fired by the player. You can make certain items + *not* trigger this with the option explore_stop_pickup_ignore greedy_pickup_smart: Similar to greedy_pickup, but tries to be - smart about it, meaning only stopping for thrown items and - items which aren't similar to any you already have in your - inventory. + smart about it, meaning only stopping for items which aren't + similar to any you already have in your inventory. It + doesn't stop for automatically picking up items which were + thrown/fired by the player; you can add "greedy_pickup_thrown" + if you want to stop for those. + + greedy_pickup_thrown: Stops after you pick up any item you've + thrown/fired. greedy_pickup automatically does this, but + greedy_pickup_smart does not. explore_stop_pickup_ignore + does not affect this condition. glowing_items: like items, but only for items which are glowing/runed/embroidered/etc. @@ -871,6 +878,9 @@ explore_stop_pickup_ignore = <regex list> not stop auto-explore because of this use "explore_stop_pickup_ignore = curare". + This options has no affect on items which were thrown by the + player. + explore_improved = false If set to true explore will attempt to reduce zig-zagging during auto-explore. On average it increases the number of turns taken diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc index 9a8be9dde2..744f72cb0a 100644 --- a/crawl-ref/source/initfile.cc +++ b/crawl-ref/source/initfile.cc @@ -1605,6 +1605,8 @@ int game_options::read_explore_stop_conditions(const std::string &field) const conditions |= ES_GREEDY_PICKUP; else if (c == "greedy_pickup_smart" || c == "greedy pickup smart") conditions |= ES_GREEDY_PICKUP_SMART; + else if (c == "greedy_pickup_thrown" || c == "greedy pickup thrown") + conditions |= ES_GREEDY_PICKUP_THROWN; else if (c == "shop" || c == "shops") conditions |= ES_SHOP; else if (c == "stair" || c == "stairs") diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index 80f6dae865..f298e19f38 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -2431,6 +2431,12 @@ static bool _interesting_explore_pickup(const item_def& item) if (item.base_type == OBJ_GOLD) return (false); + if ((Options.explore_stop & ES_GREEDY_PICKUP_THROWN) + && (item.flags & ISFLAG_THROWN)) + { + return (true); + } + std::vector<text_pattern> &ignore = Options.explore_stop_pickup_ignore; if (!ignore.empty()) { @@ -2443,10 +2449,12 @@ static bool _interesting_explore_pickup(const item_def& item) if (!(Options.explore_stop & ES_GREEDY_PICKUP_SMART)) return (true); - // "Smart" code follows. + + // If ES_GREEDY_PICKUP_THROWN isn't set, then smart greedy pickup + // will ignore thrown items. if (item.flags & ISFLAG_THROWN) - return (true); + return (false); if (is_artefact(item)) return (true); diff --git a/crawl-ref/source/travel.h b/crawl-ref/source/travel.h index 5b405e4e9e..f216a54418 100644 --- a/crawl-ref/source/travel.h +++ b/crawl-ref/source/travel.h @@ -156,19 +156,21 @@ extern travel_distance_grid_t travel_point_distance; enum explore_stop_type { - ES_NONE = 0x000, - ES_ITEM = 0x001, - ES_GREEDY_PICKUP = 0x002, - ES_GREEDY_PICKUP_SMART = 0x004, - ES_GREEDY_PICKUP_MASK = (ES_GREEDY_PICKUP | ES_GREEDY_PICKUP_SMART), - 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 + ES_NONE = 0x000, + ES_ITEM = 0x001, + ES_GREEDY_PICKUP = 0x002, + ES_GREEDY_PICKUP_SMART = 0x004, + ES_GREEDY_PICKUP_THROWN = 0x008, + ES_GREEDY_PICKUP_MASK = (ES_GREEDY_PICKUP | ES_GREEDY_PICKUP_SMART + | ES_GREEDY_PICKUP_THROWN), + ES_GREEDY_ITEM = 0x010, + ES_STAIR = 0x020, + ES_SHOP = 0x040, + ES_ALTAR = 0x080, + ES_PORTAL = 0x100, + ES_GLOWING_ITEM = 0x200, + ES_ARTEFACT = 0x400, + ES_RUNE = 0x800 }; //////////////////////////////////////////////////////////////////////////// |