summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/food.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-26 06:23:04 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-26 06:23:04 +0000
commit6d74ff5a7416c08c52ee831a34f86f3693e90630 (patch)
tree777fcf4cd6c89088c0820163d130d29b3490af5c /crawl-ref/source/food.cc
parentc19d575e17a78bca2b17860847f323274def700c (diff)
downloadcrawl-ref-6d74ff5a7416c08c52ee831a34f86f3693e90630.tar.gz
crawl-ref-6d74ff5a7416c08c52ee831a34f86f3693e90630.zip
Added options easy_eat_gourmand and easy_eat_contaminated.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8769 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/food.cc')
-rw-r--r--crawl-ref/source/food.cc14
1 files changed, 10 insertions, 4 deletions
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?)",