diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-03 21:18:44 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-03 21:18:44 +0000 |
commit | a32a2ae31db4aca7df3ea969b0c1ef456c0ba159 (patch) | |
tree | 771c0fbf31e627cc525d816de6c8dee60ed8739a /crawl-ref/source/itemname.cc | |
parent | 5408e069ec778214f8a3fe07a4d871070823891b (diff) | |
download | crawl-ref-a32a2ae31db4aca7df3ea969b0c1ef456c0ba159.tar.gz crawl-ref-a32a2ae31db4aca7df3ea969b0c1ef456c0ba159.zip |
Reorder species in newgame.cc (clean-up, no coding changes).
Add known weapons of holy wrath as useless items for undead, likewise
with weapons of pain for characters without Necromancy skill. (The
latter only applies if the item is not an artefact.)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6374 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/itemname.cc')
-rw-r--r-- | crawl-ref/source/itemname.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index 6cd8e97e04..e26dec0123 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -2385,6 +2385,19 @@ bool is_useless_item(const item_def &item, bool temp) { switch (item.base_type) { + case OBJ_WEAPONS: + if (!item_type_known(item)) + return (false); + + switch (get_weapon_brand(item)) + { + case SPWPN_HOLY_WRATH: + return (you.is_undead); + case SPWPN_PAIN: + return (temp && !you.skills[SK_NECROMANCY] && !is_artefact(item)); + } + return (false); + case OBJ_ARMOUR: return (!can_wear_armour(item, false, true)); @@ -2497,6 +2510,7 @@ bool is_useless_item(const item_def &item, bool temp) default: return (false); } + case OBJ_STAVES: if (you.religion == GOD_TROG && !item_is_rod(item)) return (true); |