From aa3717c904d5d25c9f58f5d17e66379966f00a8f Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Tue, 10 Jun 2008 07:41:27 +0000 Subject: Move pickup_butcher_tool.txt into (the recently freed) pickup.lua, re-enable it (whoops) and clean up its code. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5698 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/itemname.cc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'crawl-ref/source/itemname.cc') diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index 919db49454..82bddb848e 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -2341,15 +2341,19 @@ bool is_dangerous_item(const item_def &item) bool is_useless_item(const item_def &item, bool temp) { - if (!item_type_known(item)) - return (false); - switch (item.base_type) { case OBJ_ARMOUR: return (!can_wear_armour(item, false, true)); + case OBJ_BOOKS: + return (item.sub_type != BOOK_DESTRUCTION + && item.sub_type != BOOK_MANUAL && you.religion == GOD_TROG); + case OBJ_SCROLLS: + if (!item_type_known(item)) + return (false); + // A bad item is always useless. if (is_bad_item(item)) return (true); @@ -2368,6 +2372,9 @@ bool is_useless_item(const item_def &item, bool temp) case OBJ_POTIONS: { + if (!item_type_known(item)) + return (false); + switch (item.sub_type) { case POT_CONFUSION: @@ -2410,6 +2417,9 @@ bool is_useless_item(const item_def &item, bool temp) return (false); } case OBJ_JEWELLERY: + if (!item_type_known(item)) + return (false); + if (is_bad_item(item)) return (true); -- cgit v1.2.3-54-g00ecf