summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-21 17:30:19 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-21 17:30:19 +0000
commitdb6775f6fcf45e64dd1ed27568532a27f2acf11d (patch)
tree3a11b47d739854ff2d1e493ff8a960e5350f0fa9 /crawl-ref/source/item_use.cc
parentd6e0b68b50226f511107801bb2c11f6b358fbbc7 (diff)
downloadcrawl-ref-db6775f6fcf45e64dd1ed27568532a27f2acf11d.tar.gz
crawl-ref-db6775f6fcf45e64dd1ed27568532a27f2acf11d.zip
2088461: identify Holy Wrath brand on failed wield.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6965 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc20
1 files changed, 16 insertions, 4 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 7451d7e9fe..31c539c448 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -74,7 +74,7 @@ static bool _fire_validate_item(int selected, std::string& err);
// Rather messy - we've gathered all the can't-wield logic from wield_weapon()
// here.
-bool can_wield(const item_def *weapon, bool say_reason,
+bool can_wield(item_def *weapon, bool say_reason,
bool ignore_temporary_disability)
{
#define SAY(x) if (say_reason) { x; } else
@@ -155,7 +155,18 @@ bool can_wield(const item_def *weapon, bool say_reason,
if ((you.is_undead || you.species == SP_DEMONSPAWN)
&& (weap_brand == SPWPN_HOLY_WRATH || is_blessed_blade(*weapon)))
{
- SAY(mpr("This weapon will not allow you to wield it."));
+ if (say_reason)
+ {
+ mpr("This weapon is holy and will not allow you to wield it.");
+ // If it's a standard weapon, you know its ego now.
+ if (!is_artefact(*weapon) && !is_blessed_blade(*weapon)
+ && !item_type_known(*weapon))
+ {
+ set_ident_flags(*weapon, ISFLAG_KNOW_TYPE);
+ if (in_inventory(*weapon))
+ mpr(weapon->name(DESC_INVENTORY_EQUIP).c_str());
+ }
+ }
return (false);
}
@@ -526,7 +537,7 @@ void wield_effects(int item_wield_2, bool showMsgs)
// Only used for Singing Sword introducing itself
// (could be extended to other talking weapons...)
- const char *old_desc = item.name(DESC_CAP_THE).c_str();
+ const std::string old_desc = item.name(DESC_CAP_THE);
if (!was_known)
{
@@ -638,7 +649,8 @@ void wield_effects(int item_wield_2, bool showMsgs)
if (!was_known)
{
mprf(MSGCH_TALK, "%s says, "
- "\"Hi! I'm the Singing Sword!\"", old_desc);
+ "\"Hi! I'm the Singing Sword!\"",
+ old_desc.c_str());
}
else
mpr("The Singing Sword hums in delight!", MSGCH_TALK);