summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/docs/options_guide.txt15
-rw-r--r--crawl-ref/settings/init.txt2
-rw-r--r--crawl-ref/source/externs.h5
-rw-r--r--crawl-ref/source/food.cc14
-rw-r--r--crawl-ref/source/initfile.cc4
5 files changed, 35 insertions, 5 deletions
diff --git a/crawl-ref/docs/options_guide.txt b/crawl-ref/docs/options_guide.txt
index 3728f73ed9..7a511ca9c7 100644
--- a/crawl-ref/docs/options_guide.txt
+++ b/crawl-ref/docs/options_guide.txt
@@ -58,7 +58,8 @@ The contents of this text are:
4-i Command Enhancements.
auto_list, easy_open, easy_unequip, easy_confirm,
allow_self_target, easy_butcher, always_confirm_butcher,
- prefer_safe_chunks, easy_eat_chunks, prompt_for_swap,
+ prefer_safe_chunks, easy_eat_chunks, easy_eat_gourmand,
+ easy_eat_contaminated, prompt_for_swap,
easy_quit_item_prompts, easy_exit_menu, sort_menus
4-j Message and Display Improvements.
hp_warning, mp_warning, hp_colour, mp_colour, stat_colour,
@@ -1025,6 +1026,18 @@ easy_eat_chunks = false
be prompted for harmful chunks.
Note that this option is ignored for each of the undead races.
+easy_eat_gourmand = false
+ If both this and easy_eat_chunks are true, and you're wearing an Amulet
+ of the Gourmand, then religion-safe contaminated chunks will be eaten
+ without prompting. If prefer_safe_chunks is true then this will
+ only be done if you have no safe chunks to eat, but if it's
+ false then you'll auto-eat fresher contaminated chunks before
+ older safe chunks.
+
+easy_eat_contaminated = false
+ Like easy_eat_gourmand, but always in effect, not just when you're
+ wearing an Amulet of the Gourmand.
+
prompt_for_swap = true
If both this and easy_butcher are true, then if an auto-switch
butchery is interrupted by a hostile monster, the game will
diff --git a/crawl-ref/settings/init.txt b/crawl-ref/settings/init.txt
index 0e0834a792..3e05bdab3a 100644
--- a/crawl-ref/settings/init.txt
+++ b/crawl-ref/settings/init.txt
@@ -222,6 +222,8 @@ stash_filter = ring of hunger, amulet of inaccuracy
# always_confirm_butcher = true
# prefer_safe_chunks = false
# easy_eat_chunks = true
+# easy_eat_gourmand = true
+# easy_eat_contaminated = true
# prompt_for_swap = false
# easy_quit_item_prompts = false
# easy_exit_menu = false
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index 221d6d6187..d8c61d5131 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -1961,6 +1961,11 @@ public:
bool list_rotten; // list slots for rotting corpses/chunks
bool prefer_safe_chunks; // prefer clean chunks to contaminated ones
bool easy_eat_chunks; // make 'e' auto-eat the oldest safe chunk
+ bool easy_eat_gourmand; // with easy_eat_chunks, and wearing a
+ // "OfGourmand, auto-eat contaminated
+ // chunks if no safe ones are present
+ bool easy_eat_contaminated; // like easy_eat_gourmand, but
+ // always active.
bool default_target; // start targeting on a real target
bool autopickup_no_burden; // don't autopickup if it changes burden
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc
index b43b43556d..e18ebf0403 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -1557,6 +1557,11 @@ int prompt_eat_chunks()
chunks.push_back(item);
}
+ const bool easy_eat = Options.easy_eat_chunks && !you.is_undead;
+ const bool easy_contam = easy_eat
+ && (Options.easy_eat_gourmand && wearing_amulet(AMU_THE_GOURMAND)
+ || Options.easy_eat_contaminated);
+
if (found_valid)
{
std::sort(chunks.begin(), chunks.end(), compare_by_freshness());
@@ -1568,17 +1573,18 @@ int prompt_eat_chunks()
DESC_NOCAP_A,
MSGCH_PROMPT);
+ const bool contam = is_contaminated(*item);
+ const bool bad = _is_bad_food(*item);
// Excempt undead from auto-eating since:
// * Mummies don't eat.
// * Vampire feeding takes a lot more time than eating a chunk
// and may have unintended consequences.
// * Ghouls may want to wait until chunks become rotten.
- if (Options.easy_eat_chunks && !you.is_undead
- && !_is_bad_food(*item) && !is_contaminated(*item))
- {
+ if (easy_eat && !bad && !contam)
// If this chunk is safe to eat, just do so without prompting.
autoeat = true;
- }
+ else if (easy_contam && contam && !bad)
+ autoeat = true;
else
{
mprf(MSGCH_PROMPT, "%s %s%s? (ye/n/q/i?)",
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index 28ee46cf3d..f036bacb06 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -732,6 +732,8 @@ void game_options::reset_options()
list_rotten = true;
prefer_safe_chunks = true;
easy_eat_chunks = false;
+ easy_eat_gourmand = false;
+ easy_eat_contaminated = false;
easy_confirm = CONFIRM_SAFE_EASY;
easy_quit_item_prompts = true;
allow_self_target = CONFIRM_PROMPT;
@@ -2139,6 +2141,8 @@ void game_options::read_option_line(const std::string &str, bool runscript)
else BOOL_OPTION(list_rotten);
else BOOL_OPTION(prefer_safe_chunks);
else BOOL_OPTION(easy_eat_chunks);
+ else BOOL_OPTION(easy_eat_gourmand);
+ else BOOL_OPTION(easy_eat_contaminated);
else if (key == "lua_file" && runscript)
{
#ifdef CLUA_BINDINGS