summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells1.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-28 21:46:27 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-28 21:46:27 +0000
commitfc09d2de4c77399a6562507ad99c394d93c5cee9 (patch)
treeb957a366c7ca56c83a0e3075aed0e738a0abf5ae /crawl-ref/source/spells1.cc
parent0ffadca40b94c481141887d294d311ff738c2ad1 (diff)
downloadcrawl-ref-fc09d2de4c77399a6562507ad99c394d93c5cee9.tar.gz
crawl-ref-fc09d2de4c77399a6562507ad99c394d93c5cee9.zip
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
Diffstat (limited to 'crawl-ref/source/spells1.cc')
-rw-r--r--crawl-ref/source/spells1.cc27
1 files changed, 21 insertions, 6 deletions
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;