From cebfd4f93efdfe6cc517f1bda0a59699a8149d3e Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Tue, 8 Jul 2008 07:52:36 +0000 Subject: Apply previous fixes to 0.4. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6450 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/fight.cc | 2 +- crawl-ref/source/food.cc | 31 +++++++++++++++++++------------ crawl-ref/source/misc.cc | 5 ++++- crawl-ref/source/stuff.cc | 2 +- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 21fcd0613c..c0973cad93 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -3707,7 +3707,7 @@ void melee_attack::mons_apply_attack_flavour(const mon_attack_def &attk) // Disallow draining of summoned monsters since they can't bleed. // XXX: Is this too harsh? - if (mons_is_summoned(def)) + if (defender->atype() == ACT_MONSTER && mons_is_summoned(def)) break; if (x_chance_in_y(defender->res_negative_energy(), 3)) 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) diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 715a70edd3..2ebe2153f9 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -1822,8 +1822,11 @@ void down_stairs( int old_level, dungeon_feature_type force_stair, // reaching the Abyss. if (grd[you.x_pos][you.y_pos] == DNGN_ENTER_ABYSS) mark_milestone("abyss.enter", "entered the Abyss!"); - else if (grd[you.x_pos][you.y_pos] == DNGN_EXIT_ABYSS) + else if (grd[you.x_pos][you.y_pos] == DNGN_EXIT_ABYSS + && you.char_direction != GDT_GAME_START) + { mark_milestone("abyss.exit", "escaped from the Abyss!"); + } } #endif diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc index 6fef267f58..2ab5cec604 100644 --- a/crawl-ref/source/stuff.cc +++ b/crawl-ref/source/stuff.cc @@ -868,7 +868,7 @@ bool one_chance_in(int a_million) bool x_chance_in_y(int x, int y) { - if (x <= 0 || y <= 0) + if (x <= 0) return (false); if (x >= y) -- cgit v1.2.3-54-g00ecf