summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells1.cc
diff options
context:
space:
mode:
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;