summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-08-06 22:05:42 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-08-06 22:05:42 +0000
commit52fa41b7a9881c60f8d0c27b206b17da299d2b52 (patch)
treeff269536e9c6bdc7a7a5e2789d852193ee54fca6 /crawl-ref
parentb4d50875d584b6b65964e57a45f3a9e0a59a465c (diff)
downloadcrawl-ref-52fa41b7a9881c60f8d0c27b206b17da299d2b52.tar.gz
crawl-ref-52fa41b7a9881c60f8d0c27b206b17da299d2b52.zip
Note identification of randarts *after* autoinscribing them and, in the
case of weapons, it suffices if the properties are known - knowing a weapon's enchantment is not necessary for the ID note. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6787 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/delay.cc15
-rw-r--r--crawl-ref/source/item_use.cc19
2 files changed, 28 insertions, 6 deletions
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index fd1f3eac7b..d92591529c 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -33,6 +33,7 @@
#include "monstuff.h"
#include "mon-util.h"
#include "mstuff2.h"
+#include "notes.h"
#include "ouch.h"
#include "output.h"
#include "player.h"
@@ -1246,11 +1247,19 @@ static void _armour_wear_effects(const int item_slot)
item_def &arm = you.inv[item_slot];
const bool was_known = item_type_known(arm);
+ if (is_random_artefact(arm))
+ arm.flags |= ISFLAG_NOTED_ID;
+
set_ident_flags(arm, ISFLAG_EQ_ARMOUR_MASK );
- if (Options.autoinscribe_randarts && is_random_artefact( arm )
- && !was_known)
+
+ if (!was_known)
{
- add_autoinscription( arm, randart_auto_inscription(arm));
+ if (Options.autoinscribe_randarts && is_random_artefact( arm ))
+ add_autoinscription( arm, randart_auto_inscription(arm));
+
+ // Make a note of it.
+ take_note(Note(NOTE_ID_ITEM, 0, 0, arm.name(DESC_NOCAP_A).c_str(),
+ origin_desc(arm).c_str()));
}
mprf("You finish putting on %s.", arm.name(DESC_NOCAP_YOUR).c_str());
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index d19029aea2..3affd408d9 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -59,6 +59,7 @@
#include "monstuff.h"
#include "mstuff2.h"
#include "mon-util.h"
+#include "notes.h"
#include "ouch.h"
#include "player.h"
#include "quiver.h"
@@ -546,14 +547,26 @@ void wield_effects(int item_wield_2, bool showMsgs)
// (could be extended to other talking weapons...)
const char *old_desc = item.name(DESC_CAP_THE).c_str();
- set_ident_flags( item, ISFLAG_EQ_WEAPON_MASK );
+ if (!was_known)
+ {
+ if (is_random_artefact(item))
+ item.flags |= ISFLAG_NOTED_ID;
+ set_ident_flags( item, ISFLAG_EQ_WEAPON_MASK );
+ }
if (is_random_artefact( item ))
{
i_dam = randart_wpn_property(item, RAP_BRAND);
use_randart(item_wield_2);
- if (Options.autoinscribe_randarts && !was_known)
- add_autoinscription( item, randart_auto_inscription(item));
+ if (!was_known)
+ {
+ if (Options.autoinscribe_randarts)
+ add_autoinscription( item, randart_auto_inscription(item));
+
+ // Make a note of it.
+ take_note(Note(NOTE_ID_ITEM, 0, 0, item.name(DESC_NOCAP_A).c_str(),
+ origin_desc(item).c_str()));
+ }
}
else
{