diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-08 07:36:20 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-08 07:36:20 +0000 |
commit | 8b35f4c9a5b7232313b2f53d8de26145759852ed (patch) | |
tree | 87439c96b0656d3c5389eefd81a132978c21398f /crawl-ref/source/food.cc | |
parent | d0650b984a9d22727429bceb1d51a3dfb8aa84ef (diff) | |
download | crawl-ref-8b35f4c9a5b7232313b2f53d8de26145759852ed.tar.gz crawl-ref-8b35f4c9a5b7232313b2f53d8de26145759852ed.zip |
* Fix logic error in x_chance_in_y (BR 2013029)
* Fix crash from vampire bite (BR 2013112)
* Remove milestone for "escape from the Abyss" as a Lugonu CK (BR 2009840)
* Overhaul eating prompt (BR 2012809), now allows direct access to
inventory and is a bit cleaner. I'll probably revert my changes to
yesnoquit() now they're not needed anymore.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6449 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/food.cc')
-rw-r--r-- | crawl-ref/source/food.cc | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index b915203df7..1f4ece801e 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -1187,26 +1187,33 @@ int eat_from_floor() } found_valid = true; - std::ostringstream prompt; - prompt << (you.species == SP_VAMPIRE ? "Drink blood from" : "Eat") - << ' ' << ((si->quantity > 1) ? "one of " : "") - << si->name(DESC_NOCAP_A) << '?'; + mprf(MSGCH_PROMPT, "%s %s%s? (ye/n/q/i?)", + (you.species == SP_VAMPIRE ? "Drink blood from" : "Eat"), + ((si->quantity > 1) ? "one of " : ""), + si->name(DESC_NOCAP_A).c_str()); - const int ans = yesnoquit( prompt.str().c_str(), true, 0, false, false, - 'E' ); - - if (ans == -1) // quit - return -1; - else if (ans == 1) // yes + int keyin = tolower(c_getch()); + switch (keyin) { + case 'q': + canned_msg(MSG_OK); + return -1; + case 'e': + case 'y': if (can_ingest(si->base_type, si->sub_type, false)) { eat_floor_item(si->index()); return 1; } need_more = true; + case 'i': + case '?': + // Directly skip ahead to inventory. + return (0); + default: + // Else no: try next one. + break; } - // else no: try next one } if (!found_valid) @@ -1245,7 +1252,7 @@ int eat_from_floor() if (need_more && Options.auto_list) more(); - return (false); + return (0); } static const char *_chunk_flavour_phrase(bool likes_chunks) |