summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authorHaran Pilpel <haranp@users.sourceforge.net>2010-01-03 21:47:34 +0200
committerHaran Pilpel <haranp@users.sourceforge.net>2010-01-03 21:47:34 +0200
commitda5a6f678e819f92d5d3dc2f26e62de2006eadaf (patch)
tree9e869fde3b1414203d236e9ea56df5b066fb9823 /crawl-ref/source/player.cc
parent5ee20d6f13b4d3240dd96e2fcc5ea273adcb745a (diff)
downloadcrawl-ref-da5a6f678e819f92d5d3dc2f26e62de2006eadaf.tar.gz
crawl-ref-da5a6f678e819f92d5d3dc2f26e62de2006eadaf.zip
Type-identify amulets of clarity when you resist confusion based on
them; this works even if you're drinking an unIDed !oConfusion or similar, because nowhere else that I know of gives that exact message.
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index d29a361040..49ebabc724 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -4733,6 +4733,19 @@ bool confuse_player(int amount, bool resistable)
if (resistable && wearing_amulet(AMU_CLARITY))
{
mpr("You feel momentarily confused.");
+ // Identify the amulet if necessary.
+ if (!extrinsic_amulet_effect(AMU_CLARITY))
+ {
+ // Since it's not extrinsic, it must be from the amulet.
+ ASSERT(player_wearing_slot(EQ_AMULET));
+ item_def* const amu = you.slot_item(EQ_AMULET);
+ if (!item_ident(*amu, ISFLAG_KNOW_TYPE))
+ {
+ set_ident_flags(*amu, ISFLAG_KNOW_TYPE);
+ mprf("You are wearing: %s",
+ amu->name(DESC_INVENTORY_EQUIP).c_str());
+ }
+ }
return (false);
}