From fc09d2de4c77399a6562507ad99c394d93c5cee9 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sat, 28 Jun 2008 21:46:27 +0000 Subject: Fix 2004501: buggy ?identify; also finally properly id ?identify itself after a successful identification (if there are several). Fix 2004793: wandering mushroom flees - for real, this time (I hope). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6189 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/spells1.cc | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'crawl-ref/source/spells1.cc') diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index aab5108603..37b08aaddc 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -423,7 +423,7 @@ void identify(int power, int item_slot) { int id_used = 1; - // scrolls of identify *may* produce "extra" identifications {dlb}: + // Scrolls of identify *may* produce "extra" identifications. if (power == -1 && one_chance_in(5)) id_used += (coinflip()? 1 : 2); @@ -442,7 +442,7 @@ void identify(int power, int item_slot) if (fully_identified(item)) { mpr("Choose an unidentified item, or Esc to abort."); - if ( Options.auto_list ) + if (Options.auto_list) more(); item_slot = -1; continue; @@ -451,7 +451,22 @@ void identify(int power, int item_slot) set_ident_type( item, ID_KNOWN_TYPE ); set_ident_flags( item, ISFLAG_IDENT_MASK ); - // output identified item + // For scrolls, now id the scroll, unless already known. + if (power == -1 + && get_ident_type(OBJ_SCROLLS, SCR_IDENTIFY) != ID_KNOWN_TYPE) + { + set_ident_type(OBJ_SCROLLS, SCR_IDENTIFY, ID_KNOWN_TYPE); + + const int wpn = you.equip[EQ_WEAPON]; + if (wpn != -1 + && you.inv[wpn].base_type == OBJ_SCROLLS + && you.inv[wpn].sub_type == SCR_IDENTIFY) + { + you.wield_change = true; + } + } + + // Output identified item. mpr(item.name(DESC_INVENTORY_EQUIP).c_str()); if (item_slot == you.equip[EQ_WEAPON]) you.wield_change = true; @@ -461,13 +476,13 @@ void identify(int power, int item_slot) if (Options.auto_list && id_used > 0) more(); - // in case we get to try again + // In case we get to try again. item_slot = -1; } while (id_used > 0); -} // end identify() +} -// return whether the spell was actually cast +// Returns whether the spell was actually cast. bool conjure_flame(int pow) { struct dist spelld; -- cgit v1.2.3-54-g00ecf