summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-06-25 22:50:05 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-06-25 22:50:05 +0000
commitb791456793c967f1c484f0e3b726aadde102fc8a (patch)
tree8ebbf1eff3334decd91a238c11cf6a268ea3249b /crawl-ref/source/item_use.cc
parent048093d6df17f7a9d57c3de999f8d2b71289bc19 (diff)
downloadcrawl-ref-b791456793c967f1c484f0e3b726aadde102fc8a.tar.gz
crawl-ref-b791456793c967f1c484f0e3b726aadde102fc8a.zip
Replace "is_random_artefact()" with "is_artefact()" in a few places where
this was missed, and add checks for unrandart and special unrandarts where applicable. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10044 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 866dd8ac09..e9de2ca5b7 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -444,7 +444,9 @@ int item_special_wield_effect(const item_def &item)
return (SPWLD_NONE);
int i_eff = SPWPN_NORMAL;
- if (is_random_artefact( item ))
+ if (is_special_unrandom_artefact( item ))
+ i_eff = item.special;
+ else if (is_artefact( item ))
i_eff = artefact_wpn_property(item, ARTP_BRAND);
else
i_eff = item.special;
@@ -491,7 +493,7 @@ void wield_effects(int item_wield_2, bool showMsgs)
unsigned char special = 0;
item_def &item = you.inv[item_wield_2];
- const bool artefact = is_random_artefact(item);
+ const bool artefact = is_artefact(item);
const bool known_cursed = item_known_cursed(item);
// And here we finally get to the special effects of wielding. {dlb}
@@ -553,7 +555,8 @@ void wield_effects(int item_wield_2, bool showMsgs)
if (artefact)
{
- special = artefact_wpn_property(item, ARTP_BRAND);
+ if (!is_special_unrandom_artefact(item))
+ special = artefact_wpn_property(item, ARTP_BRAND);
use_artefact(item_wield_2);
if (!was_known)
{
@@ -3138,7 +3141,7 @@ void jewellery_wear_effects(item_def &item)
// Randart jewellery shouldn't auto-ID just because the base type
// is known. Somehow the player should still be told, preferably
// by message. (jpeg)
- const bool artefact = is_random_artefact(item);
+ const bool artefact = is_artefact(item);
const bool known_pluses = item_ident(item, ISFLAG_KNOW_PLUSES);
const bool known_cursed = item_known_cursed(item);
const bool known_bad = (item_type_known(item)
@@ -3429,7 +3432,7 @@ bool safe_to_remove_or_wear(const item_def &item, bool remove,
}
}
- if (is_random_artefact(item))
+ if (is_artefact(item))
{
prop_str += artefact_known_wpn_property(item, ARTP_STRENGTH);
prop_int += artefact_known_wpn_property(item, ARTP_INTELLIGENCE);
@@ -3731,7 +3734,7 @@ void jewellery_remove_effects(item_def &item, bool mesg)
break;
}
- if (is_random_artefact(item))
+ if (is_artefact(item))
unuse_artefact(item);
// Must occur after ring is removed. -- bwr
@@ -5262,7 +5265,7 @@ void use_artefact(item_def &item, bool unmeld)
{
#define unknown_proprt(prop) (proprt[(prop)] && !known[(prop)])
- ASSERT( is_random_artefact( item ) );
+ ASSERT( is_artefact( item ) );
const bool alreadyknown = item_type_known(item);
const bool dangerous = player_in_a_dangerous_place();