summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/initfile.cc2
-rw-r--r--crawl-ref/source/item_use.cc17
-rw-r--r--crawl-ref/source/libutil.h11
-rw-r--r--crawl-ref/source/travel.cc6
-rw-r--r--crawl-ref/source/travel.h9
5 files changed, 36 insertions, 9 deletions
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index 9a8242cef9..ea53949930 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -1369,6 +1369,8 @@ int game_options::read_explore_stop_conditions(const std::string &field) const
conditions |= ES_STAIR;
else if (c == "altar" || c == "altars")
conditions |= ES_ALTAR;
+ else if (c == "greedy_item" || c == "greedy_items")
+ conditions |= ES_GREEDY_ITEM;
}
return (conditions);
}
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 0f5ed83c17..6f4f2d1bfc 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -1473,16 +1473,25 @@ void shoot_thing(void)
if (item == ENDOFPACK)
{
- mpr("No suitable missiles.");
+ unwind_var<int> festart(Options.fire_items_start, 0);
+ if ((item = get_fire_item_index()) == ENDOFPACK)
+ mpr("No suitable missiles.");
+ else
+ mprf("No suitable missiles (fire_items_start = '%c', "
+ "ignoring item on '%c').",
+ index_to_letter(festart.original_value()),
+ index_to_letter(item));
flush_input_buffer( FLUSH_ON_FAILURE );
return;
}
dist target;
bolt beam;
- if (choose_fire_target(target, item))
- if (check_warning_inscriptions(you.inv[item], OPER_FIRE))
- throw_it( beam, item, false, 0, &target );
+ if (choose_fire_target(target, item)
+ && check_warning_inscriptions(you.inv[item], OPER_FIRE))
+ {
+ throw_it( beam, item, false, 0, &target );
+ }
}
// Returns delay multiplier numerator (denominator should be 100) for the
diff --git a/crawl-ref/source/libutil.h b/crawl-ref/source/libutil.h
index 6ee786b452..f0f4c1a4ce 100644
--- a/crawl-ref/source/libutil.h
+++ b/crawl-ref/source/libutil.h
@@ -167,6 +167,17 @@ public:
{
val = oldval;
}
+
+ T value() const
+ {
+ return val;
+ }
+
+ T original_value() const
+ {
+ return oldval;
+ }
+
private:
T &val;
T oldval;
diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc
index 8cbbc9740f..9b1f002631 100644
--- a/crawl-ref/source/travel.cc
+++ b/crawl-ref/source/travel.cc
@@ -3988,8 +3988,12 @@ void explore_discoveries::found_item(const coord_def &pos, const item_def &i)
if (!current_level)
current_level = stashes.find_current_level();
- if (current_level && is_greed_inducing_square(current_level, pos))
+ if (current_level
+ && !(Options.explore_stop & ES_GREEDY_ITEM)
+ && is_greed_inducing_square(current_level, pos))
+ {
return;
+ }
}
add_item(i);
diff --git a/crawl-ref/source/travel.h b/crawl-ref/source/travel.h
index 3f50591b5f..d48e6ab916 100644
--- a/crawl-ref/source/travel.h
+++ b/crawl-ref/source/travel.h
@@ -161,10 +161,11 @@ enum explore_stop_type
ES_ITEM = 0x01,
ES_PICKUP = 0x02,
ES_GREEDY_PICKUP = 0x04,
- ES_STAIR = 0x08,
- ES_SHOP = 0x10,
- ES_ALTAR = 0x20,
- ES_PORTAL = 0x40
+ ES_GREEDY_ITEM = 0x08,
+ ES_STAIR = 0x10,
+ ES_SHOP = 0x20,
+ ES_ALTAR = 0x40,
+ ES_PORTAL = 0x80
};
////////////////////////////////////////////////////////////////////////////